the start and end of the arc, i.e.,

${\tau}(0)={a}+4\pi{D}e^{2i{\psi}_{0}},\qquad{\tau}(1)=\frac{{\mathbf{a}}{\tau}(0)+{\mathbf{b}}}{{\mathbf{c}}{\tau}(0)+{\mathbf{d}}}={a}+4\pi{D}e^{2i{\psi}_{1}},$

we calculate the phase difference as Ganor:2014pha :

$e^{i({\psi}_{1}-{\psi}_{0})}=\operatorname{sgn}({\mathbf{a}}+{\mathbf{d}})\frac{|{\mathbf{c}}{\tau}(0)+{\mathbf{d}}|}{{\mathbf{c}}{\tau}(0)+{\mathbf{d}}}\,,$

and the total Berry phase is easily calculated to be

$e^{i\int_{0}^{1}{{\mathcal{A}}}}=e^{\frac{i}{2}({\psi}_{1}-{\psi}_{0})}=\left[\operatorname{sgn}({\mathbf{a}}+{\mathbf{d}})\frac{|{\mathbf{c}}{\tau}(0)+{\mathbf{d}}|}{{\mathbf{c}}{\tau}(0)+{\mathbf{d}}}\right]^{1/2}.$
(143)

The sign of the square root is determined so that
$-\frac{\pi}{2}<\frac{1}{2}({\psi}_{1}-{\psi}_{0})<\frac{\pi}{2}$.

###  7.3 Modular transformations of the Landau wavefunctions

To introduce the ${M}$-duality wall, we need to examine the behavior of the
wavefunction under an $\operatorname{SL}(2,\mathbb{Z})$ transformation that
acts as

${\bf{\xi}}^{1}\rightarrow{\mathbf{a}}{\bf{\xi}}^{1}+{\mathbf{b}}{\bf{\xi}}^{2}\,,\qquad{\bf{\xi}}^{2}\rightarrow{\mathbf{c}}{\bf{\xi}}^{1}+{\mathbf{d}}{\bf{\xi}}^{2}\,,\qquad{\tau}\rightarrow\frac{{\mathbf{a}}{\tau}+{\mathbf{b}}}{{\mathbf{c}}{\tau}+{\mathbf{d}}}\,.$

The general $\operatorname{SL}(2,\mathbb{Z})$ transformation can be composed
from the ${S}$ and ${T}$ generators, which act on wavefunctions as

$\displaystyle
S:\quad{\Psi}_{j,{{q}}}\left(-{\bf{\xi}}^{2},{\bf{\xi}}^{1};-\tfrac{1}{{\tau}}\right)$
$\displaystyle=$ $\displaystyle e^{-\frac{\pi
i}{4}}\left(\frac{{\tau}}{|{\tau}|}\right)^{\frac{1}{2}}\frac{1}{\sqrt{{{q}}}}\sum_{l=0}^{{{q}}-1}e^{-\frac{2\pi
i}{{{q}}}jl}{\Psi}_{l,{{q}}}({\bf{\xi}}^{1},{\bf{\xi}}^{2};{\tau})\,,$ (144)

and for even ${{q}}$ we have

$T:\quad{\Psi}_{j,{{q}}}\left({\bf{\xi}}^{1}+{\bf{\xi}}^{2},{\bf{\xi}}^{2};{\tau}+1\right)=e^{\frac{\pi
ij^{2}}{{{q}}}}{\Psi}_{j,{{q}}}\left({\bf{\xi}}^{1},{\bf{\xi}}^{2};{\tau}\right).$
(145)

We note that for any ${{q}}\in\mathbb{Z}$ we have

$\displaystyle{\Psi}_{j,{{q}}}\left({\bf{\xi}}^{1}+{\bf{\xi}}^{2},{\bf{\xi}}^{2};{\tau}+1\right)$
$\displaystyle=$ $\displaystyle e^{\frac{i\pi
j^{2}}{{{q}}}}\frac{1}{2\pi}\left(2{{q}}{\tau}_{2}\right)^{\frac{1}{4}}e^{-\frac{i{{q}}{\bf{\xi}}^{1}{\bf{\xi}}^{2}}{4\pi}}\sum_{n=-\infty}^{\infty}e^{i({{q}}n+j){\bf{\xi}}^{1}+\pi
i{{q}}{\tau}\left(n+\frac{j}{{{q}}}-\frac{{\bf{\xi}}^{2}}{2\pi}\right)^{2}}(-1)^{{{q}}n}.$

This is well-defined on the ${{q}}$-dimensional Hilbert space for ${{q}}\in
2\mathbb{Z}$, since the RHS is a linear combination of the
${\Psi}_{j,{{q}}}$’s, but for odd ${{q}}\in\mathbb{Z}$ only the square
${T}^{2}$ is a well-defined operator on the Hilbert space.

###  7.4 Recovering the Landsberg-Schaar relation

For ${M}={S}{T}^{q+2}$ and ${{q}}=2p$ we combine the two modular
transformations (144)-(145) to get

${\Psi}_{j,2p}\rightarrow\left(\frac{{\tau}}{|{\tau}|}\right)^{\frac{1}{2}}\frac{e^{-\frac{\pi
i}{4}}}{\sqrt{2p}}e^{\frac{\pi i(q+2)j^{2}}{2p}}\sum_{l=0}^{2p-1}e^{-\frac{\pi
i}{p}jl}{\Psi}_{l,2p}\,.$ (147)

In this expression ${\tau}$ is a shorthand for ${\tau}(0)+q+2$ [since this is
the value of ${\tau}$ after ${T}^{q+2}$ acts on ${\tau}(0)$], and
${\Psi}_{l,2p}$ on the RHS is a shorthand for
${\Psi}_{l,2p}\left({\bf{\xi}}^{2}+(q+2){\bf{\xi}}^{1},-{\bf{\xi}}^{1};{\tau}(0)\right)$.
The RHS of (147) represents the wavefunction at ${\sigma}_{1}=1$ (not
including the Berry phase yet) after the action by ${M}$. To complete the
calculation of the partition function, we must multiply the RHS of (147) by
$e^{-I^{\prime\prime}}$ [with $I^{\prime\prime}$ given in (81)], take its
inner product with ${\Psi}_{j,2p}$, sum over $j$, and multiply by the Berry
phase (143). Note that the role of $I^{\prime\prime}$ is to ensure periodicity
in $\left({\bf{\xi}}^{1},{\bf{\xi}}^{2}\right)$, since the arguments in
${\Psi}_{l,2p}$ correspond to ${X}$ at ${\sigma}_{1}=1$, while those in
${\Psi}_{j,2p}$ correspond to ${X}$ at ${\sigma}_{1}=0$, and they can differ
by ${\mathcal{N}}$, as defined in (50). Moreover, since ${\Psi}_{j,2p}$ is
periodic only up to a gauge transformation (in the language of the Landau
problem of a particle in a uniform magnetic field), periodicity in
$\left({\bf{\xi}}^{1},{\bf{\xi}}^{2}\right)$ can only be restored by including
$e^{-I^{\prime\prime}}$ which plays the role of a gauge factor. The resulting
partition function is

${\mathcal{Z}}^{\prime}=\frac{e^{-\frac{\pi
i}{4}}}{\sqrt{2p}}\sum_{j=0}^{2p-1}e^{\frac{\pi
iqj^{2}}{2p}}=\frac{e^{-\frac{\pi i}{4}}}{\sqrt{2p}}{\varrho_{{p}}({q})}\,.$

Equating ${\mathcal{Z}}$ calculated in (109) with ${\mathcal{Z}}^{\prime}$, we
recover the (complex conjugate of the) basic Landsberg-Schaar relation (8).

##  8 Identities for generalizations of Gauss sums

In previous sections we saw how the Landsberg-Schaar identity (4) is recovered
for duality twists of the form ${M}={S}{T}^{q+2}$ and
${\widetilde{{M}}}={\widetilde{S}}{\widetilde{T}}^{2+2p}$, as in §7.1. We can
get more complicated identities by looking at
$\operatorname{SL}(2,\mathbb{Z})$ elements which are expressed as longer
words, with more ${S}$ generators in ${M}$ or ${\widetilde{S}}$ generators in
${\widetilde{{M}}}$. In all cases, the identities that we get are of the
schematic form

$\text{Tr}_{\mathcal{H}_{{M}}}\left({\widetilde{{M}}}\right)=e^{i\varphi}\text{Tr}_{\mathcal{H}_{{\widetilde{{M}}}}}({M}),$

where $\text{Tr}_{\mathcal{H}_{{M}}}$ is a trace over the
$|\det({\mathbb{I}}-{M})|$-dimensional Hilbert space $\mathcal{H}_{{M}}$ of
ground states of the ${M}$-twisted circle compactification [whose states
correspond to the finite abelian group ${\Xi_{0}}$ defined in (55)], and
$\text{Tr}_{\mathcal{H}_{{\widetilde{{M}}}}}$ is a similar trace over the
$|\det({\mathbb{I}}-{\widetilde{{M}}})|$-dimensional Hilbert space
$\mathcal{H}_{{\widetilde{{M}}}}$ of ground states of the
${\widetilde{{M}}}$-twisted circle compactification, and $\varphi$ is a phase
correction (arising from the Berry phase212121The first place where a Berry
phase appears as a multiplicative factor in the partition function is in
Haldane2 , where each “hedgehog” defect, a singular configuration, of a spin
field in a $(2+1)$d antiferromagnet, described by an $O(3)$ NLSM, carries a
Berry phase. It is also directly related to the Wess-Zumino term Altland-
Simons as in §7.2).

In some cases we will be able to rewrite the sum (109) explicitly, which
requires identifying the abelian group ${\Xi_{0}}$ as a direct sum of cyclic
groups, and turns out to be of the form
$\mathbb{Z}_{d_{1}}\oplus\mathbb{Z}_{d_{2}}$. To achieve this we need to
calculate the “Smith normal form” of the matrix ${\mathbb{I}}-{M}$, i.e., to
find matrices ${P},{Q}\in\operatorname{SL}(2,\mathbb{Z})$ and unique integers
$d_{1},d_{2}\in\mathbb{Z}$ such that

${\mathbb{I}}-{M}={P}\begin{pmatrix}d_{1}&0\\\ 0&d_{2}\\\ \end{pmatrix}{Q}.$

We will present a few examples below.

###  8.1 ${M}$ generated by ${S}$ and ${T}^{2}$ and
${\widetilde{{M}}}={\widetilde{S}}{\widetilde{T}}^{2+{{q}}}$

Let us assume that ${M}$ can be expanded as the word

${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}\cdots{S}{T}^{2{v}_{s}},\qquad\text{with
${v}_{1},\ldots,{v}_{s}$ nonzero integers.}$ (148)

We will also assume that
${\widetilde{{M}}}={\widetilde{S}}{\widetilde{T}}^{2+{{q}}}$, with ${{q}}$
even. We recall that in $\operatorname{SL}(2,\mathbb{Z})$ there are no
relations among ${S}$ and ${T}^{2}$, other than those that follow from
inserting an even number of ${S}^{2}=-{\mathbb{I}}$ in expressions, and
therefore if ${M}$ is of the form (148), the decomposition is unique. In fact
the subgroup of $\operatorname{SL}(2,\mathbb{Z})$ freely generated by ${S}$
and ${T}^{2}$ is isomorphic to the Hecke congruence subgroup $\Gamma_{0}(2)$.
(See Example 3.7 of KeithConrad .)

We now get an identity that equates the partition function ${\mathcal{Z}}$
given in the form (109) (with ${\mathbf{k}}={{q}}-2$), to a partition function
calculated by combining the modular transformations of the ${{q}}$ ground-
state wavefunctions and the Berry phase, as in §7.2-§7.3. The result of the
latter is

$\left(\frac{e^{\frac{\pi
i}{4}}}{\sqrt{{{q}}}}\right)^{{s}}\sum_{l_{1},\ldots,l_{s}=0}^{{{q}}-1}\exp\left\\{-\frac{2\pi
i}{{{q}}}\left(\sum_{j=1}^{s}{v}_{j}l_{j}^{2}+\sum_{j=1}^{{s}-1}l_{j}l_{j+1}+l_{1}l_{s}\right)\right\\}.$

The generalized identity for Gauss sums then takes the form

$\frac{1}{\sqrt{|{\Xi_{0}}|}}\sum_{{\mathcal{N}}\in{\Xi_{0}}}\exp\left[-i\pi{{q}}{\mathcal{N}}^{t}{\epsilon}({\mathbb{I}}-{M})^{-1}{\mathcal{N}}\right]=\frac{e^{\frac{\pi
i{s}}{4}}}{{{q}}^{{s}/2}}\sum_{l_{1},\ldots,l_{s}=0}^{{{q}}-1}e^{-\frac{2\pi
i}{{{q}}}\left(\sum_{j=1}^{s}{v}_{j}l_{j}^{2}+\sum_{j=1}^{{s}-1}l_{j}l_{j+1}+l_{1}l_{s}\right)}\,.$
(149)

For example, we take ${s}=2$ and

${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}=\begin{pmatrix}-1\quad&-2{v}_{2}\\\
2{v}_{1}\quad&4{v}_{1}{v}_{2}-1\\\ \end{pmatrix}.$

For simplicity, we assume that ${v}_{1},{v}_{2}\geq 1$. Then

$|{\Xi_{0}}|=|\det({\mathbb{I}}-{M})|=4({v}_{1}{v}_{2}-1).$

The Smith normal form of ${\mathbb{I}}-{M}$ is given by

${\mathbb{I}}-{M}=\begin{pmatrix}1\quad&{v}_{2}\\\
-2{v}_{1}\quad&1-2{v}_{1}{v}_{2}\\\
\end{pmatrix}\begin{pmatrix}2(1-{v}_{1}{v}_{2})\quad&0\\\ 0\quad&2\\\
\end{pmatrix}\begin{pmatrix}1\quad&0\\\ {v}_{1}\quad&1\\\ \end{pmatrix}.$

[Note that the leftmost matrix on the RHS is in
$\operatorname{SL}(2,\mathbb{Z})$.] An element of
${\Xi_{0}}\cong\mathbb{Z}^{2}/({\mathbb{I}}-{M})(\mathbb{Z}^{2})$ can then be
parametrized as

${\mathcal{N}}=\begin{pmatrix}1\quad&{v}_{2}\\\
-2{v}_{1}\quad&1-2{v}_{1}{v}_{2}\\\
\end{pmatrix}\begin{pmatrix}{\mathbf{n}}\\\ {\mathbf{a}}\\\
\end{pmatrix}=\begin{pmatrix}{\mathbf{n}}+{v}_{2}{\mathbf{a}}\\\
(1-2{v}_{1}{v}_{2}){\mathbf{a}}-2{v}_{1}{\mathbf{n}}\\\ \end{pmatrix}\,,$

with

${\mathbf{a}}=0,1\,,\qquad{\mathbf{n}}=0,\dots,2({v}_{1}{v}_{2}-1)-1.$

And then we calculate

${\mathcal{N}}^{t}{\epsilon}({\mathbb{I}}-{M})^{-1}{\mathcal{N}}=\frac{{v}_{1}{\mathbf{n}}^{2}}{2({v}_{1}{v}_{2}-1)}-\frac{{v}_{2}{\mathbf{a}}^{2}}{2},$
(150)

so the LHS of (149) can be expressed as

$\frac{1}{\sqrt{|{\Xi_{0}}|}}\sum_{{\mathcal{N}}\in{\Xi_{0}}}\exp\left[-i\pi{{q}}{\mathcal{N}}^{t}{\epsilon}({\mathbb{I}}-{M})^{-1}{\mathcal{N}}\right]=\frac{1+i^{-{{q}}{v}_{2}}}{2\sqrt{{v}_{1}{v}_{2}-1}}\sum_{{\mathbf{n}}=0}^{2({v}_{1}{v}_{2}-1)-1}\exp\left(\frac{i\pi{{q}}{v}_{1}{\mathbf{n}}^{2}}{2({v}_{1}{v}_{2}-1)}\right).$

Setting $a={v}_{1}$, $b={v}_{2}$, and taking the complex conjugate, we find
that (149) becomes

$\boxed{-\frac{i}{{{q}}}\sum_{m,n=0}^{{{q}}-1}e^{\frac{2\pi
i}{{{q}}}(am^{2}+bn^{2}-2mn)}=\frac{1+i^{{{q}}b}}{2\sqrt{ab-1}}\sum_{{\mathbf{n}}=0}^{2ab-3}\exp\left(-\frac{\pi
i{{q}}a{\mathbf{n}}^{2}}{2(ab-1)}\right)}$ (151)

for $a,b\in\mathbb{Z},\,ab>1$, and ${{q}}\in 2\mathbb{Z}_{+}$. This is our
first concrete generalization of the Landsberg-Schaar relation, whose proof we
include in Appendix D. Identity (151) is actually a special case of a
collection of generalizations of the basic Landsberg-Schaar identity derived
by Krazer in 1912 Krazer:1912 and other authors from then onwards, and the
requirement for even ${{q}}$ also appears there. In our case it is a
requirement that appeared at the end of §4. We will discuss Krazer’s and
others’ work in §8.3. We also note that double quadratic Gauss sums with
denominators [${{q}}$ in (151)] that are powers of a prime have been evaluated
in Alaca:2016 in terms of the Legendre symbol.

###  8.2 More generalizations

We can obtain more identities by allowing ${\widetilde{{M}}}$ to take the more
general form

${\widetilde{{M}}}={\widetilde{S}}{\widetilde{T}}^{2{u}_{1}}{\widetilde{S}}{\widetilde{T}}^{2{u}_{2}}\cdots{\widetilde{S}}{\widetilde{T}}^{2{u}_{r}},$
(152)

with ${u}_{1},\ldots,{u}_{s}$ nonzero integers.

We recall that ${\widetilde{S}}$ and ${\widetilde{T}}^{2}$ generate an
index-$3$ congruence subgroup of $\operatorname{SL}(2,\mathbb{Z})$, called the
theta subgroup222222However, any subgroup $\langle S,T^{m}\rangle$ with $m>2$
does not have a finite index inside $\operatorname{SL}(2,\mathbb{Z})$., and is
isomorphic to the Hecke congruence subgroup $\Gamma_{0}(2)$ KeithConrad ;
Wang1 . Inserting the ${\widetilde{{M}}}$-twist in the ${\sigma}_{2}$
direction amounts to inserting ${r}$ duality walls of the type (66), one for
each ${\widetilde{S}}{\widetilde{T}}^{2{u}_{j}}$ factor ($j=1,\dots,{r}$). The
combined phase factor of modular transformations and the Berry phase, as in
§7.2-§7.3, now comes out to $\exp(\frac{i\pi}{4}{s}{r})$.

If we repeat the analysis of §7.2 for the system with ${r}$ duality walls, we
get instead of (139), a reduced (0+1)d system that describes geometric
quantization of $T^{2{r}}$ with an action given by

$-\frac{i}{4\pi}\int\sum_{{\mathbf{i}},{\mathbf{j}}=1}^{{r}}{\widetilde{K}}_{{\mathbf{i}}{\mathbf{j}}}{\xi}_{\mathbf{i}}^{t}{\epsilon}d{\xi}_{\mathbf{j}},$

where ${\widetilde{K}}$ is an ${r}\times{r}$ integer coupling constant matrix
given by an expression similar to (134)-(135), which for ${r}$ takes the form

${\widetilde{K}}\equiv\begin{pmatrix}2{u}_{1}&-1&0&&-1\\\
-1&\ddots&\ddots&\ddots&\\\ 0&\ddots&\ddots&\ddots&0\\\
&\ddots&\ddots&\ddots&-1\\\ -1&&0&-1&2{u}_{r}\\\ \end{pmatrix}\,,$ (153)

and ${\xi}_{\mathbf{i}}$ (${\mathbf{i}}=1,\dots,{r}$) are coordinates on the
${\mathbf{i}}^{th}$ $T^{2}$ factor. For ${r}=2$, ${\widetilde{K}}$ takes the
form

${\widetilde{K}}\equiv\begin{pmatrix}2{u}_{1}&-2\\\ -2&2{u}_{2}\\\
\end{pmatrix}\,.$ (154)

For example, for ${s}={r}=2$ we obtain the identity

$\displaystyle\frac{1}{pq-1}\left[1+(-1)^{sq}\right]\sum_{m,n=0}^{2pq-3}e^{-\frac{\pi
ip}{pq-1}(sm^{2}+tn^{2}-2mn)}$ (155a)
$\displaystyle=-\frac{1}{st-1}\bigl{[}1+(-1)^{tp}\bigr{]}\sum_{m,n=0}^{2st-3}e^{\frac{\pi
is}{st-1}(pm^{2}+qn^{2}-2mn)}\,,\qquad\text{for $tq\in 2\mathbb{Z}$.}$ (155b)

where we have set $p={u}_{1}$, $q={u}_{2}$, $s={v}_{1}$, $t={v}_{2}$. The
requirement that $tq$ must be even arises as follows. The abelian group
${\Xi_{0}}$ defined in (55) turns out to be isomorphic to
$\mathbb{Z}_{st-1}\oplus\mathbb{Z}_{2}^{2}$ in this case, and the sum over the
$\mathbb{Z}_{2}^{2}$ factor produces a factor of
$\bigl{[}1+(-1)^{tq}\bigr{]}\bigl{[}1+(-1)^{sq}\bigr{]}$ on the LHS of (155a),
while the RHS receives a factor of
$\bigl{[}1+(-1)^{tq}\bigr{]}\bigl{[}1+(-1)^{tp}\bigr{]}$ instead. We cancelled
the common factor of $\bigl{[}1+(-1)^{tq}\bigr{]}$ by assuming $tq\in
2\mathbb{Z}$. For $t$ and $q$ both odd, the relation in (155a) is not
generally correct, for example for $s=p=2$ and $t=q=1$ the two sides differ by
a $(-)$ sign, and for $s=1$, $p=3$, $t=q=1$, the LHS is $8$ while the RHS is
$0$.

###  8.3 Relation to Krazer’s, Jeffrey’s, Deloup’s, and Turaev’s reciprocity
formulae

Let us now briefly discuss the relationship among the identities we found in
§8.1-§8.2 and a few known results in the mathematical literature spanning
centuries. In the late 19${}^{\text{th}}$ century, a univariate formula which
slightly generalizes the Landsberg-Schaar identity (4) was discovered
independently by Cauchy, Dirichlet, and Kronecker Turaev :

$|b|^{-1/2}\sum_{x\in\mathbb{Z}/b\mathbb{Z}}e^{\frac{\pi
ia}{b}(x+\omega)^{2}}=e^{\frac{\pi
i}{4}\text{sign}(ab)}|a|^{-1/2}\sum_{x\in\mathbb{Z}/a\mathbb{Z}}e^{-\frac{\pi
ib}{a}x^{2}-2\pi i\omega x}\,,$ (156)

where $a,\,b$ are nonzero integers and $\omega\in\mathbb{Q}$ such that
$ab+2a\omega\in 2\mathbb{Z}$. Later, a version of (156) for multivariate Gauss
sums was obtained around 1912 by A. Krazer Krazer:1912 ; Braun ; Siegel :

$d^{-\frac{m}{2}}\sum_{x\in(\mathbb{Z}/d\mathbb{Z})^{m}}e^{\frac{\pi
ix^{t}Ax}{d}}=\frac{d^{\frac{m-r}{2}}e^{\frac{\pi i}{4}\sigma(A)}}{|\det
A|^{\frac{1}{2}}}\sum_{y\in\mathbb{Z}/A^{\prime}\mathbb{Z}^{m}}e^{-\pi
idy^{t}A^{\prime-1}y},$ (157)

where $d$ is again a nonzero integer, $A$ is a symmetric $m\times m$ matrix
with integer entries, $\sigma(A)\in\mathbb{Z}$ is the signature of $A$ (i.e.,
the difference between numbers of positive and negative eigenvalues), and
either $d$ or $A$ is even (i.e., all diagonal entries of $A$ are even). The
$r\times r$ symmetric invertible matrix $A^{\prime}$ with integer entries is
determined from $A$ by finding a unimodular matrix $P$ such that
$P^{t}AP=A^{\prime}\oplus(0_{m-r})$, where $0_{m-r}$ is the zero matrix of
size $m-r$. Equation (157) generalizes the case $\omega=0$ of (156) by
replacing one of the numbers $a$ and $b$ in the exponents there by an integer-
valued quadratic form given by $A$. Note that the input to the identity is a
single bilinear form $A$ and an integer $d$, because $A^{\prime}$ is
determined by $A$.

In 1992, Jeffrey studied the semiclassical expansion of $SU(2)$ Chern-Simons
partition functions on Lens spaces and torus bundles Jeffrey:1992tk , and
discovered a generalization (which was slightly corrected by Deloup and Turaev
Turaev2 in 2005):

$\text{vol}\left(\Lambda^{*}\right)\sum_{\lambda\in\Lambda/r\Lambda}e^{i\pi\langle\lambda,B\lambda/r\rangle+2\pi
i\langle\lambda,\psi\rangle}=\left(\frac{\det
B}{r^{l}}\right)^{-1/2}e^{i\pi\sigma(g)/4}\sum_{\mu\in\Lambda^{*}/B\Lambda^{*}}e^{-i\pi\langle\mu+\psi,rB^{-1}(\mu+\psi)\rangle},$
(158)

where $\Lambda$ is a lattice of finite rank $l$ with $\Lambda^{*}$ being its
dual, $\langle\cdot,\cdot\rangle$ is the inner product on the real vector
space $\Lambda_{\mathbb{R}}=\Lambda\otimes_{\mathbb{Z}}\mathbb{R}$,
$\psi\in\Lambda_{\mathbb{R}}$, $r\in\mathbb{Z}_{>0}$, and $B$ is a self-
adjoint automorphism on $\Lambda_{\mathbb{R}}$ (i.e., a bilinear form). The
volume $\text{vol}(\Lambda^{*})$ is the absolute value of the determinant of a
matrix obtained by expanding a basis of $\Lambda^{*}$ in terms of an
orthonormal basis of $\Lambda_{\mathbb{R}}$. The symmetric bilinear form
$g:\Lambda\times\Lambda\rightarrow\mathbb{Z}$ is defined by $g(x,y)=\langle
x,B(y)\rangle$ for all $x,y\in\Lambda$, and $\sigma(g)$ is the signature of a
diagonal matrix presenting the bilinear extension
$\Lambda_{\mathbb{R}}\times\Lambda_{\mathbb{R}}\rightarrow\mathbb{R}$ of $g$.
Formula (158) extends Krazer’s formula in that the lattice to be summed over
is now arbitrary, and on both sides there are additional linear terms in
$\psi$ in the exponents, whose significance will be discussed in the next
paragraph. Notice that there is still only one single bilinear form $B$.

In 1996, independently of Jeffrey, Deloup Deloup ; Deloup3 geometrically
generalized Krazer’s formula (157) (as well as Jeffrey’s) by essentially
replacing both integers $a$ and $b$ in (156) with bilinear forms, and applied
his result to calculate topological invariants of $3$-manifolds, such as
Witten-Reshetikhin-Turaev (WRT) invariants (i.e., Chern-Simons partition
functions). For integral quadratic forms determined by two invertible, even,
symmetric matrices ${\mathbf{A}}$ and ${\mathbf{B}}$, Deloup’s reciprocity
theorem relates a Gauss sum with bilinear form
${\mathbf{A}}\otimes{\mathbf{B}}^{-1}$ to another Gauss sum with bilinear form
$-{\mathbf{A}}^{-1}\otimes{\mathbf{B}}$.232323For an $m\times m$ matrix
${\mathbf{A}}$ and $n\times n$ matrix ${\mathbf{B}}^{-1}$, the
$(mn)\times(mn)$ matrix ${\mathbf{A}}\otimes{\mathbf{B}}^{-1}$ denotes the
tensor (Kronecker) product. This identity appears as Theorem 3 in Deloup , and
we do not present it here, since it would require quite a few new notations
and definitions. In the context of our §8.2, ${\mathbf{A}}$ can be identified
with the coupling constant matrix ${\widetilde{K}}$ (derived from
${\widetilde{{M}}}$) of abelian Chern-Simons theory, while ${\mathbf{B}}$ can
be identified with a similar but independent matrix derived from
${M}=ST^{2v_{1}}\cdots ST^{2v_{s}}$:

${K}\equiv\begin{pmatrix}2{v}_{1}&-1&0&&-1\\\ -1&\ddots&\ddots&\ddots&\\\
0&\ddots&\ddots&\ddots&0\\\ &\ddots&\ddots&\ddots&-1\\\ -1&&0&-1&2{v}_{s}\\\
\end{pmatrix}\,.$ (159)

We note that in a Gauss sum with a bilinear form governed by ${K}^{-1}$, the
sum would be over the finite abelian group
$\mathbb{Z}^{n}/{K}(\mathbb{Z}^{n})$ [where ${K}(\mathbb{Z}^{n})$ is the
sublattice of $\mathbb{Z}^{n}$ generated by the columns of ${K}$]. This
abelian group is equivalent to ${\Xi_{0}}$ in (55), as shown in Appendix A of
Ganor:2014pha . Deloup’s reciprocity relation is actually more general,
allowing non-even ${\mathbf{A}}$ and ${\mathbf{B}}$ by introducing arithmetic
“Wu classes”. For a quadratic form ${\mathbf{x}}^{t}{\mathbf{A}}{\mathbf{x}}$
(with ${\mathbf{x}}\in\mathbb{Z}^{n}$), a Wu class is realized by a constant
vector ${\mathbf{w}}\in\mathbb{Z}^{n}$ such that
${\mathbf{x}}^{t}{\mathbf{A}}{\mathbf{x}}+{\mathbf{w}}^{t}{\mathbf{x}}\in
2\mathbb{Z}$ for all ${\mathbf{x}}\in\mathbb{Z}^{n}$ Deloup . By adding such
linear terms (also similarly in Jeffrey’s), one overcomes the ambiguity in the
definition of Gauss sums in (157) for a non-even ${\mathbf{A}}$. In our
context, this suggests a possible extension to twists ${M}$ and
${\widetilde{{M}}}$ beyond the $\operatorname{SL}(2,\mathbb{Z})$ form given by
(152), by inserting operators linear in the bosonic field ${X}$ introduced in
§3.1, which would correspond to “vertex operators”, but we will not explore
this possibility in the present paper.

In 1998, Turaev further generalized Turaev Deloup’s formula to capture an
arbitrary “rational Wu class” (which means that the Gauss sums are sums of
exponentials in quadratic forms on a lattice plus linear terms with rational
coefficients that ensure that the exponents are well-defined up to $2\pi i$).
Overall, the place of our construction and generalization in §8.1-§8.2 is
somewhere in between Krazer’s/Jeffrey’s formula and Deloup’s theorem – for
example, if we set the duality twists to be
${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}$ and
${\widetilde{{M}}}={\widetilde{S}}{\widetilde{T}}^{2{u}_{1}}{\widetilde{S}}{\widetilde{T}}^{2{u}_{2}}$,
we get bivariate quadratic forms on both sides of the identity (155a); the
result is a special case of Deloup’s formula, but beyond Krazer’s formula. In
other words, our physical system is able to accommodate two independent
bilinear forms, and the identities obtained in (151) and (155a) are slightly
more general than Jeffrey’s formula (158).

Recently, the corrected formula (158) has been extensively used in studying
the categorification of WRT invariants Gukov:2016gkn ; Zedhat ; Cheng:2018vpl
; Chun:2019mal . It plays an essential role in the derivation of
$\hat{Z}$-invariants, or “homological blocks”, of plumbed 3-manifolds $M_{3}$.
The topology of $M_{3}$ is encoded in its plumbing graph, hence the linking
matrix of the link corresponding to the graph. The colored Jones polynomials
of this link, or equivalently the WRT invariant of $M_{3}$, is a Laurent
polymonial $J[q,q^{-1}]$ in variable242424$h^{\vee}$ is the dual Coxeter
number of the gauge group of the pure Chern-Simons theory defined on $M_{3}$.
$\displaystyle{q\equiv\exp\left(\frac{2i\pi}{{\mathbf{k}_{\tiny\rm
cs}}+h^{\vee}}\right)}$, which are raised to powers dictated by linking matrix
elements. Formula (158) then basically converts $J[q,q^{-1}]$ into a linear
combination of homological blocks, i.e., a summation over the lattice defined
by the linking matrix, whose cokernel determines $H^{1}(M_{3})$.

Finally, for a more comprehensive and technical historical account of the long
sequence of Quadratic Reciprocity formulae up to the early 20${}^{\text{th}}$
century [i.e., just prior to Krazer’s formula (157)], consult Chapter 1 of
Doyle or Chapter 4 of Lemmermeyer .

##  9 Discussion and outlook

We have constructed a supersymmetric double-Janus configuration for a 2d
$\sigma$-model with $T^{2}$ target space, where all the moduli are allowed to
vary along both coordinates, and we focused on a particular solution of the
SUSY conditions whereby the complex structure varies along one direction and
the Kähler structure varies along the other. We then placed the 2d double-
Janus configuration on $T^{2}$ with periodic boundary condition that include
$\operatorname{SL}(2,\mathbb{Z})$-duality walls. We discovered a nontrivial
interaction at the intersection of the duality walls, and we calculated the
partition function and showed that it can be expressed as a quadratic Gauss
sum. The fermionic and bosonic modes generally describe what might be called
"a second quantized supersymmetric quantum mechanics”, where the single-
particle energy levels are those of a 0+1d supersymmetric system with an
arbitrary periodic superpotential. The fermionic and bosonic determinants
cancel each other, leaving only a number-theoretic quadratic Gauss sum, which
we could compute in two different ways, verifying the Landsberg-Schaar
relation and obtaining generalizations. Our derivation of the Landsberg-Schaar
relation contains somewhat similar ingredients to a method introduced by
Armitage and Rogers ArmitageRogers , where quantum mechanics with a toroidal
phase space was also considered, although in their approach the physical time
was quantized.

Our work here is a prelude to the problem of an ${\mathcal{N}}={4}$ Super-
Yang-Mills theory with nonabelian $U(n)$ gauge group compactified on a closed
double-Janus configuration with an $\operatorname{SL}(2,\mathbb{Z})$-duality
twist. As suggested in Ganor:2014pha , such a system can be studied by
realizing it in terms of a stack of D$3$-branes and then mapping it to a
system of weakly-coupled strings in Type-IIA on a mapping torus. That system
can be compactified on another mapping torus, and the work in this paper
provides the partition function of a sector of the weakly-coupled Type-IIA
strings. It suggests interesting connections between number theory and
partition functions with $\operatorname{SL}(2,\mathbb{Z})$-duality walls.

## Acknowledgements

We are grateful to Richard E. Borcherds, Chi-Ming Chang, Zhu-Xi Luo, Ryan
Thorngren, Alessandro Tomasiello, Daniel Waldram, and Zhenghan Wang for
helpful conversations and discussions. OJG is grateful to E. Witten and the
organizers of the workshop “Master Lectures on Mathematical Physics: Edward
Witten” that took place at Tsinghua Sanya International Mathematics Forum
(TSIMF), in December 2015, where part of this work was presented. This
research was supported by the Berkeley Center of Theoretical Physics. The
research of N. R. Torres-Chicon was supported by the National Science
Foundation Graduate Research Fellowship Program under Grant No. DGE-11-06400.

##  Appendix A Janus compactifications and mapping tori

We begin with the 6d $(2,0)$ theory on a spacetime with metric given by

$ds^{2}=-dt^{2}+dx_{1}^{2}+dx_{2}^{2}+dy^{2}+R_{4}(y)^{2}dx_{4}^{2}+R_{5}^{2}dx_{5}^{2},$

where $R_{5}$ is a constant and $R_{4}$ varies with periodicities $x_{4}\sim
x_{4}+2\pi$ and $x_{5}\sim x_{5}+2\pi$, and noncompact $-\infty<y<\infty$.
Note that direction $x_{4}$ forms an $S^{1}$-fibration over $\mathbb{R}$, the
direction $y$, whose total space is a noncompact Riemann surface. The 6d
$(2,0)$-theory compactification therefore falls within the class of theories
studied by Gaiotto in Gaiotto:2009we . To preserve $8$ supersymmetries we
introduce, as in Gaiotto:2009we , an R-symmetry twist that matches the
holonomy of the Riemann surface. This is done with a background gauge field
for an $SO(2)$ subgroup of the $\operatorname{Spin}(5)$ R-symmetry group.
Dimensional reduction along directions $x_{4},x_{5}$ gives rise to a Janus
configuration with ${\tau}(y)=iR_{5}/R_{4}$ varying with $y$ and taking values
along the imaginary axis. Now, apply an $\operatorname{SL}(2,\mathbb{R})$
transformation that acts as

$h:{\tau}\rightarrow\frac{\alpha{\tau}+\beta}{\gamma{\tau}+\delta},\qquad
h=\begin{pmatrix}\alpha&\beta\\\ \gamma&\delta\\\
\end{pmatrix}\in\operatorname{SL}(2,\mathbb{R}),$ (160)

and linearly transforms $x_{4},x_{5}$ to obtain the metric

$ds^{2}=dt^{2}+dx_{1}^{2}+dx_{2}^{2}+dy^{2}+R_{4}(y)^{2}\left(\delta
dx_{4}^{\prime}-\beta dx_{5}^{\prime}\right)^{2}+R_{5}^{2}\left(\alpha
dx_{5}^{\prime}-\gamma dx_{4}^{\prime}\right)^{2}.$ (161)

We also modify the periodicity condition so that the new coordinates
$x_{4}^{\prime},x_{5}^{\prime}$ are periodic with periodicity $2\pi$. The
$3$-manifold in directions $y,x_{4}^{\prime},x_{5}^{\prime}$ still has an
$SO(2)$ holonomy, but dimensional reduction along
$x_{4}^{\prime},x_{5}^{\prime}$ now produces a 4d gauge theory with a complex
structure ${\tau}(y)$ that varies along a semicircle in the upper half-plane.
The semicircle is the image of the imaginary axis under (160). The R-symmetry
twist creates additional mass terms for the R-charged fields, as discovered in
Gaiotto:2008sd .

In the following we would like to take the further step of compactifying the
$y$ direction as well, say $y\sim y+1$. This would be possible if we could
find an $\operatorname{SL}(2,\mathbb{Z})$ MCG transformation acting on
$x_{4}^{\prime},x_{5}^{\prime}$ that relates ${\tau}(y)$ to ${\tau}(y+1)$. The
$\operatorname{SL}(2,\mathbb{Z})$ element will then be identified with ${M}$,
the S-duality twist in (1), and one of the eigenvalues of ${M}$ has to be
$R_{4}(1)/R_{4}(0)$ [and the other eigenvalue will be $R_{4}(0)/R_{4}(1)$].
Note, however, that the area of the $T^{2}$ in directions
$x_{4}^{\prime},x_{5}^{\prime}$, which is $(2\pi)^{2}R_{4}(y)R_{5}$, is not
generally a periodic function of $y$, and so we can only compactify $y$ after
the limit $R_{4},R_{5}\rightarrow 0$ has been taken to reach the 4d SYM low-
energy limit.

From the 4d SYM theory we can proceed to 2d by compactifying directions
$x_{1},x_{2}$ on another $T^{2}$ and taking the low-energy limit. If the gauge
group is $U(1)$ then we obtain a $\sigma$-model with $T^{2}$ target space from
the gauge fields, whose complex structure is ${\tau}(y)$. We can now proceed
in a parallel fashion to (161) and replace the so far untouched 3d part of the
metric with

$dt^{2}+dx_{1}^{2}+dx_{2}^{2}\rightarrow
dt^{2}+R_{1}(t)^{2}\left(\delta^{\prime}dx_{1}^{\prime}-\beta^{\prime}dx_{2}^{\prime}\right)^{2}+R_{2}^{2}\left(\alpha^{\prime}dx_{2}^{\prime}-\gamma^{\prime}dx_{1}^{\prime}\right)^{2},$
(162)

where

$\begin{pmatrix}\alpha^{\prime}&\beta^{\prime}\\\
\gamma^{\prime}&\delta^{\prime}\\\
\end{pmatrix}\in\operatorname{SL}(2,\mathbb{R}).$

In the low-energy limit, the $U(1)$ gauge field will reduce to a 2d
$\sigma$-model with $T^{2}$ target space whose complex structure varies with
$y$ and whose Kähler structure varies with $t$. We can then compactify $t$ by
imposing the periodicity $t\sim t+1$ together with an associated linear
transformation on $(x_{1}^{\prime},x_{2}^{\prime})$ given by
${\widetilde{{M}}}\in\operatorname{SL}(2,\mathbb{Z})$. This is possible in the
limit $R_{1},R_{2}\rightarrow 0$ provided that $R_{1}(0)/R_{1}(1)$ is one of
the eigenvalues of ${\widetilde{{M}}}$ [the other eigenvalue being
$R_{1}(1)/R_{1}(0)$].

We stress that the above construction is only a motivation for the
$\sigma$-model that we studied in the main paper, which is a supersymmetric 2d
$\sigma$-model with varying parameters.

##  Appendix B Locality and action $I^{\prime\prime}$ at the intersection of
the $\operatorname{SL}(2,\mathbb{Z})$ duality walls

The bosonic part of the duality wall corresponding to
${\widetilde{{M}}}={\overline{S}}{\overline{T}}^{\overline{k}}$ was given by
the sum of $I_{b}^{\prime}$ and $I^{\prime\prime}$ from (66) and (80):

$I_{b}^{\prime}+I^{\prime\prime}=\left.\frac{i}{4\pi}\int_{0}^{1}\bigl{(}2{X}_{1}^{t}{\epsilon}d{X}_{0}-{\overline{k}}{X}_{0}^{t}{\epsilon}d{X}_{0}\bigr{)}\right\rvert_{{\sigma}_{2}=0}+\frac{i}{4\pi}\left({\overline{k}}-2\right){X}(1,0)^{t}{\epsilon}{M}{X}(0,0)\,.$
(163)

We mentioned below (80) that $I^{\prime\prime}$ is necessary to incorporate
the periodic identification (53) in a local way. Let us now explain in what
sense (163) is a local action. For one, it is crucial that the coefficient in
(80) is $\left(2-{\overline{k}}\right)$. The key point is that ${X}_{0}$ and
${X}_{1}$ are only one set of representative functions on $\mathbb{R}^{2}$
that represent a map to the coset $T^{2}\simeq\mathbb{R}^{2}/\mathbb{Z}^{2}$.
In order to analyze the locality of the expression, let us divide the range
$0\leq{\sigma}_{1}<1$ into ${\mathfrak{n}}$ segments labeled by
${\mathfrak{g}}=0,\dots,{\mathfrak{n}}-1$ with endpoints

$0={\sigma}_{1,0}<{\sigma}_{1,1}<\cdots<{\sigma}_{1,{\mathfrak{n}}-1}<{\sigma}_{1,{\mathfrak{n}}}=1\,.$

In each segment
$\left[{\sigma}_{1,{\mathfrak{g}}},{\sigma}_{1,{\mathfrak{g}}+1}\right]$, we
define fields ${X}_{0,{\mathfrak{g}}}({\sigma}_{1})$, with
${\sigma}_{1,{\mathfrak{g}}}\leq{\sigma}_{1}\leq{\sigma}_{1,{\mathfrak{g}}+1}$.
Similarly, at ${\sigma}_{2}=1$ we have another sequence of vector functions
$\left\\{{X}_{1,{\mathfrak{g}}}\right\\}_{{\mathfrak{g}}=1}^{\mathfrak{n}}$.
Thanks to the equivalence (53), there is an infinite number of ways to pick
${X}_{0,{\mathfrak{g}}}$ and ${X}_{1,{\mathfrak{g}}}$ in each segment, but
different choices differ by a constant vector ${K}$. To incorporate that
ambiguity in a local way, we allow the boundary conditions at the point were
${\sigma}_{1,{\mathfrak{g}}+1}$, where one segment touches the next one, to
include a shift by ${\mathcal{N}}_{\mathfrak{g}}\in\mathbb{Z}^{2}$ [which
plays the role of ${K}$ in (53)]:

${X}_{i,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}+1})={M}^{{\nu}_{\mathfrak{g}}}{X}_{i,{\mathfrak{g}}+1}\left({\sigma}_{1,{\mathfrak{g}}+1}\right)+2\pi{\mathcal{N}}_{\mathfrak{g}}\,,\qquad
i=0,1.$ (164)

In (164), we also allow a twist by an integer power
${\nu}_{\mathfrak{g}}\in\mathbb{Z}$ of ${M}$ between the ${\mathfrak{g}}^{th}$
and $({\mathfrak{g}}+1)^{th}$ segment. In order to comply with (49), we
require that the net twist be ${M}$, so that:

$\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}{\nu}_{\mathfrak{g}}=1.$

Our convention is that ${\mathfrak{n}}\sim 0$ so that
${\mathcal{N}}_{\mathfrak{n}}={\mathcal{N}}_{0}$. We require that the action
be a sum of local expressions, and we start by replacing the first two terms
in (163) with

${\tilde{I}}_{b}^{\prime}\equiv-\frac{i}{4\pi}\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}\int_{{\sigma}_{1,{\mathfrak{g}}}}^{{\sigma}_{1,{\mathfrak{g}}+1}}\left({\overline{k}}{X}_{0,{\mathfrak{g}}}^{t}{\epsilon}d{X}_{0,{\mathfrak{g}}}-2{X}_{1,{\mathfrak{g}}}^{t}{\epsilon}d{X}_{0,{\mathfrak{g}}}\right)\,.$
(165)

Next, we require local gauge invariance. The gauge transformations are labeled
by ${\mathfrak{n}}$ vectors ${K}_{\mathfrak{g}}\in\mathbb{Z}^{2}$ and act as

${X}_{i,{\mathfrak{g}}}\rightarrow{X}_{i,{\mathfrak{g}}}+2\pi{K}_{\mathfrak{g}}\,\quad(i=0,1)\,,\qquad{\mathcal{N}}_{\mathfrak{g}}\rightarrow{\mathcal{N}}_{\mathfrak{g}}+{K}_{\mathfrak{g}}-{M}^{{\nu}_{\mathfrak{g}}}{K}_{{\mathfrak{g}}+1}\,,\qquad{\mathfrak{g}}=0,\dots,{\mathfrak{n}}-1.$
(166)

Under this gauge transformation the action transforms as

$\displaystyle{\tilde{I}}_{b}^{\prime}$ $\displaystyle\rightarrow$
$\displaystyle{\tilde{I}}_{b}^{\prime}-\frac{i}{2}\left({\overline{k}}-2\right)\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}{K}_{\mathfrak{g}}^{t}{\epsilon}\left[{M}^{{\nu}_{\mathfrak{g}}}{X}_{0,{\mathfrak{g}}+1}({\sigma}_{1,{\mathfrak{g}}+1})-{X}_{0,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}})\right]-i\left({\overline{k}}-2\right)\pi\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}{K}_{\mathfrak{g}}^{t}{\epsilon}{\mathcal{N}}_{\mathfrak{g}}\,.\qquad$
(167)

Since we assume that ${\overline{k}}\in 2\mathbb{Z}$, the last term is in
$2\pi\mathbb{Z}$ and we can drop it, since the path integral is over $e^{-I}$.
For the remaining terms, we can rearrange the sum to read

$\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}{K}_{\mathfrak{g}}^{t}{\epsilon}\left[{M}^{{\nu}_{\mathfrak{g}}}{X}_{0,{\mathfrak{g}}+1}({\sigma}_{1,{\mathfrak{g}}+1})-{X}_{0,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}})\right]=\sum_{{\mathfrak{g}}=1}^{{\mathfrak{n}}}\left[{K}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}-{K}_{\mathfrak{g}}^{t}\right]{\epsilon}{X}_{0,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}}),$

where we used the identity
$\left({M}^{{\nu}_{{\mathfrak{g}}-1}}\right)^{t}{\epsilon}{M}^{{\nu}_{{\mathfrak{g}}-1}}=(\det{M})^{{\nu}_{{\mathfrak{g}}-1}}{\epsilon}={\epsilon}\,.$
Thus, (167) can be rewritten as

${\tilde{I}}_{b}^{\prime}\rightarrow{\tilde{I}}_{b}^{\prime}-\frac{i}{2}\left({\overline{k}}-2\right)\sum_{{\mathfrak{g}}=1}^{{\mathfrak{n}}}\left[{K}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}-{K}_{\mathfrak{g}}^{t}\right]{\epsilon}{X}_{0,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}})\qquad{\pmod{2\pi\mathbb{Z}}}\,.$

So, ${\tilde{I}}_{b}^{\prime}$ is not gauge invariant on its own. To fix it,
we can add to ${\tilde{I}}_{b}^{\prime}$ the term

${\tilde{I}}^{\prime\prime}\equiv\frac{i}{2}\left({\overline{k}}-2\right)\sum_{{\mathfrak{g}}=0}^{{\mathfrak{n}}-1}{\mathcal{N}}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}{\epsilon}{X}_{0,{\mathfrak{g}}}({\sigma}_{1,{\mathfrak{g}}}).$
(168)

We can now check that ${\tilde{I}}_{b}^{\prime}+{\tilde{I}}^{\prime\prime}$ is
invariant, using (166) to calculate

${\mathcal{N}}_{\mathfrak{g}}\rightarrow{\mathcal{N}}_{\mathfrak{g}}+{K}_{\mathfrak{g}}-{M}^{{\nu}_{\mathfrak{g}}}{K}_{{\mathfrak{g}}+1}\,,\qquad{\mathcal{N}}_{{\mathfrak{g}}-1}^{t}\rightarrow{\mathcal{N}}_{{\mathfrak{g}}-1}^{t}+{K}_{{\mathfrak{g}}-1}^{t}-{K}_{{\mathfrak{g}}}^{t}\left({M}^{{\nu}_{{\mathfrak{g}}-1}}\right)^{t}\,,$

and thus

${\mathcal{N}}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}\rightarrow{\mathcal{N}}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}+{K}_{{\mathfrak{g}}-1}^{t}\left({M}^{-{\nu}_{{\mathfrak{g}}-1}}\right)^{t}-{K}_{{\mathfrak{g}}}^{t}\,.$

Now, if we set

${\nu}_{-1}\equiv{\nu}_{{\mathfrak{n}}-1}=1\,,\qquad{\nu}_{0}={\nu}_{1}=\cdots={\nu}_{{\mathfrak{n}}-2}=0\,,$

and

${\mathcal{N}}_{-1}\equiv{\mathcal{N}}_{{\mathfrak{n}}-1}={\mathcal{N}}\,,\qquad{\mathcal{N}}_{0}={\mathcal{N}}_{1}=\cdots={\mathcal{N}}_{{\mathfrak{n}}-2}=0\,,$

then we recover the action (82).

##  Appendix C On the equivalence between
$2{\widetilde{{\mathfrak{q}}}}(\cdot)$ and ${v}^{t}{\epsilon}{M}{v}$ in (118)

###  C.1 Proof for ${M}={S}{T}^{2{v}_{1}}$ and
${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}$

We now show that (118) holds for the cases ${M}={S}{T}^{2{v}_{1}}$ and
${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}$. Equation (118) states that the
quadratic form $2{\widetilde{{\mathfrak{q}}}}({v})$ can be written as
${v}^{t}{\epsilon}{M}{v}$ up to an integer.

The case ${M}={S}{T}^{2{v}_{1}}$ is simple. The group ${\Xi_{0}}$, defined in
(55), is isomorphic to the cyclic group $\mathbb{Z}_{(2{v}_{1}-1)}$, and an
element of $({M}-{\mathbb{I}})^{-1}(\mathbb{Z}^{2})/\mathbb{Z}^{2}$ can be
expressed as

${v}=\frac{{\mathbf{n}}}{2{v}_{1}-2}\begin{pmatrix}1\\\ -1\\\
\end{pmatrix},\qquad\text{for ${\mathbf{n}}=0,\dots,2({v}_{1}-1)-1.$}$

Then (half) the RHS of (118) is equal to

$\tfrac{1}{2}{v}^{t}{\epsilon}{M}{v}=\frac{{\mathbf{n}}^{2}}{4({v}_{1}-1)}.$

The coupling constant matrix ${K}$ is $1\times 1$ and given by $(2{v}_{1}-2)$
which results in the same expression. Thus, in this case
${\widetilde{{\mathfrak{q}}}}({v})$ equals
$\frac{1}{2}{v}^{t}{\epsilon}{M}{v}$.

For the case ${M}={S}{T}^{2{v}_{1}}{S}{T}^{2{v}_{2}}$, (half) the RHS of (118)
was calculated in (150) as

$\tfrac{1}{2}{v}^{t}{\epsilon}{M}{v}=\frac{{v}_{1}{\mathbf{n}}^{2}}{4({v}_{1}{v}_{2}-1)}-\frac{{v}_{2}{\mathbf{a}}^{2}}{4}$
(169)

using an identification of ${\Xi_{0}}$ with
$\mathbb{Z}_{2({v}_{1}{v}_{2}-1)}\oplus\mathbb{Z}_{2}$ via

${v}\mapsto\begin{pmatrix}{\mathbf{n}}\\\ {\mathbf{a}}\\\
\end{pmatrix},\qquad{\mathbf{a}}=0,1\,,\qquad{\mathbf{n}}=0,\dots,2({v}_{1}{v}_{2}-1)-1.$

[The relation ${v}=({M}-{\mathbb{I}})^{-1}{\mathcal{N}}$ is needed to relate
(150) to (169).]

To calculate ${\mathfrak{q}}(\cdot)$ we note that

${K}=\begin{pmatrix}2{v}_{1}&-2\\\ -2&2{v}_{2}\\\
\end{pmatrix}=\begin{pmatrix}0&-1\\\ 1&{v}_{2}\\\
\end{pmatrix}\begin{pmatrix}2({v}_{1}{v}_{2}-1)&0\\\ 0&2\\\
\end{pmatrix}\begin{pmatrix}1&0\\\ -{v}_{1}&1\\\ \end{pmatrix}.$

Thus, we can define the isomorphism ${\widetilde{\varphi}}$ by

${\widetilde{\varphi}}({v})={\mathbf{v}}=\begin{pmatrix}0&-1\\\ 1&{v}_{2}\\\
\end{pmatrix}\begin{pmatrix}{\mathbf{n}}\\\ {\mathbf{a}}\\\ \end{pmatrix},$

and use (116) to calculate

${\widetilde{{\mathfrak{q}}}}({v})={\mathfrak{q}}({\widetilde{\varphi}}({v}))=\tfrac{1}{2}{\mathbf{v}}^{t}K^{-1}{\mathbf{v}}=\frac{{v}_{2}}{4}{\mathbf{a}}^{2}+\frac{{v}_{1}}{4({v}_{1}{v}_{2}-1)}{\mathbf{n}}^{2}+\frac{1}{2}{\mathbf{a}}{\mathbf{n}}.$
(170)

Comparing (170) to (169) we see that in general

${\widetilde{{\mathfrak{q}}}}({v})\neq\tfrac{1}{2}{v}^{t}{\epsilon}{M}{v}{\pmod{\mathbb{Z}}}$

but

$2{\widetilde{{\mathfrak{q}}}}({v})\equiv{v}^{t}{\epsilon}{M}{v}{\pmod{\mathbb{Z}}},$

as stated.

###  C.2 Example for $M$ with three $ST^{\\#}$ factors

Although we did not prove the equivalence of $2{\mathfrak{q}}({v})$ and
${v}^{t}{\epsilon}{M}{v}$ (mod $1$) for the case with three factors of
$ST^{\\#}$ inside the decomposition of $M$, we here present a numerical
example to support our conjecture that signs could be added by hand to the
naive252525In this section, by “naive” we mean that we do not consider any
$\pm$ sign shown in (127), or the phase $\phi$ predicted by the signature
${\sigma}$ of the quadratic form ${v}^{t}{\epsilon}{M}{v}$ in (118).
$\widetilde{\mathscr{T}}$ to satisfy
$(\mathscr{S}\widetilde{\mathscr{T}})^{3}=\mathscr{S}^{2}$. The naive
$\widetilde{\mathscr{T}}$ is defined as

$\widetilde{\mathscr{T}}{\left\lvert{v}\right\rangle}\equiv e^{-\pi
iv^{t}\epsilon Mv}{\left\lvert{v}\right\rangle},\quad v\in{\Xi_{0}}.$

Let us consider

$M=ST^{2}ST^{2}ST^{4}=\begin{pmatrix}-2&-7\\\ 3&10\end{pmatrix},$ (171)

which yields a cyclic group ${\Xi_{0}}\cong\mathbb{Z}_{6}$ with an ordered
basis

$\left\\{\left(\frac{5}{6},\frac{1}{2}\right),\left(\frac{2}{3},0\right),\left(\frac{1}{2},\frac{1}{2}\right),\left(\frac{1}{3},0\right),\left(\frac{1}{6},\frac{1}{2}\right),\left(0,0\right)\right\\}.$

Here we do not calculate $\mathscr{S}$ according to the definition (126). The
reason is as follows: without knowing the correct $\pm$ sign in front of each
matrix element beforehand, if one were to choose all signs to be, say, $+$,
then it is a numerical observation that almost always one would obtain a
singular $\mathscr{S}$ where at least two rows are identical, and furthermore
$\mathscr{S}^{2}$ would not be the charge conjugation operator. Hence, we
start by using the unsymmetrized262626The exponent is unsymmetrized (no
symmetrization or antisymmetrization whatsoever), but $\mathscr{S}$ is still a
symmetric matrix./naive definition:

$\widetilde{\mathscr{S}}{\left\lvert{{v}}\right\rangle}\equiv\frac{1}{\sqrt{|{\Xi_{0}}|}}\sum_{{u}\in{\Lambda}/\mathbb{Z}^{2}}e^{2\pi
i{v}^{t}{\epsilon}({M}-{\mathbb{I}}){u}}{\left\lvert{{u}}\right\rangle},\quad
u,v\in{\Xi_{0}}.$ (172)

Then we calculate

$\widetilde{\mathscr{T}}=\left(\begin{array}[]{cccccc}e^{\frac{5i\pi}{6}}&&&&\\\
&e^{-\frac{2i\pi}{3}}&&&\\\ &&-i&&\\\ &&&e^{\frac{i\pi}{3}}&\\\
&&&&e^{\frac{5i\pi}{6}}&\\\ &&&&&1\\\ \end{array}\right),$

and

$\widetilde{\mathscr{S}}=\frac{1}{\sqrt{6}}\left(\begin{array}[]{cccccc}e^{\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}&-1&e^{-\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&1\\\
e^{\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&1&e^{\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&1\\\
-1&1&-1&1&-1&1\\\
e^{-\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&1&e^{-\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&1\\\
e^{-\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}&-1&e^{\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&1\\\
1&1&1&1&1&1\\\ \end{array}\right).$

We can easily check that $\widetilde{\mathscr{S}}^{2}$ is the Sylvester’s
“shift” matrix in the canonical basis

$\left(\begin{array}[]{cccccc}0&0&0&0&1&0\\\ 0&0&0&1&0&0\\\ 0&0&1&0&0&0\\\
0&1&0&0&0&0\\\ 1&0&0&0&0&0\\\ 0&0&0&0&0&1\\\ \end{array}\right),$

i.e., the charge conjugation sending ${\left\lvert{v}\right\rangle}$ to
${\left\lvert{-v}\right\rangle}$, and
$\widetilde{\mathscr{S}}^{4}={\mathbb{I}}$.

We found four solutions to
$\big{|}(\widetilde{\mathscr{S}}\mathscr{T})^{3}\big{|}=\widetilde{\mathscr{S}}^{2}$,
and below is the list of phases272727Up to multiplications by $e^{\frac{2\pi
i}{3}}$ and $e^{\frac{4\pi i}{3}}$, due to the three distinct ways of lifting
a projective representation of $SL(2,\mathbb{Z})$ to a linear representation
(i.e., three distinct “linearizations”), see for example Wang1 ; TenerWang .
required to multiply the entire $\mathscr{T}$ to possibly become the refined
$\mathscr{T}$ as in (127) satisfying
$(\widetilde{\mathscr{S}}\mathscr{T})^{3}=\widetilde{\mathscr{S}}^{2}$, along
with positions on the diagonal of $\widetilde{\mathscr{T}}$ where signs were
flipped in each solution:

  * •

phase: $e^{-\frac{i\pi}{12}}$, positions: 1, 2, 3, 5, 6;

  * •

phase: $e^{\frac{i\pi}{12}}$, positions: 1, 3, 4, 5;

  * •

$\boxed{\text{phase:}\,\,e^{-\frac{i\pi}{4}},\,\,\text{positions:}\,\,2,6};$

  * •

phase: $e^{\frac{i\pi}{4}}$, position: 4.

We see that the third sign configuration yields a phase matching
$\phi=e^{-i\pi\sigma(K)/12}$ in ${{\mathcal{T}}}$ in (111), since the
signature of the $K$-matrix (112) in this example

$\begin{pmatrix}2&-1&0\\\ -1&2&-1\\\ 0&-1&4\end{pmatrix}$ (173)

is 3 [because exponents in $ST^{\\#}$ factors of $M$ in (111) are all
positive].

Our final comment is that the naive $\widetilde{\mathscr{T}}$ and
unsymmetrized $\widetilde{\mathscr{S}}$ matrices here also enable us to find
the correct sign configuration on the refined $\mathscr{T}$ in (127), with a
phase matching the signature of $K$-matrix for cases with two $ST^{\\#}$
factors in $M$, as expected from Appendix C.1. We also conjecture that the
correct sign configuration on $\mathcal{S}$ in (120) and $\mathscr{S}$ in
(126) is exactly given by $\widetilde{\mathscr{S}}$ on the face value.

###  C.3 Concrete exercises for $M$ with two $ST^{\\#}$ factors

The purpose of this subsection is to provide examples for Appendix C.1. Our
first example is

$M=ST^{2}ST^{4}=\begin{pmatrix}-1&-4\\\ 2&7\end{pmatrix},$

which generate ${\Xi_{0}}$ as $\mathbb{Z}_{2}\oplus\mathbb{Z}_{2}$, the Klein
4-group282828Incidentally, we note that
$M=ST^{-1}ST^{-3}ST=\begin{pmatrix}3&4\\\ 2&3\end{pmatrix}$ also give the same
$\mathbb{Z}_{2}\oplus\mathbb{Z}_{2}$ with the same basis.. Since everything is
mod 1 here, we choose the ordered basis
$\left\\{(1/2,1/2),(1/2,0),(0,1/2),(0,0)\right\\}$. Then its naive
$\widetilde{\mathscr{T}}$ matrix is

$\mathscr{T}=\begin{pmatrix}-i&0&0&0\\\ 0&i&0&0\\\ 0&0&-1&0\\\ 0&0&0&1\\\
\end{pmatrix},$

If we were to following the customs to symmetrize the quadratic form on the
exponent in (126) to be a quadratic refinement (a symmetric bilinear form)
Moore ; Anyon , then we would get a candidate “$\mathcal{S}$-matrix” with
symmetrized exponents $e^{-\pi
i({v}^{t}{\epsilon}{M}{u}+{u}^{t}{\epsilon}{M}{v})}$:

$\mathcal{S}^{\prime}=\frac{1}{2}\begin{pmatrix}-1&-1&1&1\\\ -1&-1&1&1\\\
1&1&1&1\\\ 1&1&1&1\\\ \end{pmatrix}.$

However, as we have claimed in Appendix C.2, it is singular and its square is
not a charge conjugation matrix.

On the other hand, another candidate “$\mathcal{S}$-matrix” with
antisymmetrized exponents $e^{-\pi
i({v}^{t}{\epsilon}{M}{u}-{u}^{t}{\epsilon}{M}{v})}$ is

$\mathcal{S}^{\prime\prime}=\frac{1}{2}\begin{pmatrix}1&-1&-1&1\\\
-1&1&-1&1\\\ -1&-1&1&1\\\ 1&1&1&1\\\ \end{pmatrix},$ (174)

which now squared to be the identity, but one cannot achieve
$\big{|}(\mathcal{S}^{\prime\prime}\widetilde{\mathscr{T}})^{3}\big{|}=\mathcal{S}^{\prime\prime
2}$ by flipping signs on elements in $\widetilde{\mathscr{T}}$, and the best
one could possibly do is to flip the lower right entry in
$\widetilde{\mathscr{T}}$ so that

$\left[\mathcal{S}^{\prime\prime}\begin{pmatrix}-i&0&0&0\\\ 0&i&0&0\\\
0&0&-1&0\\\ 0&0&0&\boxed{-1}\\\
\end{pmatrix}\right]^{3}=\begin{pmatrix}1&0&0&0\\\ 0&1&0&0\\\ 0&0&-1&0\\\
0&0&0&-1\\\ \end{pmatrix},$

which is fine because we are working with (mod $1$) for MCG actions in (126)
and (127). However, in the upcoming example we will not be so lucky with
antisymmetrization, which would fail there.

Now let us consider

$M=ST^{4}ST^{6}=\begin{pmatrix}-1&-6\\\ 4&23\end{pmatrix},$

which generate ${\Xi_{0}}$ with the basis of the following order

$\begin{split}&\left\\{\left(0,0\right),\left(\frac{7}{10},\frac{1}{10}\right),\left(\frac{2}{5},\frac{1}{5}\right),\left(\frac{1}{10},\frac{3}{10}\right),\left(\frac{4}{5},\frac{2}{5}\right),\left(\frac{1}{2},\frac{1}{2}\right),\left(\frac{1}{5},\frac{3}{5}\right),\left(\frac{9}{10},\frac{7}{10}\right),\right.\\\
&\,\,\,\,\left(\frac{3}{5},\frac{4}{5}\right),\left(\frac{3}{10},\frac{9}{10}\right),\left(\frac{9}{10},\frac{1}{5}\right),\left(\frac{3}{5},\frac{3}{10}\right),\left(\frac{3}{10},\frac{2}{5}\right),\left(0,\frac{1}{2}\right),\left(\frac{7}{10},\frac{3}{5}\right),\\\
&\,\,\,\,\left.\left(\frac{4}{5},\frac{9}{10}\right),\left(\frac{1}{10},\frac{4}{5}\right),\left(\frac{1}{2},0\right),\left(\frac{2}{5},\frac{7}{10}\right),\left(\frac{1}{5},\frac{1}{10}\right)\right\\},\end{split}$
(175)

so its naive $\widetilde{\mathscr{T}}$ matrix is

$\begin{split}\widetilde{\mathscr{T}}=\text{diag}&\left(1,e^{-\frac{3\pi}{10}i},e^{\frac{4\pi}{5}i},e^{-\frac{7\pi}{10}i},e^{-\frac{4\pi}{5}i},i,e^{-\frac{4\pi}{5}i},e^{-\frac{7\pi}{10}i},e^{\frac{4\pi}{5}i},e^{-\frac{3\pi}{10}i},e^{-\frac{\pi}{5}i},e^{-\frac{3\pi}{10}i},e^{\frac{\pi}{5}i},-i,\right.\\\
&\,\,\,\left.e^{\frac{\pi}{5}i},e^{\frac{7\pi}{10}i},e^{-\frac{\pi}{5}i},-1,e^{\frac{3\pi}{10}i},e^{\frac{7\pi}{10}i}\right).\end{split}$
(176)

The antisymmatrization proposal similar to (174) will yield a candidate

$\mathcal{S}^{\prime\prime}=\scalebox{0.72}{\mbox{$\displaystyle\frac{1}{2\sqrt{5}}\left(\begin{array}[]{cccccccccccccccccccc}1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\ \end{array}\right)$}},$

whose square and the fourth power are nothing close to a charge conjugation
operator or the identity matrix.

Following the unsymmetrized definition (172), we have the
$\widetilde{\mathscr{S}}$ matrix

$\widetilde{\mathscr{S}}=\scalebox{0.72}{\mbox{$\displaystyle\frac{1}{2\sqrt{5}}\left(\begin{array}[]{cccccccccccccccccccc}1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1&1\\\
1&e^{\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&-1&e^{-\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&1&e^{\frac{3i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&-1&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}\\\
1&e^{-\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&1&e^{-\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&1&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&1&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}\\\
1&e^{-\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&-1&e^{\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&1&e^{-\frac{i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&-1&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}\\\
1&e^{\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&1&e^{\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&1&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&1&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}\\\
1&-1&1&-1&1&-1&1&-1&1&-1&-1&1&-1&1&-1&1&-1&-1&1&1\\\
1&e^{-\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&1&e^{-\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&1&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&1&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}\\\
1&e^{\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&-1&e^{-\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&1&e^{\frac{i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&-1&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}\\\
1&e^{\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&1&e^{\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&1&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&1&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}\\\
1&e^{-\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&-1&e^{\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&1&e^{-\frac{3i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&-1&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}\\\
1&e^{\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&-1&e^{-\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&-1&e^{-\frac{4i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&1&e^{-\frac{3i\pi}{5}}&e^{\frac{i\pi}{5}}\\\
1&e^{\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&1&e^{\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{\frac{i\pi}{5}}&-1&e^{-\frac{i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{3i\pi}{5}}&-1&e^{\frac{3i\pi}{5}}&e^{-\frac{i\pi}{5}}\\\
1&e^{-\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&-1&e^{\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&-1&e^{\frac{2i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&1&e^{-\frac{i\pi}{5}}&e^{-\frac{3i\pi}{5}}\\\
1&1&1&1&1&1&1&1&1&1&-1&-1&-1&-1&-1&-1&-1&-1&-1&-1\\\
1&e^{\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&-1&e^{-\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&-1&e^{-\frac{2i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{\frac{4i\pi}{5}}&1&e^{\frac{i\pi}{5}}&e^{\frac{3i\pi}{5}}\\\
1&e^{\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&1&e^{\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{3i\pi}{5}}&-1&e^{-\frac{3i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{i\pi}{5}}&-1&e^{-\frac{i\pi}{5}}&e^{-\frac{3i\pi}{5}}\\\
1&e^{-\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&-1&e^{\frac{4i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{4i\pi}{5}}&-1&e^{\frac{4i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{\frac{2i\pi}{5}}&1&e^{\frac{3i\pi}{5}}&e^{-\frac{i\pi}{5}}\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&-1&1&1&-1&-1\\\
1&e^{-\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&1&e^{-\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{-\frac{2i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{\frac{3i\pi}{5}}&e^{-\frac{i\pi}{5}}&-1&e^{\frac{i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{\frac{3i\pi}{5}}&-1&e^{-\frac{3i\pi}{5}}&e^{\frac{i\pi}{5}}\\\
1&e^{-\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&1&e^{-\frac{2i\pi}{5}}&e^{-\frac{4i\pi}{5}}&e^{\frac{4i\pi}{5}}&e^{\frac{2i\pi}{5}}&e^{\frac{i\pi}{5}}&e^{-\frac{i\pi}{5}}&e^{-\frac{3i\pi}{5}}&-1&e^{\frac{3i\pi}{5}}&e^{-\frac{3i\pi}{5}}&e^{-\frac{i\pi}{5}}&-1&e^{\frac{i\pi}{5}}&e^{\frac{3i\pi}{5}}\\\
\end{array}\right)$}},$

which squared to be the charge conjugation operator – the “shift” matrix in a
non-canonical basis.

It is not hard to use Mathematica to find 8 solutions to
$\big{|}(\widetilde{\mathscr{S}}\mathscr{T})^{3}\big{|}=\widetilde{\mathscr{S}}^{2}$,
out of $2^{20}=1,048,576$ possible sign configurations of
$\widetilde{\mathscr{T}}$’s diagonal elements. Below for each solution, we
list positions of entries in $\widetilde{\mathscr{T}}$ whose signs are
flipped, as well as the phase needs to be added by hand to convert the naive
$\widetilde{\mathscr{T}}$ matrix into the refined $\mathscr{T}$ so that
$(\widetilde{\mathscr{S}}\mathscr{T})^{3}=\widetilde{\mathscr{S}}^{2}$:

  * •

phase: $e^{\frac{i\pi}{6}}$ or $e^{\frac{5i\pi}{6}}$ or $e^{-\frac{i\pi}{2}}$,
positions: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 18;

  * •

phase: $1$ or $e^{\frac{2i\pi}{3}}$ or $e^{\frac{4i\pi}{3}}$, positions 1, 2,
3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 19, 20;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{i\pi}{2}}\,\,\text{or}\,\,e^{\frac{7i\pi}{6}}\,\,\text{or}\,\,e^{-\frac{i\pi}{6}},\,\,\text{positions:
1, 3, 5, 7, 9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20}}$;

  * •

phase: $1$ or $e^{\frac{2i\pi}{3}}$ or $e^{\frac{4i\pi}{3}}$, positions: 1, 3,
5, 7, 9;

  * •

phase: $-1$ or $e^{\frac{i\pi}{3}}$ or $e^{-\frac{i\pi}{3}}$, positions: 2, 4,
6, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20;

  * •

phase: $e^{\frac{i\pi}{6}}$ or $e^{\frac{5i\pi}{6}}$ or $e^{-\frac{i\pi}{2}}$,
positions: 2, 4, 6, 8, 10;

  * •

phase: $-1$ or $e^{\frac{i\pi}{3}}$ or $e^{-\frac{i\pi}{3}}$, positions: 11,
13, 15, 17, 18;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{i\pi}{2}}\,\,\text{or}\,\,e^{\frac{7i\pi}{6}}\,\,\text{or}\,\,e^{-\frac{i\pi}{6}},\,\,\text{positions:
12, 14, 16, 19, 20}}$.

Now in this case, the $K$-matrix defined as (113) is

$\begin{pmatrix}4&-2\\\ -2&6\end{pmatrix},$ (177)

whose signature is $2$, meaning that the third and the last solutions yield
the right phase as dictated by comments following (111) and (137).

###  C.4 A concrete exercise for $M$ with 4 factors of $ST^{\\#}$

In fact, our above procedure goes beyond 3 factors of $ST^{\\#}$ in $M$. To
support this claim, we finally consider

$M=ST^{2}ST^{3}ST^{2}ST^{3}=\begin{pmatrix}-5&-12\\\ 8&9\end{pmatrix}$ (178)

with four $ST^{\\#}$ factors.

In the ordered basis of ${\Xi_{0}}$

$\begin{split}&\left\\{(0,0),\left(0,\frac{1}{2}\right),\left(\frac{1}{2},\frac{2}{3}\right),\left(\frac{1}{2},\frac{1}{6}\right),\left(0,\frac{1}{3}\right),\left(0,\frac{5}{6}\right),\left(\frac{1}{2},0\right),\left(\frac{1}{2},\frac{1}{2}\right),\left(0,\frac{2}{3}\right),\left(0,\frac{1}{6}\right),\right.\\\
&\left.\,\,\,\left(\frac{1}{2},\frac{1}{3}\right),\left(\frac{1}{2},\frac{5}{6}\right)\right\\},\end{split}$
(179)

the naive $\widetilde{\mathscr{T}}$ matrix is

$\widetilde{\mathscr{T}}=\text{diag}\left(1,-1,e^{-\frac{2i\pi}{3}},e^{\frac{i\pi}{3}},e^{-\frac{2i\pi}{3}},e^{\frac{i\pi}{3}},1,-1,e^{-\frac{2i\pi}{3}},e^{\frac{i\pi}{3}},e^{-\frac{2i\pi}{3}},e^{\frac{i\pi}{3}}\right).$
(180)

The unsymmetrized $\widetilde{\mathscr{S}}$ matrix is

$\widetilde{\mathscr{S}}=\scalebox{0.85}{\mbox{$\displaystyle\frac{1}{2\sqrt{3}}\left(\begin{array}[]{cccccccccccc}1&1&1&1&1&1&1&1&1&1&1&1\\\
1&1&-1&-1&1&1&-1&-1&1&1&-1&-1\\\
1&-1&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&1&-1&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}\\\
1&-1&e^{\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&-1&1&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}\\\
1&1&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&1&1&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}\\\
1&1&e^{-\frac{i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&-1&-1&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{\frac{i\pi}{3}}\\\
1&-1&1&-1&1&-1&1&-1&1&-1&1&-1\\\ 1&-1&-1&1&1&-1&-1&1&1&-1&-1&1\\\
1&1&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&1&1&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}\\\
1&1&e^{\frac{i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{\frac{2i\pi}{3}}&-1&-1&e^{-\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{-\frac{i\pi}{3}}\\\
1&-1&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&1&-1&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}\\\
1&-1&e^{-\frac{i\pi}{3}}&e^{\frac{2i\pi}{3}}&e^{-\frac{2i\pi}{3}}&e^{\frac{i\pi}{3}}&-1&1&e^{\frac{2i\pi}{3}}&e^{-\frac{i\pi}{3}}&e^{\frac{i\pi}{3}}&e^{-\frac{2i\pi}{3}}\\\
\end{array}.\right)$}}$ (181)

We find 8 solutions to
$(\widetilde{\mathscr{S}}\mathscr{T})^{3}=\widetilde{\mathscr{S}}^{2}$ by
flipping signs and multiplying phases on the diagonal of $\mathscr{T}$:

  * •

phase: $e^{\frac{i\pi}{3}}$, positions: 1, 2, 3, 5, 6, 7, 9, 10, 11;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{-i\pi}{3}},\,\,\text{positions: 1, 2, 4, 5,
6, 8, 9, 10, 12}}$;

  * •

phase: $e^{\frac{i\pi}{3}}$, positions: 1, 3, 4, 5, 7, 8, 9, 11, 12;

  * •

phase: $e^{\frac{i\pi}{3}}$, positions: 2, 3, 4, 6, 7, 8, 10, 11, 12;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{-i\pi}{3}},\,\,\text{positions: 1, 5, 9}}$;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{-i\pi}{3}},\,\,\text{positions: 1, 3, 4, 5,
7, 8, 9, 11, 12}}$;

  * •

phase: $e^{\frac{i\pi}{3}}$, positions: 1, 2, 4, 5, 6, 8, 9, 10, 12;

  * •

$\boxed{\text{phase:}\,\,e^{\frac{-i\pi}{3}},\,\,\text{positions: 1, 2, 3, 5,
6, 7, 9, 10, 11}}$.

The $K$-matrix of $M$ is

$\begin{pmatrix}2&-1&0&-1\\\ -1&3&-1&0\\\ 0&-1&2&-1\\\ -1&0&-1&3\end{pmatrix}$
(182)

with signature 4, and again all phases are up to multiplications by
$e^{\frac{2i\pi}{3}}$ and $e^{-\frac{2i\pi}{3}}$, so we see that the second,
the fifth, the sixth and the last solutions yield the correct results.

Finally, we propose the following conjecture:

Conjecture For any $M\in\operatorname{SL}(2,\mathbb{Z})$ built from a finite
number of $ST^{\\#}$ factors with any integer power $\\#$, we perform the
following steps: • Compute the unsymmetrized $\widetilde{\mathscr{S}}$ and the
naive $\widetilde{\mathscr{T}}$ à la (120), or à la (126) and (127); • Flip
signs on $\widetilde{\mathscr{T}}$’s diagonal to get $\mathscr{T}$ satisfying
$\big{|}(\widetilde{\mathscr{S}}\mathscr{T})^{3}\big{|}=\widetilde{\mathscr{S}}^{2}$;
• Multiply $\mathscr{T}$ with a necessary phase $\phi$ to satisfy
$(\widetilde{\mathscr{S}}\mathscr{T})^{3}=\widetilde{\mathscr{S}}^{2}$. We
claim that the resulting $\widetilde{\mathscr{S}}$ and $\mathscr{T}$ always
exist, and they give the correct sign configurations for $\mathcal{S}$ and
$\mathcal{T}$ in (120); as well as $\mathscr{S}$ in (126) and $\mathscr{T}$ in
(127). Moreover, $\phi$ equals $e^{-i\pi\sigma(K)/12}$ as mentioned below
(111) and (137), where $K$ is defined by (112) together with (113).

##  Appendix D Proof of the bivariate Landsberg-Schaar relation in (151)

The identity to be proved is:

$\boxed{-\frac{i}{q}\sum_{m,n=0}^{q-1}e^{-\frac{2\pi i}{q}\left(2mn-
am^{2}-bn^{2}\right)}=\left(\frac{1+i^{qb}}{2\sqrt{ab-1}}\right)\sum_{n=0}^{2ab-3}\exp\left(-\frac{\pi
iqan^{2}}{2(ab-1)}\right)}\,,$ (183)

for $q\in 2\mathbb{Z}_{+},\,a,b\in\mathbb{Z},\,ab>1.$

In the following subsections, we will prove this by discussing two separate
situations, in which $q=4r$ and $q=4r+2$, respectively, where $r$ is an odd
integer.

###  D.1 Analysis for $q=4r$

To prove this identity (183) we start with the Poisson resummation in two
variables:

$\sum_{m,n\in\mathbb{Z}}f(m,n)=\sum_{x,y\in\mathbb{Z}}\hat{f}(x,y),$

where the Fourier transform is defined with normalization as:

$\hat{f}(x,y)\equiv\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{-2\pi
i(mx+ny)}f(u,v)dudv$

We choose the function to be

$f(u,v)\equiv e^{2\pi
i\tau\left(au^{2}+bv^{2}-2uv\right)}\,,\qquad{\text{Im}}\tau>0,\qquad a,b>1,$

then

$\begin{split}\hat{f}(x,y)&=\int_{-\infty}^{\infty}\int_{-\infty}^{\infty}e^{2\pi
i\left(a\tau x^{2}+b\tau y^{2}-2\tau xy-ux-vy\right)}dxdy\\\
&=-\frac{1}{2i\sqrt{ab-1}}\exp\left[-\frac{\pi
i\left(bu^{2}+av^{2}+2uv\right)}{2(ab-1)\tau}\right].\end{split}$ (184)

So, we have

$-\frac{1}{2i\sqrt{ab-1}}\sum_{m,n\in\mathbb{Z}}\exp\left[-\frac{\pi
i\left(bm^{2}+an^{2}+2mn\right)}{2(ab-1)\tau}\right]=\sum_{m,n\in\mathbb{Z}}e^{2\pi
i\tau\left(am^{2}+bn^{2}-2mn\right)}\,.$ (185)

Now, we set

$\tau=\frac{1}{q}+i\epsilon,\quad q=4r,$ (186)

and take the limit $\epsilon\rightarrow 0$, so that292929This is similar to
the standard complex-analytical technique in proving the basic univariate
Landsberg-Schaar relation (4), shown for example in Analysis .

$-\frac{1}{\tau}=-q+iq^{2}\epsilon+O\left(\epsilon^{2}\right).$ (187)

The expression on the RHS of (185) can be expanded by setting

$m\equiv m_{1}q+m_{0},\qquad n\equiv n_{1}q+n_{0},\qquad
m_{0},n_{0}=0,\dots,q-1,\qquad m_{1},n_{1}\in\mathbb{Z},$

so that with (186),

$\exp\left[2\pi
i\tau\left(am^{2}+bn^{2}-2mn\right)\right]\approx\exp\left[\frac{2\pi
i}{q}\left(am_{0}^{2}+bn_{0}^{2}-2m_{0}n_{0}\right)\right]e^{-2\pi
q^{2}\epsilon\left(am_{1}^{2}+bn_{1}^{2}-2m_{1}n_{1}\right)},$

where in the exponent of the second factor on the RHS, we have ignored terms
$2am_{0}m_{1}q$, $bm_{0}^{2}$, $2bn_{0}n_{1}q$, $bn_{0}^{2}$, $-2m_{1}n_{0}q$,
$-2m_{0}n_{1}q$, and $-2m_{0}n_{0}$, which are proportional to either $q$ or
1, because both $m_{0}$ and $n_{0}$ are only comparable to $q$ at most.

Then

$\sum_{m,n\in\mathbb{Z}}e^{2\pi
i\tau\left(am^{2}+bn^{2}-2mn\right)}=\left(\sum_{m,n=0}^{q-1}e^{\frac{2\pi
i}{q}\left(am^{2}+bn^{2}-2mn\right)}\right)\sum_{m,n\in\mathbb{Z}}e^{-2\pi
q^{2}\epsilon\left(am^{2}+bn^{2}-2mn\right)}.$ (188)

In the limit $\epsilon\rightarrow 0$, the leftmost sum on RHS of (188) can be
evaluated by converting it into an integral with a change of variables
$u\equiv m\sqrt{\epsilon}$ and $v\equiv n\sqrt{\epsilon}$:

$\lim_{\epsilon\rightarrow 0}\sum_{m,n\in\mathbb{Z}}e^{-2\pi
q^{2}\epsilon\left(am^{2}+bn^{2}-2mn\right)}\approx\frac{1}{\epsilon}\int_{-\infty}^{\infty}du\int_{-\infty}^{\infty}dve^{-2\pi
q^{2}\left(am^{2}+bn^{2}-2mn\right)}=\frac{1}{2\epsilon q^{2}\sqrt{ab-1}}.$

So, we have

$\lim_{\epsilon\rightarrow 0}\sum_{m,n\in\mathbb{Z}}e^{2\pi
i\tau\left(am^{2}+bn^{2}-2mn\right)}\approx\frac{1}{2\epsilon
q^{2}\sqrt{ab-1}}\sum_{m,n=0}^{q-1}e^{\frac{2\pi
i}{q}\left(am^{2}+bn^{2}-2mn\right)}.$ (189)

Now to approximate the LHS of (185), we need to perform a similar manipulation
on the double sum

$\sum_{m,n\in\mathbb{Z}}\exp\left[-\frac{\pi
i\left(bm^{2}+an^{2}+2mn\right)}{2(ab-1)\tau}\right]\,.$ (190)

It would help to know the Smith Normal Form of the matrix
$\begin{pmatrix}a&-1\\\ -1&b\\\ \end{pmatrix}$, which is related to the
inverse of the quadratic form in the exponent of (190) by

$\begin{pmatrix}a&-1\\\ -1&b\\\ \end{pmatrix}=(ab-1)\begin{pmatrix}b&1\\\
1&a\\\ \end{pmatrix}^{-1}\,.$

Its decomposition into the Smith Normal Form is:

$\begin{pmatrix}a&-1\\\ -1&b\\\ \end{pmatrix}=\begin{pmatrix}1&-a\\\ 0&1\\\
\end{pmatrix}\begin{pmatrix}ab-1&0\\\ 0&1\\\
\end{pmatrix}\begin{pmatrix}0&1\\\ -1&b\\\ \end{pmatrix}.$

We want to convert the sum over $(m,n)\in\mathbb{Z}^{2}$ in (190) into a sum
over a finite number of points in the fundamental cell generated by the
columns of $\begin{pmatrix}a&-1\\\ -1&b\\\ \end{pmatrix}$, times a sum over
the lattice points generated by these columns. So, we write $(m,n)$ as

$\begin{pmatrix}m\\\ n\\\ \end{pmatrix}=\begin{pmatrix}m_{0}\\\ n_{0}\\\
\end{pmatrix}+\begin{pmatrix}a&-1\\\ -1&b\\\
\end{pmatrix}\begin{pmatrix}m_{1}\\\ n_{1}\\\
\end{pmatrix}=\begin{pmatrix}m_{0}+am_{1}-n_{1}\\\ n_{0}+bn_{1}-m_{1}\\\
\end{pmatrix}\,,$

where $(m_{0},n_{0})$ take $ab-1$ possible integer values.

Replacing

$\begin{pmatrix}m_{1}\\\ n_{1}\\\
\end{pmatrix}\rightarrow\begin{pmatrix}0&1\\\ -1&b\\\
\end{pmatrix}\begin{pmatrix}m_{1}\\\ n_{1}\\\ \end{pmatrix},$

we can write

$\begin{pmatrix}m\\\ n\\\ \end{pmatrix}=\begin{pmatrix}m_{0}\\\ n_{0}\\\
\end{pmatrix}+\begin{pmatrix}1&-a\\\ 0&1\\\
\end{pmatrix}\begin{pmatrix}ab-1&0\\\ 0&1\\\
\end{pmatrix}\begin{pmatrix}m_{1}\\\ n_{1}\\\ \end{pmatrix}\,.$

Setting

$\begin{pmatrix}m_{0}\\\ n_{0}\\\ \end{pmatrix}=\begin{pmatrix}1&-a\\\ 0&1\\\
\end{pmatrix}\begin{pmatrix}j\\\ 0\\\ \end{pmatrix}\,,\qquad
j=0,\dots,ab-2\,,$

we find

$\begin{pmatrix}m\\\ n\\\ \end{pmatrix}=\begin{pmatrix}j+m_{1}(ab-1)-n_{1}a\\\
n_{1}\\\ \end{pmatrix}\,.$

So, we set $n\equiv n_{1}$ and $m\equiv j+(ab-1)k-na$, where $j=0,\dots,ab-2$.
Then,

$bm^{2}+an^{2}+2mn=bj^{2}+(ab-1)\left[a(bk-n)^{2}-b(k-j)^{2}+2(k-j)n+bj^{2}\right]\,,$

and (190) becomes

$\displaystyle\sum_{j=0}^{ab-2}\left(e^{-\frac{\pi
ibj^{2}}{2(ab-1)\tau}}\sum_{n,k\in\mathbb{Z}}\exp\left[-\frac{\pi
i\left[a(bk-n)^{2}-b(k-j)^{2}+2(k-j)n+bj^{2}\right]}{2\tau}\right]\right)$

In the limit $\tau=1/q+i\epsilon$ (187) with $\epsilon\rightarrow 0$, we can
approximate the exponent

$\displaystyle-\frac{\pi
i}{2\tau}\left[a(bk-n)^{2}-b(k-j)^{2}+2(k-j)n+bj^{2}\right]$
$\displaystyle\approx$ $\displaystyle-\frac{\pi
i}{2}q\left[a(bk-n)^{2}-b(k-j)^{2}+2(k-j)n+bj^{2}\right]-\frac{\pi}{2}q^{2}\epsilon\left[a(bk-n)^{2}-bk^{2}+2kn\right].$

Because $4\lvert q$, the first term on the last line in (D.1) is an integer
multiple of $2\pi i$ and can be dropped, so we are left with

$\displaystyle\sum_{m,n\in\mathbb{Z}}\exp\left[-\frac{\pi
i\left(bm^{2}+an^{2}+2mn\right)}{2(ab-1)\tau}\right]$ (192) $\displaystyle=$
$\displaystyle\left(\sum_{j=0}^{ab-2}e^{-\frac{\pi
iqbj^{2}}{2(ab-1)}}\right)\lim_{\epsilon\rightarrow
0}\sum_{n,k\in\mathbb{Z}}e^{-\frac{\pi}{2}q^{2}\epsilon\left[a(bk-n)^{2}-bk^{2}+2kn\right]}.$

The limit $\epsilon\rightarrow 0$ can be evaluated by converting (192) into an
integral with a change of variables $u\equiv k\sqrt{\epsilon}$ and $v\equiv
n\sqrt{\epsilon}$:

$\displaystyle\lim_{\epsilon\rightarrow
0}\sum_{n,k\in\mathbb{Z}}e^{-\frac{\pi}{2}q^{2}\epsilon\left[a(bk-n)^{2}-bk^{2}+2kn\right]}$
$\displaystyle=$
$\displaystyle\frac{1}{\epsilon}\int_{-\infty}^{\infty}du\int_{-\infty}^{\infty}dve^{-\frac{\pi}{2}q^{2}\left[a(bu-v)^{2}-bu^{2}+2uv\right]}=\frac{2}{q^{2}(ab-1)\epsilon}.$

Finally, we need to show that in (192),

$\sum_{j=0}^{ab-2}e^{-\frac{\pi
iqbj^{2}}{2(ab-1)}}=\sum_{j=ab-1}^{2ab-3}e^{-\frac{\pi iqbj^{2}}{2(ab-1)}}.$
(193)

In order to achieve this, we consider the pairings between exponents of forms

$-\frac{qbj^{2}}{ab-1}\frac{\pi
i}{2}\quad\text{and}\quad-\frac{qb(ab-1+j)^{2}}{ab-1}\frac{\pi i}{2},\quad
j=0,\dots,ab-2,$

then the difference between $j^{2}$ and $(ab-1+j)^{2}$ is
$a^{2}b^{2}-2ab+1+2j(ab-1)=(ab-1)^{2}+2j(ab-1)$, so the difference between two
exponents is $(ab-1+2j)qb\pi i/2$, which is an integer multiple of $2\pi i$
because $4\lvert q$. So the summands in (193) can be paired using the one-to-
one correspondence between $j$ and $ab-1+j$, and (193) is true.

At this point, we have results (185), (189), and the newly proved:

$\displaystyle\lim_{\epsilon\rightarrow
0}\sum_{m,n\in\mathbb{Z}}\exp\left[-\frac{\pi
i\left(bm^{2}+an^{2}+2mn\right)}{2(ab-1)\tau}\right]$ (194)
$\displaystyle\approx\frac{2}{q^{2}(ab-1)\epsilon}\sum_{j=0}^{ab-2}e^{-\frac{\pi
iqbj^{2}}{2(ab-1)}}=\frac{2}{q^{2}(ab-1)\epsilon}\sum_{j=0}^{2ab-3}e^{-\frac{\pi
iqbj^{2}}{2(ab-1)}}.$ (195)

Combining these three equations, by inspection, (183) holds if $4\lvert q$.

###  D.2 Analysis for $q=4r+2=2s$

####  D.2.1 The case of odd $b$

In this case, the RHS of (183) is obviously zero. Hence we need to show that
the LHS of (183) also vanishes, i.e., for fixed $q$ and $m$,

$\sum_{n=0}^{q-1}e^{-\frac{2\pi i}{q}\left(2mn-am^{2}-bn^{2}\right)}=0.$

We need to show that with $m$ fixed, for every $n$, there is always a single
$n^{\prime}=n+t$ such that $am^{2}+bn^{2}-2mn$ and $am^{2}+b(n+t)^{2}-2m(n+t)$
differ by an odd multiple of $s$, hence the pairing
$\displaystyle{e^{\frac{\pi i}{s}\left(am^{2}+bn^{2}-2mn\right)}+e^{\frac{\pi
i}{s}\left(am^{2}+bn^{\prime 2}-2mn^{\prime}\right)}}$ is 0.

We calculate this difference
$am^{2}+b(n+t)^{2}-2m(n+t)-\left(am^{2}+bn^{2}-2mn\right)=bt^{2}+2bnt-2mt$,
and set it to be $-\delta s$. Then we only need to show that $\delta$ can be
odd for every $n$. We start from the quadratic equation in $t$:

$bt^{2}+2(bn-m)t+\delta s=0,$ (196)

with solutions $\displaystyle{t_{\pm}=-n+\frac{m\pm\sqrt{(bn-m)^{2}-b\delta
s}}{b}}$. We set the discriminant $\Delta$ to be $x^{2}$, $x\in\mathbb{Z}$,
then it follows that

$(bn-m-x)(bn-m+x)=b\delta s.$ (197)

We also denote $\displaystyle{\frac{m\pm\sqrt{\Delta}}{b}\equiv y}$, leading
to $m=by\pm x$. Then (197) becomes

$(n-y)(bn-by\pm 2x)=\delta s.$

In order to establish the pairing between $n$ and $n^{\prime}$ for all $n$ and
$n^{\prime}$, we have to require $-n+y$, a solution to (196), be exactly
$s=q/2$ [so that the pairings are all “diagonal” in the irregular $q$-sided
polygon on the complex plane, whose vertices are $e^{-\frac{2\pi
i}{q}\left(2mn-am^{2}-bn^{2}\right)}$]. So we have

$bn-by\pm 2x=-bs\pm 2x=-\delta.$

Since both $b$ and $s$ are odd, $\delta$ has to be odd, as expected. Hence,
for $q=4r+2$ and odd $b$, both sides of (183) are zero.

####  D.2.2 The case of even $b$ and odd $a$

In this case, we do not construct pairings as before, but resort to an
analytic method. The first term in (D.1) expands as

$s\pi i\left[ab^{2}k^{2}-2abnk+an^{2}-bk^{2}+2bjk+2(k-j)n\right].$

Since all terms in the square brackets, except for $an^{2}$, are even, the
overall contributing exponent provided by (D.1) is

$-\frac{\pi}{2}q^{2}\epsilon\left[a(bk-n)^{2}-bk^{2}+2kn\right]-asn^{2}\pi i.$

So the sum concerning $n$ and $k$ following (D.1) becomes

$\lim_{\epsilon\rightarrow
0}\sum_{n,k\in\mathbb{Z}}e^{-\frac{\pi}{2}q^{2}\epsilon\left[a(bk-n)^{2}-bk^{2}+2kn\right]}e^{-asn^{2}\pi
i},$ (198)

where the second factor is just $(-1)^{n}$. We evaluate the first factor again
by converting it into a single integral via a change of variables $u\equiv
k\sqrt{\epsilon}$ and $v\equiv n\sqrt{\epsilon}$:

$\frac{1}{\epsilon}\int_{-\infty}^{\infty}du\int_{-\infty}^{\infty}dve^{-\frac{\pi}{2}q^{2}\left[a(bu-v)^{2}-bu^{2}+2uv\right]}dudv=\frac{1}{q}\sqrt{\frac{2}{b(ab-1)\epsilon}}\sum_{n\in\mathbb{Z}}e^{-\frac{\pi
q^{2}\epsilon n^{2}}{2b}},$ (199)

where we only performed the $u$-integral and have converted $v$ back to $n$
after the equal sign. Then we consider the remaining infinite sum in (198):

$\frac{1}{q}\lim_{\epsilon\rightarrow
0}\sqrt{\frac{2}{b(ab-1)\epsilon}}\sum_{n\in\mathbb{Z}}(-1)^{n}e^{-\frac{\pi
q^{2}\epsilon n^{2}}{2b}},$

which is zero because this is an alternating Riemann sum, and the decay in the
exponent is $\sim\epsilon\rightarrow 0$, while the denominator of here goes as
$\sim 1/\sqrt{\epsilon}$.

Notice that the result here agrees with the symmetry between $a$ and $b$ which
is manifest on the LHS of (183), as well as the fact that both sides vanishes
for an odd $b$ as shown in §D.2.1.

###  D.3 If both $a$ and $b$ are even

Then again the first term in (D.1) is an integer multiple of $2\pi i$, and the
remaining argument conincide with that in the previous subsection §D.2.2. ∎

## References

  * (1) D. Bak, M. Gutperle and S. Hirano, “A Dilatonic Deformation of $AdS_{5}$ and its Field Theory dual,” JHEP 05 (2003) 072 [hep-th/0304129].
  * (2) A. Clark and A. Karch, “Super Janus,” JHEP 10 (2005) 094 [hep-th/0506265].
  * (3) E. D’Hoker, J. Estes and M. Gutperle, “Interface Yang-Mills, Supersymmetry, and Janus,” Nucl. Phys. B 753 (2006) 16 [hep-th/0603013].
  * (4) D. Gaiotto and E. Witten, “Janus Configurations, Chern-Simons Couplings, And The Theta-Angle in $\mathcal{N}=4$ Super Yang-Mills Theory,” JHEP 06 (2010) 097 [arXiv:0804.2907].
  * (5) C. Kim, E. Koh and K. M. Lee, “Janus and Multifaced Supersymmetric Theories,” JHEP 06 (2008) 040 [arXiv:0802.2143].
  * (6) C. Kim, E. Koh and K.-M. Lee, “Janus and Multifaced Supersymmetric Theories II,” Phys. Rev. D 79 (2009) 126013 [arXiv:0901.0506].
  * (7) Y. Terashima and M. Yamazaki, “$\operatorname{SL}(2,\mathbb{R})$ Chern-Simons, Liouville, and Gauge Theory on Duality Walls,” JHEP 08 (2011) 135 [arXiv:1103.5748].
  * (8) N. Drukker, D. Gaiotto and J. Gomis, “The Virtue of Defects in 4D Gauge Theories and 2D CFTs,” JHEP 06 (2011) 025 [arXiv:1003.1112].
  * (9) J. A. Minahan and U. Naseer, “Gauge theories on spheres with 16 supercharges and non-constant couplings,” J. Phys. A: Math. Theor. 52 (2019) 235401 [arXiv:1811.11652].
  * (10) D. Gaiotto, “Surface Operators in $\mathcal{N}=2$ 4d Gauge Theories,” JHEP 11 (2012) 090 [arXiv:0911.1316].
  * (11) K. Goto and T. Okuda, “Janus interface in two-dimensional supersymmetric gauge theories,” JHEP 10 (2019) 045 [arXiv:1810.03247].
  * (12) A. Dabholkar and J. A. Harvey, “String islands,” JHEP 02 (1999) 006 [hep-th/9809122].
  * (13) O. J. Ganor, “U-duality twists and possible phase transitions in $2+1$ D supergravity,” Nucl. Phys. B 549 (1999) 145 [hep-th/9812024].
  * (14) S. Hellerman, J. McGreevy and B. Williams, “Geometric Constructions of Nongeometric String Theories,” JHEP 01 (2004) 024 [hep-th/0208174].
  * (15) A. Dabholkar and C. Hull, “Duality twists, Orbifolds, and Fluxes,” JHEP 09 (2003) 054 [hep-th/0210209].
  * (16) A. Dabholkar and C. Hull, “Generalised T-Duality and Non-Geometric Backgrounds,” JHEP 05 (2006) 009 [hep-th/0512005].
  * (17) A. Gadde, S. Gukov and P. Putrov, “Duality Defects,” arXiv:1404.2929.
  * (18) O. J. Ganor, N. P. Moore, H.-Y. Sun and N. R. Torres-Chicon, “Janus configurations with $\operatorname{SL}(2,\mathbb{Z})$-duality twists, strings on mapping tori and a tridiagonal determinant formula,” JHEP 07 (2014) 010 [arXiv:1403.2365].
  * (19) B. Assel and A. Tomasiello, “Holographic duals of 3d S-fold CFTs,” JHEP 06 (2018) 019 [arXiv:1804.06419].
  * (20) L. Martucci, “Topological duality twist and brane instantons in F-theory,” JHEP 06 (2014) 180 [arXiv:1403.2530].
  * (21) C. T. Hsieh, Y. Tachikawa and K. Yonekura, “Anomaly of the Electromagnetic Duality of Maxwell Theory,” Phys. Rev. Lett. 123 (2019) 161601 [arXiv:1905.08943].
  * (22) T. Dimofte, D. Gaiotto and S. Gukov, “Gauge Theories Labelled by Three-Manifolds,” Commun. Math. Phys. 325 (2014) 367 [arXiv:1108.4389].
  * (23) T. Dimofte, D. Gaiotto and S. Gukov, “3-Manifolds and 3d Indices,” Adv. Theor. Math. Phys. 17 (2013) 975 [arXiv:1112.5179].
  * (24) D. Gang, N. Kim, M. Romo and M. Yamazaki, “Taming Supersymmetric Defects in 3d–3d Correspondence,” J. Phys. A: Math. Theor. 49 (2016) 30LT02 [arXiv:1510.03884].
  * (25) D. Gang, N. Kim, M. Romo and M. Yamazaki, “Aspects of Defects in 3d-3d Correspondence,” JHEP 10 (2016) 062 [arXiv:1510.05011].
  * (26) S. Chun, S. Gukov, S. Park and N. Sopenko, “3d-3d correspondence for mapping tori,” arXiv:1911.08456.
  * (27) E. Artin, “Beweis des allgemeinen Reziprozitätsgesetzes,” Abhandlungen aus dem Mathematischen Seminar der Universität Hamburg 5: 353–363; Collected Papers, 131-141 (1927).
  * (28) K. Ireland and M. Rosen, “A Classical Introduction to Modern Number Theory,” Graduate Texts in Mathematics 84, Springer-Verlag (1990).
  * (29) L. Glasser and M. S. Milgram, “On Quadratic Gauss Sums and Variations Thereof,” Cogent Math. 2 (1) (2015) 1021187 [arXiv:1405.3194].
  * (30) M. Schaar, “Mémoire sur la théorie des résidus quadratiques,” Mémoires de l’Académie Royale des Sciences, des Lettres et des Beaux-Arts de Belgique 24 (1850) 5, 1-14.
  * (31) G. Landsberg, “Zur Theorie der Gaussschen Summen und der linearen Transformation der Thetafunctionen,” J. reine angew Math. 111 (1893) 234–253.
  * (32) H. Dym and H. P. McKean, “Fourier Series and Integrals,” Academic Press (1972).
  * (33) J. M. Borwein and P. B. Borwein, “Pi and the AGM: A Study in Analytic Number Theory and Computational Complexity,” Wiley (1987).
  * (34) B. Moore, “A proof of the Landsberg-Schaar relation by finite methods,” Ramanujan J. (2020) 1-13, arXiv:1810.06172.
  * (35) B. C. Berndt and R. J. Evans, “The determination of Gauss sums,” Bull. Amer. Math. Soc. 5 (1981) 107.
  * (36) C. Vafa, “Evidence for F-Theory,” Nucl. Phys. B 469 (1996) 403-415 [hep-th/9602022].
  * (37) A. Giveon, M. Porrati and E. Rabinovici, “Target Space Duality in String Theory,” Phys. Rept. 244 (1994) 77 [hep-th/9401139].
  * (38) K. S. Narain, M. H. Sarmadi and C. Vafa, “Asymmetric orbifolds,” Nucl. Phys. B 288 (1987) 551-577.
  * (39) A. Kapustin and M. Tikhonov, “Abelian duality, walls and boundary conditions in diverse dimensions,” JHEP 11 (2009) 006 [arXiv:0904.0840].
  * (40) O. J. Ganor, S. Jue and S. McCurdy, “Ground States of Duality-twisted Sigma-Models with $K_{3}$ Target Space,” JHEP 02 (2013) 017 [arXiv:1211.4179].
  * (41) D. Gaiotto and E. Witten, “S-Duality of Boundary Conditions In $\mathcal{N}=4$ Super Yang-Mills Theory,” Adv. Theor. Math. Phys. 13 (2009) 721-896 [arXiv:0807.3720].
  * (42) Y. Lozano, “S duality in gauge theories as a canonical transformation,” Phys. Lett. B 364 (1995) 19 [hep-th/9508021].
  * (43) O. J. Ganor, “A Note on zeros of superpotentials in F-theory,” Nucl. Phys. B 499 (1997) 55 [hep-th/9612077].
  * (44) E. Witten, “$\operatorname{SL}(2,\mathbb{Z})$ Action On Three-Dimensional Conformal Field Theories With Abelian Symmetry,” In M. Shifman (ed.) et al.: From fields to strings, vol. 2 1173-1200 [hep-th/0307041].
  * (45) O. J. Ganor and Y. P. Hong, “Selfduality and Chern-Simons Theory,” arXiv:0812.1213.
  * (46) O. J. Ganor, Y. P. Hong and H. S. Tan, “Ground States of S-duality Twisted $\mathcal{N}=4$ Super Yang-Mills Theory,” JHEP 03 (2011) 099 [arXiv:1007.3749].
  * (47) E. Witten, “Dynamical breaking of supersymmetry,” Nucl. Phys.  B 188 (1981) 513.
  * (48) F. Cooper and B. Freedman, “Aspects of Supersymmetric Quantum Mechanics,” Ann. Phys. 146 (1983) 262.
  * (49) F. Cooper, A. Khare and U. Sukhatme, “Supersymmetry and Quantum Mechanics,” Phys. Rept. 251 (1995) 267 [hep-th/9405029].
  * (50) S. Gukov, M. Mariño and P. Putrov, “Resurgence in complex Chern-Simons theory,” arXiv:1605.07615.
  * (51) M. C. N. Cheng, S. Chun, F. Ferrari, S. Gukov and S. M. Harrison, “3d Modularity,” JHEP 10 (2019) 010 [arXiv:1809.10148].
  * (52) C. T. C. Wall, “Quadratic forms on finite groups, and related topics,” Topology 2 (1963) 281-298.
  * (53) C. Galindo and N. J. Torres, “Solutions of the hexagon equation for abelian anyons,” Rev. Colomb. de Mat. 50 (2016) 277-298 arXiv:1606.01414.
  * (54) M. S. Zini, “Lecture notes on vector-valued modular forms” by Zhenghan Wang at UC Santa Barbara (Math 227C, Spring 2019), unpublished.
  * (55) D. M. Belov and G. W. Moore, “Classification of abelian spin Chern-Simons theories,” hep-th/0505235.
  * (56) D. Delmastro and J. Gomis, “Symmetries of Abelian Chern-Simons Theories and Arithmetic,” arXiv:1904.12884.
  * (57) Y. Lee and Y. Tachikawa, “A study of time reversal symmetry of abelian anyons,” J. High Energ. Phys. 07 (2018) 90 [arXiv:1805.02738].
  * (58) F. Deloup, “Topological Quantum Field Theory, Reciprocity and the Weil representation,” available at http://www.math.univ-toulouse.fr/d̃eloup/Weil-book10.pdf.
  * (59) R. J. Milgram, “Surgery with coefficients,” Ann. Math. 100 (1974) 194-248.
  * (60) B. Williams, “Computing modular forms for the Weil representation,” PhD thesis, University of California, Berkeley. Available at https://math.berkeley.edu/btw/thesis.pdf
  * (61) J. Cano, M. Cheng, M. Mulligan, C. Nayak, E. Plamadeala and J Yord, “Bulk-Edge Correspondence in $2+1$-Dimensional Abelian Topological Phases,” Phys. Rev. B 89 (2014) 115116 [arXiv:1310.5708].
  * (62) X.-G. Wen, “Vacuum degeneracy of chiral spin states in compactified space,” Phys. Rev. B 40 (1989) 7387.
  * (63) X.-G. Wen and Q. Niu, “Ground-state degeneracy of the fractional quantum Hall states in the presence of a random potential and on high-genus Riemann surfaces,” Phys. Rev. B 41 (1990) 9377.
  * (64) S. Elitzur, G. Moore, A. Schwimmer and N. Seiberg, “Remarks on the Canonical Quantization of the Chern-Simons-Witten Theory,” Nucl. Phys. B 326 (1989) 108-134.
  * (65) S. Axelrod, S. D. Pietra and E. Witten, “Geometric quantization of Chern Simons gauge theory,” J. Diff. Geom. 33 (1991) 787-902.
  * (66) E. Witten, “Quantum field theory and the Jones polynomial,” Commun. Math. Phys. 121 (1989) 351.
  * (67) L. C. Jeffrey, “Chern-Simons-Witten invariants of lens spaces and torus bundles, and the semiclassical approximation,” Commun. Math. Phys. 147 (1992) 563.
  * (68) L. C. Jeffrey, “Symplectic Quantum Mechanics and Chern-Simons Gauge Theory II: Mapping Tori of Tori,” J. Math. Phys. 54 (2013) 052305 [arXiv:1210.6635].
  * (69) M. F. Atiyah, “On framings of 3-manifolds,” Topology 29 (1990) 1-7.
  * (70) A. Gadde, S. Gukov and P. Putrov, “Fivebranes and 4-manifolds,” In: Ballmann W., Blohmann C., Faltings G., Teichner P., Zagier D. (eds) Arbeitstagung Bonn 2013. Progress in Mathematics, vol 319. Birkhäuser, Cham. 155-245 [arXiv:1306.4320].
  * (71) S. Gukov, P. Putrov and C. Vafa, “Fivebranes and 3-manifold homology,” JHEP 07 (2017) 071 [arXiv:1602.05302].
  * (72) X.-G. Wen and A. Zee, “Classification of Abelian quantum Hall states and matrix formulation of topological fluids,” Phys. Rev. B 46 (1992) 2290. In “Thouless, D.J.: Topological quantum numbers in nonrelativistic physics”, World Scientific, 1998, 316-327.
  * (73) E. Witten, “Fermion Path Integrals And Topological Phases,” Rev. Mod. Phys. 88 (2016) 035001 [arXiv:1508.04715].
  * (74) F. D. M. Haldane and E. H. Rezayi,“Periodic Laughlin-Jastrow wave functions for the fractional quantized Hall effect,” Phys. Rev. B 31 (1985) 2529(R).
  * (75) M. Spera, “Quantization on Abelian Varieties,” Rend. Semin. Mat. Univ. Politec. Torino 44 (1986) 383-392.
  * (76) J. R. Kaluder and E. Onofri, “Landau levels and geometric quantization,” Int. J. Mod. Phys. A 4 (1989) 3939-3949.
  * (77) F. D. M. Haldane, “$O(3)$ Nonlinear $\sigma$-Model and the Topological Distinction between Integer- and Half-Integer-Spin Antiferromagnets in Two Dimensions,” Phys. Rev. Lett. 61 (1988) 1029.
  * (78) A. Altland and B. Simons, “Condensed Matter Field Theory,” Cambridge University Press (2010).
  * (79) K. Conrad, “$\operatorname{SL}_{2}(\mathbb{Z})$,” available at  https://kconrad.math.uconn.edu/blurbs/grouptheory/SL(2,Z).pdf
  * (80) P. Bonderson, E. C. Rowell, Z. Wang and Q. Zhang, Congruence Subgroups and Super-Modular Categories, Pacific J. Math. 296 (2018) 257-270 [arXiv:1704.02041].
  * (81) A. Krazer, “Zur Theorie der mehrfachen Gaußschen Summen.” In Festschrift Heinrich Weber zu seinem siebzigsten Geburtstag am 5. März 1912, Leipzitg und Berlin, B. G. Teubner, s. 181.
  * (82) S. Alaca and G. Doyle, “Explicit Evaluation of Double Gauss Sums,” J. Comb. Number Theory 8 (2016) 47-61 [arXiv:1609.03919].
  * (83) V. Turaev, “Reciprocity for Gauss sums on finite abelian groups,” Math. Proc. Camb. Phil. Soc. 124 (1998) 205-214.
  * (84) H. Braun, “Geschlechter quadratischer Formen,” J. reine angew. Math. 182 (1940) 32-49.
  * (85) C. L. Siegel, “Über das quadratische Reziprozitätsgesetz algebraischen Zahlkörpern,” Vandenhoeck & Ruprecht, 1960.
  * (86) F. Deloup and V. Turaev, “On Reciprocity,” J. Pure Appl. Algebra 208 (2007) 153–158 [math/0512050].
  * (87) F. Deloup, “Linking forms, reciprocity for Gauss sums and invariants of 3-manifolds,” Trans. Amer. Math. Soc. 351 (1999) 1895–1918.
  * (88) F. Deloup, “On abelian quantum invariants of links in 3-manifolds,” Math. Ann. 319 (2001) 759–795.
  * (89) S. Gukov, D. Pei, P. Putrov and C. Vafa, “BPS spectra and 3-manifold invariants,” arXiv:1701.06567.
  * (90) F. Lemmermeyer, “Reciprocity Laws: From Euler to Eisenstein,” Springer 2000.
  * (91) G. Doyle, “Quadratic Form Gauss Sums,” PhD thesis, University of California, Berkeley. Available at https://curve.carleton.ca/6245016a-490e-4f76-a439-039e0a1e4496
  * (92) V. Armitage and A. Rogers, “Gauss Sums and Quantum Mechanics,” J. Phys. A: Math. Gen. 33 (2000) 5993-6003 [quant-ph/0003107].
  * (93) D. Gaiotto, “$N=2$ dualities,” JHEP 08 (2012) 034 [arXiv:0904.2715].
  * (94) J. E. Tener and Z. Wang, On classification of extremal non-holomorphic conformal field theories, J. Phys. A: Math. Theor. 50 (2017) 115204 [arXiv:1611.04071].