Discrete Theta Angles, Symmetries and Anomalies

Gauge theories in various dimensions often admit discrete theta angles, that arise from gauging a global symmetry with an additional symmetry protected topological (SPT) phase. We discuss how the global symmetry and 't Hooft anomaly depends on the discrete theta angles by coupling the gauge theory to a topological quantum field theory (TQFT). We observe that gauging an Abelian subgroup symmetry, that participates in symmetry extension, with an additional SPT phase leads to a new theory with an emergent Abelian symmetry that also participates in a symmetry extension. The symmetry extension of the gauge theory is controlled by the discrete theta angle which comes from the SPT phase. We find that discrete theta angles can lead to two-group symmetry in 4d QCD with $SU(N),SU(N)/\mathbb{Z}_k$ or $SO(N)$ gauge groups as well as various 3d and 2d gauge theories.


Introduction
Gauge theories often admit topological terms that assign different weights to different bundles in the partition function where v denotes different topological sectors. Some sectors might be absent in the sum if α v vanishes (see the examples in [1][2][3]). If α v is nonzero, it can be a discrete phase in some theories. We will refer to it as a discrete theta angle. Some examples were presented in [3].
In this note we discuss the general relation among families of gauge theories with different discrete theta angles. In particular, we will focus on their global symmetries and 't Hooft anomalies. 1 Theories with different discrete theta angles often arise from gauging a global symmetry in a quantum field theory with different symmetry-protected topological (SPT) phases. Gauging the symmetry sums over different topological sectors labelled by the gauge field. Let us denote two SPT phases by S and S ′ with partition functions α v , α ′ v , and their resulting theories after gauging the symmetry by T and T ′ . In such cases, the theories T and T ′ are related by coupling to a topological quantum field theory (TQFT). The TQFT is constructed by gauging the global symmetries in the SPT phase (S ′ − S) with the partition function α v (α ′ v ) * by summing over the topological sectors, When the symmetry being gauged is Abelian (for simplicity we will assume it to be discrete), the theories T , T ′ as well as the TQFT has a dual non-anomalous Abelian symmetry A.
Gauging the symmetry in the theories T and T ′ restricts the sum over the topological sector to a single term and recovers the original theory. More generally, one can use the dual symmetry A to couple the theory T to the TQFT by gauging the diagonal symmetry (1. 3) The coupling identifies the gauge fields in the theory T and in the TQFT so the theory after gauging is equivalent to T ′ with a different discrete theta angles.
We can then determine the properties of the theory T ′ from the theory T and the TQFT. Theories with different discrete theta angles form a family of theories. The difference between theories within a family is captured universally by the TQFTs that relate them. In this note we study these universal aspects that depend on the TQFTs. 2 We discuss several examples including gauge theories with or without matter in 3d and 4d.
In some examples, the symmetry that we gauge is a subgroup of a larger symmetry. If the larger symmetry is a non-trivial extension of the gauged subgroup and its quotient (in other words, not a direct product), we observe that the resulting gauge theories have different extensions of global symmetries and 't Hooft anomalies, that depend on the SPT phases i.e. the discrete theta angles for the gauged symmetry.
When the discrete theta angle vanishes, our results agree with the general discussion in [5], where a mixed anomaly is observed in the resulting gauge theory due to the symmetry extension in the original theory. On the other hand, for nonzero discrete theta angle we find such mixed anomaly can be absent.
When the symmetries involved in the extension are q-form symmetries with different degrees q [6], the global symmetry describes a higher-group [7][8][9]. We stress that in order to produce the symmetry extension, the original symmetry does not need to have an anomaly (and adding an SPT phase also does not change the anomaly of the theory ). This is a generalization of the discussion in [10,5,8,9], which describes a special case (gauging a symmetry without adding an SPT phase). It was shown that a mixed anomaly in the original symmetry produces a symmetry extension in the gauge theory, while here we find that the mixed anomaly is not necessary for the symmetry extension in the gauge theory. In particular, we show that theories with two-group symmetries can be constructed by gauging a subgroup symmetry that does not have a mixed anomaly with the remaining symmetry.
We use the method to study the global symmetry and its 't Hooft anomaly in various theories, including 3d gauge theory and 4d SU(N)/Z k and SO(N), Spin(N), O(N) gauge theories. SU(N)/Z k gauge theory in 4d has a discrete theta angle p with even pk [11,12] 2πp 2k P(w k 2 ), p = 0, 1, · · · 2k − 1 , (1.4) where w k 2 is the obstruction to lifting the bundle to an SU(N) bundle, and P is the Pontryagin square operation reviewed in Appendix B [13]. SO(N) gauge theory in 4d has a Z 4 discrete theta angle [11] 2πp 4 P(w (1) 2 ), p = 0, 1, 2, 3 , (1.5) where w (1) 2 is the obstruction to lifting the gauge bundle to a Spin(N) bundle. O(N) gauge theory in 4d has the discrete theta angle 2πp 4 2 ) + πr (w 1 ) 2 w 2 , p = 0, 1, 2, 3, r = 0, 1 , (1. 6) where w 1 , w are the first and second Stiefel-Whitney classes of the O(N) bundle. The TQFTs corresponding to these discrete theta angles are two-form and one-form gauge theories (see Section 2 and C for details). In particular, we find two-group symmetries or symmetry extension that depends on the discrete theta angles of the gauge theory. Some examples are • 4d SU(N)/Z k gauge theory with discrete theta angle p and N f massless Dirac fermions in the tensor representation with r boxes in the Young tableaux that satisfies the relation gcd(N, r) = k. The theory has Z k magnetic one-form symmetry, and the flavor 0-form symmetry where the various quotients are explained in section 3.3. The one-form symmetry and the flavor symmetry combines into a two-group symmetry with Postnikov class 3 Θ = pBock(w f 2 ) , (1.9) where w f 2 is the obstruction associated with the Z N/k quotient in the flavor symmetry background gauge field, and Bock is the Bockstein homomorphism for the short exact sequence 1 → Z k → Z N → Z N/k → 1.
• 4d SO(N) gauge theory with discrete theta angle p and N f massless Weyl fermions in the vector representation, with even N and N f . The theory has a flavor symmetry and Z 2 charge conjugation symmetry that extends the SO(N) gauge field to O(N) gauge field. The theory also has a Z 2 electric one-form symmetry. The symmetries combine into a two-group symmetry with Postnikov class where w f 2 is the obstruction associated with the Z 2 quotient in the flavor symmetry, and B C 1 is the background gauge field of the charge conjugation symmetry. Bock denotes the Bockstein homomorphism for the short exact sequence 1 → Z 2 → Z 4 → Z 2 → 1.
• 3d Z N gauge theory with discrete theta angle given by Chern-Simons level k, obtained by gauging a Z N normal subgroup 0-form symmetry in a system with G 0-form symmetry. G is the group extension 1 → Z N → G → G → 1 described by η 2 ∈ H 2 (G, Z N ). We assume the Z N subgroup symmetry is non-anomalous and there is no 3 For one-form symmetry G (1) and 0-form symmetry G (0) , the Postnikov class Θ ∈ H 3 (G (0) , G (1) ) expresses how the zero-form and one-form symmetries combine in terms of their backgrounds B 1 , B 2 where δ is the differential (the coboundary operator for C * (M, G (1) ) on spacetime M ) and B * 1 Θ is the pullback of Θ. mixed anomaly between Z N and G. The new theory has two-group symmetry that combines the emergent Z N dual one-form symmetry generated by the Wilson line and G 0-form symmetry, with the Postnikov class Θ = kBock(η 2 ) , (1.12) where Bock is the Bockstein homomorphism for 1 → Z N → Z N 2 → Z N → 1.
• 2d Z 2 gauge theory with discrete theta angle given by p times the quadratic refinement from the Arf invariant [14][15][16] 4 where p = 0, 1, obtained by gauging a Z 2 normal subgroup 0-form symmetry in a system with G 0-form symmetry. G is the group extension 1 → Z 2 → G → G → 1. We assume the Z 2 subgroup symmetry is nonanomalous and there is no mixed anomaly between Z 2 and G. If p = 0, the new theory does not have discrete theta angle and it has Z 2 × G symmetry, while if p = 1 the theory has discrete theta angle given by the Arf invariant and the symmetry is the extension G.
In Section 2, we review the global symmetry and its anomaly in 4d two-form gauge theory, and then study the symmetry in QFTs that couple to the two-form gauge theory. The two-form gauge theory controls the discrete theta angle of the QFTs. In Section 3, we apply the results in Section 2 to study the symmetry in 4d SU(N)/Z k gauge theory with discrete theta angle. In Section 4, we discuss the symmetry in 4d gauge theory with Spin(N), SO(N), O(N) gauge groups, and determine how the symmetry and its anomaly depends on the discrete theta angles. In Section 5, we review the symmetry and its anomaly in Z N gauge theory, and then discuss how symmetry depends on the discrete theta angle when we gauge a Z N zero-form symmetry in 3d. In Section 6, we discuss more examples of 3d gauge theories with discrete theta angles and examine their global symmetry. In Section 7, we discuss gauging Z 2 zero-form symmetry in 2d with or without a discrete theta angle given by the Arf invariant, and we find that the symmetry extension and 't Hooft anomaly depends on the discrete theta angle.
There are several appendices. In Appendix A we summarize some mathematical backgrounds for cochains and cohomology operations. In Appendix B we describe the symmetry extension from the analogue of the Green-Schwarz mechanism using discrete notation for discrete gauge fields. In Appendix C we discuss the symmetry in a class of TQFTs that can be defined in any spacetime dimension by generalizing the two-form gauge theory discussed in Section 2. In Appendix D we discuss gauging Z 2 × Z 2 symmetry in 2d Ising × Ising model with or without discrete torsion labelled by H 2 (Z 2 × Z 2 , U(1)) = Z 2 .
4 It is the non-trivial fermionic SPT phase with unitary Z 2 symmetry (in addition to the fermion parity) in 2d described by the generator in Ω 2 Spin (BZ 2 ) = Z 2 2 which is not the generator of the fermionic SPT phase without any symmetry other than the fermion parity [17,18] where pN is an even integer and b is a U(1) two-form gauge field with a constraint The coefficient p is an integer with the identification p ∼ p + 2N, for more details see [12]. As discussed in [20,6,12], the theory has a Z N one-form and a Z N two-form symmetry for p = 0. In the following we will review how the symmetries are deformed when p is non-zero. Denote the background gauge fields for the higher-form symmetries by a Z N 2-cochain B 2 and a Z N 3-cocycle Y 3 . We use the continuous notation to embed them in U(1) two gauge fields B 2 and Y 3 . The Z N 2-cochain B 2 couples to the system through the following term in the action The topological action (2.1) and the coupling (2.3) has a bulk dependence The first term involves dynamical gauge fields so it has to be removed. It can be achieved by demanding the following relation between the backgrounds for a Hamiltonian model realization of such theory. 6 We will use variables without a hat, such as b, to denote a discrete gauge field and the corresponding variables without a hat, such as b, to denote its embedding in a U (1) gauge field such that b = 2π N b. The former will be referred to as the discrete notation while the later will be referred to as the continuous notation. The subscript denotes the degree of the gauge fields. We will omit ∧'s between U (1) gauge fields and ∪'s between discrete gauge fields. This implies that for gcd(N, p) = 1, the background Y 3 is non-trivial while p Y 3 is trivial. When gcd(N, p) = 1, the symmetry has an 't Hooft anomaly given by the bulk term for the background fields: When gcd(N, p) = 1, the background Y 3 is trivial and the bulk dependence (2.7) can be removed by a local counterterm (Nα/4π) 4d B 2 B 2 of the background fields with integer α that satisfies αp = 1 mod N, and thus it does not represent a genuine 't Hooft anomaly.
The above computation is repeated using discrete notation in appendix B. In discrete notation, the backgrounds obey δB 2 + pY 3 = 0 , (2.8) and the anomaly is 2π

Symmetry enrichment
The two-form gauge theory can couple to background gauge fields for other global symmetries, such as 0-form symmetries, through symmetry enrichment [22][23][24][25][26][27]. This arises naturally when the two-form gauge theory is the low energy effective theory of some ultraviolet theories. In such scenario, the ultraviolet symmetry is realized in the infrared by their actions on extended operators in the two-form gauge theory.
We can describe the coupling using the background gauge field B 2 , Y 3 of the Z N one-form and Z N two-form symmetries in the two-form gauge theory that obey where δ is the coboundary operator on C * (M, Z N ) for spacetime M.
For instance, we can couple the gauge theory to background gauge fields X 1 for 0-form symmetry G (0) and X 2 for one-form symmetry G (1) by [9,4] If gcd(p, N) = 1, the low energy TQFT has non-trivial line and surface operators obeying Z gcd(p,N ) fusion algebra and the symmetries G (0) , G (1) act on these operators. For instance, if f, g, h is the trivial homomomorphisms and p = 0, non-trivial η 2 represents symmetry fractionalization for G (0) on the line operators. Similarly, non-trivial η 3 represents a world-volume anomaly on the surface operator charged under the two-form symmetry.
On the other hand, if gcd(p, N) = 1, the two-form gauge theory is an invertible TQFT, and the symmetries G (0) , G (1) only acts in the UV.
The symmetries G (0) , G (1) in general has a mixed anomaly with the Z N one-form symmetry depending on p and f, g, h, η i . This is given by the anomaly As we will see, the mixed anomaly will be important for determining the symmetries in the theories coupled to the two-form gauge theory.

Couple QFT to two-form gauge theory
Suppose we start with a 4d theory with a non-anomalous Z N one-form symmetry, and then gauge the symmetry. We have a freedom of adding an SPT phase for the Z N two-form gauge fields with the action (2.1) labelled by p. This leads to a theory with a discrete theta angle p, which we will denote by T p . These theories are related by (2.14) As a special case with k = 0, the theories T p with discrete theta angle and T 0 without discrete theta angle are related.
Let us discuss the relations between the symmetries in T p and T 0 . The symmetry in T 0 might have a mixed anomaly with the Z N one-form symmetry. When gauging the diagonal Z N one-form symmetry, this contributes a non-trivial bulk dependence involving the dynamical gauge field. On the other hand, the two-form gauge theory also contributes a non-trivial bulk dependence (2.13) involving the dynamical gauge field. The two bulk dependence cancel to give a well-defined 4d theory, and the cancellation might require the background gauge fields to obey certain constraints. This implies that the symmetries of T p and T 0 might be different. We will see many examples of this phenomenon in the rest of the discussions.

Gauging Z k ⊂ Z N subgroup one-form symmetry
Let us start with a theory in 4d with a non-anomalous Z N one-form symmetry and then gauge a Z k subgroup of the symmetry. We can add an SPT phase for the Z k one-form symmetry with the action (2.1) labelled by a Z 2k coefficient p [12].
Let us first discuss the symmetry of the theory T 0 with p = 0. The theory has an emergent Z k dual one-form symmetry generated by the "Wilson surface" of the Z k twoform gauge field. In addition, there is a remaining Z N /Z k = Z N/k one-form symmetry. Denote the background two-form gauge fields for the Z N/k × Z k one-form symmetries by B e 2 , B m 2 . The two one-form symmetries have a mixed anomaly described by the 5d SPT where Bock is the Bockenstein homomorphism of the exact sequence 1 → Z k → Z N → Z N/k . The anomaly arises from the symmetry extension in the original theory [5]. As a check, gauging the emergent Z k dual one-form symmetry recovers the Z N one-form symmetry in the original theory. Promoting the Z k gauge field B m 2 to a dynamical gauge field introduces an emergent Z k two-form gauge field B ′e 2 that couples as 2π To cancel the gaugeglobal anomaly (2.16), the background gauge fields obey It recovers the Z N two-cocycle k B ′e 2 + B e 2 that serves as the background for the Z N one-form symmetry in the original theory, where tilde denotes a lift to a Z N cochain.
Next, we study the symmetry in the theory T p with discrete theta angle p. The theory is related to T 0 by Gauging the diagonal Z k one-form symmetry sets where b m 2 is the dynamical gauge field for the diagonal one-form gauge symmetry and B ′m 2 is the background gauge field for the residue Z k one-form symmetry. The bulk dependence 7 The anomaly has order gcd(k, N/k) i.e. this many copies of the system has trivial anomaly. To see this, note that there exists integers α, β such that gcd(N/k, k) = αk + βN/k. Thus multiplying the mixed anomaly by gcd(N/k, k) gives where the tilde denotes a lift to a Z co-chain. This is consistent with the property that if gcd(N/k, k) = 1, of the theory has two contributions from (2.7) and (2.16) We remove the gauge-global anomaly by imposing the following constraint (2.20) The backgrounds B 2 , Y 3 in the Z k two-form gauge theory satisfy (2.10). Thus the background gauge fields B e 2 , B ′m 2 in T p satisfy What's the symmetry described by such backgrounds? The relations between backgrounds can be translated into relations between symmetry charges. Denote the generators that couple to B ′m 2 and B e 2 by U and V respectively, then we have the following relations In particular, U generates the emergent Z k one-form symmetry, which is dual to the Z k one-form symmetry that we gauged in the first place. For p = 0, V generates a Z N/k one-form symmetry and the total one-form symmetry is the direct product Z N/k × Z k . For generic p, the total one-form symmetry is no longer a direct product; rather it becomes an extension of the Z N/k one-form symmetry by the Z k one-form symmetry. For instance, when p = 1 the total one-form symmetry is Z N , generated by V . In general, the symmetry group can be expressed as the quotient of Z × Z by the group generated by the columns of the following matrix N/k p 0 k . (2.23) The matrix can be put into Smith normal form with J = gcd(k, N/k, p), by multiplying SL(2, Z) matrices from the left and the right. The resulting quotient group is invariant under the transformation. Hence the one-form symmetry is For p = 0, the one-form symmetry is Z gcd(N/k,k) ×Z N/ gcd(N/k,k) ∼ = Z k ×Z N/k which reproduces the symmetry in T 0 . 8 Substituting the relation (2.20) back to (2.19) gives the bulk dependence of the theory T p that describes the 't Hooft anomaly: The bulk dependence is defined up to local counterterms on the boundary. Denote In particular, there is no mixed anomaly for L = 1, but a non-trivial anomaly for L = 1.
In section 3 and section 4, we will apply the above analysis to pure SU(N)/Z k and SO(N) gauge theory.

Gauging Z k one-form symmetry in two-group
Let us consider gauging a Z k one-form symmetry that is part of a two-group symmetry with 0-form symmetry G and Postnikov class Θ. Denote the background gauge field for the 0-form symmetry by B 1 , and the gauge field for the Z k one-form symmetry by b. The two-group symmetry implies where δ is the differential (coboundary operator) acting on C * (M, Z k ) for spacetime M. We can also add an SPT phase labelled by p for the one-form symmetry when gauging the symmetry.
x ′ = αx + βy mod ℓ, y ′ = −(n/ℓ)x + (m/ℓ)y mod mn/ℓ . The inverse map is x = (m/ℓ)x ′ − βy ′ mod m, y ′ = (n/ℓ)x ′ + αy ′ mod n . (2.27) Let us begin with p = 0. The theory has an emergent dual Z k one-form symmetry generated by exp( 2πi k b), whose background gauge field we will denote by B 2 . The two-group symmetry implies that the emergent dual Z k one-form symmetry has a mixed anomaly with the 0-form symmetry G [5,9] 2π Next, let us consider theory with non-zero p by coupling the p = 0 theory to the twoform gauge theory with action labelled by p. From a similar analysis as in section 2.2.1, we obtain the constraint The constraint (2.10) in the Z k two-form gauge theory implies that the backgrounds B 2 , B 1 satisfy the constraint Thus we find that the theory after gauging the one-form symmetry has different two-group symmetries depending on the SPT phases (labelled by p). More precisely, the one-form symmetry is Z k and the 0-form symmetry is G for all p, but the new Postnikov class Θ (p) (that specifies how the one-form and 0-form symmetries "mix") depends on p as follows The anomaly for the new two-group symmetry can be derived in a similar way as before, given by where L = gcd(p, k).

Bundle and classical action
The topology of an SU(N)/Z k bundle, with k a divisor of N, is characterized by the instanton number and the Z k discrete magnetic flux w k 2 ∈ H 2 (M, Z k ) where M is the spacetime manifold. 9 The magnetic flux w k 2 can be understood as the obstruction to lifting the bundle to an SU(N) bundle. When w k 2 vanishes, the bundle can be lifted to an SU(N) bundle. The instanton number is related to the magnetic flux by [11,20,6,12,29] 1 where F is the field strength, and P(w k 2 ) is the Pontryagin square operation (reviewed in appendix (B)).
The gauge theory can include two topological terms in the action: a continuous θ angle that multiplies the instanton number and a discrete Z 2k theta angle p with pk being even The theta angles are subjected to an identification For even k, the theories with discrete theta angle p and p + k differ by where w 2 (T M) is the second Stiefel-Whitney class of the tangent bundle. Thus the only difference is that the spin of the magnetic line (with odd S 2 w k 2 on S 2 that surrounds the line) differs by 1/2. If we consider gauge theory with fermions on a spin manifold (where w 2 = 0), then p can be restricted to a Z k coefficient for both k even and odd, since one can modify the magnetic line by a gravitational spin 1/2 line.

Global symmetry
The theory with discrete theta angle p has the following spectrum of line operators [11].
where W, T are the basic Wilson and 't Hooft lines.
The one-form symmetry of the pure gauge theory was analyzed in appendix C of [6], We can then identify the trivial charges U k and V N/k U −p . This reproduces the relation (2.22), and thus matches the one-form symmetry (2.25). The one-form symmetry has an 't Hooft anomaly, given by (2.31). The symmetry and 't Hooft anomaly of an SU(N)/Z k gauge theory have been discussed in [30]. Our results are in complete agreement.
3.3 Two-group symmetry in SU (N ) and SU (N )/Z k QCD with tensor fermions Let's consider SU(N) QCD with N f Dirac fermions of equal mass in the representation R with r boxes in its Young Tableau. For simplicity we assume that the representation R is complex. We first discuss the case when the fermions are massive with the same mass. The discussion is similar in the massless case. The theory has a Z k one-form symmetry with k = gcd(N, r) and a flavor symmetry The fermion transforms under the group where SU(N) is the gauge group, and the Z N/k quotient identifies Activating the background B 2 for the Z k one-form symmetry modifies the SU(N) gauge bundle to an SU(N)/Z k bundle. More generally, we can simultaneously activate B 2 and the background B 1 for the G (0) flavor symmetry. Due to the identification (3.10), if B 1 is a G (0) background that can not be lifted to a G (0) background, the background B 2 is necessarily activated. The backgrounds B 1 , B 2 modify the gauge bundle to a P SU(N) bundle [31] described by where w 2 (P SU(N)) is the obstruction to lifting the gauge bundle to an SU(N) bundle, tilde denotes a lift to Z N cochain, and w f 2 denotes the obstruction to lifting the G (0) background to a G (0) background. This implies that the background satisfies a relation Thus SU(N) QCD with N f massive fermions in representation R has a two-group symmetry that combines the Z k one-form symmetry and the flavor symmetry G (0) , as described by the Postnikov class When the fermions are massless, the flavor symmetry G (0) is enlarged to Here I(R) is the index of the representation R. 10 The quotient in G (0) introduces the following identification (3.16) The fermion transforms under the group where SU(N) is the gauge group and the Z N/k quotient identifies The index is defined as Tr R (T a T b ) = δ ab I(R)/(2h ∨ G ) with h ∨ G the dual Coxeter number and T a normalized such that Tr adj (T a T b ) = δ ab . The index for the fundamental representation and the adjoint representation is 1 and 2N respectively. Similar to the massive theory, the massless QCD also has a two-group symmetry that combines the Z k one-form symmetry and the enlarged flavor symmetry G (0) in (3.15). The corresponding Postnikov class is still given by (3.14) with w f 2 now being the obstruction to lifting the G (0) background to a G (0) background with G (0) , G (0) in (3.15).

SU(N)/Z k QCD
Next, we gauge the Z k one-form symmetry with an SPT phase labelled by p for the Z k two-form gauge field. This turns the theory into an SU(N)/Z k gauge theory with discrete theta angle p that couples to N f Dirac fermions in representation R. The theory has the G (0) symmetry (3.9) and a magnetic Z k one-form symmetry whose background is denoted by B m .
Following the discussion in section 2.2.2, the background gauge fields satisfy a constraint which describes a two-group symmetry that combines the Z k one-form symmetry and the flavor symmetry G (0) , with Postnikov class that depends on the discrete theta angle The two-group symmetry has a mixed anomaly where L = gcd(p, k). In particular, there is no mixed anomaly if L = 1 but a non-trivial anomaly otherwise.
When the fermion mass is large, the theory flows to an SU(N)/Z k pure gauge theory with an accidental electric one-form symmetry. The two-group symmetry and the anomaly is realized by the symmetry enrichment B e = B * 1 w f 2 . In the ultraviolet theory, one can interpret the relation as an explicit breaking of the center one-form symmetry by the screening from the fermion fields.

4d gauge theories with so(N ) Lie algebra
In this section, we will discuss 4d gauge theories associated with so(N) Lie algebra, including Spin(N), SO(N) and O(N) gauge theories.

Bundle
The gauge bundles associated with so(N) Lie algebra were reviewed in [3]. Here we briefly summarize their topology which are characterised by the Stiefel-Whitney characteristic The O(N) group has the largest set of possible bundles. They are characterized by w 1 and w (1) 2 , where w 1 is the obstruction to restricting the bundle to an SO(N) bundle while w (1) 2 is the obstruction to lifting the bundle to a P in + (N) bundle. All the SO(N) bundles can be constructed by restricting the O(N) bundles whose w 1 vanishes. The SO(N) bundles are then characterized by w (1) 2 , which is the obstruction to lifting the bundle to an Spin(N) bundle. All the Spin(N) bundle can be constructed by lifting the SO(N) bundles whose w ∈ H 2 (M, Z 2 ), which is the obstruction to lifting the bundles to O(N) bundles. The characteristic classes w where Bock is the Bockstein homomorphism associated with the extension 1 → Z 2 → Z 4 → Z 2 → 1. The constraint can be understood from the properties of the Spin(N) group.
For even N, Spin(N) has a center of order 4 (Z 2 × Z 2 for N = 0 mod 4 and Z 4 for N = 2 mod 4). The obstruction to lifting a P O(N) bundle to an Spin(N) bundle is then characterized by w where tilde denotes the lift to a Z 4 cochain. This leads to the first term in the constraint (4.1).
The Spin(N) group has a Z 2 charge conjugation outer-automorphism. It acts nontrivially on the center of Spin(N) for even N. To see this, we can consider the semi-direct product group P in + (N) = Spin(N) ⋊ Z 2 . Its center is Z 2 for even N [32][33][34][35]. It implies that the charge conjugation outer-automorphism acts non-trivially on the center of Spin(N) leaving a Z 2 subgroup invariant. This leads the second term in the constraint (4.1).
Without loss of generality, we will always assume even N in the rest of the section unless specified. The discussions can be applied to the odd N cases simply by setting w

Classical action 4.2.1 Continuous theta angle
Both Spin(N) and SO(N) gauge theories have continuous θ angle that multiplies the instanton number. In Spin(N) gauge theory it is 2π periodic, while in SO(N) gauge theory it is 4π periodic on a non-spin manifold but 2π periodic on a spin manifold [29]. The difference between θ and θ + 2π is that the basic 't Hooft line in the SO(N) gauge theory differs in their spin by 1/2, and thus they are indistinguishable on spin manifolds (or in a fermionic theory) where the theory has gravitational fermion line that can be used to modify the line operators without changing the dynamics.

Discrete theta angles
Spin(N) gauge theory does not have any discrete theta angle while SO(N) gauge theory admits discrete theta angle where p is a Z 4 coefficient. The theta angles are subject to the identification [29] (θ, p) ∼ (θ + 2π, p + 2), and p ∼ p + 4 . The theories with p and p + 2 differ in the spin of the basic 't Hooft lines. 11 Hence they are indistinguishable on spin manifolds. As discussed in [11], the theories with p = 0, denoted by SO(N) + and p = 1, denoted by SO(N) − have different line operator spectrum.
O(N) gauge theory has an additional discrete theta angle given by where r is a Z 2 coefficient and Bock is the Bockstein homomorphism for 1 → Z 2 → Z 4 → Z 2 → 1. This is an analogue of the topological term π w 1 w 2 in 3d O(N) gauge theory discussed in [36,3]. 12 11 This follows from the identity π w is the second Stiefel-Whitney class of the tangent bundle. 12 On orientable manifold, π w 3 w 1 = π Bock(w 2 w 1 ) = 0 mod 2πZ, and thus the π w 3 w 1 term is trivial.

Global symmetry 4.3.1 Spin(N) gauge theory
The theory has an electric one-form symmetry A determined by the center of the gauge group: (4.5) Denote the background for the Z 2 subgroup one-form symmetry by B (1) 2 . For even N, the one-form symmetry includes an additional Z 2 factor whose background is denoted by B (2) 2 . The theory also has a Z 2 0-form charge conjugation symmetry C whose background is denoted by B C 1 . Activating only the charge conjugation background twists the gauge bundle to a P in + (N) bundle. More generally, we can activate all these background which twists the gauge bundle to a P O(N) bundle with the characteristic classes The constraint (4.1) then implies the following relation We can also couple the theory to a different Z 2 background gauge field B 1 through a non-trivial symmetry fractionalization In such case, the lines charged under the Z 2 one-form symmetry that couples B 2 , such as the Wilson lines in the spinor representations, are in the projective representation of the Z 2 symmetry whose generator becomes of order 4. Activating this Z 2 background twists the gauge bundle to a P in − bundle with w (1) 2 = w 1 ∪ w 1 . This is consistent with the properties of the P in − (N) bundles [15].
All of these global symmetries do not have 't Hooft anomalies i.e. they can be gauged. Gauging the charge conjugation symmetry extends the gauge group to P in + (N) while gauging the Z 2 symmetry with non-trivial fractionalization extends the gauge group to P in − (N).

SO(N) gauge theory
SO(N) gauge theory can be constructed from Spin(N) gauge theory by gauging the Z 2 subgroup one-form symmetry that does not transform the Wilson lines in the vector representations (as opposite to Wilson lines in the spinor representations). For N = 2 mod 4, it gauges the Z 2 subgroup of the Z 4 one-form symmetry while for N = 0 mod 4, it gauges one of the Z 2 's of the Z 2 × Z 2 symmetry.
The theory has a Z 4 discrete theta angle p. The theories with p and p + 2 are related by the coupling π w (1) 2 ∪ w 2 which shifts the spin of the basic 't Hooft line by 1/2. The theory has an emergent dual Z 2 magnetic one-form symmetry whose background is denoted by B m 2 . The full one-form symmetry depends on the discrete theta angle, following from (2.25). It is summarized in table 1. The theory still has the Z 2 charge conjugation symmetry whose background is B C 1 . It acts as a Z 2 outer-automorphism on the one-form symmetry when N is even. For even N the background gauge fields satisfy where B (2) 2 is the background for the remaining electric one-form symmetry. The backgrounds are independent when p is even, but are correlated when p is odd. In particular, activating B (2) 2 and B C 1 necessarily activates B m 2 . Let us discuss the 't Hooft anomaly of these symmetries. For odd N there is no 't Hooft anomaly. For even N, the anomaly depends on the discrete theta angle p • When p = 0, the symmetries have an 't Hooft anomaly. The relation (4.1) implies that in the presence of the backgrounds B 2 and B C 1 , the coupling to the background B m 2 for the magnetic one-form symmetry is not well-defined: it depends on the bulk by π δw The theory flows to the Z 2 two-form gauge theory (2.1) with p = 0 in the infrared [11]. The anomaly is matched by the symmetry fractionalization map • When p = 1, the symmetries have no 't Hooft anomaly. The anomaly (4.10) can be removed by adding the local counterterm π 2 P(B m 2 ). The topological terms in the action 2 ) + π w 11) odd N N = 2 mod 4 N = 0 mod 4 even p Table 1: One-form symmetry in SO(N) pure gauge theory with discrete theta angle p.
then becomes well-defined since w SO 2 + B m is a Z 2 two-cocycle.
Let us now discuss gauging the Z 2 magnetic one-form symmetry in the SO(N) gauge theory. The gauging promotes the gauge field B m 2 to a dynamical gauge field b m 2 . We can introduce a new Z 2 two-form background gauge field B ′ 2 that couples to the theory as π b m 2 B ′ 2 . We again have the freedom to include an additional SPT phase, p ′ π 2 P(b m 2 ) with p ′ = 0, 1: • p ′ = 0. The gauge field b m 2 acts as a Lagrangian multiplier that forces w 2 = 0 thus we recover the Spin(N) gauge theory. To cancel the bulk dependence (4.10), the background fields are constrained such that 2 ) + B 2 B C 1 .
2 . Hence the full symmetry in Spin(N) gauge theory is recovered. The discussion also applies to the p = 1 case since the local counterterm for b m 2 is fixed and no longer can be used to cancel the bulk dependence. When p = 1, the symmetry extension (4.9) in the SO(N) gauge theory implies that the coupling π b m B ′ 2 is not well-defined but has a bulk dependence 2 ) + B which can be cancelled by the classical local counterterm (π/2) P(B ′ 2 ). We conclude that gauging the Z 2 magnetic one-form symmetry with p ′ = 0 recovers the original non-anomalous symmetries of the Spin(N) gauge theory.
• p ′ = 1. After gauging, the resulting theory is equivalent to an SO(N) gauge theory with a shifted discrete theta angle p → p − 1. This follows from the fact that the TQFT for b m 2 with p ′ = 1 is invertible so we can integrate out b m 2 as 2 )+π w 2 )+ π 2 P(b ′m 2 ) , (4.14) where the last term is a decoupled invertible TQFT of a Z 2 two-form gauge field b ′m 2 .
Let us now show how the symmetry and anomaly for theories with different p are related by such gauging. If we start with the p = 0 theory, δb m 2 = 0 so the action is well-defined only if the combination w 2 + B ′ 2 is closed. This imposes the following constraints on the background 2 ) + B 2 . On the other hand, if we start with the p = 1 theory, is well-defined if δB ′ 2 = 0. The action has a bulk dependence 2 ) + B which agrees with the 't Hooft anomaly of the SO(N) gauge theory with even p if we identified B ′ 2 with B 2 . We conclude that gauging the Z 2 magnetic one-form symmetry with p ′ = 1 reproduces the symmetry and anomaly of the SO(N) gauge theory with a shifted discrete theta angle p → p − 1.

O(N) gauge theory
The O(N) gauge theory can be constructed from the SO(N) gauge theory by gauging the Z 2 charge conjugation symmetry. The theory has the following symmetries • Z 2 magnetic one-form symmetry generated by exp(iπ w 2 ). Denote its background by B m 2 .
• Z 2 two-form symmetry generated by exp(iπ w 1 ). Denote its background by B 3 .
These symmetries are free of 't Hooft anomaly and can be gauged.
If N is even, the theory has an additional electric one-form symmetry. Denote its background by B 2 . Depending on the discrete theta angles (p, r) in (4.2)(4.4), the center one-form symmetry can form different symmetry groups with the other symmetries and they can have non-trivial 't Hooft anomaly as discussed below. We will always assume that N is even.
(p,r)=(0,0): no discrete theta angles. The electric one-form symmetry is Z 2 . Its background B 2 ) + B Thus the coupling is no-longer well-defined. We can extend the fields to the bulk, then these terms have the bulk dependence 2 ) + B where the part that represents a gauge-global anomaly can be cancelled by π w 1 B 3 with the modified cocycle condition This can be interpreted as a three-group symmetry. The classical term in the bulk is the SPT phase that describes the 't Hooft anomaly for the 3-group symmetry: 2 )B m 2 . (4.24) (p,r)=(0,1). In addition to the bulk dependence (4.22), the topological term of r = 1 also contributes to the bulk dependence 2 ) + π B where the first term is trivial on orientable manifolds (whose first Stiefel-Whitney class w 1 vanishes). The last term represents a gauge-global anomaly. One can attempt to cancel it using the coupling π Y 1 (w 1 ) 3 , which leads to the relation It implies that the background B (2) 2 is trivial. Hence the electric one-form symmetry is explicitly broken. Another way to see this is by examining the one-form symmetry transformation B 2 + w 1 λ due to the constraint (4.20), and accordingly transforms the topological term of r = 1 by This implies that the one-form symmetry transformation is broken by the point operators which carry non-trivial flux exp(iπ S 3 (w 1 ) 3 ) = −1 on the S 3 surrounding it. 13 Thus in contrast to the case (p, r) = (0, 0), the symmetries do not form a three-group, and the anomaly (4.24) vanishes since B 2 ) + B 2 w 1 (4.28) It represents a gauge-global anomaly. One can attempt to cancel the second term using the coupling π w It implies that the background B (2) 2 is trivial. Hence the electric one-form symmetry is explicitly broken. It is violated by the point operators that carry non-trivial flux exp(iπ S 3 w 1 w 2 ) = −1 on the S 3 that surrounds it. Thus in contrast to the previous case (p, r) = (0, 0), the symmetries do not form a three-group, and the anomaly (4.24) vanishes since B (2) 2 vanishes. 13 As discussed in section 4.3 of [5], this anomalous transformation (4.27) can be interpreted as a gauge anomaly π 3d (w 1 ) 3 on the worldvolume of the one-form symmetry defect (which is a surface operator). This gauge anomaly can be cancelled by introducing a non-trivial TQFT coupled to w 1 on the worldvolume of the surface operator, which gives rise to non-invertible defects.
(p, r) = (1, 1). The theory has three contributions (4.22), (4.25), (4.28) to its bulk dependence. The gauge-global anomaly implies that the electric one-form symmetry is broken explicitly by the operator with non-trivial flux exp iπ S 3 (w 1 w Thus in contrast to the case (p, r) = (0, 0), the symmetries do not form a three-group, and the anomaly (4.24) vanishes since B

Two-group symmetry in Spin(N ) QCD with vector fermions
Consider Spin(N) gauge theory with N f massless Weyl fermions in the vector representation. The theory has mesons ψ a I ψ a J and baryons ǫ a 1 ···a N ψ a 1 I 1 · · · ψ a N I N as local operators where I, J = 1, · · · , N f and a 1 , a 2 · · · = 1, · · · N are flavor and color indices.
The baryons are charged under a Z 2 charge conjugation symmetry. We will denote the symmetry by Z C 2 and denote its background by B C 1 . Two baryons can annihilate into mesons using the identity When N is even, the (−1) F symmetry, which is a Z 2 subgroup of the flavor symmetry, can be identified with a gauge rotation in the center of the gauge group and thus acts trivially on the local operators. When N is odd, the (−1) F symmetry is identified with the charge conjugation symmetry. In summary, the ordinary global symmetry is We will focus on the cases when both N and N f are even. The background for the flavor symmetry can be decomposed into a P SU(N f ) gauge field A and a Z 2N f gauge field A χ with a constraint δA χ = 2 w where w is the obstruction to lifting the P SU(N f ) bundle to an SU(N f ) bundle, and w f 2 is the obstruction to lifting the SU (N f )/Z 2 bundle to an SU(N f ) bundle.
The theory also has Wilson lines in the spinor representations that are not screened by the matter. The Wilson lines are charged under a Z 2 electric one-form symmetry. We will denote the background for the one-form symmetry by B (2) 2 . For even N and N f , the one-form symmetry combines with the flavor symmetry to a two-group symmetry. 14 The background of the two group symmetry is The one-form symmetry is expected to be unbroken at low energy which signals confinement. The two-group symmetry implies that the strings charged under the one-form symmetry carry an 't Hooft anomaly on their worldsheet characterized by (4.34)

Two-group symmetry in SO(N ) QCD with N f vector fermions
The theory can be constructed from Spin(N) QCD by gauging the Z 2 electric one-form symmetry. One can include discrete theta angle p. As in Spin(N) QCD, We will focus on the case where both N, N f are even.
The theory has a dual Z 2 magnetic one-form symmetry generated by exp(iπ w 2 ). Denote the background for the dual magnetic one-form symmetry by B m 2 , which couples to the theory as π w 2 w 2 with w 2 the second Stiefel-Whitney class of the spacetime manifold, we have the identification (p, B m 2 ) ∼ (p + 2, B m 2 + w 2 ). Without loss of generality, we can restrict to p = 0, 1. These two theories are denoted by SO(N) + and SO(N) − respectively.

SO(N) + QCD
When p = 0, the two-group symmetry in the Spin(N) QCD becomes a mixed anomaly after gauging π δw It is a mixed anomaly between the magnetic one-form symmetry and the flavor symmetry (and charge conjugation symmetry).

SO(N) − QCD
When p = 1, the theory couples to the two-form gauge theory (2.1). Applying the discussion in section 2.2.2, the theory has a two-group symmetry whose backgrounds obey the relation In contrast to SO(N) + QCD, the symmetry has no 't Hooft anomaly. Integrating out the gauge field b constrains a to be a Z N gauge field a ∈ 2π N Z. We define the electric and magnetic line operators as U = exp(i a) and V = exp(i b) respectively. They obey the relation where ψ is the transparent fermion line. For odd k, the theory contains ψ, and hence it is a fermionic theory that depends on spin structure. For simplicity, we will restrict to bosonic Z N gauge theories, i.e theories with even k below.
The line operators form an Abelian group. The group can be understood as the quotient of Z × Z by the group generated by the columns of the following matrix The matrix can be put into Smith normal form with L = gcd(k, N) by multiplying SL(2, Z) matrices from the left and the right. The resulting quotient group is invariant under the transformation. Hence for even k the line operators generate a A = Z L ×Z N 2 /L one-form symmetry (for odd k the one-form symmetry will be modified by the additional Z 2 symmetry generated by ψ). We emphasize that the one-form symmetry A always has a Z N subgroup generated by U. This Z N subgroup will be important in the later discussions. 15 We can couple the one-form symmetry A to background gauge fields as follows. Let Integrating out b imposes the constraint (5.5) which implies that the gauge field a is no longer properly quantized. Hence the remaining action develops a bulk dependence  The first term involves dynamical gauge fields so it has to be removed. This can be achieved by imposing the following constraint on the backgrounds The second term of (5.8) depends only on the background fields. It represents an 't Hooft anomaly, (5.10) The anomaly is also given by the spin of the symmetry line operators [12].
The above calculation is repeated in discrete notation in appendix B. In the discrete notation, the backgrounds obay where Bock is the Bockstein homomorphism for the exact sequence 1 (5.12)

Fermionic Z 2 one-form gauge theory
Fermionic Z 2 gauge theory in 3d can be constructed by gauging the Z 2 symmetry in the 3d SPT phase with unitary Z 2 symmetry, the later admits Z 8 classification [40-43, 16, 44] from Ω 3 Spin (BZ 2 ) = Z 8 . The Abelian Chern-Simons theory construction discussed above only accounts for four of them. The other four fermionic gauge theories have non-Abelian anyons. All these Z 2 gauge theories, denoted by (Z 2 ) L , can be described by (see Appendix B of [3]) where L ∼ L + 8. The Z 2 gauge theory (Z 2 ) k , that has an Abelian Chern-Simons theory construction (5.1), is mapped to (Z 2 ) 2k by tensoring with an almost trivial theory {1, ψ} with ψ the transparent fermion line.
The Spin(L) 1 TQFT was studied in [45] (also see e.g Appendix C of [46] for a review). For odd L, the Spin(L) 1 theory has three lines: the identity line 1 with spin 0, the line ǫ in vector representation with spin 1 2 and the line σ in spinor representation with spin − L 16 . They obey the Ising fusion rule: (5.14) The product of ǫ and ψ is mapped to the Wilson line of (Z 2 ) L , which generates a Z 2 one-form symmetry. This Z 2 one-form symmetry is crucial in the later discussion. The only charged line under this symmetry is σ.
To conclude, we summarize the fusion rule and the one-form symmetry of (Z 2 ) L gauge theory (omitting the transparent fermion line ψ with ψ 2 = 1 from the SO(L) 1 factor in (5.13)) • L = 0 mod 4: the theory has topological lines that obey Z 2 × Z 2 fusion rule. They generate a Z 2 × Z 2 one-form symmetry.
• L = 2 mod 4: the theory has topological lines that obey Z 4 fusion rules. They generate a Z 4 one-form symmetry.

Couple QFT to bosonic one-form gauge theory
Consider a 3d theory with a non-anomalous Z N 0-form symmetry. Gauging the symmetry with or with adding an SPT phase leads to different theories. Denote the resulting theory with a Chern-Simons level k for the Z N gauge field by T k . Below we will restrict to bosonic SPTs i.e. theories with even k.
The theory T k has a Z N one-form symmetry generated by U = exp( 2πi N a) where a is the dynamical Z N gauge field. The Z N one-form symmetry can be understood as the emergent symmetry dual to the gauged Z N zero-form symmetry. All the gauged theories are related by where the quotient means gauging the diagonal Z N one-form symmetry that identifies the Z N gauge fields in T p and (Z N ) k .
The equation (5.15) is compatible with the addition of discrete theta angle. If we apply (5.15) again with k replaced by k ′ , 16) where in the last duality we reparametrized the Z (1) N quotient such that one of them acts only on (Z N ) k × (Z N ) k ′ and identifies their Z N gauge fields to give (Z N ) k+k ′ .
Let us compare the symmetries in T 0 and T k . The two theories in general may not have the same symmetry. This arises if the symmetry in T 0 has a mixed anomaly with the dual Z N one-form symmetry.
Suppose the theory T 0 has a one-form symmetry A, which is a group extension specified by a Z N element k ′ . In terms of the symmetry generators, this means where U and V are the generator of the Z N and Z r one-form symmetry. The Z N subgroup one-form symmetry should be identified with the Z N one-form symmetry generated by the Wilson line U = exp( 2πi N a). We will refer to this symmetry as the Z N magnetic one-form symmetry. The background gauge field for the one-form symmetry A can be described by a Z r cocycle B 2 and a Z N cochain B m 2 with the constraint where Bock is the Bockstein homomorphism for the short exact sequence 1 → Z r → Z N r → Z r → 1.
We further assume that the symmetry generator U and V has non-trivial mutual braiding, which implies an 't Hooft anomaly of the one-form symmetry A [12]. The 't Hooft anomaly becomes trivial when it is restricted to the Z N subgroup one-form symmetry (gauging the Z N one-form symmetry recovers the original theory). This implies that V r = U k ′ has trivial braiding with U so the braiding between U and V can only be exp (2πiq/ gcd(N, r)) for some integer q. This leads to the mixed anomaly [12] 2πq 20) which can be accompanied by an anomaly ω(B 2 ) that depends only on B 2 .
Let us now discuss the symmetry of the theory T k . The theory T k is constructed by gauging the diagonal Z N one-form symmetry in the theory T 0 × (Z N ) k . The gauging sets the gauge fields for the magnetic one-form symmetries to be b m 2 in T 0 and b m 2 + B m 2 in (Z N ) k . Here b m 2 is a dynamical gauge field, and B m 2 is the background gauge field for the residue magnetic one-form symmetry. The theory has the bulk dependence 2πq gcd (N, r) To cancel the gauge-global anomaly i.e the bulk terms that depend on b m 2 , the background must satisfy The gauge fields for the magnetic one-form symmetries further obey the constraints (5.11), Together with (5.22) we find the relation It implies that the one-form symmetry of T k is The symmetry has an anomaly obtained by substituting (5.22) back to (5.21) As a check, consider gauging a Z N zero-form symmetry in an empty theory with an additional Chern-Simons term for the Z N gauge field. This leads to a family of theories T p = (Z N ) p . From the symmetry extension (5.11) and 't Hooft anomaly (5.12), we identified the theory T p as a special case of the discusssion above with k ′ = p, r = N, q = 1. The above analysis then implies that the theory T p+k has the symmetry Z J × Z N 2 /J , J = gcd (k + p, N) , (5.27) which agrees with the one-form symmetry of the theory T p+k = (Z N ) p+k . can be coupled to a Z N one-form gauge field a through

Example
where b is a dynamical gauge field that constrains a to be a Z N gauge field a ∈ 2π N Z. Promoting a to a dynamical gauge field gauges a Z N zero-form symmetry. The dynamical gauge field a then becomes a Lagrange multiplier that forces The theory has a Z N one-form symmetry generated by exp(i a) = exp(iM u) (which is the Z N subgroup of a larger Z N M one-form symmetry generated by exp(i u)), and a Z N M one-form symmetry generated by exp(i b). These two symmetries have a mixed anomaly due to the non-trivial braiding phase exp(2πi/N) between their generators. Denote their background gauge field by B m 2 and B 2 respectively. The anomaly is characterized by [12] 2π Comparing with the discussion above, we identify r = MN and q = 1, k ′ = 0.
We can add a Chern-Simons term with level k for the Z N gauge field. Applying the analysis above, we find that the resulting theory has the following one-form symmetry N) . (5.32) The one-form symmetry has an 't Hooft anomaly As a consistent check, we can examine the one-form symmetry of the resulting theory directly. It has Lagrangian Integrating out the gauge field v simplifies the theory to The theory has a Z J ×Z N 2 M/J subgroup symmetry generated by exp(iM u) and exp(i b) whose spins are consistent with the 't Hooft anomaly (5.33).

Couple QFT to fermionic Z 2 gauge theory
Consider gauging a non-anomalous Z 2 zero-form symmetry in a 3d system. We can add an additional fermionic SPT phase for the Z 2 symmetry classified by Ω 3 Spin (BZ 2 ) = Z 8 . Denote the theory with discrete theta angle k by T k . All these theories are related by where the quotient means gauging the diagonal Z 2 one-form symmetry generated by the product of exp(iπ a) in T 0 , ǫ in Spin(k) −1 and ψ in SO(k) 1 .

Non-invertible topological lines
As discussed in the previous subsection, the theory T 0 and T k with even k can have different symmetry. This occurs when T 0 has another Z 2 one-form symmetry whose generator carries charge 1 under the emergent Z 2 one-form symmetry generated by exp(iπ a). In the theory T k , the generator of the Z 2 one-form symmetry is paired with the lines in the spinor representation of Spin(k) −1 that are also odd under the Z 2 one-form symmetry due to the gauging in (5.36). This leads to the following fusion category in the theory T k : • k = 0 mod 4: the theory has topological lines that obey Z 2 × Z 2 fusion rule. They generate a Z 2 × Z 2 one-form symmetry.
• k = 2 mod 4: the theory has topological lines that obey Z 4 fusion rules. They generate a Z 4 one-form symmetry.
We remark that the above discussion can be compared with the discussion in Section 6 of [48] for 2d fermionic CFT equipped with an anomalous Z 2 symmetry (classified by Z 8 [40][41][42][43]16,44]) that has a mixed anomaly with the total fermion parity. It was shown that after gauging the total fermion parity the Z 2 symmetry gets extended, with the symmetry line defect turned into one of the line in the above fusion categories with k identified with the Z 8 anomaly coefficient in 2d. This can be understood from gauging the total fermion parity in a 2d/3d boundary/bulk system, with the 3d system given by product of a spin theory and the fermionic SPT phase for the Z 2 symmetry. The line in the 3d can move to the 2d boundary. 16 6 3d gauge theories with discrete theta angles In this section we discuss concrete examples of gauging a non-anomalous Z N zero-form symmetry in 3d theories with an additional SPT phase that becomes a discrete theta angle. We also discuss the symmetry in O(N) Chern-Simons theory with discrete theta angle denoted by O(N) 1 in the notation of [3].

Gauging Z N ⊂ G subgroup zero-form symmetry
We start with a system in 3d with a 0-form symmetry G which is an extension of G by Z N We assume the Z N subgroup symmetry is non-anomalous and there is no mixed anomaly between Z N and G. Then we gauge the Z N subgroup symmetry with an additional SPT phase given by a level k Chern-Simons term. What's the symmetry of the new system?
For k = 0 the new system has an emergent Z N dual one-form symmetry generated by the Z N Wilson line. The extension G implies that this emergent one-form symmetry has a mixed anomaly with the remaining G 0-form symmetry. To see this, we can turn on background gauge field B 1 for G, and and background gauge field B 2 for the Z N oneform symmetry. Denote the (dynamical) Z N one-form gauge field by a, then the symmetry extension G implies that where η 2 ∈ H 2 (G, Z N ) describes the group extension G. The background B 2 couples as 2π N aB 2 . (6.3) 16 We thank Shu-Heng Shao for pointing this out to us.
Thus the coupling has a mixed anomaly described by the bulk term Now, let us consider theories with nonzero Chern-Simons term k. Comparing (6.2), (6.3) with (5.5),(5.7), we identify B e 2 = B * 1 η 2 and B m 2 = B 2 . Thus these backgrounds satisfy which represents a two-group symmetry that combines the Z N one-form symmetry and G 0-form symmetry, with Postnikov class The 't Hooft anomaly for the two-group symmetry is described by the bulk term 6.1.1 Example: Z 2 gauge theory with two complex scalars As an example, we consider gauging a Z 2 zero-form symmetry (without Dijkgraaf-Witten action) in a theory with two complex scalars that are Z 2 odd. The resulting theory T 0 is a Z 2 gauge theory with two charged complex scalars.
The theory has a magnetic Z 2 one-form symmetry generated by the Z 2 Wilson line, whose background is denoted by B 2 . It also has an SO(3) flavor symmetry that transforms the two complex scalars, whose background is denoted by B 1 . The transformation that flips the signs of both scalars is identified with a gauge rotation. Thus if we turn on SO(3) background gauge field that is not an SU(2) background gauge field, whose obstruction is described by a non-trivial w f 2 , the Z 2 gauge bundle will be twisted: Now, let us introduce a discrete theta angle for the Z 2 bundle as described by Chern-Simons level k. We find that the background for the magnetic one-form symmetry (generated by the Z 2 Wilson line) now satisfies The relation describes a 2-group symmetry that combines the Z 2 magnetic one-form symmetry and the SO(3) flavor symmetry, with Postnikov class Θ = kBock(w f 2 ) that depends on the discrete theta angle k. For even k, the Postnikov class is trivial so the symmetries do not combine into a two-group symmetry. The symmetry has an 't Hooft anomaly determined by (6.7): If the scalars are massive with equal mass, the theory flows to a pure Z 2 gauge theory (Z 2 ) k in the infrared. The infrared theory has an accidental electric one-form symmetry. To match the ultraviolet symmetry and anomaly, the SO(3) gauge field B 1 couples to the infrared theory by a symmetry enrichment using the background gauge field B e 2 for the accidental electric one-form symmetry.

O(N ) Chern-Simons theory with discrete theta angle
Here we present an example with discrete theta angle associated to mixed topological terms that arise from gauging a Z 2 one-form and a Z 2 0-form symmetry.
We start with a Spin(N) K Chern-Simons theory, and gauge the Z 2 zero-form charge conjugate symmetry and the Z 2 one-form symmetry that does not transform the Wilson lines in vector representation. The resulting theory is a O(N) K Chern-Simons theory. We can add to the theory a discrete theta angle where p is a Z 2 coefficient. The characteristic classes w 1 , w 2 are defined in section 4. They are controlled by the dynamical gauge fields for the zero-form charge conjugation symmetry and the one-form symmetry, respectively. We will focus on theories with even N, K.
The theory O(N) K with p = 0 has one-form symmetry [3] The Z 2 subgroup of the one-form symmetry is generated by the symmetry line operator exp(iπ w 1 ), with background denoted by B 2 . There is also center one-form symmetry, with background denoted by B 2 . The one-form symmetry is the extension of these two symmetries. It is reflected in the constraint of the backgrounds 2 ) , (6.14) where Bock is the Bockstein homomorphism for the exact sequence 1 → Z 2 → Z 4 → Z 2 → 1. The symmetry extension implies that if the constraint were not satisfied, rather δB 3 = 0, the theory has a mixed gauge-global anomaly given by the bulk term 2 ) . (6.15) What's the symmetry in the theory with p = 1? As explained in section 4, the background B (2) 2 modifies the cocycle condition of w 2 ) + B (2) Thus the discrete theta angle (6.12) with p = 1 has the bulk dependence 2 ) + B (2) 2 ) , (6.17) where we used the property w 1 ∪w 1 = Bock(w 1 ) and π Bock(B 2 w 1 ) is trivial on orientable manifolds. Thus in order to cancel the gauge-global anomaly, the background field B 2 ) , (6.18) which implies that the one-form symmetry in the theory with p = 1 is A = Z 2 × Z 2 K + N + 2 = 0 mod 4 Z 4 K + N + 2 = 2 mod 4 (6.19) in agreement with [3] and consistent with the level-rank dualities [3].
This example can also be understood as follows. Consider the 3d TQFT (C.1) with N = 2, q = 0 and p = 1. The theory can be expressed as where the quotient Z 2 means gauging the diagonal one-form symmetry that identifies w 1 with a in the TQFT. The condition (6.16) implies that the TQFT is coupled to the gauge field Y 3 = Bock(B 2 ) + B (2) 2 a. Then a similar computation in the TQFT shows that the symmetry is deformed as we discussed above. 7 2d Z 2 one-form gauge theory 2d Z 2 fermionic gauge theory can be constructed by gauging Z 2 symmetry in 2d fermionic SPT phase with unitary Z 2 symmetry (in addition to the fermion parity). The latter admits Z 2 × Z 2 classification [16], while one of the Z 2 is generated by the fermionic SPT phase without the Z 2 symmetry [17,18,16] (given by the Arf invariant [14,15]). Thus there are two fermionic Z 2 gauge theories in 2d, labelled by discrete theta angle p = 0, 1.
The action for the Z 2 gauge theory can be constructed from the Arf invariant Arf(ρ), which is a Z 2 function of the spin structure ρ. The spin structure ρ is a Z 2 one-cochain that trivializes the second Siefel-Whitney class of the tangent bundle w 2 (T M) = δρ. Denote the Z 2 gauge field by a which is a Z 2 one-cocycle. Define q(a) = Arf(a + ρ) − Arf(ρ) . (7.1) The action of the Z 2 gauge theory with gauge field a is pπ q(a), p = 0, 1 .
We remark that q is the quadratic refinement of the cup product [14,15]: for any Z 2 onecocycles a, b, Let us begin with p = 0. The theory has an emergent Z 2 zero-form symmetry generated by the Z 2 line operator exp(iπ a), whose background is denoted by B 1 . The theory also has a Z 2 one-form symmetry with background B 2 , which modifies the cocycle condition for a to be δa = B 2 . (7.4) The coupling to B 1 is π a ∪ B 1 .
In the presence of B 2 the coupling depends on the bulk and it results a mixed anomaly between the zero-form and the one-form symmetries: Now let us discuss the case p = 1. In the presence of B 2 , a is no longer a Z 2 cocycle and thus the action πq(a) is not well-defined. However, the total action (7.2) and (7.5) can be made well-defined if the backgrounds obey The total action together with an additional classical local counterterm πq(B 1 ) combines into πq(a + B 1 ) , (7.8) which is well-defined since a + B 1 is a Z 2 cocycle. The constraint (7.7) implies that the background of the Z 2 one-form symmetry is trivial for p = 1, and thus the one-form symmetry is explicitly broken in this case.
We remark that for p = 1 there is no 't Hooft anomaly for the above symmetries since the action (7.8) is well-defined in the presence of the background gauge fields. This is consistent with the fact that the theory with p = 1 is an invertible (spin-)TQFT [49] (it describes the Kitaev chain [17] as discussed in [16]), and thus all anomalies must be trivial by the 't Hooft anomaly matching condition.

Couple QFT to Z 2 one-form gauge theory
Consider a 2d system with ordinary symmetry G that is the extension of G by Z 2 , The background gauge field for the G symmetry can be described by a Z 2 cochain a and background B ′ 1 for the G symmetry, with the constraint where η 2 ∈ H 2 (G, Z 2 ) specifies the group extension G.
In the following we assume the Z 2 normal subgroup is non-anomalous and we will gauge this symmetry. We will also assume there is no mixed anomaly between the Z 2 symmetry and G. We can include the discrete theta angle p = 0, 1 for the Z 2 gauge field a given by (7.2). The resulting system has a new Z 2 0-form symmetry generated by exp(iπ a) with background identified with B 1 . The condition (7.10) identifies the background B 2 with For p = 0, the resulting system has Z 2 × G symmetry. From (7.6) and (7.11), the two symmetries have a mixed anomaly For p = 1, from (7.7) and (7.11) we find the backgrounds satisfy which describes the background for the symmetry extension G. Thus the resulting system has G symmetry, in contrast to the symmetry Z 2 × G for p = 0. Moreover, there is no mixed anomaly between the Z 2 subgroup symmetry and G. 17 A simplicial p-cochain f ∈ C p (G, A) is a function on p-simplices taking values in an Abelian group A (we use additive notation for Abelian groups). For simplicity, we will take A to be a field (an Abelian group endowed with two products: addition and multiplication).
The coboundary operation on the cochains δ : where the hatted vertices are omitted. The coboundary operation is nilpotent δ 2 = 0. When a cochain x satisfies δx = 0, it is called a cocycle.
The cup product ∪ for p-cochain f and q-cochain g gives a (p + q)-cochain defined by It is associative but not commutative. In this note we will omit writing the cup products.
The higher cup product f ∪ 1 g is a (p + q − 1) cochain, defined by It is not associative and not commutative.
We have the following relations for a p cochain f and q cochain g: More generally, Similarly, if there is G action on A given by ρ : G → Aut(A), one can define a twisted coboundary operation that is nilpotent. Similarly the cup products ∪, ∪ 1 can be modified. The rules (A.4) are still true (with δ meaning the twisted coboundary operation).
When the coefficient group is A = Z 2 , there are additional operations in the cohomology called the Steenrod squares. For the purpose of this note we only need the operations Sq 1 and Sq 2 . Sq i maps a Z 2 p-cocycle to a Z 2 (p + i)-cocycle. The definitions of Sq 1 and Sq 2 acting on Z 2 i-cocycle x i are (A.6) In particular, Sq 1 acts on the cohomology the same way as the Bockstein homomorphism for the short exact sequence 1 → Z 2 → Z 4 → Z 2 → 1.

B Extension of symmetries in discrete notation
In this appendix, we repeat the calculation in the main text using discrete notation.
B.1 4d Z N two-form gauge theory In discrete notation, the Z N two-form gauge field (denoted by b 2 ) is a Z N two-cocycle. The action is 2π where pN is an even integer and P(b 2 ) is the generalized Pontryagin square operation. The operation is constructed as follows [13] where b 2 is an integer lift of b 2 and M is the spacetime manifold.
The theory has a Z N one-form and a Z N two-form symmetry, with backgrounds B 2 , Y 3 . Y 3 modifies the cocycle condition for the two-form gauge field such that it becomes a two-cochain while B 2 couples to the theory as In the presence of the background field, the action (B.1) is no longer well-defined for even N. Suppose we change the lift b 2 → b 2 + Nu 2 for some integral 2-cochain u 2 . The action is shifted by Since b 2 is no longer a two-cocycle, the shift does not vanish, instead, it gives We can compensate the shift by adding the following coupling to the background The term is non-trivial since b 2 is a Z N cochain in general.
To see whether the action is anomalous under gauge transformation, we can extend the fields to the bulk and study how the theory depends on the bulk. A consistent theory requires the bulk term to be independent of the dynamical field b 2 , and that will give a constraint on the consistent background fields. The total theory depends on the bulk as follows. The action (B.1) contributes the bulk dependence The additional term (B.8) contributes the bulk dependence Combining the two contributions and simplify using δb 2 − Y 3 = 0 mod N we find the bulk dependence The first term can be cancelled by demanding B 2 to satisfy The remaining bulk dependence together with the contribution from the coupling (B.5) gives the 't Hooft anomaly The anomaly is defined up to local counterterm. For gcd(p, N) = 1 there are integers α, β such that αp = 1 + Nβ. Then the bulk dependence can be cancelled by the local counterterm where w 2 (T M) is the second Stiefel-Whitney class of the tangent bundle. δB ′ 2 = −pY 3 . The local counterterm gives a bulk dependence that cancels the putative 't Hooft anomaly (B.13)

B.1.2 Odd N
For odd N, p is even, and the action (B.1) is independent of the lift of b 2 to integral cochain even in the presence of background fields. The action depends on the bulk as where we used δb 2 b 2 = b 2 δb 2 + δ(δb 2 ∪ 1 b 2 ) + δb 2 ∪ 1 δb 2 and δb 2 = Y 3 , and we add the 4d A consistent theory requires the dynamical field b 2 to be independent of the bulk, and thus the background B 2 obeys The 't Hooft anomaly is given by Similarly, for gcd(p, N) = 1 the above bulk dependence can be cancelled by a local counterterm and there is no anomaly.

B.2 3d Z N one-form gauge theory
Consider Z N gauge theory with the action where we will take k to be even and b 1 is a Z N cocycle. To examine whether the total action is consistent, we extend the fields to the bulk. The theory is consistent only if the dynamical field b 1 is independent of the bulk, and for this to be true the backgrounds are required to obey constraint. The total bulk dependence is The 't Hooft anomaly is given by the remaining bulk dependence, including that contributed where P(B e ) = B e ∪ B e − δB e ∪ 1 B e is the generalized Pontryagin square of B e .

B.3 Two-form and one-form coupled gauge theory
In the presence of Y 2 , Y 3 the second term in (B.28) is no longer well-defined. Consider b 2 → b 2 + Nh 2 , b 1 → b 1 + Nh 1 for some integral cochains h 1 , h 2 . This terms shifts by Thus we need to supplement the action with the following coupling to cancel the shift Next we study the bulk dependence of the action coupled to the backgrounds. We find that in order for the dynamical fields b 1 , b 2 to be independent of the bulk extension, the backgrounds must satisfy where Bock is the Bockstein homomorphism for 1 → Z N → Z N 2 → Z N → 1.

C More general topological field theories
In this appendix, we consider a class of topological field theories that can be defined in any dimension D. The degrees of freedom includes a Z N (q + 1)-form gauge field a and a Z N (D − q − 1)-form gauge field b. We will use continuous notation that embeds the discrete Z N gauge fields in U(1) gauge fields a and b. This means that the holonomy a, b ∈ 2π N Z. The action of the theory is The parameter p has an identification p ∼ p + N. When D = 2, q = 0, the theory is equivalent to a 2d Z N × Z N Dijkgraaf-Witten theory [51].
When p = 0, the theory has a Z N (D−q−2)-form symmetry generated by exp(i a) and a Z N q-form symmetry generated by exp(i b). We denote their backgrounds by A D−q−1 and B q+1 . The coupling to these backgrounds adds to the action the following term The theory also has a Z N (q + 1)-form symmetry and a Z N (D − q − 1)-form symmetry whose background X q+1 and Y D−q modifies the quantization of a and b, respectively This implies a mixed anomaly: the coupling to A D−q−1 and B q+1 is no longer well-defined in the presence of X q+2 and Y D−q , but depends on the extension to the bulk by (C.4) The anomaly has order N i.e. this many copies of the systems has trivial anomaly. To conclude, the theory has a Z When p is non-trivial, the topological action (C.1) is not well-defined in the prescence of the background X q+2 and Y D−q . The action has a bulk dependence We can cancel the bulk dependence by modifying the quantization for A D−q−1 and B q+1 in the coupling (C.2) to be d A D−q−1 + p Y D−q = 0, d B q+1 + p X q+2 = 0 . (C.6) For p = 1, this means that X q+2 , Y D−q are non-trivial background fields for the higher-form symmetries, but p X q+2 , p Y D−q are trivial background gauge fields with holonomy in 2πZ. Thus the (q + 1)-form and the (D − q − 1)-form symmetries are broken explicitly to a subgroup by the discrete theta angle.
Another way to see this is that the higher-form symmetry changes the topological action (C.1) by The action is invariant only for q X , q Y ∈ NZ/ gcd(N, p) and thus the higher-form symmetries are broken to the subgroup Z gcd (N,p) .
The theory has a putative bulk dependence (C.4). We can reduce it by adding a classical counterterm which shifts the bulk dependence by Here k is an arbitrary integer. This reduces the order of the anomaly to gcd(N, p) i.e. this many copies of the systems has trivial anomaly. In particular, when gcd(N, p) = 1, the theory has no anomaly.
To conclude, the theory has an anomaly of order gcd(N, p), and its backgrounds obey the constraint (C.6). D Gauging Z 2 × Z 2 symmetry in 2d Ising × Ising CFT Orbifold by Z 2 × Z 2 symmetry can have discrete torsion since H 2 (Z 2 × Z 2 , U(1)) = Z 2 [52]. The non-trivial element corresponds to the Z 2 ×Z 2 Dijkgraaf-Witten theory [51]. Explicitly, denote the two Z 2 gauge fields by a, a ′ the action is π a ∪ a ′ . (D.1) The Z 2 × Z 2 gauge theory with the Dijkgraaf-Witten action is an invertible bosonic TQFT: the equations of motion for a, a ′ imply the gauge fields have trivial holonomy.

D.1 Symmetry in TQFT
Let us study the symmetry of the Z 2 ×Z 2 Dijkgraaf-Witten theory. The backgrounds B 2 , B ′ 2 for the one-form symmetry modify the fluxes of the gauge fields Let B 1 , B ′ 1 denote the backgrounds for the 0-form symmetries generated by a, a ′ . They couple to the theory through 3) The coupling π a∪a ′ are not well-defined in the presence of B 2 , B ′ 2 , but it can be cancelled by an analogue of the Green-Schwarz mechanism The coupling (D.3) has a bulk dependence for the background fields, but it can be cancelled by the local counterterm of backgrounds π B 1 ∪ B ′ 1 : π δa ∪ B 1 + B ′ 1 ∪ δa ′ = π δ(B ′ 1 ∪ B 1 ) . (D.5)

D.2 Coupling CFT to TQFT
An an example, consider Ising ×Ising conformal field theory (CFT) in (1 + 1)d. The theory has a D 8 0-form symmetry that includes a Z 2 × Z 2 non-anomalous subgroup. In the following, we will discuss gauging the symmetry with or without discrete torsion i.e. a Z 2 × Z 2 Dijkgraaf-Witten theory.
An Ising CFT has three Virasoro primaries including the vacuum operator 1 with h = h = 0, the energy operator ǫ with h = h = 1 2 and a spin field σ with h = h = 1 16 . The theory has a Z 2 symmetry that flips the spin fields: (D.6) The torus partition function of the Ising model is the sum of the characters of the three parimaries Z Ising (τ, τ ) = |χ 0 (τ )| 2 + |χ1 2 (τ )| 2 + |χ 1 16 (τ ) | 2 . (D.7) The characters are χ 0 (τ ) = 1 2 is the same as the torus partition function of an Ising CFT. This implies that the Z 2 orbifold of an Ising CFT is again an Ising CFT. The orbifold theory has a Z 2 symmetry which can be viewed as the emergence dual Z 2 symmetry of the gauged Z 2 symmetry. Now consider two copies of Ising CFTs. The theory has a Z 2 × Z 2 symmetry that flips the spin fields σ in one of the two copies. It also has a Z 2 symmetry that swaps the two copies. These two symmetries combine into a D 8 symmetry.
The Z 2 × Z 2 orbifold of the theory is also an Ising×Ising CFT. The orbifold theory has a D 8 symmetry whose Z 2 × Z 2 subgroup are the emergent dual symmetry of the gauged Z 2 × Z 2 symmetry while the Z 2 symmetry that exchanges the two copies remains intact.
The Z 2 × Z 2 orbifold theory can include a discrete torsion. This modifies the torus partition function into Z torsion gauged Ising 2 (τ, τ ) = which is the same as the torus partition function of a compact boson with radius r = 1 i.e. U(1) 4 . We choose the convention that the self-dual radius is r = 1/ √ 2.
We remark that orbifold with discrete torsion can also be understood as a two step gauging process. First we gauge the Z 2 symmetries in the first Ising CFT. Second we gauge the diagonal Z 2 symmetry of the second Ising CFT and the orbifold theory of the first Ising CFT. Since the orbifold of an Ising CFT is itself, this amounts to gauging the diagonal Z 2 symmetry of two copies of Ising CFTs. The resulting theory is U(1) 4 [53].