We study the supersymmetric partition function of a 2d linear σ-model whose target space is a torus with a complex structure that varies along one worldsheet direction and a Kähler modulus that varies along the other. This setup is inspired by the dimensional reduction of a Janus configuration of 4d N = 4 U (1) Super-Yang-Mills theory compactified on a mapping torus (T 2 fibered over S 1 ) times a circle with an SL(2, Z) duality wall inserted on S 1 , but our setup has minimal supersymmetry. The partition function depends on two independent elements of SL(2, Z), one describing the duality twist, and the other describing the geometry of the mapping torus. It is topological and can be written as a multivariate quadratic Gauss sum. By calculating the partition function in two different ways, we obtain identities relating different quadratic Gauss sums, generalizing the Landsberg-Schaar relation. These identities are a subset of a collection of identities discovered by F. Deloup. Each identity contains a phase which is an eighth root of unity, and we show how it arises as a Berry phase in the supersymmetric Janus-like configuration. Supersymmetry requires the complex structure to vary along a semicircle in the upper half-plane, as shown by Gaiotto and Witten in a related context, and that semicircle plays an important role in reproducing the correct Berry phase.