Higher-group symmetry in finite gauge theory and stabilizer codes

A large class of gapped phases of matter can be described by topological finite group gauge theories. In this paper we show how such gauge theories possess a higher-group global symmetry, which we study in detail. We derive the $d$-group global symmetry and its 't Hooft anomaly for topological finite group gauge theories in $(d+1)$ space-time dimensions, including non-Abelian gauge groups and Dijkgraaf-Witten twists. We focus on the 1-form symmetry generated by invertible (Abelian) magnetic defects and the higher-form symmetries generated by invertible topological defects decorated with lower dimensional gauged symmetry-protected topological (SPT) phases. We show that due to a generalization of the Witten effect and charge-flux attachment, the 1-form symmetry generated by the magnetic defects mixes with other symmetries into a higher group. We describe such higher-group symmetry in various lattice model examples. We discuss several applications, including the classification of fermionic SPT phases in (3+1)D for general fermionic symmetry groups, where we also derive a simpler formula for the $[O_5] \in H^5(BG, U(1))$ obstruction that has appeared in prior work. We also show how the $d$-group symmetry is related to fault-tolerant non-Pauli logical gates and a refined Clifford hierarchy in stabilizer codes. We discover new logical gates in stabilizer codes using the $d$-group symmetry, such as a Controlled-Z gate in (3+1)D $\mathbb{Z}_2$ toric code.

In general (d + 1) space-time dimensions, much less is known about the general algebraic structure of topological defects, aside from a general expectation that they should be characterized by a unitary fusion d-category.A complete understanding of topological defects is a difficult question, in part because the problem of classifying topological defects contains within it the problem of classifying all topological phases of matter.The more tractable problem is to focus on the structure of invertible topological defects, as the classification of invertible topological phases is a discrete Abelian group in each dimension [27,28,29,30,31,32,33,34,35,26].
One large class of gapped phases of matter can be described by topological finite gauge theory, that is, gauge theory with a finite, discrete gauge group.Such theories can be studied using exactly solvable lattice models [70,71,72,73,74,75].In (3+1)D, it has been argued that all topologically ordered phases of matter with fully mobile excitations can be described by finite gauge theory coupled to either bosonic or fermionic point charges [76,77,78].While the electric and magnetic defects in finite gauge theories are well known and have been studied in some depth [79,80,81,82], the full higher-group structure of invertible topological defects in finite gauge theories has not been developed.
Recently, some progress has been made in understanding part of the 3-group symmetry in (3+1)D gauge theories with finite gauge group [44,83].In this paper, we continue this line of work and develop a more comprehensive understanding of the d-group symmetry in (d + 1)D finite gauge theory with gauge group G, together with its 't Hooft anomaly.In addition to including both Abelian and non-Abelian G, we include the possibility of a Dijkgraaf-Witten twist for the gauge theory [82], characterized by a cohomology class [ω (D) ] ∈ H D (BG, U (1)).
The d-group symmetry arises essentially from the following phenomena.In theories with bosonic charges, the higher form symmetries are generated by decorating submanifolds with symmetry-protected topological (SPT) phases and then gauging the G symmetry of the full theory.The magnetic codimension-2 defects, when intersecting the gauged SPT defects, will source lower dimensional gauged SPT defects.An example of this was described in detail recently in Refs.[44,83]: in (3+1)D, the intersection point between magnetic strings and (1+1)D gauged SPT defects sources an electric charge.The generalization to magnetic defects crossing generic gauged SPT defects and sourcing lower-dimensional gauged SPT defects can be viewed as a generalization of this charge-flux attachment and the Witten effect [84] on submanifolds.See Ref. [85] for a generalization to defects in nonlinear sigma models.
Moreover, in the presence of a Dijkgraaf-Witten twist ω (D) , there are several non-trivial changes to the properties of the magnetic defects, which we discuss in this paper.First, the magnetic defects become dressed with gauged SPT defects of one higher dimension, which is another analog of charge-flux attachment.This dressing implies that some of the magnetic defects can become non-Abelian, even when associated with Abelian magnetic flux, and become endowed with exotic non-Abelian braiding transformations.This implies that the invertible magnetic defects correspond to a subgroup Z ω (G) ⊂ Z(G) of the center Z(G).Second, the fusion rules of the magnetic defects themselves get modified such that they can fuse to gauged SPT defects.
On the lattice, the higher-group symmetry manifests as commutation relations that do not produce a number, but a non-trivial operator: if the generators of symmetries are the operators O 1 , O 2 , O 3 acting on the Hilbert space, an example of a higher group structure is This implies that O 3 is created from the configuration of generators on the left.We can also generalize the relation to a nest of commutators of the form . This is to be contrasted with the case where the commutation relation produces a number (different from unity), which is the same in any state, and represents an 't Hooft anomaly of the symmetry that remains the same across different states (and thus the same for states of different energies); here, the expectation value of the commutation relation is different on states with different eigenvalues of O 3 .Such "operator-valued anomaly" means the symmetry algebra is modified to be a higher group, and is by definition not an 't Hooft anomaly, as emphasized in Refs.[40,41].Examples of lattice gauge theory models with higher-group symmetry are discussed in Ref. [83].
In general, the symmetry generators of finite Abelian gauge theory are realized as the logical gates on the codespace in a stabilizer code, which is the ground state subspace of some stabilizer lattice Hamiltonian [86,87,88,89,90,91,92].When the symmetry generators correspond to the logical gates, the higher-group symmetry that mixes the symmetry generators endows a non-trivial relation between the logical gates.For instance, we will encounter examples where [O 2 , O 3 ] = 1, and together with [O 1 , O 2 ] = O 3 they imply that at least one of O 1 , O 2 , O 3 must realize a logical gate that cannot be described by the Pauli operator.In other words, the higher-group symmetry of the stabilizer Hamiltonian model implies that the corresponding stabilizer code has a non-Pauli logical gate.As concrete examples, we find that the generator of 0-form symmetry in (3+1)D Z 2 and Z 2  2 toric code, in general, realizes the non-Pauli Clifford gate, which is enabled by the non-trivial 3-group structure among 0-form, 1-form and 2-form symmetries.In particular, we construct control-Z gate in (3+1)D Z 2 toric code.We also derive a new upper bound on the possible logical gates implemented by the gauged SPT defects of untwisted Z N 2 gauge theory in generic dimensions, which refines the known result given in Ref. [93].
An important property of global symmetry is its 't Hooft anomaly, i.e. obstruction to gauging the symmetry.The 't Hooft anomaly constrains the boundary properties and phase transitions between different gapped phases, and it is also useful in constraining the low energy dynamics of the microscopic model, such as ruling out symmetric gapped phases in quantum systems with an anomaly that cannot be matched by the proposed low energy dynamics, see e.g.Refs.[44,94,57].In particular, it has been understood that 't Hooft anomalies are intimately related to Lieb-Schulz-Mattis constraints [95,96,97] in many-body quantum systems [98,99,100,101].There is also a conjecture that two quantum systems with the same anomaly for all symmetries should be dual to each other, or can be connected by a symmetry preserving continuous deformation.
One important application of understanding the d-group symmetry and its 't Hooft anomaly is in classifying SPT states and also symmetry-enriched topological orders.For example, consider the problem of classifying fermion SPT states with fermionic symmetry group G f , which is a central extension of a bosonic symmetry group G b by fermion parity Z f 2 .Gauging the Z f 2 fermion parity gives a "bosonic shadow" theory, which involves a dynamical Z f 2 gauge field coupled to fermionic matter, with a global G b symmetry [102,103,104,105,106].Understanding how to characterize and classify such Z f 2 gauge theories with G b symmetry is intimately related to the problem of characterizing and classifying fermion SPT states with G f symmetry.Furthermore, the former requires an understanding of the d-group symmetry and its 't Hooft anomaly in Z f 2 gauge theory.In this paper, we will follow this program and develop a classification of (3+1)D fermion SPTs with general G f symmetry.Our results give an alternative perspective on the classification derived previously in Refs.[33,34].Using our methods, we also are able to give a significantly simpler formula for the [O 5 ] ∈ H 5 (BG, U (1)) obstruction appearing in the classification of (3+1)D fermionic SPTs.
This paper is organized as follows.In Section 2, we discuss the generalized Witten effect, that dresses magnetic defect with the generalization of the "electric charge" in the presence of topological interaction.In Section 3, we investigate the higher-group symmetry in examples such as Abelian gauge theory, using the generalized Witten effect and also exactly solvable lattice Hamiltonian models.In Section 4, we investigate the anomaly of the higher-group symmetry in these examples.In Section 5, we discuss the application of higher-group symmetry in lattice models and the relationship to fault-tolerant logical gates that are not Pauli operators.In Section 6 and 7, we investigate higher-group symmetry and its 't Hooft anomaly in general finite group gauge theories with bosonic electric charges.In Section 8, we investigate the 3-group symmetry in Z 2 gauge theory with fermion particles in (3+1)D, and discuss a new construction of fermionic symmetry-protected topological (SPT) phases in (3+1)D and their classification using the 3-group symmetry.
There are several appendices.In Appendix A we summarize some mathematical properties of an n-group.In Appendix B we discuss higher-group symmetry in Abelian gauge theories by embedding the gauge fields into continuous U (1) gauge fields.In Appendix C we give some details of the data classifying the fermionic SPT phases in (3+1)D.

Generalized Witten effect and charge-flux attachment
In this section, we consider G gauge theory in D space-time dimensions with topological action S[a] = M D a * ω (D)  for the G gauge field, and we will take G to be a finite group, which can be Abelian or non-Abelian.The partition function on space-time manifold M D takes the form . (2) is the pullback to a representative cocycle for H D (M D , U (1)), and the sum is over all flat principal G bundles over spacetime M D .On D-dimensional sphere, the bundles are trivial, and the partition function is 1/|G|.The theory has codimension-2 magnetic defects, around which there is a non-trivial holonomy of the G gauge field that takes value in conjugacy class [g], see e.g.Ref. [107].For finite group G, these magnetic defects are topological.
One can also consider gauge theories with continuous gauge groups and topological terms.For continuous gauge groups, there are also codimension-3 't Hooft-Polyakov monopole operators that carry fluxes of the gauge field on the surrounding 2-sphere; they are absent in the finite group gauge theory considered here.
In this section, we will explain how the topological action changes the magnetic defects and their fusion rules and their statistics.Some previously known examples of such phenomena are as follows.
• In (3+1)D, gauge theories with continuous gauge groups can have theta terms [108,109] (and possibly discrete theta terms [110,111]).These topological actions change the spectrum of line operators: while the spectrum of Wilson lines is not affected, the spectrum of 't Hooft lines becomes modified with additional "fractional" electric charges that are the projective representation of the gauge group, which is the Witten effect [84].As a result, the 't Hooft lines become dyons, and their fusion rule is modified.In the absence of topological action, the fusion of 't Hooft lines always produces 't Hooft lines, while in the presence of topological action, they become dyons, and their fusion can produce Wilson lines.In addition, the correlation function of the line operator is also modified: the statistics of the particles also depend on the topological action.For instance, a theta term in SO(N ) gauge theory with θ = 2π does not change the spectrum of line operators, but the self-statistics of the basic monopole changes from boson to fermion or vice versa (see e.g.Refs.[112,113,114,53]).
• Similar phenomena occur in (2+1)D Chern-Simons theory, where the topological Chern-Simons interaction modifies the 't Hooft lines with the magnetic charge to carry electric charges, which is the flux attachment.
The fusion rules and statistics of the 't Hooft lines also depend on the Chern-Simons topological action.For instance, the spin of the monopole operator attached to the Wilson line depends on the topological Chern-Simons term [115,116,117,118,119,120,103].
• It also occurs in higher-form gauge theory.For finite group n-form gauge theory, the magnetic defect that carries holonomy of the gauge field has codimension n + 1, and in the presence of a topological action for the n-form gauge field, it is attached with a codimension-n topological defect that supports a topological action for the n-form gauge field.For instance, in 2-form Z N gauge theory in (3+1)D, where the magnetic defect is a line operator, the topological action N p 4π bb for 2-form gauge field b implies that the magnetic line defect attaches to the Wilson surface p b (see e.g.[36,53]).
We will see that similar phenomena occur in finite group gauge theories for magnetic defects.

Gauged SPT defects
The main players in the discussion are defects described by topological finite group G gauge theory on the submanifold that support the defect.The insertion of such a defect on an n-dimensional submanifold M n ⊂ M D is equivalent to modifying the path integral with an additional weight that depends on the G gauge field a where Mn L[a] is a topological action of the gauge field supported on n-dimensional submanifold M n , and the defect is invariant under small deformations of M n for finite group gauge field a, which is flat, and thus the insertion represents a topological defect supported on M n . 1 These defects can be obtained from the following construction; one starts with a D-dimensional G-SPT phase, characterized by a cocycle [ω (D) ] ∈ H D (BG, U (1)), and then decorates an ndimensional submanifold with a lower dimensional G-SPT phase, characterized by a cocycle [η (n) ] ∈ H n (BG, U (1)).Finally, one gauges the G symmetry by summing over all flat G-gauge field configurations.These defects generate an Abelian (D − n − 1)-form symmetry, with the group multiplication law given by stacking the SPT phases.We will refer to such defects as the gauged SPT defects.For instance, when the submanifold is one-dimensional, (0+1)D SPT phases are vacuum electric charges.Such defects are the Wilson lines in the one-dimensional representations of the gauge group G, Mn L[a] = M1 a * η (1) , with η (1) ∈ H 1 (BG, U (1)) = Hom(G, U (1)) labeling the one-dimensional representations of G, where a * η (1) is the pullback of η (1) by a.For other instances of gauged SPT defects, see e.g.
We believe that all invertible defects of codimension greater than two in Dijkgraaf-Witten theories in spacetime dimension D > 3 come from such gauged SPT defects obtained by gauging lower-dimensional G-SPT phases supported on submanifolds.For codimension-2, we expect invertible defects come from either Abelian magnetic defects or from (D − 2)-dimensional gauged G-SPT phases; some evidence for this was given in Ref. [83] by comparing with layer constructions.For codimension-1 and D > 3, invertible defects can arise from gauging codimension-1 SPT phases or from elements of Aut(G); in D = 3 there are more exotic examples of invertible codimension-1 defects since electric and magnetic excitations can be permuted [70,83].
For n = 1, the magnetic defects transform linearly under the (D − 2)-form symmetry, with eigenvalue given by evaluating the character of the Wilson line with respect to the holonomy carried by the magnetic defect, which is a conjugacy class of G. On the other hand, for n > 1, there are no objects transformed as linear representations of these higher-form symmetries, but the generators of these higher-form symmetries are nonetheless non-trivial.In particular, these gauged SPT defects participate in non-trivial correlation functions with multiple magnetic defects, as we will discuss in later sections.

Magnetic defects are attached to gauged SPT phases
We will show that the pure magnetic defect in the presence of the topological action carries an anomalous G symmetry.The anomalous G symmetry can be described by a G gauge theory living on a codimension-1 defect whose boundary supports the magnetic defect.Let us consider the codimension-2 magnetic defect supported at the origin of R2 , extending in the remaining (D − 2)-directions, and we elongate R 2 into a semi-infinite cigar with holonomy given by the conjugacy class [g] of g ∈ G supported on the circumference, which is a circle fibration over the radial direction [0, ∞).See Figure 1 for illustration.We then reduce the theory onto the magnetic defect.The presence of the topological action for the G gauge field implies that the magnetic defect is dressed with a gauged SPT phase, given by integrating the topological action along the circle fiber.Denote the partition function by for some (D − 2) dimensional submanifold Σ D−2 , and let us take g ∈ Z(G) to be in the center of the gauge group, where L[a, g] = S 1 (0) L[a] with S 1 (0) being a small circle surrounding the origin 0 ∈ R 2 where the magnetic defect is inserted.The additional weight in the above path integral indicates the presence of the gauged SPT defect inserted at [0, ∞) × Σ D−2 whose boundary is the magnetic defect.Examples of such methods of deriving the gauged SPT defect attached to the magnetic defect in a higher-form gauge theory with topological action are discussed in e.g.
Ref. [53]. 2  holonomy g Magnetic defect Gauged SPT defect Figure 1: The magnetic defect is attached to a gauged G SPT defect (that supports G gauge theory with a topological action) in the presence of topological action, with the gauged SPT defect given by integrating the topological action over the circle fiber with given holonomy of the magnetic defect.The magnetic and gauged SPT defects both extend in the remaining transverse (D − 2) dimensions, which we suppress in the figure.
In the following, we will focus on the magnetic defects that carry the holonomy of G gauge field that takes value in the center Z(G).
Consider the topological action of G gauge field given by a Dijkgraaf-Witten term [ω (D) ] ∈ H D (BG, U (1)) with cocycle representative ω (D) .In general, for finite group G, the element has finite order k, and we can fix a cocycle representative such that it takes value 2π k Z on any n group elements: where the subscript k in (ω (D) ) k means that it is a cocycle with coefficient in Z k .
For the topological action S[a] = a * ω (D) , the circle reduction with holonomy g ∈ Z(G) is described by the degree-(D − 1) cocycle given by the slant product of ω (D) with respect to g [82], S[a, g] = S 1 ω (D) = i g ω (D) .Thus the gauged SPT phase attached to the magnetic defect of conjugacy class g in the center Z(G) is3 For finite group G, the cocycle i g ω (D) evaluated on any (D − 1) group elements is a kth root of unity.It can be expressed as the map of a Z k -valued cocycle using the inclusion ι : for ) has order k ′ (which must be a divisor of k), it can be represented by a Then we can decompose for some (D − 2) cocycle denoted by (i ′ g ω (D) ) k ′′ that takes value in Z k ′′ for some integer k ′′ .Let us denote the above decomposition of i g ω (D) by where |ω (D) | = k is the order of [ω (D) ] in H D (BG, U (1)), and i B g ω (D) ∈ 2π k ′′ Z. 4The reason that we distinguish these two is that while the first part (i g ω (D) ) k ′ describes non-trivial defects that support SPT phase with dynamical G gauge field in (D − 1) dimension, the second part (i ′ g ω (D) ) k ′′ does not.Intuitively, it is a fraction 1/k ′′ of a defect that supports the SPT phase with dynamical G gauge field in (D − 2)

Magnetic defect
Emits gauged SPT defect dimension.Nevertheless, the second part also plays an important role in the correlation functions of the magnetic defects.The second part can be detected by the trivalent junction of fusing magnetic defects, as in Figure 2. Fusing two magnetic defects that carry holonomies g, g ′ ∈ Z(G) produces a magnetic defect of holonomy g + g ′ ∈ Z(G), and the junction emits a (D − 2)-dimensional defect that carries an SPT phase with dynamical gauge field G, given by To summarize, the effect of topological interaction ω (D) of the G gauge fields have two effects on the magnetic defect: (1) The magnetic defect lives on the boundary of a gauged SPT defect in one dimension higher as in Figure 1, which is decorated with G gauge theory with topological action ) for a magnetic defect with holonomy g ∈ Z(G).
(2) The trivalent junction of the magnetic defects lives on the boundary of a gauged SPT defect in the same dimension as the magnetic defect as in Figure 2, given by Ω(g, g ′ ) in (12) for the junction of three magnetic defects with holonomies g, g ′ , g + g ′ ∈ Z(G).

Generalization to continuous gauge groups
Let us reproduce the known results on the Witten effect in gauge theory in (3+1)D, and the flux attachment in Chern-Simons theory in (2+1)D, using the above method.We note that for a continuous gauge group such as U (1), one can also consider a magnetic monopole (a magnetic defect of codimension 3 in spacetime).Take the spacetime to be locally R 3 × R D−3 , then the monopole sits at a point x ∈ R 3 and spans the entire R D−3 .The monopole can be surrounded by a sphere S 2 × {point y} ⊂ R 3 × R D−3 , where S 2 ⊂ R 3 encloses the point x ∈ R 3 ; we note that shrinking the size of S 2 until the sphere becomes a point intersects the monopole once at a point (x, y) ∈ R 3 × R D−3 .The sphere carries magnetic flux {m i } of the Cartan subgroup U (1) r of the gauge group of rank r [126,127,128].
We consider the setup of elongating R 3 to be the cigar geometry of S 2 fibers over the radial direction, with flux {m i } supported on S 2 , S 2 F i = 2πm i , where F i with i = 1, • • • , r are the field strengths for the Cartan subgroup U (1) r of the gauge group.By integrating the topological action of the gauge field over the S 2 fiber with the prescribed magnetic fluxes, we can deduce the gauged SPT defect attaching to the magnetic monopole sitting at a point in R 3 (and span the remaining (D − 3) dimensions).
The Witten effect In (3+1)D spacetime, consider the topological θ term for U (1) gauge theory, Integrating the theta term over the fiber S 2 implies that the monopole is attached to which is the analogue of the total derivative contribution i B g .Using F = da, we find that the monopole with magnetic charge m carries fractional electric charge mθ/2π.This is the Witten effect [84].
Flux attachment Similarly, consider U (1) k Chern-Simons theory in (2+1)D, Integration over S 2 fiber with flux da = 2π can be carried out by decomposing a = a + 2πτ , where τ is the Berry connection on S 2 whose field strength has unit flux.This produces and thus the basic monopole operator is attached to charge k Wilson line that ends on the point where the monopole operator is located.

Equivalence of codimension-1 gauged SPT defects
In the Dijkgraaf-Witten theory with topological action ω (D) , the gauged SPT defect of codimension one given by i g ω (D) ∈ H D−1 (BG, U (1)) for every g ∈ Z(G) is trivial.There are several ways to see this: • One way to see this is that such defect can be created by shrinking a small bubble of the codimension-2 magnetic defect, and thus such gauged SPT defects are trivial in any correlation function.
• Another way to see this is from the equation of motion for the gauge field, for variation with holonomy g ∈ Z(G) it is i g ω (D) = 0.
Therefore the gauged SPT defects of codimension-1 has the equivalence relation We remark that similar results hold in continuous gauge group.For instance, in (2+1)D bosonic U (1) Chern-Simons theory with even level k, the Wilson line of charge k can attach to the unit magnetic monopole as explained in Section 2.2.1, and thus the charge k Wilson line is trivial: we can create a charge k Wilson loop by a small monopoleantimonopole pair.This also follows from the equation of motion for the U (1) gauge field.As a consequence, the Wilson lines with different U (1) charge Q are not all distinct, but they have the equivalence relation

Magnetic defects of center-holonomy can have non-Abelian fusion
Let us explain how the topological action modifies the fusion rule of the magnetic defects.The modification of the fusion rule originates from the anomalous G symmetry on the defect that is present due to the topological action of the G gauge field.In other words, the anomalous G symmetry on the magnetic defect arises because the magnetic defect is at the boundary of a gauged SPT phase of one dimension higher.To incorporate such anomalous G symmetry, the magnetic defect that couples to the bulk gauge theory must have extra degrees of freedom, and this changes the fusion rule.
In the following, we will show that even when the holonomy carried by the magnetic defect is in the center of the gauge group, the fusion rule of the magnetic defects can become non-Abelian in the presence of non-trivial topological action of the G gauge field.We will focus on the magnetic defects with holonomies in the center of the gauge group.

Fusion of magnetic defect with codimension-2 gauged SPT defect
Due to the anomalous G symmetry on the magnetic defect, under a G gauge transformation by λ that takes value in G, the magnetic defect changes by an amount given by the anomaly inflow mechanism, which we will call the anomaly descendant.
Denote the anomaly descendant for an n cocycle η ), for a gauge transformation by a 0-cochain λ.In a simplicial formulation, we transform the gauge element on link (01) connecting vertices 0,1 by g(01) → λ −1 0 g(01)λ 1 .j λ is defined by the equations: The solution j λ (η (n) ) in the above equation can be interpreted as the anomalous transformation of the partition function, Z boundary → Z boundary e i j λ (η (n) ) , on the boundary of the bulk SPT phase with effective action η (n) , under the background gauge transformation λ.We would like to obtain the anomalous transformation when the gauge transformation on the boundary is global, λ i = λ.In such cases, the boundary partition function is multiplied with the partition function of an (n − 1)-dimensional SPT phase with symmetry given by the centralizer subgroup of λ in G.For the centralizer subgroup to be the entire G, let us take λ i = λ ∈ Z(G) the center of G.The corresponding (n − 1)-dimensional SPT phase with G symmetry can be obtained as follows.Let us consider the bulk geometry to be [0, 1] x × M for closed M and an interval 0 ≤ x ≤ 1, and we perform gauge transformation by λ ∈ Z(G) on one end x = 1 relative to the other end x = 0, which can be viewed in the following two equivalent ways: • This is a global transformation on the boundary {x = 1} × M by parameter λ, and it produces extra (n − 1) dimensional SPT phase with effective action j λ η (n) | λi=λ .
• This gives the same phase from reducing the effective action η (n) for the n-dimensional SPT phase on a circle with holonomy λ, where the circle is obtained by gluing the two ends of the interval 0 ≤ x ≤ 1.
By comparing the two descriptions, we have We thus have the following fusion rule.Denote the magnetic defect by U g (M D−2 ), and the gauged SPT defect of dimension n by ).Then by taking the transformation with constant λ ∈ Z(G), we find the fusion rule The fusion rule is the statement that in the presence of G gauge field, under a G global transformation on the magnetic defect there is an anomalous shift depending on the anomaly of G symmetry.Thus the magnetic defect is non-Abelian if and only if ).

Fusion among magnetic defects
Similarly, we can consider fusing two magnetic defects.Then the fusion of two magnetic defects is: where the quotient simplifies the result of the fusion outcome using (21), and the normalization factor N is included such that the trivial fusion channel only appears once, i.e.

Non-Abelian braiding of magnetic defects
We remark that in addition to the above non-Abelian fusion, for the magnetic defects that are attached to non-trivial gauged SPT defect in one dimension higher, i.e. the magnetic defects with holonomy g such that [i A g ω (D) ] ̸ = 0, the braiding of the magnetic defects becomes non-Abelian (when the spacetime dimension allows such braiding).
Denote the support of the magnetic defect by a (D −2)-dimensional submanifold M D−2 , which is on the boundary of V D−1 that supports the gauged SPT defect attached to the magnetic defect, given by D−1 support non-trivial gauged SPT defects, and the intersection of the magnetic defect with the gauged SPT defect produces lower-dimensional gauged SPT defects, the linking of two magnetic defects with holonomies g, g ′ produces extra gauged SPT defects, given by W igi g ′ ω (D) and W i g ′ igω (D) .In other words, the braiding of two magnetic excitations does not return to the original configuration, and the braiding becomes non-Abelian.
where u, v, w are Z 2 cochains that act as Lagrangian multipliers enforcing a, b, c to be cocycles.Integrating out v, w and a gives du which describes the gauge field of the Dihedral group of order 8. Thus the theory is equivalent to untwisted gauge theory with gauge group given by the Dihedral group of order 8.The Wilson line in the two-dimensional representation of the Dihedral group corresponds to where γ = ∂Σ, and it does not depend on the surface Σ: suppose we choose a different surface Σ ′ with ∂Σ ′ = γ, then Σ ∪ Σ ′ ≡ Σ ′′ is a closed surface, and the operator changes by where we used the equation of motion, and thus the operator W 2 does not depend on the bounding surface. 6This is an example of a magnetic defect, associated with Z 2 flux of a, being attached to a higher dimensional gauged SPT, described by b ∪ c, and thus being endowed with non-Abelian fusion rules.
There are three Wilson lines in one-dimension representations: We can compute their fusion rule as above: [129] This agrees with the tensor product decomposition of the representations of Dihedral group of order 8. Similarly, one can show that other magnetic lines all carry non-trivial projective representation and become non-invertible.Thus the center of gauge group does not give non-trivial invertible 1-form symmetry.

Total invertible 1-form symmetry is a central extension
Consider the subset of magnetic defects that are invertible: these are the magnetic defects with holonomy g ∈ Z ω (G) for the subgroup Z ω (G) ⊂ Z(G) given by Since the trivalent juction of magnetic defects that describe their fusion can emit extra gauged SPT defects in H D−2 (BG, U (1)), the 1-form symmetry G (1) generated by the codimension-2 invertible magnetic defects and the gauged SPT defect of dimension (D − 2) form a group extension The extension is specified by a 2-cocycle Ω that depends on two elements of Z ω (G) and takes value in the Abelian group We will refer the background gauge field for the 1-form center symmetry generated by the magnetic defect as B 2 .Let us denote the background for the 1-form symmetry generated by the gauged SPT defects in H D−2 (BG, U (1)) as C 2 .(Similarly, we will denote the background for the n-form symmetry H D−n−1 (BG, U (1)) generated by the gauged SPT defects by C n+1 .)Then in the absence of other background gauge fields, the background gauge fields for the 1-form symmetry obey the relation where Bock is the Bockstein homomorphism for (30).

Self-statistics
The magnetic defects have non-trivial correlation function due to the attached gauged SPT defect.Let us compute the correlation function, which gives the self-statistics of the magnetic defect.Denote the support of the magnetic defect by M D−2 , which is on the boundary of V D−1 .If the magnetic defect carries a holonomy g, it has the effect of sourcing a background contribution to the gauge field7 where δ(V D−1 ) ⊥ is the delta function 1-form that restricts to V D−1 , and it is the Poincaré dual 1-form of V D−1 .The correlation function of the magnetic defect itself is where (a g ) * (i g ω (D) ) is the pullback of the cocycle to spacetime by the gauge field configuration a = a g .The correlation function will in general depend on the framing of M D−2 .
Example: semion in twisted Z 2 gauge theory in (2+1)D Consider Z 2 with topological action given by the non-trivial element ω in Then for the non-trivial element g = 1 ∈ {0, 1} = Z 2 , the pullback of i 1 (ω) by the Z 2 gauge field a is πda/2.Then the self-statistics of the magnetic defect is described by the correlation function where #(M 1 , V 2 ) is the self linking number of M 1 .This reproduces the semion self-statistics i for the magnetic defect.

Correlation function of magnetic defects and gauged SPT defects
Similarly, the correlation function in the presence of other gauged SPT defect 3 Higher-group symmetry in gauge theory with bosons In this section, we will use examples to illustrate that the symmetry generated by the magnetic defects U g of codimension-2 mixes with other symmetries generated by gauged SPT defect W η (n) to form a higher-group symmetry.
On the other hand, the symmetries generated only by the gauged SPT defects do not mix with each other.
We will demonstrate such a mixing between symmetries by examining the configuration of magnetic defects that intersect with the gauged SPT defect, which creates a magnetic source on the gauged SPT defect.Then the generalized Witten effect implies an additional gauged SPT defect emitted from the intersection.We will demonstrate such a phenomenon using the background gauge fields and the property of gauged SPT phases, and using operator commutation relation in the lattice model.

Example: Z 2 gauge theory in (3+1)D
Let us consider the following symmetries: the 0-form symmetry generated by a domain wall that is decorated with a Dijkgraaf-Witten Z 2 gauge theory, the 1-form symmetry generated by the magnetic surface defect, the 2-form symmetry generated by the Wilson line.These symmetries mix into a 3-group, as discussed in Ref. [44].In Appendix B we provide another derivation of such 3-group symmetry by embedding the discrete gauge fields into continuous Figure 3: Junction of 0-form symmetry defects indicated by black and dashed lines (with red arrows indicating their orientations to specify the action of the symmetry).On the right, we include a magnetic flux loop encircling the junction, and there are semion and anti-semion particles at the intersection of the flux loop with the non-trivial domain walls, indicated by the green and orange points.To compensate for their difference, there is an electric charge at the junction, indicated by the red dot.
U (1) gauge fields.The 3-group symmetry can be summarized using the following relation between the background gauge fields C 1 , B 2 , C 3 for the Z 2 0-form, 1-form, and 2-form symmetries: where the above equations hold modulo 2. C1 is a lift of C 1 to Z 4 coefficients that satisfies C1 mod 2 = C 1 .Physically, C 1 determines whether a domain wall exists, and the lift C1 determines an orientation on the domain wall. 8he last equation can be understood as follows.To create the Z 2 domain wall requires a choice of orientation (see lattice description below).The physical implication of the choice of orientation is that it determines whether a magnetic flux piercing the domain wall induces a semion or an anti-semion.Now we can consider the junction between two Z 2 domain walls created with opposite orientations.A magnetic flux loop circling the junction induces a semion in one of the domain walls and an anti-semion in the other domain wall, which leaves the boson, which is the Z 2 charge, at the junction (see Figure 3).In other words, the junction emits an extra electric charge in the presence of magnetic loop excitation piercing the domain walls.
The equation dC 3 = B 2 ∪ d C1 /2 describes 3-group symmetry, with Postnikov class The equation also implies that under a transformation In other words, if we insert a magnetic defect by performing a 1-form transformation with parameter λ, then it produces an extra Wilson line.Such mixing of the background gauge transformation is the defining signature of a higher-group symmetry 9 , see e.g.Refs.[39,40,41].
We remark that such mixing (37) has implications for the symmetry fractionalization when the theory is enriched with a unitary Z 2 symmetry [132], as discussed in [44].
In the following, we will provide a description of the structure (37) using the toric code lattice model.

Lattice description of 3-group
We can describe Z 2 gauge theory using the (3+1)D toric code model [70].Let us consider a Euclidean cubic lattice in three spatial dimensions, with a qubit on each edge acted on by the Pauli operators X, Y, Z.The Hamiltonian is Figure 4: The operator U on the cubic in grey shade is given by the product of the control-S gates on the pairs of edges indicated in the figure, where the control-S on edge 1, 2 with variables a = a 1 , a 2 of Z eigenvalues in {0, 1} ⊂ Z 4 is given by i a1a2 .
where the product of X is over the six edges that meet at the vertex v, and the product of Z is over the four edges that surround the face f .The Z 2 gauge field is represented by the operator-valued 1-form a = (1 − Z)/2 that acts on the qubit on each edge e by Z e = (−1) a(e) .
The symmetries that participate in the 3-group as described in Eq. ( 37) are generated by the following operators: • The Z 2 0-form symmetry is emergent because it keeps the ground state subspace invariant, but does not commute with the full Hamiltonian.It is generated by an operator supported on a three-dimensional region R: Here ã denotes the Z 4 lift of a where the non-trivial element of Z 2 is lifted to the generator 1 Here σ(c) = ±1 is an arbitrary choice of orientation for each cube c.The orientation-reversing domain walls where σ(c) changes sign determines a 2d surface in space, which will play an important role below.|{a}⟩ is the state of the Hilbert space specified by the Z 2 gauge field configuration {a} on edges, and CS is the control-S operator with the product over all pairs of edges that have non-trivial contributions to a ∪ dã/2 on a cube c, see Figure 4 for an illustration.
The operator supported on the entire space commutes with the Hamiltonian on the low energy subspace with zero flux (while there can be electric charges).Indeed, the commutation relation between U on the entire space and the vertex term of the Hamiltonian on a vertex v in the low energy subspace where da = 0 can be computed as where the integral is over the whole space, and v is a Z 2 0-cochain which is nonzero only on the vertex v.
We note that in the low energy subspace without the magnetic flux, the operator U is topological, even in the presence of electric charges If the region R has a non-zero boundary ∂R, the operator U (R, σ) creates a Z 2 domain wall on ∂R, associated with the orientation σ restricted to ∂R.
• Z 2 1-form symmetry generated by the membrane operator that is supported on a surface on the dual lattice, given by where the product is over the edges that intersect the membrane on the dual lattice.This operator V (Σ) supported on closed membrane commutes with the Hamiltonian in the whole Hilbert space, so it is an exact symmetry rather than an emergent symmetry.Note that V (Σ) becomes fully topological and generates Z 2 1-form symmetry only in the subspace where electric particles are absent. 10In the computation, we use the property a + dv = ã + dv + 2a ∪ 1 dv mod 4, and • Z 2 2-form symmetry generated by the line operator that is supported on a curve on the lattice, where the product is over the edges on the curve γ.The line operator W (γ) is also an exact symmetry of the Hamiltonian, though it is not fully topological in the presence of magnetic flux excitations.In the low energy subspace where the magnetic excitations are absent, W (γ) becomes topological and regarded as a generator of Z 2 2-form symmetry.

3-group symmetry as commutation relation
In the following, we will show that these operators obey the following commutation relation on the low energy subspace with zero flux Here γ is the 1d curve along which the orientation-reversing domain walls defined by σ intersect the surface Σ. Figure 5 shows an example where there is a single orientation-reversing domain wall separating two half-spaces.
Let us first show that such a commutation relation is equivalent to the spacetime description of the symmetry defects that we discussed earlier.The orientation-reversing domain wall defined by σ in U can be regarded as a trivalent junction of 0-form symmetry generators in spacetime described in Figure 3, where the junction emits a trivial codimension-1 defect.The commutation relation Eq. ( 44) can then be understood as a result of crossing the magnetic surface operator V (Σ) through the junction of 0-form symmetry generators.That is, the commutation relation is regarded as a sequence of operators U, V, U −1 , V −1 inserted in spacetime at distinct spatial slices, and it can be evaluated by passing the magnetic surface operator V (Σ) through U (R, σ) which amounts to changing the order of operators.This process involves crossing the worldsheet of the magnetic flux loop through the junction of 0-form symmetries, and leaves the worldline W (γ) of the electric charge at the intersection between the junction and the surface Σ, due to the crossing effect described in Figure 3.
We note that the commutation produces a non-trivial operator that acts on the Hilbert space, instead of a number.Such a commutation relation by definition cannot be viewed as an 't Hooft anomaly and implies that the symmetry forms a higher group structure [40,41].
We proceed to prove the commutation relation (44).Let us illustrate this commutation relation in a simple setting where we take σ = −1 on the half-space x ≤ 0 and σ = +1 on the half-space x ≥ 0. The orientation-reversing domain wall is at x = 0, and it intersects the membrane operator V placed at z = 0, at the line x = 0, z = 0 along the y direction.See Figure 5.The membrane operator acts on the collection of edges in the z direction that intersects the entire membrane on the xy plane.Let us denote λ to be a Z 2 -valued 1-cocycle that takes the nonzero value on edges intersecting the membrane operator V , otherwise zero.λ is closed dλ = 0, and it satisfies λ ∪ λ = 0. Using XZX = −Z, we have where we used a + λ = ã + λ + 2a ∪ 1 λ as a Z 4 -valued cochain, and also d λ/2 = λ ∪ λ = 0 mod 2. On the low energy subspace of zero flux |a⟩ : da = 0, the term a ∪ d(a ∪ 1 λ) becomes a coboundary and can be ignored.We thus obtain where we used the fact that the first integral is a total derivative since (d λ)/2 = λ ∪ λ = 0 mod 2, and it can be written as the boundary contribution from the half-space x ≥ 0 and x ≤ 0. If there is no reversal of orientation, the two contributions would have been canceled, since the normal direction is opposite on the interface with respect to the two half-spaces.However, since the orientation is reversed on x ≥ 0, the two contributions add up to x=0 a ∪ λ, and from the definition of λ we find the commutation relation gives W supported on the intersection of the membrane and the domain wall, which is the y axis.From a similar manipulation, one can show the commutation relation holds for the operators supported on general geometry, where λ is some 1-cocycle which becomes nonzero for all edges intersecting the membrane, otherwise zero.For membranes that do not self-intersect, λ ∪ λ = 0, the commutation relation gives where the curve γ is the intersection of the domain wall with the Poincaré dual of λ, i.e. the membrane that supports V . . 11This extra sign represents an 't Hooft anomaly of the 3-group symmetry, which we will discuss in more detail in later sections.
We remark that since the cup product can be defined for any triangulated manifolds, we can also generalize the discussion to the toric code model on any 3d triangulated manifold M 3 , with a qubit on each edge, and in the Hamiltonian, the vertex term is the product of X on the edges that meet at the given vertex, while the plaquette term is the product of Z on the edges on the boundary of each triangular face.The ground state degeneracy is given by 2 |H 1 (M3,Z2)| .We note that M 3 does not have to be orientable.The operators U, V, W can be defined in a similar way, and on the low energy subspace with zero flux da = 0 they obey the same commutation relation.

Breaking the 3-group symmetry
In the toric code Hamiltonian, we can include a transverse field with coupling J:12 Such a term breaks the 2-form symmetry generated by closed Wilson loop W and also breaks the 0-form symmetry generated by U .This is consistent with the property that these symmetries mix into a 3-group, which implies that we cannot break the 2-form symmetry while preserving the 0-form and 1-form symmetry.Note that as long as J is small so that we do not pass through a phase transition, the 2-form and 0-form symmetries will both become emergent symmetries.
Instead of e X e , one can also modify the Hamiltonian with e Z e , then this breaks the 1-form symmetry generated by the magnetic defect V , while preserving the other symmetries, again compatible with the 3-group symmetry structure.
by a gauged SPT defect and the magnetic defects, and 2-form symmetry H 1 (BG, U (1)) = Z 2 2 .Denote the Z 2 × Z 2 gauge field by a, a ′ , then the generators can be written as: 0-form symmetry: As discussed in [44], the above gauged SPT defects together with 1-form, 2-form symmetry generated by magnetic surfaces and electric Wilson lines form a non-trivial 3-group.In Appendix B we provide another derivation of such 3-group symmetry by embedding the discrete gauge fields into continuous U (1) gauge fields.Such 3-group symmetry can be expressed in terms of their Z 2 background gauge fields.Let us write the background gauge fields of the above gauged SPT defects as C 1 , C ′ 1 , C ′′ 1 , C 2 , and the background gauge fields for 1-form and 2-form symmetry generated by magnetic and electric operators as B 2 , B ′ 2 , C 3 , C ′ 3 , respectively.Following the argument of Appendix B and (3.21) of [44], we find that these background fields satisfy where the above equations hold modulo two, and C1 , C′ 1 , C′′ 1 , B2 , B′ 2 denote some lifts of the Z 2 background gauge fields to Z 4 such that their mod 2 reductions equal respectively.The background gauge fields with the above relation describe a 3-group symmetry.
We note that we can set to zero any of the backgrounds in C 2 , C 1 , C ′ 1 , C ′′ 1 in the above equation, and they describe different subgroups of the 3-group.Let us focus on C 2 = 0, and 2 are consequences of the following property of the magnetic particles on the domain wall arising from the intersection of the magnetic flux loop with the domain wall: 14   • The charge-flux attachment implies that the magnetic particle on the domain wall for the gauge field a is attached to electric charge 1/2 for gauge field a ′ , and the magnetic particle on the domain wall for the gauge field a ′ is attached to electric charge 1/2 for the gauge field a.This implies that the magnetic particles on the domain wall obey the Z 4 fusion rule, where the fusion of two magnetic particles for the gauge field a (resp.a ′ ) gives an electric particle for the gauge field a ′ (resp.a), see Figure 6.This reflects that the (2+1)D Z 2 × Z 2 gauge theory with topological action dã 2 ∪ a ′ is described by untwisted Z 4 gauge theory, and the magnetic particles behave as the distinct anyons of the untwisted Z 4 gauge theory generating a Z 4 group under fusion.
• In addition, under the orientation reversal of the domain wall, the magnetic particle for a ′ is dressed with an additional electric particle of a, while the magnetic particle for a is left invariant under the orientation reversal.This effect can be understood from the fact that the mutual braiding phases must be complex conjugated under orientation reversal.If we denote the electric and magnetic particles of the (2+1)D Z 4 gauge theory as E and M , then the magnetic particles for a and a ′ can be associated with E and M respectively, while the charge under a and a ′ is M 2 and E 2 respectively.Under orientation reversal, we must have E → E (or vice versa), which shows that the magnetic particle for a must get attached to a charge of a ′ (or vice versa).This leads to the asymmetric action of the orientation reversal on the magnetic particles of a and a ′ as described above.
The attachment of electric charge 1/2 implies that when the magnetic surface has a non-trivial trivalent junction on the domain wall, it is regarded as a fusion of two magnetic particles on the domain wall, and there is an additional electric charge emitted from the intersection point (see Figure 6).This is the contribution of d B2 2 ∪ C 1 to dC ′ 3 , and the similar contribution of d B′ 2 2 ∪ C 1 to dC 3 .In addition, at the junction of fusing two domain walls into the trivial domain wall, the non-trivial domain walls can meet at the junction with the opposite orientation, and the magnetic 14 Another way to see these properties is as follows: we can describe the domain wall theory using U (1) 1-form gauge fields a, b, a ′ , b ′ .The domain wall theory is 1 2π  A similar figure can also be found in [44].
defect for the second Z 2 gauge group intersects the junction at a point that emits extra electric charge of the first Z 2 gauge group (this is analogous to the configuration described in Figure 3).This is the contribution of In the following, we will provide a description of such a 3-group symmetry using the toric code lattice model.

Lattice description of 3-group
We consider a three-dimensional euclidean lattice, with two types of qubits on each edge, acted on by the Pauli operators X, Y, Z and X ′ , Y ′ , Z ′ , respectively.The two Z 2 gauge fields are a = (1 − Z)/2 and a ′ = (1 − Z ′ )/2.The Hamiltonian is two copies of the Z 2 toric codes where H, H ′ are given in the previous example, and in H ′ the Pauli operators are replaced by the operators with a prime, indicating that they act on the other type of qubit.We will consider the following symmetry generators: • 0-form symmetry, generated by The operator supported on the entire space commutes with the Hamiltonian on the low energy subspace with zero flux.The commutation relation between U on the entire space and the vertex term of the Hamiltonian on a vertex v in the low energy subspace where da = 0, da ′ = 0 can be computed as where the integral is over the whole space, and v is a Z 2 0-cochain which is nonzero only on the vertex v.The same relation also holds for the vertex term of the Hamiltonian involving X ′ operators.
• The 1-form symmetry generated by the membrane operator V = e X e , V ′ = e X ′ e , where the two products are over the edges that intersect the membranes on the dual lattice that support the operators V, V ′ , respectively.
• The 1-form symmetry generated by the membrane operator defined on a closed surface Σ The excitation created by this operator is referred to as the twist string in [83].
• The 2-form symmetry generated by the line operators W = e Z e , W ′ = e Z ′ e , where the two products are over the edges on the curves that support the operator W, W ′ , respectively.
We will show that the operator U satisfies the following commutation relation on the low energy subspace of zero flux da = 0, da ′ = 0: where the operators are supported on the following geometry: • In the commutator [V, U ], the operator U is supported on the half-space x ≤ 0, and its orientation-reversal is supported on the other half space x ≥ 0. The domain wall that separates the two half-spaces intersect the membrane that supports the operator V ′ by a curve, and the commutation relation implies that this curve supports the Wilson line W .In addition, there is Wilson line W on the curve at the self-intersection of the membrane that supports V ′ in the region that supports U .Similarly, there is Wilson line W ′ on the curve at the self-intersection of the membrane that supports V in the region that supports U .
• In the commutator [V, T ], the Wilson line W ′ is supported at the curve on the intersection between the membranes that support V and T .Similarly, W is supported on the curve on the intersection of the membranes that support V and T ′ .
The derivation of the commutation relation ( 56) follows from a similar derivation in the Z 2 gauge theory example.Let us denote λ (resp.λ ′ ) to be a Z 2 -valued 1-cocycle that takes the nonzero value on edges intersecting the membrane operator V (resp.V ′ ), otherwise zero.The first commutation relation gives which in the low energy subspace da = 0, da ′ = 0 equals where γ is the curve given by the self-intersection of the membrane in the region that supports the operator U .
The second commutation relation can be derived similarly: Let us first consider the case that the membranes do not self intersect, λ ′ ∪λ ′ = 0, then at the low energy subspace with da = 0, da ′ = 0, the integral is where γ ′ is the intersection of the membrane that supports V ′ with the domain wall across which the orientation of U is reversed.

Anomaly and correlation functions in gauge theory with bosons
In this section, we will use examples to illustrate that the symmetry generated by the magnetic defects U g of codimension-2 has a mixed anomaly with other symmetries generated by gauged SPT defect W η (n) .In other words, the higher-group symmetry has an 't Hooft anomaly.The 't Hooft anomalies are completely described by non-trivial correlation functions of the symmetry generators that take non-trivial numerical values.We note that since the correlation functions involving the gauged SPT defect are all trivial, the symmetries generated only by the gauged SPT defects do not have an 't Hooft anomaly.

Example: Z 2 gauge theory in (3+1)D
The anomaly of the 3-group symmetry discussed in the previous section is computed in Ref. [44], and the anomaly can be derived from the correlation function of the generators of the 0-form symmetry, 1-form symmetry and 2-form symmetry in the 3-group symmetry.Denote the support of the magnetic defect by Σ, which is on the boundary of V 3 .Then the magnetic defect sources the gauge field where δ(V 3 ) ⊥ is the delta function 1-form that is Poincaré dual to V 3 .The correlation function of the magnetic defect and another gauged SPT defect is given by substituting the above value of the gauge field into the topological action on the manifolds that support the gauged SPT defect.Following the notation in Section 3.1.1,let us denote the generator of the center 1-form symmetry by V that is supported on a surface Σ, the generator for the 2-form symmetry by the Wilson line W that is supported on a curve γ, and the generator of the 0-form symmetry that supports a gauged Levin-Gu Z 2 SPT phase by U , which is supported on a three-dimensional region R.The correlation function of the generators is given by where the first sign is the braiding of γ and Σ, and the second phase is given by the self-braiding of the intersection of the membrane Σ on the domain wall.The correlation function can also be explained by the charge-flux attachment: the non-trivial self-braiding of the magnetic particle appears because there is non-trivial topological action on the domain wall, and the magnetic particles (which are the intersection point of the flux loop with the domain wall) carry electric charges, and thus the full braiding of the magnetic excitation on the domain wall produces a sign from the braiding of the electric charge and the flux loop.

't Hooft anomaly as correlation function
The 't Hooft anomaly of 3-group symmetry G (3) in (3+1)D can be described by an SPT phase in (4+1)D bulk with the 3-group symmetry, as classified by H 5 (BG (3) , U (1)) [41].Such bulk SPT phases can be described in terms of an effective action in the bulk that depends on the background gauge fields of the 3-group symmetry.In the following, we will express this effective action using the correlation function of the symmetry generators.We can describe the correlation function on a coordinate patch using the background gauge fields that describe the geometries supporting the defects, using the Poincaré duality.The backgrounds are The correlation function in terms of the backgrounds is: where we rewrite the integral on the left-hand side in terms of a (D + 1)-dimensional bulk manifold that bounds the spacetime.Using the 3-group relation for the background fields we find the correlation function ( 62) is given by e iS bulk with where P(B 2 ) = B2 ∪ B2 − B 2 ∪ 1 dB 2 is the Pontryagin square operation that takes Z 2 valued 2-cocycle and maps it to a Z 4 valued 4-cocycle.On a coordinate patch, B 2 = dλ, and the bulk term can be written as a boundary term.The complete bulk action is given by evaluating the action and gluing B 2 = dλ with a suitable transition function across the coordinate patches to obtain non-trivial B 2 by the analogue of the clutching construction for vector bundles.
As discussed above, the correlation function (62) of the magnetic defect V , the Wilson line W and the domain wall U is given by e iS bulk .In particular, the first term in (65), δ(V 3 ) ⊥ δ(γ) ⊥ = Link(Σ, γ) with Link for the linking number, represents the mutual braiding between the electric particle and the magnetic flux loop.The second term represents the framing anomaly of the magnetic particle on the codimension-1 defect due to its semion self-statistics.

Lattice description of the anomaly in Z 2 gauge theory
The anomaly can be described by the following commutation relations The first equation is valid in the whole Hilbert space of the lattice model.The second equation is valid only within the low energy subspace with the zero flux, and thus should be regarded as an anomaly of emergent symmetries on the low energy subspace.This reflects that while the operators V, W commute with the Hamiltonian and generate global symmetries in the whole Hilbert space, U only works as an emergent symmetry of low-energy subspace with zero flux.The first commutator represents the braiding of the Wilson line and the magnetic defect, with the membrane that supports V having an odd number of intersections with the Wilson line W .The second commutator follows from [V, U ] = W , and the first commutator, and it represents the braiding between the extra electric charge created by W carried by the magnetic excitation, and the magnetic excitation (where the magnetic excitations are separated also in time due to the ordering in the commutation relation).In other words, the full mutual braiding between magnetic excitations on the domain wall produces a sign.
The anomaly precludes the presence of a symmetry-preserving gapped ground state, which is consistent with the fact that the ground state subspace spontaneously breaks the emergent 3-group symmetry on topologically non-trivial manifolds.

Example: untwisted
We can repeat the discussion for Z 2 × Z 2 gauge theory.For simplicity, let us focus on the "subgroup" 3-group symmetry that only involves the center 1-form symmetry, generated by the magnetic defects V, V ′ , the 2-form symmetry generated by the Wilson lines W, W ′ , and the 0-form symmetry generated by the domain wall U that hosts a gauged SPT phase with Z 2 × Z 2 symmetry: in terms of the Z 2 × Z 2 gauge fields a, a ′ , the symmetry generators are in addition to the magnetic defects V, V ′ supported on surfaces Σ, Σ ′ , which are on the boundary of V 3 , V ′ 3 , respectively.The magnetic defects source the gauge field The correlation function on a coordinate patch can be computed by substituting (68) in the topological actions on the gauged SPT defects: using (67), we find The first two terms describe the braiding of the magnetic defects with the Wilson lines, while the last term describes the mutual braiding of the magnetic defects V, V ′ on the domain wall R, where the magnetic defects intersect the domain wall by 1-dimensional loops.
Anomaly from correlation function In terms of the background fields, the correlation function is e iS bulk with where we used with tilde denotes a lift of the gauge field to Z 4 value.As discussed above, the correlation function (69) of the magnetic defects V, V ′ , the Wilson lines W, W ′ , and the domain wall U is given by e iS bulk .In particular, the first term in S bulk , δ(V 3 ) ⊥ δ(γ) ⊥ = Link(Σ, γ) and δ(V ′ 3 ) ⊥ δ(γ ′ ) ⊥ = Link(M ′ 2 , γ ′ ), represents the mutual braiding of electric particles and magnetic flux loops for the two Z 2 gauge fields.The second term in S bulk describes the braiding between magnetic particles (which acquire fractional statistics) induced on the domain wall due to intersection of the domain wall with magnetic flux loops.
5 Application: higher-group symmetry and Clifford hierarchy of logical gates In this section, we will explain that the higher-group symmetry of Hamiltonian models gives non-trivial constraints on the logical gates realized by the symmetry generators on the ground state subspace.We will illustrate this with the stabilizer Hamiltonian, where the Hilbert space is given by N types of qubits on each edge of the lattice.The Z N 2 gauge theory is realized as the low energy subspace of the topological stabilizer model, where the ground state subspace is referred to as the codespace and encodes logical qubits.A unitary operator acting within the codespace is referred to as a logical gate.The symmetry generators preserve the low energy subspace, and they are logical gates on the codespace.
We will show that higher-group symmetry commutation relation gives rise to new logical gates in Z N 2 toric code model, such as control-Z (CZ) gate in (3+1)D Z 2 toric code.In Ref. [93], it is stated that the symmetry generators of (d + 1)-dimensional Z N 2 gauge theory is bounded by d-th level of the Clifford hierarchy denoted as P d .We will show that the such bound can in fact be improved by considering the gauged SPT defects and their higher-group commutation relations.

Control-Z gate in (3+1)D Z 2 toric code from Klein bottle
In the lattice Hamiltonian models for the Z 2 gauge theory in (3+1)D discussed in Section 3, we have seen that the 3-group symmetry leads to the following commutation relation between symmetry generators of the form together with [U, W (γ)] = 1, where V (Σ) represent the magnetic defects that generate the Z 2 1-form symmetry, and W (γ) is the electric Wilson line operator generating the Z 2 2-form symmetry.Note that the above commutator gives a non-trivial logical gate if and only if U supports an orientation-reversing defect on it, and Σ intersects the orientation-reversing defect along a topologically non-trivial 1-cycle γ.This can happen when we have a non-orientable 3d space such as Klein bottle × S 1 .Under these conditions, the magnetic defect V (Σ) is then identified as the Pauli X gate acting on the codespace, while W (γ) is regarded as the Pauli Z gate.The above commutation relation then implies that the SPT defect U encodes CZ logical gate acting on the codespace.There are 3 logical qubits, and depending on where we put the orientation reversal the CZ gate acts on two of them.

Review of Clifford hierarchy
More generally, in lattice models that realize Z N 2 gauge theories for general N , the sets {P j } of logical gates labeled by positive integer j that describe the symmetry generators are organized inductively by a structure called Clifford hierarchy [93,133]: • P 1 is the group generated by all Pauli X, Z gates acting on the codespace • P j for higher j is defined as the set of unitary operators U satisfying U P 1 U † ⊆ P j−1 for j ≥ 2 The set P j forms a group for j = 1, 2, where P 1 is called Pauli group and P 2 is called Clifford group.P j for j ≥ 3 does not have a group structure and constitutes the j-th level of Clifford hierarchy.

Relation between Clifford hierarchy and higher-group symmetry in (3+1)D
Let us discuss the relation between 3-group symmetry in Z N 2 gauge theories in (3+1)D, and the Clifford hierarchy in the corresponding lattice Hamiltonian model.
First, we will show that the action of 1-form symmetry of (3+1)D Z N 2 gauge theory given by (1+1)D SPT phase is contained in a certain subgroup P ′ 2 of the Clifford group P 2 , where P ′ 2 is generated by S, CZ gates and overall U (1) phase e iϕ ∈ U (1) acting on the codespace.
This can be established by computing the commutation relation between the 1-form symmetry generator U 1 (Σ) and logical X, Z operators realized by V (Σ), W (γ) with γ, Σ the non-trivial 1, 2-cycles of the manifolds respectively.The symmetry generator U 1 (Σ) given by SPT phase commutes with W (γ), so [U 1 (Σ), Z] = 1 for all Pauli Z operators.Also, the commutation relation between U 1 (Σ) and V (Σ ′ ) is in general given by the 2-form symmetry generator supported on the intersection of two surfaces Σ and Σ ′ , so it implies that [U 1 (Σ), X] has the form of since a non-trivial generator of 2-form symmetry is generally given by the electric line operator W (γ) that corresponds to a Z gate.The above commutation relations involving X, Z are satisfied if and only if U 1 (Σ) is the element of P ′ 2 .In particular, the non-trivial commutation relation [U 1 (Σ), X] = ±Z implies that the 1-form and 2-form symmetry forms a 3-group.Therefore, in order for U (Σ) to realize the non-Pauli Clifford gate in P ′ 2 \ P 1 , it is necessary that the 1-form symmetry U 1 , V and 2-form symmetry W mix into 3-group.
Let us then look at the generator U 0 of the 0-form symmetry given by (2+1)D SPT phase, which fills the entire 3d space.The commutation relations involving Z, X are in general given in the form of The set of unitary operators satisfying the above commutation relation defines a subset P ′ 3 of P 3 .The possible action of 1-form symmetry in Z N 2 gauge theory is bounded by the set P ′ 3 .When the commutation relation is given in the form of [U 0 , X] = ±Z, it implies that the 0-form, 1-form and 2-form symmetries together form a 3-group, as we have seen in previous sections.Meanwhile, when [U 0 , X] is given by a non-trivial Clifford gate in P ′ 2 \ P 1 , it implies that the 0-form symmetry induces the permutation of 1-form symmetry defects.In that case, the 0-form symmetry U 0 encodes the non-Clifford gate in P ′ 3 \ P ′ 2 . 15  5.4 Constraints on logical gates in general dimensions from higher-group symmetry 5.4.1 Higher-group symmetry in untwisted Z N 2 gauge theory on the lattice in general dimension Let us consider the lattice Hamiltonian model for untwisted G = Z N 2 gauge theory on d-dimensional hypercubic Euclidean lattice Z d .On each edge we place N qubits, acted on by the Pauli matrices X (I) , Y (I) , Z (I) with I = 1, • • • , N .We can obtain a non-trivial logical code subspace by picking appropriate boundary conditions, although the precise details are not important for our discussion below.
The theory has higher-group symmetry that mixes the symmetries generated by the gauged SPT defects and the 1-form symmetry generated by the magnetic defects, and such higher-group symmetry leads to the non-trivial algebra on the logical gates described by the symmetry generators on the ground state subspace.The symmetry generators are • 1-form symmetry generated by the magnetic defect, represented by the operator that is the product of Pauli X gates.For the magnetic defect that carries holonomy g = (g where the product is over the edges that cut the codimension-one subspace Σ on the dual lattice.The superscript I labels the Pauli operators that act on different qubits, and it is included in the product if and only if the Ith component of g ∈ Z N 2 is the non-trivial Z 2 flux.• n-form symmetry generated by gauged SPT defect.For the symmetry group element [η where a = (a (1) , a (2) , e )/2, and σ assigns orientation to all simplices in the (d − n)-dimensional subspace R on the lattice.The operator can be described in the Z (I) -eigenbasis for all I = 1, • • • , N .The integral a * η (d−n) is given by summing over the contributions from (d − n)-dimensional simplices, where on each (d − n)-simplex it is given by the value of a * η (d−n) for the field specified by the eigenvalue of a(e) on each edge e in the simplex.These symmetries mix into a higher group, which can be shown from the commutation relation (where we omit an overall phase): where U η (R, σ) generates an n-form symmetry, U i A g η (R A , σ) generates an (n + 1)-form symmetry, and U i B g η (R B , σ) generates an (n + 2)-form symmetry.We take Σ to be a codimension-1 hyperplane without self-intersection on the dual lattice.On the right-hand side of the commutation relation, )is supported on region R A , where R A is the intersection between Σ and R.This contribution is discussed in Ref. [90].Examples of such commutation relation are the commutator [V, T ] = W ′ and [V ′ , T ] = W in Eq. ( 56) in (3+1)D Z 2 2 toric code model in Section 3.1.The commutation relation implies that the intersection of the symmetry generators V, U η for the 1-form and n-form symmetries produces the generator U i A g η of (n + 1)-form symmetry.Such higher-group symmetry can be described in terms of the background gauge fields B 2 , C n+1 , C n+2 of the symmetries by the relation of the form dC n+2 ⊃ B 2 ∪ C n+1 , such as the first term on the right-hand side of the last two lines in Eq. ( 50) in (3+1)D Z 2 2 toric code model in Section 3.1.• The (d − n)-dimensional subspace R has a (d − n − 1)-dimensional orientation-reversing defect on it, across which the orientation σ changes.U i B g η (R B , σ) is supported on the region R B given by the intersection between Σ and the orientation-reversing defect in R. Examples of such commutation relation are Eq.( 44) and the first line in Eq. ( 56) in the (3+1)D Z 2 and Z 2 2 toric code models in Section 3.1.The commutation relation implies that the intersection of the symmetry generators V, U η for the 1-form and n-form symmetries produces the generator U i B g η of (n + 2)-form symmetry.Such higher-group symmetry can be described by the relation for background gauge fields of the form dC n+3 ⊃ B 2 ∪ Bock(C n+1 ), such as Eq. ( 37) and Eq. ( 50) in the (3+1)D untwisted Z 2 and Z 2 2 gauge theories in Section 3.1.

Consequences for Clifford hierarchy and comparison with the literature
The above commutation relation implies that the (d − n)-dimensional gauged SPT defect U η gives an element of P ′ d−n , where P ′ k for k ≥ 3 is defined inductively as the set of unitary operators U satisfying [U, X] ⊆ P ′ k−1 and [U, Z] = 1, with P ′ 2 defined earlier by the subset generated by the S, CZ gates and overall U (1) phase e iϕ ∈ U (1).This bound on the possible action of SPT logical gates U η ⊆ P ′ d−n for 0 ≤ n ≤ d − 1 refines the bound given in Ref. [93], where it states that symmetry defect of (d + 1)-dimensional Z N 2 gauge theory is bounded by P d .
6 d-group symmetry in (d + 1)D Dijkgraaf-Witten gauge theory with bosonic charges 6.1 d-group symmetry from 1-form transformations and generalized Witten effect In the general bosonic gauge theory with boson particles, let us consider the symmetry generated by the defect with gauged SPT phase supported on n-dimensional submanifold, and the symmetry generated by the magnetic defect: ), for n ̸ = 0, 1 where the extension is defined by a )), given by S ⊂ Aut(G) leaves the topological action ω (D) invariant.In the 0-form symmetry G (0) we quotient out the subgroup K generated by {i g ω (D) : g ∈ Z(G)}, since such gauged SPT defects are trivial as explained in Section 2.3.
In general, the 0-form symmetry G (0) can permute the generators of other symmetries G (k) using the automorphisms in S, and also dress the magnetic defects in G (1) with gauged SPT defects.We thus have a set of group homomorphisms: such that for n > 1, the permutation action arises entirely from the automorphisms in S. For n = 1, the group homomorphism describes how a codimension-2 magnetic defect is permuted into a combination of a magnetic defect and a codimension-2 gauged SPT defect as it crosses a codimension-1 gauged SPT domain wall, as can be determined by dimensional reduction and the slant product.In the discussion below we will omit S for simplicity. 16  16 The Dijkgraaf-Witten theory of finite group G and topological action ω (D) has (D − 1)-fusion category symmetry ΣZ Vec ω (D) G .Mathematically, the above symmetries describe its invertible parts.
When the magnetic defect intersects the gauged SPT defect, it creates a magnetic source on the submanifold of some dimension n that supports the gauged SPT defect.Due to the charge-flux attachment or generalized Witten effect, this magnetic source is attached to a new gauged SPT defect of dimension (n − 1).In other words, a new gauged SPT defect of lower dimension is emitted from such a junction.The property that the intersection of the magnetic defect and the original gauged SPT defect that generate 1-form and (D − n − 1)-form symmetry creates another gauged SPT defect of lower dimension that generates higher-form symmetry is the hallmark of higher-group symmetry (see e.g.[40,41]): the higher-form symmetry mixes with the lower form symmetries.If we wish to study the fractionalization [23,134,41,57] of only the lower form symmetry part of the higher group, this represents an obstruction to symmetry localization: we cannot only consider defects of the lower form symmetries, since some configuration of defect intersection necessarily produces the defects that generate the higher-form symmetry.All of these follow from the generalized Witten effect or the charge-flux attachment.Thus higher-group symmetry is very generic in gauge theory in (3+1)D and higher spacetime dimensions.It also applies to higher-form gauge theories, which also have the generalized Witten effect from fiber integration. 17et us phrase the above description using background gauge fields of the symmetries.The emission of the gauged SPT defect at various junctions in the presence of the magnetic defect indicates that performing the corresponding 1form transformation for the 1-form symmetry generated by the magnetic defect produces an extra background gauge field for the symmetry generated by the gauged SPT defects, and such mixing of transformation is the hallmark of a higher-group symmetry [40,41].Let us turn on the background gauge fields C n for the symmetries generated by the gauged SPT defects.Denoting the dynamical G gauge field by a, the action is where a * η (n) is the pullback of the group cocycle η (n) by the gauge field a.For the (n − 1)-form symmetry i that generates the Z Ni subgroup, we turn on background gauge field C n = (C n ) i where (C n ) i is the background gauge field for the Z Ni subgroup symmetry generated by (η (D−n) ) i .For simplicity, we will take the spacetime to be a D-dimensional torus.The higher-group symmetry involves the 1-form symmetry generated by the magnetic defect, which is a shift symmetry of the gauge field.Consider a → a + λ , where λ is a Z ω (G)-valued 1-form, and let us expand it as for some basis integer 1-forms λ g that takes value 0, 1 on basis 1-cycles.Let us take dλ g = 0.In fact, on spacetime that is a D-dimensional torus, we can take dλ g = 0 in real coefficient.In such case, there is no background for the center 1-form symmetry, B 2 = 0. We note that B 2 = gdλ g is equivalent to inserting a magnetic defect that carries holonomy g at M D−2 = ∂V D−1 with λ g = δ(V D−1 ) ⊥ .Thus for B 2 = 0, we take V D−1 to have no boundary.In other words, we first insert magnetic defect on the boundary of some open submanifold V ′ D−1 , then remove the magnetic defect by closing up the boundary of For the action to be invariant up to terms that depend on the classical fields λ and C k but independent of the dynamical field a (such terms describe the 't Hooft anomaly), the backgrounds in general must transform in a non-linear way.To see this, we note that the cocycle changes by We can verify the relation by integrating the cocycle over arbitrary n-dimensional torus, where λ changes the holonomy of the gauge field (which is flat for finite gauge group) on the circles inside the torus.Concretely, for each 1-cycle γ j of the torus, one can rewrite the integral on a torus with holonomy a j + λ j in the direction of γ j as the integral on the disconnected sum of two tori with holonomy a j and λ j respectively.By performing this process for each 1-cycle of the torus, one can decompose T n (a + λ) * η (n) into the right-hand side of (84) in addition to T n a * η (n) , which verifies (84).Thus the term C n ∪ a * η (n) produces terms with lower degree group cocycles, and to compensate for the change, the backgrounds of higher degree that couple to these lower cocycles must be shifted.Such mixing of transformation is the hallmark of higher-group symmetry, or the symmetry extension involving symmetry of different form degrees.The correction can be obtained by iteration, starting from correcting the transformation of C 2 , C 3 , • • • , C D−1 by non-trivial shift.To compute the shift, we also recall that i g η (n) can be decomposed into two parts where |η (n) | is the order of the class [η (n) ] in H n (BG, U (1)).We will see that the second term, i B g η (n) , does not contribute to the shift of the background gauge fields C k when the transformation parameter satisfies dλ g = 0 in real coefficients.
Let us denote the shifted backgrounds by C λ n , which differ from C n by a shift induced from the λ transformation.We note that C 1 does not need to be shifted, C λ 1 = C 1 .The first case of correction on the transformation starts from C 2 that couples to the gauged SPT defect of dimension (D − 2).The background C 2 needs to be shifted as where we expand the backgrounds C n under some basis in H D−n+1 (BG, U (1)), and ) is the expansion of x under the basis of H n (BG, U (1)). 18The physical meaning of the above transformation of C 2 is the following.The fact that the transformation shifts the background C 2 means that different ways of adding the magnetic defect can produce a gauged SPT defect that couples to the background C 2 .From the first term with C 1 , if we intersect the magnetic excitation with the domain wall for C 1 , then there is additional excitation created by the gauged SPT defect of dimension (D − 2).This is the statement about the 0-form symmetry acts on the 1-form symmetry: when a magnetic defect of holonomy g crosses the domain wall, it is stacked with additional gauged SPT defect of dimension (D − 2).
Let us continue to the correction for the transformation of C 3 : Continuing the induction process, if we already computed the shifted backgrounds Such mixture of transformation for background gauge fields describe a (D − 1)-group symmetry (if . The physical meaning of each term in the shift of C n is different way of producing an extra gauged SPT defect that couples to C n by adding a magnetic defect.

Description of Postnikov classes
We can describe the modification of the background gauge transformations as modified cocycle condition where the right hand side is the Postnikov class of the higher group.Denote the background for the 1-form symmetry generated by the magnetic defects by B 2 .Under the 1-form transformation B 2 → B 2 +dλ, a → a+λ, the background gauge field C n is shifted by the anomaly descendant α n of f n+1 , i.e. dα n = f n+1 | B2+dλ − f n+1 | B2 . 19Then α n with dλ = 0 is the shift transformation of the background C n in (88).From a similar discussion as in Section 2, α n | dλ=0 is obtained from the reduction of f n+1 on a circle with B 2 = λdϑ/2π, where ϑ ∼ ϑ + 2π is the angular coordinate on the compactified circle.
To obtain f n+1 from α n , let us start with B 2 = 0, then since f n+1 | B2=0 = 0, we have f n+1 | Bn=dλ = dα n .This is the expression of f n+1 on coordinate patches, where B 2 = dλ.Then we can obtain f n+1 for general B 2 by the analogue of the clutching construction of vector bundles. 20lternatively, we can infer the Postnikov classes from the junction of symmetry defects using the charge-flux attachment: when a magnetic defect intersects a gauged SPT defect, there is a lower-dimensional gauged SPT defect emitted at the intersection as specified by the slant product.The Postnikov class is an element of [f n+1 ] ∈ H n+1 (BG (n−1) , G (n−1) ).For (n − 1)-group G (n−1) , which in general involves k-form symmetries for 0 ≤ k ≤ n − 2, each element in H n+1 (BG (n−1) , G (n−1) ) is the symmetry defect of G (n−1) that emits from a codimension-(n + 1) junction of these k -form symmetry defects (where 0 ≤ k ≤ n − 2).
The Postnikov class for the d-group symmetry in Dijkgraaf-Witten theory is the element of H n+1 (BG (n−1) , G (n−1) ), such that the emission of the symmetry defect at the junction is specified by the charge-flux attachment.By scanning the possible defect configurations that can produce the gauged SPT defects for the (n − 1)-form symmetry, inductively starting from n = 1, we obtain the Postnikov classes f n+1 for the d-group symmetry.
For instance, f n+1 for several lower values of n are described as follows.For n = 1, there is no shift in the background C 1 , C λ 1 = C 1 .Similarly, there is no configuration of symmetry defect that can emit a domain wall decorated with gauged SPT phases.Thus

n = 2, extension of 1-form symmetry
We have where on a 3-simplex, the first term is dx/|ω (D) | with 2-cocycle x whose value on face f is as follows: denote the value of B 2 on face f by g = B 2 (f ), then x(f ) = i B g (ω (D) ), which gives an element in H D−2 (BG, U (1)).The second term computes the cup product of face f , which has g = B 2 (f ), with edge e in the 3-simplex, which has C 1 (e) ∈ H D−1 (BG, U (1)), with the cup product coefficient given by i A g (C 1 (e)) ∈ H D−2 (BG, U (1)).The second term on the rhs above describes the codimension-2 defect that arises from dimensionally reducing the codimension-1 gauged SPT defect, described by C 1 , on the magnetic defect described by B 2 .By introducing a coboundary operation δ ρ twisted by ρ, we can rewrite the above equation as The equation is the twisted version of (30) in the presence of the background gauge field C 1 , and it describes the action of the 0-form symmetry acting on the total 1-form symmetry given by the extension of the center 1-form symmetry Z ω (G) by H D−2 (BG, U (1)).
In this case, the 0-form and 1-form symmetry groups G (0) and G (1) describe a 2-group symmetry with a trivial H 3 (BG (0) , G (1) ) Postnikov class.It is possible to get a non-trivial H 3 Postnikov class by considering the permutation action arising from S ⊂ G (0) .Some examples of such non-trivial classes were studied in (2+1)D finite gauge theories based on dihedral groups [23,43].
The last term β contributes to f n+1 by a total derivative, using dB 2 = 0: which can be absorbed into the definition of Cn, and such redefinition has the effect of changing the fractionalization class [23,134,41,57].This gives the f n+1 from (αn)| dλ=0 in (88) up to redefinitions of the background fields.As such, we set β n−2 = 0 in our computation.
6.2.2 n = 3, 3-group symmetry, and H 4 Postnikov class We have On a 4-simplex, the first term receives contributions from cup product of surfaces f, f ′ , where B 2 (f ) = g ∈ Z ω (G), and C 2 (f ′ ) ∈ H D−2 (BG, U (1)), and the coefficient of the cup product is given by i A g C 2 (f ′ ), which is an element in H D−3 (BG, U (1)).The second term receives contribution from faces f, f ′ and edge e where ( f ∪ 1 f ′ ) ∪ ẽ ̸ = 0 where f , f ′ , ẽ denote the cochains that takes value 1 on f, f ′ , e and 0 otherwise.We have ).The remaining terms receive contribution from 3-simplex c and edge e such that c ∪ ẽ ̸ = 0, from faces f, f ′ such that f ∪ f ′ ̸ = 0, and from face f and 3-simplex c such that f ∪ 1 c ̸ = 0.
Each term on the right hand side above can be understood physically as follows.The first term, −i A B2 (C 2 ), describes a codimension-3 gauged SPT defect (described by C 3 ) that is sourced by the codimension-3 crossing between the codimension-2 magnetic defect (described by B 2 ) and the codimension-2 gauged SPT defect (described by C 2 ).In the case D = 4, this corresponds to an electric charge that is sourced at the crossing point between the codimension-2 magnetic and gauged SPT defects, and was analyzed in [83].Using f 3 , we find that the first term and the last term combine into a term of the form The second term can be rewritten as the following form: The physical meaning of this term was analyzed in [83] in the context of (3+1)D untwisted Z 3 2 gauge theory.It describes a source for a codimension-3 gauged SPT defect arising from the intersection of two magnetic defects on the codimension-1 gauged SPT domain wall described by C 1 .In the case D = 4, this corresponds to a source of electric charge at the (non-generic) crossing point between the magnetic defects and the codimension-1 gauged SPT domain wall.
The third term, −i B Bock(B2) (C 1 ), arose in our example in Section 3.2 on (3+1)D untwisted Z 2 2 gauge theory.It describes how a junction of magnetic defects, intersecting with a codimension-1 gauged SPT domain wall, sources a codimension-3 gauged SPT defect.In the case of D = 4, this corresponds to a source for an electric charge, as seen in Figure 6.
The fourth term, −i B B2 (Bock(C 1 )), arose in our example in Section 3.1 on (3+1)D untwisted Z 2 gauge theory.The intersection of the magnetic defect with the codimension-2 junction of codimension-1 domain walls, sources a codimension-3 gauged SPT defect.In the case D = 4, this corresponds to a source of electric charge, as shown in Figure 3.
Finally, the fifth term, D) , can be understood as a combination of effects described previously.First, the codimension-3 junction of magnetic defects can 'emit' a codimension-2 gauged SPT defect, as described in Section 2.4.Next, the codimension-3 intersection between the codimension-2 magnetic defect described by B 2 and the codimension-2 emitted SPT, described by i B dB2/|ω (D) | ω (D) , sources a codimension-3 gauged SPT defect.In the case D = 4, this corresponds to yet another possible source of electric charge.

Example: untwisted Z 3 2 gauge theory in (3+1)D
Let us illustrate the previous discussion using twisted Z 3 2 gauge theory in (3+1)D, which has 3-group symmetry as discussed in [83].In Appendix B we give another derivation of the 3-group symmetry by embedding the discrete gauge fields into continuous U (1) gauge fields.
Denote the Z 2 gauge fields by a 1 , a 2 , a 3 , and the shifts by λ 1 , λ 2 , λ 3 .Let us consider the 0-form symmetry generated by (−1) a1∪a2∪a3 , and the 1-form symmetry generated by the gauged SPT phase (−1) ai∪aj for i < j, and the 2-form symmetry generated by the Wilson lines.Denote their backgrounds by Under the shift a i → a i + λ i with dλ i = 0, for the action to be invariant up to classical terms, the backgrounds are shifted as This is consistent with the relations derived in [83], where B i 2 is the background for the center 1-form symmetry that transforms a i .In the above relation between background gauge fields, B k 2 → B k 2 + dλ k reproduces (99) in the case of trivial backgrounds B k 2 and closed λ k .
7 Anomaly of d-group symmetry in Dijkgraaf-Witten gauge theory The anomaly of d-group symmetry G (d) in spacetime dimension D can be described by an SPT phase in a (D + 1)dimensional bulk with the d-group symmetry.Such SPT phases are characterized by an element in H D+1 (BG (d) , U (1)) [41] (recall D = d + 1), and can be described in terms of a bulk effective action that depends on the background gauge field for the d-group symmetry, extended into the (D + 1)-dimensional space-time.In the following, we will derive the anomaly by studying the correlation functions of the symmetry generators.The correlation function is non-trivial only when the magnetic defect is present.For magnetic defect carrying holonomy g in the center of gauge group, and supported on M g D−2 , which is on the boundary of V g D−1 , the defect sources the gauge field a Then the correlation function of magnetic defect U g and gauged SPT defect For instance, consider ω (D) = 0, and the 0-cocycle i g1 i g2 • • • i gn η (n) ̸ = 0 is a nonzero constant, and take M n to be an n-dimensional torus.The correlation function of the gauged SPT defect W η (n) (M n ) and the magnetic defects of holonomies g 1 , • • • , g n−1 , g n is given by (n + 1)-linking number: where the integral in Link {M gi D−2 } n i=1 , M n is over the D-dimensional spacetime.Examples with 3-loop braiding in (3+1)D [135] described by the above correlation functions are discussed in [136,44].

't Hooft anomaly of d-group symmetry In terms of background gauge fields
the correlation function is given by e iS bulk , where on a coordinate patch we have This is the bulk term contributed from a coordinate patch, where B 2 = dλ is exact.The bulk integral is given by summing over the contribution from all coordinate patches, with transition function that changes λ to produce non-trivial B 2 background gauge field by the analogue of the clutching construction for vector bundles.
8 3-group symmetry in Z 2 gauge theory with fermion particles in (3+1)D In this section we discuss the 3-group symmetry in bosonic Z 2 gauge theory in (3+1)D where the electric particles are emergent fermions.Such theory in the absence of magnetic defects can be described by a Z 2 gauge field a that satisfies da = w 2 (T M ), where w 2 (T M ) is the second Stiefel-Whitney class of the spacetime manifold [137].We do not include additional topological action for a in the path integral.
As an application and consistency check, we use the 3-group symmetry to enrich the theory with ordinary symmetry G b (in this section, G b will be a global symmetry instead of the gauge group of dynamical gauge field), by embedding the G b bundle into the 3-group bundle, following the discussion in [41].The resulting theory is the 'bosonic shadow' of a fermionic SPT phase with G b and Z f 2 symmetries, related by gauging the fermion parity symmetry Z f 2 .We show that the 3-group symmetry in the Z 2 gauge theory with fermionic electric charge provides a compact and explicit way to characterize and classify interacting fermionic SPT phases in (3+1)D based on field theory.This gives a simpler approach as compared with the results of [34], which is based on explicit microscopic constructions of fixed point wave functions.In particular, we obtain a simple expression for the O 5 obstruction, and we show that it agrees with [34].Ref. [138] followed a similar approach, but considered a subclass of fermion SPT phases (those described by group supercohomology [139]) and restricted to the case where the fermionic symmetry group splits as G f = G b × Z f 2 ; our approach applies to general fermionic SPT phases with general unitary internal G f symmetry.

3-group symmetry
Since the gauge theory has fermionic particles, the invertible topological defects are obtained by gauging the fermion parity symmetry on submanifolds decorated with invertible topological phases.The theory has the following symmetries: • 2-form symmetry generated by the Wilson line • 1-form symmetry generated by the magnetic surface defect V (Σ).
• 1-form symmetry generated by the gauged invertible fermionic phases in (1+1)D: on surface Σ, the defect is [31,53] where ρ is the spin structure on the defect, q ρ is the quadratic function on Σ that takes Z 2 valued 1-form and produces a Z 4 valued 2-form [140,141], and a ′ is a dynamical Z 2 gauge field related to the (3+1)D gauge field by where a| Σ is the restriction of a to the defect.In particular, in the absence of the magnetic defects, da ′ = 0. We note that the topological action π 2 q ρ (a ′ ) describes the Kitaev chain [142,143] as discussed in [31,144,53].
To investigate the 3-group symmetry, let us couple U to a background 2-form gauge field C 2 , and we turn on background gauge field B 2 that couples to the center 1-form symmetry generated by the magnetic defect, and background C 3 for the 2-form symmetry generated by the Wilson line: where the Wilson line of a describes bulk emergent fermion particle, and the first term can be written as an integral over the Poincaré dual of C 2 , where the spin structure ρ and the gauge field a ′ is well-defined.
To see the 3-group symmetry, let us follow the procedure in Section 6.Let us perform a transformation of the 1-form center symmetry (whose background is B 2 ) We will take 1-form λ to satisfy dλ = 0, and thus we can turn off B 2 .Using the property of quadratic function q(x + y) = q(x) + q(y) + 2x ∪ y for Z 2 gauge fields x, y, we find that for the action to be invariant up to classical terms that only depend on the backgrounds C 2 , C 3 , λ but not the dynamical fields, the backgrounds need to be shifted as This implies that if we insert a magnetic defect that intersects with the surface supporting the defect U , there is additional electric charge.This is consistent with [83].Moreover, if we perform transformation C 2 → C 2 + dλ ′ (and keep B 2 = 0), the first term in (109) changes by where the equality follows from integration by parts and the dependence of the quadratic function on the spin structure [140,141,53].Thus to compensate for the change under the transformation λ ′ , the background C 3 is shifted as We note that the surface defect U that couples to the background C 2 squares to the Wilson line operator W that couples to the background C 3 , when the surface that supports the defect has self-intersections: where we used the Wu formula on Σ, a ′ ∪ a ′ = w 1 (T Σ) ∪ a ′ [137], and w 1 (T Σ) = δ Σ (γ) ⊥ where the subscript in δ Σ restricts the perpendicular direction with respect to embedding the curve γ inside Σ to be zero. 23The property that the surface defect squares to the line defect implies that the 1-form symmetry combines with the 2-form symmetry into a 3-group.We can summarize the transformations of C 3 in ( 111) and ( 113) into the following relation between the background gauge fields and the Postnikov class of the 3-group symmetry is This is consistent with [83].
't Hooft anomaly Let us compute the 't Hooft anomaly using the correlation function of the symmetry generators.If we insert the magnetic defect V (M 2 ) at surface M 2 , which is on the boundary of V 3 , it activates the gauge field a = a g , a g = δ(V 3 ) ⊥ .
The configuration of the above symmetry generators is equivalent to the background gauge fields where there is a shift in B 2 = w 2 (T M ) + δ(M 2 ) ⊥ by w 2 (T M ), since the Wilson line is a fermion.The correlation function can be written in terms of the background gauge fields as e iS bulk , where where Y is a (4+1)D manifold that bounds the spacetime.This is the expression of the effective action on a coordinate patch for the bulk invertible phase with 3-group symmetry that describes the anomaly, where B 2 = dλ with λ = δ(V 3 ) ⊥ .The effective action on general bulk manifold can then be obtained by the analogue of clutching construction for vector bundles.In particular, the first term in the bulk effective action is where the equality uses the Wu formula [137].

Review of fermionic SPT phases in (3+1)D
Let us consider fermionic SPT phases in (3+1)D with an internal 0-form fermionic symmetry group G f .G f is in general a central extension of the bosonic symmetry group G b by Z f 2 , specified by extension class [ω 2 ] ∈ H 2 (BG b , Z 2 ).Such fermionic SPTs are known to be classified by the following data: [34] n 1 ∈ C 1 (BG b , Z T ), n 2 ∈ C 2 (BG b , Z 2 ), n 3 ∈ C 3 (BG b , Z 2 ), ν 4 ∈ C 4 (BG b , U (1)), satisfying Here s 1 ∈ Z 1 (BG b , Z 2 ) and s 1 (g) ̸ = 0 means that g is an anti-unitary symmetry.Z T in C 1 (BG b , Z T ) means that G b acts on Z through the map s 1 .We note that n 1 modifies the cocycle conditions in the above equations only for non-trivial s 1 .The formula of O 5 is given in [34].The physical meaning of n 1 is the decoration of the p+ip topological superconductor on the domain wall that generated the time-reversal symmetry.
We will focus on the case of unitary symmetry G b .In such a case, n 1 = 0, s 1 = 0, and we have where O 5 is given in Eq. (220) of Ref. [34].
In the following, we will reproduce (123) using the 3-group symmetry in the bosonic shadow theory of the fermionic SPT phases, which are Z 2 gauge theories with fermionic particles enriched by 0-form symmetry G b .

Fermionic SPT phases from bosonic shadow with 3-group symmetry
Following the approach in [35], we study the fermionic SPT phases using their bosonic shadow obtained by gauging the fermion parity symmetry.Such bosonic shadow theory is the Z 2 gauge theory with fermion electric charge in (3+1)D, and it can be described by (3+1)D fermionic Z 2 Toric code model.Let us discuss the meaning of the classifying data n 1 , n 2 , n 3 , ν 4 for fermionic SPT phases in this Z 2 gauge theory.
In the (3+1)D fermionic toric code, n 2 corresponds to the decoration of codimension-two defect (gauged Kitaev chain), ω 2 corresponds to the m-loop, and n 3 corresponds to the fermion ψ.In other words, denote the background G b gauge field by A, this corresponds to Then the 3-group relation (115) reproduces the constraint on the classification data n 3 , n 2 , ω 2 in (123).The obstruction O 5 is given by the anomaly (120) of the 3-group symmetry.In particular, the first term (121) in the anomaly gives We can then complete the rest by demanding the anomaly to be closed, and we summarize the computation details in Appendix C. We obtain In Appendix C we show that this expression of O 5 agrees with Eq. (220) of Ref. [34], but is significantly simpler.

C Computation detail for fermionic SPT phases
In this appendix, we give the details for discussing the fermionic SPT phases in (3+1)D in Section 8.2, where we used the 3-group symmetry to classify the fermionic SPT phases.A useful formula is the Cartan formula [ Therefore, we define our O 5 as Notice that this is the minimal choice for the O 5 obstruction.In general, adding a cocycle to O 5 is possible.

Figure 2 :
Figure 2: Junction of magnetic defects can emit a gauged SPT defect of dimension (D − 2).

2. 4 . 4
Example of magnetic defect with center holonomy obey non-Abelian fusion Consider twisted Z 3 2 gauge theory in (2+1)D, with Z 2 gauge fields a, b, c, and the action

3. 2
Example: Z 2 2 gauge theory in (3+1)D Another example is G = Z 2 × Z 2 gauge theory in (3+1)D with trivial topological action for the G gauge field.The theory has 0-form symmetry Then under orientation reversal, b → −b, b ′ → −b ′ − a.

Figure 6 :
Figure6: When the magnetic surface has a non-trivial trivalent junction, it is regarded as a fusion of two magnetic flux loops.The magnetic flux at the domain wall is dressed with electric charge 1/2, which is represented by an orange dot.When the junction crosses through the codimension-1 defect, it leaves an electric charge on the defect due to the Z 4 fusion rule of the magnetic flux on the defect.A similar figure can also be found in[44].