Symmetries of Abelian Chern-Simons Theories and Arithmetic

We determine the unitary and anti-unitary Lagrangian and quantum symmetries of arbitrary abelian Chern-Simons theories. The symmetries depend sensitively on the arithmetic properties (e.g.~prime factorization) of the matrix of Chern-Simons levels, revealing interesting connections with number theory. We give a complete characterization of the symmetries of abelian topological field theories and along the way find many theories that are non-trivially time-reversal invariant by virtue of a quantum symmetry, including $U(1)_k$ Chern-Simons theory and $(\mathbb Z_k)_\ell$ gauge theories. For example, we prove that $U(1)_k$ Chern-Simons theory is time-reversal invariant if and only if $-1$ is a quadratic residue modulo $k$, which happens if and only if all the prime factors of $k$ are Pythagorean (i.e.,~of the form $4n+1$), or Pythagorean with a single additional factor of $2$. Many distinct non-abelian finite symmetry groups are found.


Introduction and Summary
Symmetries play a pivotal role in our description of nature. In classical physics symmetries generate solutions of the equations of motion and in quantum mechanics symmetries imply selection rules and constrain physical observables. 't Hooft anomalies for global symmetries, being renormalization-group invariant, provide powerful nonperturbative constraints on the dynamics. By a classic result of Wigner, symmetries in quantum mechanics are implemented in the Hilbert space either by unitary or anti-unitary operators, and the corresponding transformations are linear and anti-linear, respectively.
Invariance of the classical action under a transformation g imposes nontrivial constraints on the correlation functions of the theory. These are encapsulated in Ward identities. Invariance of the action under a transformation g is a sufficient condition for g to be a symmetry. However, this is not necessary. A transformation g that does not leave the action S invariant is nevertheless a symmetry of the quantum theory if it obeys the Ward identities where * implements complex conjugation. We shall refer to such non-Lagrangian symmetries as quantum symmetries. Naturally, determining whether a theory has a quantum symmetry is nontrivial. In this work we characterize all the symmetries, quantum or otherwise, of abelian Chern-Simons theories. Chern-Simons theories are ubiquitous in physics and mathematics. They arise as the emergent infrared description of gapped, quantum phases of matter such as the integer and fractional quantum Hall effect, quantum spin liquids and analogs of topological insulators and superconductors (see e.g [1,2]). Chern-Simons theories capture the nonperturbative infrared dynamics of 2 + 1 dimensional gauge theories with massless fermions [3][4][5][6][7][8][9], and describe the low-energy dynamics of domain walls connecting vacua of 3 + 1 dimensional gauge theories [8,[10][11][12]. Chern-Simons theory, a topological quantum field theory (TQFT), has also found beautiful and profound applications in mathematics, starting with Witten's work [13] on the topological invariants of knots and three-manifolds.
In this paper we give a complete description of all the unitary and anti-unitary symmetries of abelian Chern-Simons theories, the simplest incarnation being U (1) k Chern-Simons theory, described by the Lagrangian where a is a U (1) gauge field and the coupling constant is quantized, k ∈ Z. More generally, an arbitrary abelian TQFT can be described by a collection of such fields coupled via an integral symmetric matrix K with Lagrangian L = 1 4π a t Kda , (1.4) where a t = (a 1 , . . . , a n ). These theories have been studied intensely and enjoy a myriad of applications. In spite of this, we unearth a rich structure of symmetries in these theories, which depends on the arithmetic properties of the Chern-Simons levels K, revealing interesting connections with number theory. Symmetries in topological phases of matter have been at the forefront of recent developments at the intersection of condensed matter, particle physics, and mathematics. These gapped phases are encoded by emergent TQFTs. Gapped phases with no topological order (no nontrivial anyons) and protected by symmetries describe SPT phases (see e.g. [14][15][16][17][18]) while phases with topological order (with nontrivial anyons) and enriched by symmetries give rise to the so-called SET phases (see e.g. [19][20][21][22][23]). Symmetries and 't Hooft anomalies of TQFTs have recently played a key role in understanding the nonperturbative infrared dynamics of gauge theories [3][4][5][6][7][8][9]. Despite a lot of work, little is concretely known about the symmetries of TQFTs. Here we tackle this problem for abelian TQFTs.
For the reader's convenience we summarize here a sample of our main results: • U (1) k is a time-reversal invariant spin TQFT, 1 that is, it admits an anti-unitary symmetry, if and only if −1 is a quadratic residue modulo k (cf. proposition 3.2). Equivalently: U (1) +k ←→ U (1) −k ⇐⇒ q 2 = −1 mod k for some q ∈ Z. This result can also be stated as U (1) k being dual to U (1) −k when k ∈ T, which we denote by U (1) +k ←→ U (1) −k . The integer k is in T if and only if all its prime factors are Pythagorean (i.e., congruent to 1 modulo 4), or Pythagorean with a single factor of 2. Any time-reversal symmetry is of order 4, except for k = 1, 2, when it is of order 2 (cf. proposition 3.3).
The set of time-reversal invariant U (1) k Chern-Simons theories includes the subset k ∈ P := {k ∈ Z | kp 2 − q 2 = 1 for some p, q ∈ Z} ⊂ T. The set P corresponds to those values of the level for which the (negative) Pell equation is solvable, which was shown by Witten [24,25] to lead to time-reversal invariance.
We prove that the time-reversal symmetry is a quantum symmetry if and only if k ∈ T\P (cf. proposition 3.6). By studying the time-reversal invariance of U (1) k × U (1) k we obtain an interesting number-theoretic conjecture, to wit, k ∈ T if and only if there exist some k ∈ P such that kk ∈ P. We argue that this conjecture follows from a well-known conjecture by Hardy-Littlewood (cf. conjecture B.1).
• All the unitary symmetries of U (1) k are of order 2, and the number of such symmetries depends on the number of distinct prime factors of k, usually denoted by ω(k). More precisely, the group of unitary symmetries of U (1) k is (cf. proposition 3.10) When U (1) k with k even is upgraded to an spin TQFT by considering U (1) k × {1, ψ}, an additional factor of Z 2 appears when k is a multiple of 8. All but one factor of Z 2 in (1.7), which corresponds to charge conjugation, are quantum symmetries. When k ∈ T, the total group of symmetries is the central product of its unitary subgroup and for some integral-valued matrix P . While the first equation always admits solutions, the second one need not, and only when there is a solution is the theory time-reversal invariant. The group of symmetries is finite and generically non-abelian. A given symmetry is quantum if and only if P = 0 for all the Q's that implement it.
• The twisted gauge theory (Z k 1 ) k 2 (also known as Z k 1 Dijkgraff-Witten theory [26] when k 2 is even, and which can be realized by the U (1) 2 Chern-Simons theory with K = 0 k 1 k 1 k 2 with k 2 ∈ [0, 2k 1 )) is conjectured to be time-reversal invariant if and only if k 2 is proportional to µ(k 1 ) (cf. conjecture 4.2) where µ(n) equals n divided by all its Pythagorean prime factors (e.g. µ(10) = 2×5 5 = 2). The conjecture has been verified for k 1 ∈ [0, 200] and all k 2 . We compute the explicit group of unitary and anti-unitary symmetries of (Z k 1 ) k 2 for small values of the levels; k Aut((Z k ) 0 ) Aut U ((Z k ) 0 ) Aut((Z k ) µ(k) ) Aut U ((Z k ) µ(k) ) 2  1 for a sample. The time-reversal symmetry of (Z k 1 ) k 2 implies in particular a duality between abelian TQFTs (Z k 1 ) +k 2 ←→ (Z k 1 ) −k 2 ⇐⇒ k 2 ∝ µ(k 1 ) . (1.10) The theory (Z k ) 0 has conjecturally 2 ω(k) φ(k) unitary transformations and as many anti-unitary ones (where φ(k) is the Euler totient function, which counts the number of integers q ∈ [1, k) relatively prime to k). Among these symmetries, there is a unitary Z 2 subgroup which is Lagrangian, and four anti-unitary Lagrangian symmetries (except for k = 2, which only has two). For k > 2 the group of symmetries is non-abelian (see 4.5 for the explicit conjecture), while for k = 2, the group of symmetries is Z 2 2 , with a Z 2 unitary subgroup.
• The so-called "minimal abelian TQFT" A N,t is proven to be time-reversal invariant invariant if and only if t is proportional to µ(N ) (cf. subsection 3.2) t ∝ µ(N ) .
(1.11) These minimal theories have N anyons with a Z N fusion algebra, and their spin depends on the integer t.
TQFTs can also have a one-form symmetry group [27,28] on top of the usual (zero-form) symmetry group that we study in this paper. The Wilson lines describing the worldline of anyons transform in representations of this group. The one-form symmetries of abelian Chern-Simons theories are well understood (see e.g. [29]). Given an abelian TQFT with an abelian Chern-Simons representation, the one-form symmetry group is Z k 1 × Z k 2 . . . × Z kn , where {k i } are the Smith invariants of K (cf. section 4). Interestingly, given a QFT with a zeroform symmetry group and a one-form symmetry group, these can combine into a nontrivial extension known as a 2-group (see e.g. [25,30]). When a theory has a 2-group symmetry, the zero-form and one-form symmetries do not factorize; rather, they are mixed non-trivially. However, it is known that abelian TQFTs have a trivial 2-group of symmetries [25,31,32]: the zero-form and one-form symmetries factorize, and since the one-form symmetries are completely understood, what remains are the zero-form symmetries, which is the problem we address in this paper. Furthermore, since the 2-group in an abelian TQFT is trivial, the zero-form and one-form 't Hooft anomalies are well defined and can be classified using cohomology and cobordism groups [33][34][35][36][37][38], and "anomaly indicators" detecting the 't Hooft anomalies (see e.g. [39,40]) can be investigated. These anomaly indicators -which are the partition function evaluated on the generators of the corresponding cobordism groups, and expressed in terms of the modular data of the TQFT (see below) -are only known for a handful of symmetry groups.
The plan for the remainder of the paper is as follows. In section 2 we describe the general paradigm of symmetries in topological quantum field theories, and the simplifications that occur for abelian TQFTs. In section 3 we completely describe all the symmetries for the most characteristic abelian system: U (1) k Chern-Simons theory. In section 4 we generalize the analysis to arbitrary abelian TQFTs, by realizing them as U (1) n Chern-Simons theories. We prove several results, and make a number of conjectures. In section 5 we work out a couple dozen examples in some detail, so as to illustrate the general formalism. Finally, we summarize definitions and notations in Appendix A and leave some proofs and further results to Appendix B.

TQFTs and Symmetry
Before delving into the study of the symmetries of abelian Chern-Simons theories we describe how symmetries are realized in a TQFT in 2 + 1 dimensions. We informally review the data defining a TQFT and how, in an abelian TQFT, it is completely fixed in terms of most elementary data, to wit, the anyon fusion algebra and the anyon spins. We then proceed with the physical and mathematical characterization of a symmetry in a TQFT. More details and mathematical elaborations can be found in the literature [22,[41][42][43][44][45].
A TQFT can be understood as a finite collection of anyons -particles with fractional statistics -belonging to an anyon set A endowed with the following additional data: • Fusion: A commutative, associative product × : A × A → A describing the fusion of anyons a, b ∈ A (see figure 1): where N ab c ∈ Z ≥0 are the so-called fusion coefficients. We denote the trivial anyon by 1. Observables depend on the twisting thereof, through their spin.
• S-and T -matrices: A representation of the modular group. The S-matrix determines the braiding phase B : A × A → U (1) between anyons (see figure 3) while T ab = θ a e −2πic/24 δ ab , where c is the chiral central charge of the TQFT, which controls the framing anomaly (the dependence of observables on the 2-framing of the manifold).
• F -and R-symbols: The associator and braiding isomorphism, encoding the fusion of multiple anyons and their half-braiding. This data is defined modulo local, redundant isomorphisms (gauge transformations) U defined on fusion vector spaces. The gaugetransformed data, which we denote by U F and U R, is physically equivalent to F and R, and define the same TQFT. This data is subject to nontrivial consistency conditions, known as the Moore-Seiberg relations, which include the hexagon and pentagon relations involving the F -and R-symbols. These relations imply that some of the data above is actually redundant; for example, the topological spin θ is a gauge invariant combination of the F -and R-symbols. The TQFT data defines a modular tensor category. This data can be used to compute an arbitrary correlation function of the TQFT (cf. (1.2)).
An anyon a is said to be abelian if the fusion of a with an arbitrary anyon b contains a single anyon c = c(a, b), i.e.
In terms of the fusion coefficients (2.1), a is abelian if for any b the sum c∈A N ab c equals 1. An abelian anyon a ∈ A has a unique inverseā ∈ A such that a ×ā = 1, and therefore abelian anyons form a finite abelian group, the one-form symmetry group of the TQFT [28].
An abelian TQFT is a TQFT in which all anyons in A are abelian. Therefore, in an abelian TQFT the anyon fusion algebra defines a finite abelian group, which we also denote by A. Remarkably, an abelian TQFT is completely determined by the group A encoding the fusion of anyons, and by the topological spin θ : A → U (1) of the anyons, which is a quadratic, homogeneous function on A [32,[46][47][48]. 2 The entire TQFT data can be reconstructed from A and such a θ. 3 The braiding phase of the abelian TQFT with fusion A and spin θ takes the form while the corresponding S-matrix is Importantly, given (A, θ) there is a unique equivalence class of F and R symbols, and therefore a unique TQFT with that (A, θ). Summarizing, in an abelian TQFT the entire theory is completely fixed in terms of (A, θ). This statement is not true in a generic non-abelian TQFT, which is what makes the abelian case more tractable. The discussion above applies as stated for a bosonic TQFT, a theory that does not require specifying a spin structure on the three-manifold where it is defined. Many interesting TQFTs, including abelian Chern-Simons theories, do require a choice of a spin structure to be defined. Such TQFTs are known as spin TQFTs. In a spin TQFT there is a distinguished abelian anyon ψ with topological spin θ(ψ) = −1 and trivial braiding with all other anyons. This implies that ψ squares to the trivial anyon, i.e. ψ × ψ = 1, and that θ(a × ψ) = −θ(a) for all a ∈ A. In other words, a spin TQFT has a local (spin 1/2) fermion, which endows the data above with a Z 2 -grading. 4 Any abelian TQFT, bosonic or spin, admits a representation as an abelian Chern-Simons theory [32,46,[48][49][50], and is completely determined by (A, θ). Therefore, in spite that a complete and universally accepted axiomatization of a spin TQFT from a categorical point of view is lacking, the abelian Chern-Simons realization of the TQFT and its datum (A, θ) suffice to determine the symmetries of spin abelian TQFTs (we also provide path integral arguments to exhibit the symmetries of abelian Chern-Simons theories that do not rely on the precise categorical characterization of spin TQFTs).
The symmetries of a TQFT are, by definition, the automorphisms of its data [22]. An automorphism g of a TQFT is a permutation of the anyons g : The central charge is determined by (A, θ) only modulo 8. This indeterminacy can be understood as coming from the fact that one may always tensor by an even unimodular lattice, which has no lines, but may add central charge; the minimal such lattice is E 8 , which has signature 8. Some more refined observables (see e.g. [46,48]) are sensitive to the actual value of c, and not only to it modulo 8. If we are interested in such observables, the TQFT data should be taken as (A, θ, c) rather than just (A, θ). This will not play a major role in this work. 4 Anyons in a spin TQFT come in pairs {ã,ã × ψ}, and the S-matrix is S = 1 not modular (it is degenerate),S is, and T 2 (but not T ) is well-defined since it preserves the spin structures on the torus.

that preserves the fusion algebra
If the symmetry of the TQFT is unitary it must preserve the data modulo gauge transformations θ(g(a)) = θ(a) , while if the symmetry is anti-unitary it preserves the data modulo gauge transformations, up to complex conjugation Despite this explicit characterization, little is known about the actual symmetries of TQFTs. By contrast, the one-form symmetries of a TQFT are completely understood; they are determined by the abelian anyons and their fusion. Henceforth, when we discuss symmetries we refer to usual (zero-form) symmetries. As reviewed above, in an abelian TQFT the entire data is completely determined by the abelian group A encoding the fusion algebra and the topological spin θ. A necessary condition for the transformation g to a symmetry of an abelian TQFT is that g : A → A is an automorphism of the finite group A g(a × b) = g(a) × g(b) . (2.10) The set of automorphisms of A, denoted by Aut(A), is a finite, generically nonabelian group. An automorphism g of A lifts to a unitary symmetry of the abelian TQFT if and only if θ(g(a)) = θ(a) , (2.11) and to an anti-unitary symmetry if and only if θ(g(a)) = θ(a) * . (2.12) If such an automorphism g exists, it is guaranteed that the entire data of the abelian TQFT is preserved and g is a symmetry. In other words, the group of symmetries of an abelian TQFT is the subgroup of Aut(A) that preserves the topological spins (up to complex conjugation for anti-unitary symmetries). We introduce the following notation for this group: The main goal of this work is to study the object Aut(A, θ). We determine it explicitly in the case of U (1) k , and give a complete characterization thereof for arbitrary abelian theories. We will also work out a few illustrative examples in some detail.

U (1) k Chern-Simons
We begin by reviewing Chern-Simons theory with gauge group U (1). The generalization to the gauge group U (1) n is the content of section 4.
The Lagrangian of U (1) k Chern-Simons theory is where a is a U (1) gauge gauge field and the coupling k ∈ Z is quantized. Being topological, the theory can be defined on an arbitrary (oriented, framed) three-manifold, perhaps with a choice of spin structure depending on the parity of k.
Physically, W α describes the worldline of an anyon α with topological spin The spin of an anyon h α is only well-defined modulo an integer, because it cannot be distinguished from an anyon enriched with a soft a-photon, which has spin h = 1. If we introduce a background electromagnetic field, the anyon α is seen to carry a fractional charge given by α/k, as follows from the coupling 1 2π A da. The anyon fusion algebra is determined by the OPE of the corresponding Wilson lines: α × β = α + β. The braiding phase acquired by an anyon α circumnavigating around an anyon β is It follows from (3.5) and (3.4) that the anyon α = k has trivial braiding with respect to all other anyons, and has spin h = 0 mod 1 for k even and spin h = 1/2 mod 1 for k odd. Therefore U (1) k is a spin TQFT for odd k, and a bosonic TQFT for even k. The former describes, for example, the fractional quantum Hall fluid at filling fraction ν = 1/k, where the anyon α = k represents the microscopic electron.
Since the anyons α and α + k have indistinguishable braiding properties, and identical spins for k even, and spins that differ by 1/2 for k odd, the lines of U (1) k are subject to an equivalence relation: anyons related by a transparent bosonic anyon are to be identified. A bosonic theory can be made into a spin theory by tensoring with the trivial spin TQFT of a transparent fermion {1, ψ}. We will often follow the convention of leaving this factor implicit when discussing spin TQFTs.
Summarizing, the anyon set and the fusion algebra of U (1) k is: • U (1) k , k even: the theory has k anyons labeled by α ∈ {0, 1, . . . , k − 1} and a A ∼ = Z k fusion algebra The theory is bosonic and can be defined on an arbitrary three-manifold.
We now proceed to determine the full set of symmetries of U (1) k Chern-Simons theory.

Symmetries of U (1) k
We start with the manifest Lagrangian symmetries. U (1) k with k > 2 has a Z 2 unitary Lagrangian symmetry C : a → −a, charge conjugation, under which L → L, and that acts on the anyons as The operation C is not a symmetry of U (1) 1 and U (1) 2 because charge conjugation acts trivially on all the lines, since 1 = −1 mod 2. Time-reversal is an anti-unitary transformation 2). Therefore, if T is to be a symmetry of U (1) k , it must act non-trivially on the anyon labels: for some T : A → A.
In order to study the quantum symmetries of U (1) k Chern-Simons theory we first need to understand the automorphisms of its fusion algebra A. Indeed, as explained in section 2, a transformation g is a symmetry of a TQFT if it is an automorphism of its data (A, θ) which requires, first and foremost, that g ∈ Aut(A). As usual, any element of Aut(A) is completely determined by its action on the generators of A. With this in mind, the automorphisms of the fusion algebra A of U (1) k Chern-Simons theory are as follows: • U (1) k , k even. The most general endomorphism of A ∼ = Z k acts as g : α → qα mod k, where q := g(1) ∈ A and α ∈ {0, 1 . . . , k − 1}. This lifts to an automorphism of Z k if and only if g maps a generator of Z k into a generator of Z k . This requires q to be relatively prime to k, i.e. gcd(q, k) = 1: The number of automorphisms (and of generators) of Z k is the number of totatives of k: the number of integers 1 ≤ q ≤ k such that gcd(q, k) = 1. This number is counted by the Euler totient function φ(k). The automorphism group Aut(Z k ) is the multiplicative group of integers modulo k, an abelian group often denoted as Z × k . • U (1) k , k odd. The most general endomorphism of A ∼ = Z 2k acts as g : α → qα mod 2k, where q := g(1) ∈ A and α ∈ {0, 1, . . . , 2k − 1}. It is an automorphism if and only if q is coprime to 2k: g : α → qα mod 2k , gcd(q, 2k) = 1 . The automorphisms automatically preserve the transparent fermion (α = k) since qk = k mod 2k for q odd. The number of automorphisms of Z 2k is the Euler totient function φ(2k) = φ(k), the last equality by virtue of k being odd. The automorphism group is where α ∈ {0, 1, . . . , k − 1} and β ∈ {0, 1}. Such a map is an automorphism if and only if it is invertible (mod k, mod 2). The automorphism group of Z k × Z 2 does not admit as straightforward a description as in the previous cases, but its order is known: 4φ(k) if k/2 is even, and 6φ(k) if k/2 is odd [51,52]. The automorphism group is generically non-abelian.
Locality of the TQFT requires that the automorphism g preserves the transparent fermion, g(ψ) = ψ, that is, it fixes the anyon (0, 1). This implies that the candidate symmetries of U (1) k × {1, ψ} with k even are the automorphisms of Z k × Z 2 with b = 0 and d = 1. In order for the transformation to be invertible, one must have gcd(a, k) = 1 or, if k/2 is odd, gcd(a, k/2) = 1. The number of such transformations is 2φ(k) and 3φ(k) for k/2 even and odd, respectively.
This immediately shows that U (1) 1 and U (1) 2 have no symmetries since Aut(Z 2 ) is trivial, and indeed charge conjugation C acts trivially in these theories.
We have thus characterised all the automorphisms of A. These are the candidate transformations to be a symmetry of the TQFT. They uplift to symmetries if they respect the topological spin of the lines (up to complex conjugation for anti-unitary symmetries). We turn to this question next.

Anti-unitary Symmetries
We start by studying the anti-unitary symmetries of U (1) k Chern-Simons theory. We already established that the canonical time-reversal transformation (3.10) is not a symmetry of U (1) k . Since the TQFT data of U (1) k Chern-Simons theory is determined by the fusion algebra A and the topological spin θ, an automorphism T ∈ Aut(A) will lead to an anti-unitary symmetry if and only if θ(T(α)) = θ(T(α)) * ⇐⇒ h T(α) = −h α mod 1 . This condition is not satisfied by every automorphism of A. More importantly, depending on the value of k, there will be cases where there are no automorphisms at all that satisfy (3.15). This is precisely what happens for even k, when we regard U (1) k as a bosonic theory 5 : The bosonic theory U (1) k , with k even, is never time-reversal invariant.
Proof. Consider the permutation T : α → qα for some q ∈ [0, k). This operation satisfies h T(α) = −h α mod 1 if and only if If we take, for example, the fundamental line α = 1, this requires 1+q 2 2k to be an integer. But q must odd for T to be an automorphism, and so 1 + q 2 = 2 mod 4, which means that 1+q 2 2k cannot be an integer.
We therefore see that the theory U (1) k can only possibly be time-reversal invariant if we regard it as a spin TQFT. And even if we do so, there will still be some values of k for which U (1) k admits no time-reversal permutation at all. To see this, define the following: Definition 3.1 We let T ⊂ Z be the set of integers k such that −1 is a quadratic residue modulo k, i.e. q 2 = −1 mod k for some q ∈ Z. In other words, (3.17) With this, we prove that Proof. We begin with the case of odd k, that is, We shall look for the most general automorphism T ∈ Aut(A) that satisfies (3.15). Any such operation is of the form If we impose that h T(1) = −h 1 mod 1, we get 1 + q 2 = 2pk for some integer p. It is easy to show that this equation is solvable if and only if k ∈ T. One direction is obvious; for the opposite direction, assume that 1 +q 2 =pk. Ifp is even, we are done; if it is odd, then we can set q :=q + k, p :=q +p + k 2 (3.19) which satisfy 1 + q 2 = 2pk, as required (note thatp + k is even, and so p ∈ Z). Once we ensure the spin of the generator transforms properly under T, it is easy to show that so do the rest of lines. Indeed, where we have used that 1 + q 2 = 2pk. Finally, it is also easy to show that any integer q that solves 1 + q 2 = 2pk will be a time-reversal operation. Indeed, 1 + q 2 = 2pk implies that any common factor to k and q must divide 1, and so gcd(q, k) = 1, which means that α → qα is invertible.
We now move on to the even k case, that is, where the first factor is generated by the fundamental line (1, 0), and the second one by the transparent fermion ψ = (0, 1).
Any fusion endomorphism is fixed once we choose its action on the generators. In fact, the trasparent fermion is the only spin h = 1/2 line that braids trivially to all other lines (because U (1) k is bosonic), and thus the action of time-reversal on it is fixed to T(ψ) ≡ ψ. Therefore, we only have freedom to choose how time-reversal acts on (1, 0). We write T(1, 0) := (q 1 , q 2 ) for a pair of integers q 1 , q 2 , where q 1 ∈ {0, 1, . . . , k − 1} and q 2 ∈ {0, 1}. Proposition 3.1 implies that q 2 = 0 is not possible. Therefore, the candidate anti-unitary transformation is T(1, 0) ≡ (q, 1) for some integer q ∈ [0, k), and so the most general endomorphism is of the form We now insist that the spin of (1, 0) is mapped into its negative under time-reversal. Imposing that h 1 = −h T(1)⊗ψ mod 1 we get 1 + q 2 = (2p − 1)k for some integer p. Once again, it is easy to show that this equation is solvable if and only if k ∈ T. One direction is obvious; for the opposite direction, assume that 1 +q 2 =pk. Then, upon reducing the equation modulo 4, it becomes clear thatp has to be odd, and so we can writep = 2p − 1, as we wanted to show.
Once we ensure the spin of the generator transforms properly under T, it is easy to show that so do the rest of lines. Indeed, where we have used . This is clearly equal to as required.
• A given k is in T if and only if it can be written as k = a 2 + b 2 for relatively prime a, b ∈ Z (see e.g. [53], theorem 3.21).
• Given the prime decomposition of k

24)
k ∈ T if and only if e ∈ {0, 1} and β i ≡ 0 (see e.g. [53], theorem 3.20). In other words, k ∈ T if and only if all its prime factors are Pythagorean, or Pythagorean with a single factor of 2. This implies, for example, that T even = 2T odd .
• The set T contains a special subset P, defined as those integers k for which the (negative) Pell equation is solvable: Unlike T, the set P has no simple characterization in terms of the prime decomposition of k. See Appendix B for some mode details about Pell numbers.
It is conjectured that around 57% of the numbers in T are in P [54,55].
If k ∈ T, there exists an integer q ∈ [0, k) such that q 2 = −1 mod k. We explain in the Appendix B how to construct q explicitly.
We now go back to the theory U (1) k . We have the following: The time-reversal symmetry of U (1) k is an order-four operation (except for k = 1, 2, where it is of order two).
Proof. We shall prove that T 2 = C, where C : α → − α is the unitary Z 2 charge conjugation symmetry (3.9). From this it follows that T 4 = 1, and therefore T is an order-four operation (except for k = 1, 2, where C is trivial). 6 Showing that Similarly, if k is even, then where we have used that q is odd. We see that if k ∈ T, then there exists some anti-unitary operation T which satisfies a Z 4 algebra. That being said, there will be, in general, more than one such permutations, and therefore the time-reversal transformation is not unique. We have the following result: where (k) denotes the number of distinct prime factors of k for k odd and of k/2 for k even (cf. (1.7)).
Proof. Indeed, there are as many permutations as there are solutions to q 2 = −1+(2p−1)k with q ∈ [0, k) for k even, and to q 2 = −1 + 2pk with q ∈ [0, 2k) for k odd. We shall first show that this problem is equivalent to counting the solutions toq 2 = −1 mod k: • Consider the case with k even. Then any solution toq 2 = −1 +pk must necessarily havẽ p odd (for otherwise we reach a contradiction upon reducing the equation modulo 4), and so we can write (q,p) = (q, 2p − 1), which yields q 2 = −1 + (2p − 1)k, as required.
First, assume we are given the set {q ∈ [0, k)}; we construct the set {q ∈ [0, 2k)} as follows: ifq is odd, thenp must be even, and so (q, 2p) = (q,p); on the other hand, ifq is even, thenp must be odd, and so (q, 2p) = (q + k,p + 2q + k). Conversely, if we are given We thus see that we may reduce our problem to counting solutions to q 2 = −1 mod k, both for k even and odd. It is a well-known result that the number of solutions is precisely 2 (k) , see for example theorem 6.3 in [56] (together with remark 6.2 therein). The intuition behind this result (and which can be generalised to any polynomial congruence) is the following. Any solution to q 2 = −1 mod k can be reconstructed uniquely from the solutions to q 2 i = −1 mod π i , where π i are the prime factors of k. Each congruence q 2 i = −1 mod π i is solvable (because π i is Pythagorean), and it has two solutions ±q i (and only two, as per Lagrange's theorem, except for π = 2, where only solution is q i = 1, inasmuch as 1 = −1 mod 2). As there are (k) congruences, each having two solutions, the total number of solutions is 2 (k) , as claimed.
For completeness, we mention that one can prove that k ∈ T is sufficient for time-reversal invariance using a path integral argument, which is quite similar to one in [24,25] where it was used to show time-reversal invariance for k ∈ P ⊂ T. The argument is straightforward but it does not prove that the condition k ∈ T is also necessary. Proposition 3.5 It follows from a path integral argument that when k ∈ T the theory U (1) k is time-reversal invariant as a spin TQFT.
Proof. Take two arbitrary integers m, n with m is odd and n even, and such that for some integer q (which can easily seen to be odd). We shall prove that U (1) m and whose Wilson lines are of the form the Lagrangian becomes and the lines map according to We therefore see that , the product is time-reversal invariant. The explicit duality map is given by (3.33). We now prove that U (1) m is time-reversal invariant. To this end, we note that the theory above contains a sub-group of lines of the form (α, 0), which is isomorphic to U (1) m , with isomorphism α ↔ (α, 0). Time-reversal restricts to a well-defined action on U (1) m , because where we have used the fact that n is even. We next prove that U (1) n × {1, ψ} is time-reversal invariant. To this end, we note that the theory above contains a sub-group of lines of the form (0, β) and (m, β), which is isomorphic to U (1) n × {1, ψ}, with isomorphism β ⊗ 1 ↔ (0, β) and β ⊗ ψ ↔ (m, β). Time-reversal restricts to a well-defined action on U (1) n × {1, ψ}, because where we have used the fact that n is even and q is odd. This completes the proof. As a consistency check, we note that the action of time-reversal on the lines of U (1) m is T(α) = qα, and that on U (1) n × {1, ψ} is T(β ⊗ ψ γ ) = qβ ⊗ ψ β+γ , with γ = 0, 1. This is precisely the same map we found in proposition 3.2.
One can couple the theory U (1) k to electromagnetism by turning on a background U (1) B connection. If k ∈ T, then time-reversal remains a symmetry in the presence of this background field, but at the cost of introducing a Chern-Simons counterterm for the electromagnetic field, with fractional coefficient. This means that there is a mixed T − U (1) B 't Hooft anomaly, 7 and so the system can only be defined on the boundary of a 3 + 1 manifold. Using the Lagrangian argument above, and following the same reasoning as in [25,57], it is easy to prove that the anomaly is given by a 3 + 1 dimensional topological term θ = 2π/k for U (1) B . Remark 3.1 It is common that in theories that are symmetric under both time-reversal and charge conjugation, the operators T and CT constitute two separate Z 2 symmetries, both of which represent suitable time-reversal operations. These two symmetries are independent: they have different anomalies, they may be affected by magnetic symmetries (if any), and may be interchanged under duality (see e.g. [58]). In our case, these two symmetries in fact combine into a single Z 4 algebra, T 3 = CT, and so they do not correspond to independent symmetries.
Remark 3.2 It is interesting to note that we obtained k ∈ T as a necessary condition just by insisting that the fundamental line has a partner with opposite spin. In turns, this condition was also seen to be sufficient, so one may wonder if a similar phenomenon may occur in other topological systems. In other words, given an arbitrary TQFT, does the matching of the spin of a single line guarantee that the theory is time-reversal invariant? Generically speaking, the answer is no, as there are many examples where a specific pair of lines match but others do not. A much stronger test is the matching of all the lines, that is, the condition that {h} = {−h} mod 1 (with equality as multisets, that is, taking into account multiplicities). For example, one may we check that the set of spins matches for the theory SU Upon turning on a background metric, the duality U (1) k ←→ U (1) −k no longer holds as written, because the two theories have a different framing anomaly, and so they couple to the background gravitational field differently. This can be interpreted as a mixed anomaly between time-reversal and gravity. To maintain the duality one must adjust gravitational Chern-Simons counterterms on both sides so that their central charges agree. In particular, one may use U (1) ±1 to add/subtract one unit of central charge, without otherwise changing the topological content of the theory. With this in mind, the precise duality reads These theories can be represented by the matrices K = diag(±k, ∓1). In the bosonic case, we already included a factor {1, ψ} to make the theory into a spin theory; here we see that this factor also fixes the central charge, provided we identify {1, ψ} ≡ U (1) − sign(k) . In the spin case, this factor also fixes the central charge, but leaves the spectrum of lines unaffected. It is clear that without the factor of U (1) ±1 , time-reversal cannot possibly be a Lagrangian symmetry of the U (1) k theory, because the only GL 1 (Z) transformations are a → ±a, neither of which maps k → −k. More generally, the signature of the K-matrix is invariant under congruence (sign(K) ≡ sign(G t KG) for any G ∈ GL n (Z), as per the Sylvester law of inertia) and so time-reversal can only be a Lagrangian symmetry if the signature is a multiple of 4 (inasmuch as the chiral central charge is odd under time-reversal, and defined only modulo 8). Once we fix the central charge, time-reversal may (but need not) become a Lagrangian symmetry. It is interesting to note that, in the case at hand, this happens only for a subset of T: only for a specific set of values of k is the Lagrangian time-reversal invariant. One can show that this is so if and only if k ∈ P: Proof. The fact that this condition is necessary can be obtained by looking at the bottomright component of the equation . That this is also sufficient was originally shown in [24,25], and follows from the explicit change of variables This means that if k ∈ T but it is not in P, then U (1) k will be time-reversal invariant, but the invariance will not be a symmetry of the Lagrangian, not even if we include the factor of U (1) ±1 . It is a quantum symmetry of U (1) k × U (1) −1 . However, it is possible that in a different abelian Chern-Simons realization of the same TQFT data that the symmetry becomes Lagrangian.

Remark 3.3
As a physical application of proposition 3.2, note that given an integer such that both k and k + 2 are in T, the theory with Ψ a Dirac fermions of charge is infrared time-reversal invariant for m = 0. Indeed, integrating the fermions out we get for m → +∞. This suggests that the CFT at the massless point m = 0 may be time-reversal invariant as well. These gauge theories, in spite of not being time-reversal invariant in the ultraviolet, have an emergent time-reversal symmetry across the entire infrared phase diagram.
The first few solutions of (k, k + 2 ) ∈ T × T are  It is an interesting number-theoretic problem whether there exists, for a given ∈ Z, an infinite number of pairs with (k, k + 2 ) ∈ T 2 . This is similar in spirit to the so-called Polignac conjecture, which states that there exists an infinite number of pairs of primes of the form (π, π + n) for any n ∈ 2N (recall that primes π > 2 are in T iff they are Pythagorean). Assuming this conjecture with 2 = n (which requires to be even), and noting that π and π + 2 are either both Pythagorean or neither is, suggests that indeed there exists an infinite number of pairs (k, k + 2 ) ∈ T 2 , at least for even.

Unitary Symmetries
We now move on to the unitary symmetries of U (1) k . The principle is identical to the anti-unitary case, the only difference being a sign flip. By definition, an automorphism U ∈ Aut(A) is a unitary symmetry of (A, θ) if and only if As in the anti-unitary case, any permutation is fixed once we choose how the generators transform. The corresponding permutation will be a symmetry if it satisfies (3.42). But, unlike the case of anti-unitary symmetries, here the equation h U(α) = h α mod 1 always admits solutions: at least, the trivial permutation and charge conjugation C exist. These are transformations that leave the action of the theory invariant. We thus solve a more refined problem: the interesting automorphisms will be those that are neither trivial nor C. Another difference with the anti-unitary case is that, in general, we will find non-trivial symmetries also in the bosonic case.
We begin with the following observation: for some integer q that satisfies Similarly, the unitary symmetries of U (1) k × {1, ψ} for k even are of the form for some integer q that satisfies The solutions q = ±1 (with p = 0) always exist and corresponds to the trivial permutation, and charge conjugation C (3.9), respectively. All other solutions correspond to quantum symmetries.
Proof. The case of U (1) k (as a bosonic TQFT if k is even) is essentially identical to the anti-unitary case. Let us therefore consider U (1) k × {1, ψ} with k even. Any fusion endomorphism that fixes the transparent fermion is of the form for a pair of integers c, q. If c is even, U does not mix the lines of U (1) k with the transparent fermion, and so this is a symmetry that was also present in the bosonic case. If c is odd, the permutation does mix the lines, and so it is only a symmetry of the fermionic theory. In any case, requiring that the spin of the fundamental line is equal to the spin of its image under U, we get for some integerp. Letting −p := c 2 + 2p we get the expression in the proposition (note that p and c have the same parity, and therefore we can replace the latter by the former in the transformation U). It is straightforward to check that if the spin of the fundamental line is invariant under U, so is the spin of the rest of lines. Finally, it is easy to show that any solution of (3.48) corresponds to a permutation (i.e. q automatically has the appropriate coprimality with k to define an automorphism).
As in the anti-unitary case, all the unitary permutations have the same order: Proof. For U (1) k we have which indeed equals α. In the case of U (1) k × {1, ψ}, the argument is identical: which, using the fact that q is odd, yields (α, β), as claimed.
Take the theory U (1) k , without the factor of {1, ψ} for k even. A slight modification of the argument in proposition 3.4 proves that the number of solutions in the range q ∈ [0, 2k) for k odd, and in the range q ∈ [0, k) for k even, is 2 (k) , as in the anti-unitary case. Therefore, in order to have solutions other than U ∈ {1, C}, the level k must not be a prime power or twice a prime power. Such non-trivial solutions will not be a symmetry of the classical Lagrangian, because p = 0. They correspond to quantum symmetries.
For k even, one may also study the unitary symmetries of the theory as a spin TQFT, that is, of U (1) k × {1, ψ}. The symmetries of the bosonic theory are inherited in the fermionic theory, but new symmetries may appear -those under which the transparent fermion mixes non-trivially. The automorphisms are given by the integers q that satisfy q 2 = 1 + pk, and whether the transparent fermion mixes is controlled by the parity of p. It is easy to show that the number of solutions is 2 (k) for k = 2 mod 4, and 2 (k/2)+1 for k = 0 mod 4. Therefore, there is an enhancement of symmetry when going from the bosonic theory to the spin theory if and only if k is a multiple of 8: only in that case may the fermion mix. The additional transformation that appears when the theory is uplifted from bosonic to spin is generated by q = k/2 − 1 (with p = k/4 − 1). We summarise these claims as follows: Proposition 3.9 All the unitary symmetries of U (1) k (both as a spin theory and as a bosonic theory in the case of k even) are Z 2 -valued. There are 2 (k) permutations if k is not a multiple of 8. If k = 0 mod 8, then there are 2 (k) permutations in the bosonic theory, and twice as many in the spin theory.
Needless to say, one may compose any non-trivial unitary symmetry with a given T to yield a different notion of time-reversal. Similarly, composing any two time-reversal operations results in a unitary symmetry, and composing two unitary symmetries leads to another unitary symmetry. In fact, a stronger result is true. Let {T i } be all time-reversal symmetries, and {U i } be unitary ones. Let U 0 := 1, pick some element of {T i }, and denote it by T 0 . Then any T i can be obtained by acting with some U i on T 0 . Indeed, it is easy to see that the sets contain the same number of elements (because T 0 is invertible, so T 0 U i = T 0 U j for i = j), and so they must be identical. Thus, perhaps after relabelling its elements, we have and so one time-reversal permutation suffices to generate them all.
Recalling definition 2.1, all these considerations can be put together to obtain the following: Proposition 3.10 The group of symmetries of U (1) k as a spin TQFT is if k ∈ T, and otherwise. On the other hand, as a bosonic theory (with k even), the group reads

Minimal abelian TQFT
An important abelian theory that appears in the study of the one-form symmetries of threedimensional TQFTs is the so-called "minimal abelian TQFT" [22,29,41,60]. This theory is denoted by A N,t (also by Z . For example, if k is even, then U (1) k = A k,1 ; if k is odd, then U (1) k = A 2k,2 (which, indeed, is not modular, because the braiding matrix has a non-trivial kernel). All these theories admit an abelian Chern-Simons representation (e.g. for t = N − 1 the K-matrix is the Cartan matrix of SU (N )).
The analysis of the symmetries of A N,t is essentially identical to that of U (1) k because the fusion algebra is also cyclic. For example, following the same reasoning as in the 1 × 1 case, this theory is seen to be time-reversal invariant if and only if is solvable for some integers p, q. It is easy to prove that this equation is solvable if and only if t ∈ µ(N )Z . Indeed, by reducing (3.56) modulo µ(N ) we get t(1 + q 2 ) = 0 mod µ(N ); but (1 + q 2 ) is never divisible by a prime of the form 4n + 3, and so t itself mush vanish modulo µ(N ), showing that t ∝ µ(N ) is necessary. Conversely, noting that N/µ(N ) is always in T odd , we know that there exists a pair of integersp, q such that 2pN = µ(N )(1 + q 2 ); multiplying this equation by t/µ(N ) and letting p =pt/µ(N ) we find that t ∝ µ(N ) is also sufficient. Alternatively, one may rewrite (3.57) as a condition on N instead of t, as follows: Indeed, if N ∈ d T odd for some d|t, then there exists somep, q such that 2(N/d)p = 1 + q 2 ; multiplying this equation by t/d and letting p =pt/d shows that (3.56) is solvable. Conversely, if N / ∈ d T odd for any d|t then, in particular, N / ∈ t T odd (and, if t ∈ 2Z, then N / ∈ (t/2) T odd either), and so equation (3.56) is not solvable (note that if t is odd then N must be odd as well).
If we further assume that (N, t) = 1, the expression (3.58) can be simplified into where π are the Pythagorean prime factors of p.
As A N,t has a single generator, its group of symmetries is abelian, and can be studied along the same lines as in the U (1) k case.

U (1) n Chern-Simons theory
We now move on to Chern-Simons theories that contain an arbitrary number of factors of U (1). As a Lagrangian theory, the system is described by for a U (1) n gauge field a t = (a 1 , a 2 , . . . , a n ). The Lagrangian is metric independent and, although not manifestly so, gauge invariant provided the coefficient matrix K ∈ Z n×n is symmetric and integral-valued. Generically speaking, the theory depends on the orientation of spacetime and, if at least diagonal component of K is odd, on the spin structure. The theory has central charge c = sign(K) (the signature of K), which controls the coupling to the Chern-Simons form for the background metric, via the framing anomaly. To keep matters simple, we shall often turn off this metric, and any other background field one may ultimately want to couple a to. The observables of the theory are the Wilson lines, modulo local bosonic operators. These lines are of the form where α ∈ Z n is the representation U (1) n θ → e i α·θ . We shall call α the charge of W α , and we will often denote the line itself by α. These lines can be thought of as the worldlines of anyons, i.e., particles with fractional statistics. In particular, they have spin and may braid non-trivially. If a line α braids around a line β, their product picks up a phase B( α, β) ∈ U (1), where Similarly, the topological spin of the line corresponds to half self-braiding, The function θ is said to be a quadratic refinement of the bilinear form B, because one has This implies that the spin of the lines determines their braiding unambiguously; one need not keep track of the latter. An operator is said to be local if it braids trivially with any other line. In particular, any line with α proportional to a column of K satisfies B( α, β) ≡ 1 for any β, and so it will be local. If, furthermore, the corresponding column has even diagonal element, then h α = 0 mod 1, and so the local line will be bosonic. As before, lines differing by such a local operator are identified, and so the degrees of freedom of the theory are in fact finite. More explicitly, we have the following: • If all the diagonal components of K are even, then all the local operators are bosonic, and we need not specify a spin structure to define the theory. It is a bosonic TQFT. Any two lines that are congruent modulo some linear combination (with integer coefficients) of the columns of K are identified, which means that the lines live in the lattice Z n /KZ n . There are | det K| independent lines, which can be taken to be all the lattice points in the n-dimensional parallelepiped spanned by the columns of K.
• If at least one diagonal component of K is odd, the theory contains a local fermionic operator, which requires a choice of spin structure. The theory is a spin TQFT. Any two lines that are congruent modulo some linear combination (with integer coefficients) of the columns of K are identified, except if they differ by a local fermion. This means that the lines live in the lattice (Z n /KZ n ) × Z 2 . There are 2| det K| independent lines, which can be taken to be all the lattice points in the n-dimensional parallelepiped spanned by the columns of K, together with a Z 2 label that specifies if the line carries a local fermion or not. Alternatively, a basis of lines can be taken to be all the lattice points in the n-dimensional parallelepiped spanned by the columns ofK, whereK is the matrix given by doubling any one column of K with odd diagonal component.

The spectrum of lines is given by the set
where γ is any tuple of integers with Reducing Z n modulo K, instead of modulo ∼, would be tantamount to identifying the local fermion, if any, with the vacuum. In other words, we would forget about the information carried by such a line. This would not be correct: we need the Z 2 label to signal the presence of ψ. This extra piece of information resolves the ambiguity in lifting the symmetric form B into the quadratic form θ. We shall nevertheless often refer to the equivalence ∼ as "reduction modulo K", in order to keep the notation as simple as possible.
Due to the abelian nature of the gauge fields, any pair of unbraided lines α, β can be brought together to form a line of charge α + β. In other words, the fusion rules of the theory are α × β := ( α + β mod K) . (4.8) The theory described by a given matrix K may have several symmetries. The main focus of this paper is to study the zero-form symmetries, but for completeness we mention that the one-form symmetry group can be obtained by bringing K into its Smith normal form K → diag(k 1 , k 2 , . . . , k n ), where k i is the greatest common divisor of all i × i minors of K. Given this canonical decomposition, the one-form symmetry group is We now move on to the zero-form symmetries of the system. These are, by definition, the permutations of the lines that respect their topological properties. A unitary zero-form symmetry of the corresponding system is an automorphism U : A → A that satisfies   Thanks to (4.5), the braiding is determined by the spin, and so the third condition is automatically guaranteed to hold if the first two do; we nevertheless find it convenient to keep track of the braiding matrix explicitly.
We have denoted the anti-unitary symmetries by T because we will think of them as a time-reversal operation (or a reflection in the Euclidean setting). These symmetries do not always exist: only for some special matrices K is the system independent of the orientation of spacetime. In particular, as the Lagrangian is odd under the reversal of orientation, we require K and −K to describe equivalent theories: the theories with matrices K and −K must be dual.
A sufficient condition for the theories described by two matrices K 1 , K 2 to be equivalent is that they are congruent, i.e., GL n (Z)-equivalent: that there exists a unimodular matrix G such that K 1 ≡ G t K 2 G, as follows from the redefinition a 2 := Ga 1 . The matrix G is required to be unimodular because the change of variables has to be invertible and respect the normalisation of the gauge fields. We shall refer to these equivalences of theories as Lagrangian (or classical) symmetries, because they are manifest symmetries of the Lagrangian. As we shall show, one may have matrices K 1 , K 2 that are not GL n (Z)-equivalent, and yet the theories described by them are nevertheless equivalent. This latter notion of equivalence we refer to as a quantum symmetry, or as a duality.
Dualities of TQFTs are often valid only when the theory is regarded as a spin TQFT. In order to turn a bosonic theory into a spin TQFT, it suffices to tensor the theory by the trivial spin TQFT U (1) ±1 = {1, ψ}, where 1 is a local boson and ψ a local fermion. Tensoring a theory that is already spin by this trivial factor leaves the TQFT unaffected, inasmuch as we identify local fermions anyway (because they differ by a local boson: ψ 1 = (ψ 1 ψ 2 )ψ 2 ).
If we turn on some background field that couples to a given TQFT, then one may need to adjust appropriate counterterms for it on both sides of the duality. The canonical example is the coupling to background gravity, which is controlled by the central charge of the theory (through the framing anomaly). In particular, the central charge -being the signature of the K-matrix -is odd under time-reversal, which means that a theory can only be time-reversal invariant in the presence of gravity if the central charge is a multiple of 4 (recall that only c mod 8 is meaningful). In this sense, a theory being invariant in flat spacetime may require a gravitational counterterm to remain invariant when the metric is nontrivial. Noting that U (1) ±1 is essentially trivial but has central charge ±1, one may add as many factors of this theory as necessary so that the theory under consideration has a central charge that is a multiple of 4, as required to maintain the time-reversal symmetry when turning on a background metric. If the theory is already spin, tensoring by U (1) ±1 = {1, ψ} has no effect other than changing the central charge; but for a bosonic system, this factor turns the theory into a spin TQFT.

Symmetries of U (1) n
The analysis of the symmetries of a system described by a matrix K is essentially identical to that of U (1) k : the symmetries are those automorphisms of the fusion algebra that respect the spin of the lines. The most general endomorphism of A ∼ = Z n / ∼ is g : α → Q α (4.12) for some matrix Q, its i-th column being g( e i ), with e i the i-th unit vector. This map is an automorphism if the action of Q is invertible modulo ∼, i.e., if it is a permutation of A.
Finally, this permutation shall be a symmetry if it conserves the spin of all the lines, up to complex conjugation in the anti-unitary case. We discuss this in some more detail below.

Anti-unitary symmetries
A natural generalisation of theorem 3.2 reads Proposition 4.1 A necessary condition for the Chern-Simons theory with matrix K to admit an anti-unitary symmetry is that there exists a pair of matrices (Q, P ) ∈ Z n×n × Z n×n where P has even diagonal elements, and such that Proof. We shall look for the most general permutation that satisfies the conditions (4.11). As in the case of a single U (1) factor, any putative time-reversal operation is fixed once we know how the generators transform. The most general fusion endomorphism reads T( α) = Q α (4.14) for some matrix Q, the i-th column of which represents the action of T on the unit vector in the i-th direction e i . Imposing that the spin of e i is the opposite of that of T( e i ), we get for some integer P ii . Similarly, imposing that T commutes with braiding, B( e i , e j ) = B(T( e i ), T( e j )) * , we get for some integer P ij . These two equations, in matrix form, take the form quoted in the proposition, as claimed. Note that if this equation is satisfied, then the spin of all the lines behaves as expected, and not only that of the generators: which indeed equals −h α modulo 1. We stress that, unlike in the case of a single U (1) factor, the argument in proposition 4.1 does not prove that any map α → Q α with P K − Q t K −1 QK = 1 n represents a time-reversal operation, even though the conditions (4.11) are satisfied. One must also require Q to be a permutation, that is, invertible modulo K over the integers. This is a non-trivial condition that is not satisfied for every solution of P K − Q t K −1 QK = 1 n . (In the 1 × 1 case, the equation pk − q 2 = 1 implies that gcd(k, q) = 1, and so any solution is invertible; this is no longer necessarily true in the n × n case: some solutions may fail to be invertible).
As in proposition 3.5, one can also examine the time-reversal invariance of U (1) n through a Lagrangian argument: Proposition 4.2 A sufficient condition for the Chern-Simons theory described by the matrix K to admit an anti-unitary symmetry is that there exists a pair of matrices (Q, P ) ∈ Z n×n × Z n×n where P has even diagonal elements, and such that subject to the conditions (Note that if Q is normal and commutes with K, then these equations are automatically satisfied).
Proof. By solving for P in (4.18), and taking the transpose, it becomes clear that P is symmetric, and so it defines a (bosonic) abelian Chern-Simons theory. Take the Lagrangian with matrix K ⊕ −P 4πL = a t Kda − b t P db (4.20) and perform the GL 2n (Z) transformation  Finally, and thanks to the evenness of P , the action of T descends to a well-defined operation on the lines of U (1) K : ( α, 0) → (Q α, −P α) ∼ (Q α, 0) (4.24) as required.
Remark 4.1 It is easy to argue that the conditions in proposition 4.2 are GL n (Z)-invariant. Indeed, if we redefine our gauge fields according to a := Ga for some G ∈ GL n (Z), then the lines transform as α = (G −1 ) t α , and which leaves the equations (4.18), (4.19) invariant. This was to be expected, inasmuch as a Chern-Simons theory depends on K modulo congruences. Two K-matrices in the same congruence class have the same determinant; however, the converse is not true: there can multiple congruence classes with a given determinant. The number of congruence classes depends nontrivially on the value of the determinant.
Deciding whether the equation P K − Q t K −1 QK = 1 n is solvable for a given K is a rather non-trivial problem, unlike in the case of U (1) k (where it suffices to scan q ∈ [0, k) for solutions; moreover, and thanks to proposition B.1, deciding whether k ∈ T requires at most ω(k) ≤ 2 log k log log k operations if given the prime divisors of k). We shall make no attempt at finding an efficient characterisation of the set of K-matrices that solve this equation. We will content ourselves with focusing specifically to the case where K is a 2 × 2 matrix. In particular, we will consider the following two families of K-matrices: Remark 4.2 The theory (Z k 1 ) k 2 is also known as Dijkgraaf-Witten theory when k 2 is even [26]. It admits a Chern-Simons gauge theory realization [27,61]. One can show that any 2 × 2 matrix K with det(K) = −n 2 for some integer n can be brought into this form by a GL 2 (Z) congruence transformation G t KG (see e.g. [62]). Furthermore, it is easy to show that (Z k 1 ) k 2 ∼ (Z k 1 ) k 2 +2k 1 , because the corresponding matrices are congruent 8 .
We conjecture the following: -If k 1 k 2 = 2 mod 4, say, k 1 = 2k 1 , then the theory is T-invariant if and only if -If k 1 = 2k 1 is even, the theory is T-invariant if and only if k 2 ∈ µ(k 1 )(T ∪ 2T).

Conjecture 4.2
The theory (Z k 1 ) k 2 is time-reversal invariant if and only if k 2 ∈ µ(k 1 )Z.
Some of these claims are easy to prove. For example, if k 1 and k 2 are both even and positive, then the theory U (1) k 1 × U (1) k 2 is bosonic and has central charge +2, and so it cannot be time-reversal invariant. More generally, the conditions above can be seen to be necessary just by insisting that the generating lines e 1 , e 2 have a line with opposite spin. Proving that they are also sufficient requires more work, but in principle does not seem out of reach: an approach similar to the one-dimensional case U (1) k should work. In any case, we checked that the conjecture is correct up to |k i | ≤ 200 in the diagonal case, and |k 1 | ≤ 200 and k 2 ∈ [0, 2k 1 ) in the (Z k 1 ) k 2 gauge theory case. We stress that the diagonal theory can be be time-reversal invariant even when neither of the factors by itself is; naturally, this also holds for more general theories: a product may have more symmetries than its individual factors.
Note that if the conjecture above is true, then any odd non-Pythagorean prime factor of det(K) must appear an even number of times. In fact, it seems that this is true for any 2 × 2 matrix, whether it is of the forms above or not: Conjecture 4.3 A necessary condition for the matrix K ∈ Z 2×2 to describe a time-reversal invariant theory is that λ(det(K)) ∈ T, where λ(n) denotes the squarefree part of n .
which holds if and only if a = 2 α (2m + 1) and k = 2 α (2n + 1) for some integers α, m, n. The explicit change of variables is G t K a,b G ≡ K a,a+b , where We recall that a number is said to be squarefree if its prime decomposition contains no repeated factors. We have checked that this conjecture is true for all matrices with | det(K)| ≤ 500. (For completeness, we remark that λ(n) ∈ T if and only if n can be expressed as the sum of two perfect squares, not necessarily coprime).
It also appears that all primitive matrices with det(K) > 0, if time-reversal invariant, have T 2 = C, as in the 1 × 1 case: is positive definite and primitive (i.e. with gcd(K ij ) = 1 for all i, j), then T 2 = C.
We checked that this is true for all matrices with det(K) ≤ 400.

Unitary Symmetries.
An essentially identical philosophy allows us to study unitary symmetries rather than antiunitary ones. Following an argument equivalent to that of proposition 4.1 it is easy to prove that Proposition 4.3 Given some K ∈ Z n×n , the most general unitary symmetry (i.e., a permutation subject to (4.10)) is of the form for some Q ∈ Z n×n , invertible over A, the i-th column of which represents U( e i ), the action of the unitary symmetry on the unit vector in the i-th direction. Invariance of spin and braiding requires P K + Q t K −1 QK = 1 n (4.29) for some integral matrix P with even diagonal components.
There is always the trivial solution Q = 1 n , which leaves all the lines invariant, and its negative Q = −1 n , which corresponds to charge-conjugation C : α → − α. Any other solution Q (invertible modulo K) will correspond to some non-trivial unitary zero-form symmetry of the system.
We can finally write down the general expression for the group of symmetries of a given theory: Proposition 4.4 Given an arbitrary abelian TQFT realized as a U (1) n Chern-Simons theory with matrix of levels K, the group of (unitary and anti-unitary) zero-form symmetries can be expressed as where P is required to have even diagonal components, Q is required to be invertible modulo K, and ∼ denotes the equivalence where the last ∼ denotes equivalence in A (cf. (4.6)). The subgroup of unitary symmetries is given by with the same restrictions as before. A given symmetry [Q] is quantum if and only if P = 0 for all Q ∈ [Q].

Remark 4.3
Here we are making a slight abuse of notation in order to simplify the presentation: strictly speaking, if a given matrix Q satisfies both P K + Q t K −1 QK = 1 n and P K − Q t K −1 QK = 1 n (possibly with different P 's), they are different symmetries, and so distinct elements of Aut(K). The same permutation on the anyons constitutes both a unitary, and an anti-unitary symmetry of the system. In other words, the group of symmetries is the disjoint union of the set of anti-unitary symmetries, and the set of unitary symmetries. In order to implement this, one should think of Aut(K) as pairs (Q, σ), where σ = ±1 keeps track of whether a given permutation is unitary or anti-unitary, and one must add the condition σ(Q) = σ(Q ) to the equivalence relation ∼.
We propose the following conjecture: The group of unitary symmetries of (Z k ) 0 is multiplicative in k: Furthermore, for prime powers, it is given by where D 2n denotes the dihedral group of order 2n. The full group of symmetries, including anti-unitary transformations, is a Z 2 extension of the unitary sub-group: Remark 4.4 Note the similarity of this group and Z × k := Aut(Z k ), the multiplicative group of integers modulo k. As per a classic result of Gauss, this latter group is also multiplicative, and given by Aut(Z π n ) = Z φ(π n ) and Aut(Z 2 n ) = Z 2 × Z φ(2 n )/2 . For k = π a prime, the group Aut U ((Z π ) 0 ) = D 2(π−1) has been computed in [63].

We next illustrate how to compute Aut( ) step by step, through a couple of examples.
More examples are worked out, to a lesser degree of detail, in section 5.
Consider the theory (Z k 1 ) k 2 , whose matrix is where we can take without loss of generality k 1 > 0 and 0 ≤ k 2 < 2k 1 . The theory is bosonic if k 2 is even, and spin otherwise. In the first case, the lines are of the form (α, β) ∈ Z k 1 × Z k 1 , and in the second case (α, β) ∈ Z 2k 1 × Z k 1 . The spin of an arbitrary line is (4.37) A common notation for the lines of (Z k 1 ) k 2 is e i = (i, 0), called the electric lines, and m j = (0, j), called the magnetic lines. Their product is e i m j = (i, j). There are i ∈ [0, k 1 ) electric lines if k 2 is even, and i ∈ [0, 2k 1 ) lines of odd; and j ∈ [0, k 1 ) magnetic lines.   By explicit computation, one may check that the only endomorphisms that are actually automorphisms (i.e., the only matrices Q that are invertible modulo K) are and that the first line satisfies K −1 − Q t K −1 Q = P , and the second one K −1 + Q t K −1 Q = P , for some integral-valued matrix P . Therefore, the former generate unitary symmetries, and the latter anti-unitary symmetries. One may check that the two matrices generate the whole group of symmetries, and they satisfy and so the group of symmetries is dihedral: Similarly, the pair of matrices C := T 2 and U generate the subgroup of unitary symmetries, and they satisfy C 2 = U 2 = 1 (4.47) and so the latter is cyclic: Consider now what happens when we turn on a non-trivial twisting, say, (Z 3 ) 2 . The spin of the lines is modified into h = {0, 8/9, 5/9, 0, 2/9, 2/9, 0, 5/9, 8/9} . As we can see, there is no line with spin −8/9 = 1/9 mod 1, and so e 1 has no partner under time-reversal: the theory does not admit anti-unitary symmetries. Therefore, any symmetry must be unitary, and so it must fix the spin; thus, the condition h → +h requires One may check that all these matrices are invertible, but the only two that satisfy K −1 − Q t K −1 Q = P for some integral-valued matrix P are Finally, the second matrix is easily seen to implement charge conjugation C, and so it squares to the identity. In other words, the group of symmetries of the system is By an identical argument one may calculate the group of symmetries of an arbitrary abelian theory. In table 2 we include the group of symemtries of (Z k 1 ) k 2 for small values of the levels.
Similarly, in tables 3 and 4 we include the group of symmetries of the diagonal theory U (1) k 1 × U (1) k 2 .

Examples
Finally, we discuss some illustrative examples. To avoid repetition, we typically include a theory only if it incorporates a new feature that was not present in the previous examples. We begin by the case of a single abelian factor, U (1) k .
Example 5.1 (k = 2) We have (2) = 0, and so the system has no unitary symmetries. As the system is bosonic, there are no anti-unitary symmetries either.
One may regard the system as a spin TQFT, in which case it is usually known as the semion-fermion theory [57,64]. The system now admits one anti-unitary symmetry, which can be found by solving 2p − q 2 = 1, whose only solution in the range q ∈ [0, 2) is q = 1. This means that the permutation is s ↔ s × ψ, as is well-known.
We thus have The integer k = 2 is Pell, and so the time-reversal permutation above is a symmetry of the Lagrangian (provided by {1, ψ} we mean U (1) −1 rather than U (1) +1 ). Table 2: The group of symmetries of (Z k 1 ) k 2 , denoted by Aut( ), and its unitary subgroup Aut U ( ), for k 1 ∈ [0, 27] and k 2 = 0, µ(k 1 ). For k 2 ∝ µ(k 1 ) there are no anti-unitary symmetries. (See Appendix A for basic definitions).  2 3 4   5  6  7  8  9  10  11  12  13  14  15 Table 3: The group of symmetries of the diagonal theory K = diag(k 1 , k 2 ), to wit, We thus have The integer k = 5 is Pell, and so the time-reversal permutation above is a symmetry of the Lagrangian once we include the gravitational counterterm (but not without it).
Example 5.4 (k = 8) We have (8) = 1, and so the system only has one unitary symmetry: charge conjugation. This is a Lagrangian symmetry.
The system is bosonic, and so it is not time-reversal invariant. One may regard the system as a spin TQFT, but 8 = 0 mod 4, and so it is not time-reversal invariant either.
As a spin TQFT, one has (4) + 1 = 2, and so the system has three unitary symmetries: charge-conjugation and multiplication by ±3. The latter are not Lagrangian symmetries.  Table 4: The group of unitary symmetries of the diagonal theory K = diag(k 1 , k 2 ), to wit, We thus have where U is either of (α, β) → (±3α, α + β) (the other sign being CU).
Example 5.5 (k = 12) We have (12) = 2, and so the system has three unitary symmetries: charge conjugation and multiplication by ±5. The latter are not Lagrangian symmetries.
The system is bosonic, and so it is not time-reversal invariant. One may regard the system as a spin TQFT, but 12 = 0 mod 4, and so it is not time-reversal invariant either.
As a spin TQFT, one has (6) + 1 = 2, and so the unitary symmetries are the same as in the bosonic case. They are not Lagrangian symmetries either.
We thus have where U denotes multiplication by either of ±5 (the other sign being CU), while fixing the local fermion, if any.
Example 5.6 (k = 15) We have (15) = 2, and so the system has three unitary symmetries: charge conjugation and multiplication by ±11. The latter are not Lagrangian symmetries.
The level can be factored as 15 = 3 · 5, and 3 = 1 mod 4, and so the system is not time-reversal invariant.
We thus have where U denotes multiplication by either of ±11 (the other sign being CU).
Example 5.7 (k = 24) We have (24) = 2, and so the system has three unitary symmetries: charge conjugation and multiplication by ±7. The latter are not Lagrangian symmetries.
The system is bosonic, and so it is not time-reversal invariant. One may regard the system as a spin TQFT, but 24 = 0 mod 4, and so it is not time-reversal invariant either.
As a spin TQFT, one has (12) + 1 = 3, and so the number of unitary symmetries is doubled. The new symmetries, those that mix the bosonic lines with the transparent fermions, are generated by multiplication by 13.
We thus have where U denotes multiplication by either of ±7 (the other sign being CU) while fixing the local fermion, if any, and U denotes multiplication by 13, while mixing the local fermion. The integer k = 25 is not Pell, and so the time-reversal permutation above is not a symmetry of the Lagrangian, not even if we include the gravitational counterterm. Example 5.9 (k = 65) We have (65) = 2, and so the system has three unitary symmetries: charge conjugation and multiplication by ±51. The latter are not Lagrangian symmetries.
The integer k = 65 is Pell, and so the permutation above is a symmetry of the Lagrangian once we include the gravitational counterterm (but not without it).
We now move on to 2 × 2 matrices. We denote by [a, b, c] the equivalence class (with respect to congruence) of all matrices of which a b b c is a representative. We begin with positive-definite K, and order them by det(K). (We recall that there can be more than one congruence class with a given value of det(K)). The transformation T is not a symmetry of the Lagrangian (because the central charge is 2), but it becomes one once we subtract two units of central charge (i.e., we consider the theory diag(K, −1, −1), which is dual to U (1) 2 × U (1) −1 ).
There are no other 2 × 2 congruence classes with determinant equal to 2.  the first one of which squares to C (and is thus of order 4), and the other two are of order 2.
As it turns out, all these symmetries can be generated from just the two matrices The non-trivial permutations are which are of order 6, 6, 2, 2, 2, respectively. The whole group can be generated from one of the order 6 permutations, and one of the order 2 ones. They satisfy U 6 1 = U 2 2 = 1, together with U 1 U 2 U 1 = U 2 , and so the group structure is dihedral:      A Notation and definitions.
For the convenience of the reader, we gather here some common definitions we use throughout the text. We denote by Z := {0, ±1, ±2, . . . } the set of all integers, and by T, P the two subsets T := {k ∈ Z | kp − q 2 = 1 for some p, q ∈ Z} P := {k ∈ Z | kp 2 − q 2 = 1 for some p, q ∈ Z} . (A.1) One has P ⊂ T ⊂ Z. All primes greater than 2 are odd, and so they can be written as 4n ± 1 for some integer n. Those of the form 4n + 1 are called Pythagorean (because they can be written as the sum of two squares, unlike those of the form 4n − 1, as per Fermat's theorem).
The function φ : Z → Z denotes the Euler totient function: φ(k) is the number of integers q such that 0 < q < k and gcd(q, k) = 1, where gcd denotes the greatest common divisor. In other words, there are φ(k) integers smaller than k that are comprime to it. This function is multiplicative, φ(ab) = φ(a)φ(b) for any a, b ∈ Z with gcd(a, b) = 1, and is given by φ(π n ) = π n−1 (π − 1) for prime π and integer n.
The function ω : Z → Z counts the number of distinct prime factors, i.e. the prime decomposition of a given k ∈ Z reads We also denote (  We denote by Z n×n the set of all integral n × n matrices, and by GL n (Z) ⊂ Z n×n the subset of invertible matrices over Z. A given matrix is invertible over Z if and only if its determinant is ±1, and so the elements of GL n (Z) are known as unimodular matrices.
Given some set A with some extra structure σ, we denote by Aut(A, σ) ⊆ S A the set of all permutations of A that "respect" the structure σ, and whose group operation is that inherited from S A (i.e., composition). For example, if × : A × A → A is a binary product such that (A, ×) is a group, then Aut(A, ×) is the set of permutations that are group homomorphisms. Similarly, if A is a group and θ : A → U (1) is a quadratic form on it, Aut(A, θ) denotes the set of automorphisms of A that leave θ invariant, perhaps up to complex conjugation: θ(π(a)) = θ(a) ±1 for all a ∈ A and π ∈ Aut(A). If the data (A, θ) comes from a Chern-Simons theory with matrix K, we also use the notation Aut(K) ≡ Aut(A, θ), or even Aut(U (1) k ) in the 1 × 1 case.
Given some unital ring A, we denote by A × the group of units of A -the set of its invertible elements. For example, one has GL n (Z) ≡ (Z n×n ) × .
The group Z k denotes the cyclic group of order k, which consists of the set {0, 1, . . . , k −1}, where the product operation is just addition, followed by reduction modulo k. One can also endow Z k with integer product, which makes it into a ring (integer product is not usually invertible); the group of units is denoted by Z × k , and its order is φ(k). We also recall some basic definitions from group theory, following [65].
Definition 2.1.3 Let N and G be groups. Then an action of G on N is a homomorphism θ : G → Aut(N ). This is described by saying that G acts on N or that N is a G-group.
Definition 2.1.4 Let G and N be groups such that G acts on N with action given by θ. Then the semi-direct product N θ G of N by G with this action is defined as follows. The underlying set of N θ G is G × N and the multiplication is defined by (g 1 , n 2 )(g 2 , n 2 ) = (g 1 g 2 , (n g 2 θ 1 )n 2 ).
Definition 2.3.1 Let G be a group and Ω a non-empty finite set. Then G acts on Ω if, to each ω ∈ Ω and g ∈ G, there corresponds a unique element ω g ∈ Ω such that, if g 1 and g 2 ∈ G then (ω g 1 ) g 2 = ω g 1 g 2 ; and ω 1 = ω. If G acts on Ω then the permutation representation of G corresponding to the action is the homomorphism ρ : G → Σ Ω , the symmetric group on Ω, defined by ω(gρ) = ω g for all ω ∈ Ω and all g ∈ G. f ∈ H Ω , define f g ∈ H Ω by ωf g = ω g −1 f for all ω ∈ Ω. The (permutational) wreath product H G of H with G corresponding to this action of G on Ω is the split extension H Ω G with this action of G on H Ω . Finally, we define a few important finite groups (see e.g. Definition 2.1.11 in [65]): • The dihedral group D 2n of order 2n is defined by • The semidihedral group SD 2 n+1 of order 2 n+1 is defined by • The symmetric group S n of order n!, corresponding to all the permutations of n objects, and its commutator subgroup A n , of order n!/2, known as the alternating group and given by the even permutations of S n . One has S n = A n Z 2 for n ≥ 5.

B Further results.
In this appendix we collect some further results concerning the theory U (1) k which may prove useful in subsequent studies of this system. We begin by making some remarks concerning the set T, defined as those integers k such that −1 is a quadratic residue modulo k, i.e., those integers for which the equation q 2 = −1 + pk is solvable for some integers p, q.
It is straightforward to show that any solution (p, q) is such that q is congruent to q 0 modulo k, where (p 0 , q 0 ) is a solution with q 0 ∈ [0, k). More precisely, if (p 0 , q 0 ) is a solution, then so is (P (n), Q(n)) for any n ∈ Z, where P (n) := p 0 + 2q 0 n + kn 2 Q(n) := q 0 + kn (B.1) as is easily checked. This is not particular to our problem; the solutions to congruences of the form f (q) = 0 mod k, for some polynomial f : Z → Z, are always defined modulo k. Generically speaking, this type of congruences are solved by first solving them modulo the prime divisors of k. Indeed, if k is to divide f (q), then so must its divisors. This means that the prime divisors of k are essential in deciding whether q 2 + 1 = 0 mod k is solvable or not. To be precise, one of the key results concerning the set T is the following: Proposition B.1 A given k is in T if and only if all its prime factors are Pythagorean (that is, congruent to 1 modulo 4), perhaps up to a single factor of 2.
Proof. By reducing kp = 1 + q 2 modulo 4, and considering the odd q and even q cases separately, it becomes clear that k cannot be a multiple of 4. Similarly, by Gaussian reciprocity, −1 is a quadratic residue modulo a prime π if and only if π is Pythagorean, and so k cannot be a multiple of a non-Pythagorean prime either. This proves that the conditions above are necessary; proving that they are also sufficient can be done by explicitly constructing a solution q. We now sketch how this can be done.
First off, if k is a Pythagorean prime, we can use Wilson's theorem to obtain an explicit expression for q. Indeed, satisfies q 2 = −1 mod k. One can also take where a is any of {±1, 2, 3}.
Lifting the solution to a prime power k = π n can be done using the Hensel lemma. If we let q 1 be the solution for n = 1, then the general solution can be obtained via the quadratic map q n = q n−1 − a(q 2 n−1 + 1) where a is a solution to 2q 1 a = 1 mod π (e.g., a = (2q 1 ) π−2 , as per Fermat's little theorem). Finally, finding a solution for arbitrary k requires the use of the Chinese Remainder Theorem. For example, let k = a 1 a 2 with a 1 , a 2 two prime powers. Then q 2 = −1 mod k requires q 2 = −1 mod a i , which by the previous paragraph has a solution q i . With this, the solution of q 2 = −1 mod k is q = q 1 α 1 a 2 + q 2 α 2 a 1 mod k, where α 1 , α 2 are the Bézout coefficients for a 1 , a 2 (i.e., a pair of integers such that a 1 α 1 + a 2 α 2 = 1, which can be computed using the Euclidean algorithm). By iteration we can easily find the solutions for an arbitrary integer k = a 1 a 2 . . . a n , and so the conditions in proposition B.1 are also sufficient.
The integers q that solve q 2 = −1 mod k implement the time-reversal permutations on the anyons of U (1) k . The lines a ∈ A that are fixed under time-reversal (modulo local operators) play a special role in analysing the time-reversal symmetry of a system (and its anomalies). We have the following: The only lines that satisfy T(a) ≡ a are the identity and the transparent fermion. If k is odd, no line satisfies T(a) = a × ψ, while if k is even, the only lines satisfying T(a) = a × ψ are a = k/2 × 1 and a = k/2 × ψ.
Proof. Any line fixed by T (perhaps up to ψ) has a = T 2 (a) = C(a). Let k be odd; then lines fixed by C satisfy 2α = 0 mod 2k, that is, α ∝ k. Both lines α = 0, k have T(α) = α, and so there are no lines with T(a) = a × ψ. Now let k be even; then lines fixed by C satisfy 2α = 0 mod k, that is, α ∝ k/2. One may check that a = (0, β) satisfies T(a) = a, and a = (k/2, β) satisfies T(a) = a × ψ.
We thus see that the property T 2 = C implies that the set of lines that are fixed by time-reversal is very small. More generally, it is possible to argue that, due to θ(T(a)) = θ(a) * , an anyon can only be fixed by T (perhaps up to ψ) if its spin is either θ(a) = ±1 or θ(a) = ±i, i.e., if h ∈ {0, 1 4 , 1 2 , 3 4 }. These are the bosons, fermions, semions, and anti-semions of the theory. For some purposes, it may be useful to know how many of these lines the theory supports. We have the following: Proposition B.3 Let k ∈ Z, and denote by N h the number of lines of spin h in U (1) k (as a spin TQFT), and by λ(k) the squarefree part of k. Then we have N 0 = N 1/2 = k/λ(k). Furthermore, if we write k = 2 ek , withk odd, then N 1/4 = N 3/4 = 0 if e is even, and N 1/4 = N 3/4 = k/λ(k) if odd.
Proof. We shall need the following trivial fact: given some integer k ∈ Z, all solutions to the equation α 2 = kβ, α, β ∈ Z (B.5) are of the form (α n , β n ) = (n kλ(k), n 2 λ(k)) for some integer n. Indeed, if kβ is to be a perfect square, then β must be proportional to λ(k); and the constant of proportionality must itself be a perfect square. We next count the bosons and fermions of U (1) k . We begin with the k odd case. An anyon α ∈ [0, 2k) has vanishing spin iff α 2 = 2kβ for some integer β. All the solutions to this equation are of the form α = n 2kλ(2k) for some integer n = 0, 1, . . . , bosons. Similarly, the fermions are given by the solutions to α 2 = k(2β + 1), that is, α = n kλ(k) with n = 1, 3, . . . , 2k−1 √ kλ(k) . Therefore, there are fermions. We now move on the the k even case. The bosons in the spin theory come from the bosons and fermions in the non-spin theory. The former solve α 2 = 2kβ and the latter solve α 2 = k(2β + 1). Together, they solve α 2 = kβ, that is, α = n kλ(k), with n = 0, 1, . . . , k−1 √ kλ(k) . Therefore, there are bosons. The counting of the fermions is identical. A very similar argument proves the claim for the semions. For k odd, the counting is straightforward. For k even, one is to count the spin 1/4 and 3/4 lines in the bosonic theory, which solve 2α 2 = k(2p + 1). Writing k = 2 ek , withk odd, it is clear that no solutions exist for e even (because √ 2 is not integral). For e odd, the solution is α = 2 (e−1)/2 n k λ(k), with n = 1, 3, . . . , We now move on to the so-called Pell numbers: Definition B.1 An integer k is said to be Pell if there exists a pair of integers p, q such that kp 2 − q 2 = 1. The set of Pell numbers is denoted by P.
• A squarefree integer k is Pell iff the fundamental unit σ of Q( √ k) has norm −1. The rest of units are of the form ±σ n for some integer n (see e.g. [66], theorem 11.4.1).
• k is Pell iff the convergents of √ k have odd period. If (p 0 , q 0 ) denotes the fundamental solution, then the rest of solutions are q n + p n √ k = (q 0 + p 0 √ k) 2n+1 (see e.g. [56], theorems 5.15 and 5.16). Equivalently, p n q n = q 0 p 0 kp 0 q 0 2n p 0 q 0 (B.10) (Note that the determinant of this matrix is −1, and so its odd powers generate positive norm units).
• k is Pell iff it can be written as k = a 2 + b 2 for relatively prime a, b ∈ Z, with b odd, and such that the Gauss-type Diophantine equation b(V 2 − W 2 ) − 2aV W = 1 is solvable with V, W ∈ Z [67].
Pell numbers appear naturally in the study of the time-reversal properties of U (1) k . For example, one has the following: as required.
Taking k = 1 leads to the invariance of U (1) k ×U (1) −1 (cf. proposition 3.6). Moreover, this result, together with conjecture 4.1, leads to the following interesting purely number-theoretic conjecture: Conjecture B.1 An integer k satisfies q 2 = −1 mod k for some q ∈ Z if and only if there exists some Pell integer k such that kk is also Pell.
Recall that any solution of q 2 = −1 + pk is of the form p = p 0 + 2q 0 n + kn 2 (cf. (B.1)). If p is Pell for some n, then it suffices to take k = p, from where the conjecture would follow (because kp = q 2 + 1 is automatically Pell). Noting that whenever this polynomial is prime, it is also Pell, our conjecture actually follows from the so-called Hardy-Littlewood "conjecture F" [69], which states that ax 2 + bx + c is prime infinitely often unless b 2 − 4ac is a perfect square or a + b and c are both even (neither condition being satisfied by our polynomials). It is widely believed that the Hardy-Littlewood conjecture is true, which implies that our conjecture -being much weaker -should be true as well.
There is a more specific result due to Lemke Oliver and Iwaniec [70,71] that states that a polynomial of the type above represent primes or semiprimes infinitely often. But any prime, or any semiprime π 1 π 2 with (π 1 , π 2 ) = −1 is Pell. Having no reason to expect otherwise, one is lead to conjecture that both options (π 1 , π 2 ) = ±1 appear with the same probabilitywhich is confirmed by numerical analysis -from where it would follow that p 0 + 2q 0 n + kn 2 generates infinitely many Pell numbers. In fact, the only possibility for a failure of our conjecture is that this polynomial never represents a prime (disproving the Hardy-Littlewood conjecture), and that all the semiprimes it represents have (π 1 , π 2 ) = +1. This is extremely unlikely, but we have no proof that it cannot happen.
In any event, we checked that the conjecture is true for k up to 10 9 . For now it remains an interesting open question.
If the conjecture is true, we can in fact invert the logic and use the time-reversal invariance of U (1) k × U (1) −k to argue that of U (1) k , for any k ∈ T, by mimicking the argument of proposition 3.5.