"Zoology"of non-invertible duality defects: the view from class $\mathcal{S}$

We study generalizations of the non-invertible duality defects present in $\mathcal{N} = 4$ SU(N) SYM by studying theories with larger duality groups. We focus on 4d $\mathcal{N} = 2$ theories of class $\mathcal{S}$ obtained by the dimensional reduction of the 6d $\mathcal{N} = (2, 0)$ theory of $A_{N-1}$ type on a Riemann surface $\Sigma_g$ without punctures. We discuss their non-invertible duality symmetries and provide two ways to compute their fusion algebra: either using discrete topological manipulations or a 5d TQFT description. We also introduce the concept of"rank"of a non-invertible duality symmetry and show how it can be used to (almost) completely fix the fusion algebra with little computational effort.


Introduction
Generalizations of the concept of symmetry have attracted a great deal of attention since the seminal work [1], in which symmetries are defined as the set of topological operators of a Quantum Field Theory. Following this line of thought many recent works have described how to construct symmetry defects which do not follow a group law in d > 2 . 1 Higher dimensional generalizations of the well known Kramers-Wannier duality defects 2 have recently attracted a great deal of attention starting from [39,40]. It was first pointed out in [39] that such defects appear when the theory T is self-dual under the generalized gauging Φ of a discrete symmetry G: (1.1) A symmetry defect D can be constructed by performing the gauging operation on half spacetime and then using the isomorphism which implements the duality transformation to undo its action anywhere but on a very thin topological slab The symmetry thus obtained is not a standard zero-form symmetry, as the product with its inverse does not give back the identity, but rather a condensation defect [2] of the gauged symmetry D × D † = C G , where U(γ) are the defects generating G and ϕ represent a choice of discrete torsion. A striking example is N = 4 SYM with gauge group SU(N), which is self dual under the gauging of its discrete Z N one-form symmetry at τ = i. Similar reasoning also applies to different global forms of the SYM theory, with gauge groups PSU(N) r . This can be further generalized to N = 4 theories with different gauge groups 3 [6] and to triality defects 1 For d = 2 these categorical defects have long been described in RCFTs [31,32], a subject which has also seen a great deal of recent renewed interest [33][34][35][36] 2 See also [37,38] for earlier works in 2d. 3 Due to the action of S-duality on the gauge algebra the methods described to construct duality defects work only in theories with simply laced algebras. The unique example in which such construction can be applied to the non-simply laced case is B 2 ∼ = C 2 since the Langlands dual algebras are isomorphic.
corresponding to the other fixed point τ = e 2πi/3 [5]. A complete classification of the fusion algebra for these defects is however still missing (although the full fusion rules for the different global forms of su(N) were computed in [21] for N prime). One of the aims of this work is to fill-in this gap.
Another very natural setting in which non-invertible defects may appear are 4d N = 2 theories of class S [41], as noted in [10]. These theories are obtained as the dimensional reduction of a 6d N = (2, 0) SCFT on a Riemann surface Σ g 4 , and have a conformal manifold (i.e. a space of exactly marginal deformations) equal to the moduli space of complex structures of the Riemann surface, whose point we denote generically by Ω. Moreover, the theories have a large one-form symmetry group, and their global forms (i.e. the set of their genuine line operators) are classified by Lagrangian lattices L inside H 1 (Σ g , Z N ) [42][43][44] and also an extended duality group MCG(Σ g ) given by the group of large diffeomorphisms of the underlying Riemann surface [41]. The classification of non-invertible duality defects for these theories can be done in three steps: 1. Find Riemann surfaces Σ g with a nontrivial automorphism group G(Ω) ⊂ MCG(Σ g ). These will be the self-dual loci for the class S theory. This problem has been solved for high enough genus in the mathematical literature [45].
2. Understand the action of the duality group G(Ω) on global variants, which are Lagrangian lattices in H 1 (Σ g , Z N ).
3. Study the action of discrete gauging operations Φ on half-space. These turn out to form a central extension of Sp(2g, Z N ), which we dub Sp(2g, Z N ) T . These operations have already been studied in detail in [5,6] for the case of Z N one-form symmetry. We generalize and streamline their construction.
We construct a duality defect D M L composing the duality action M ∈ Sp(2g, Z N ) with an appropriate topological manipulation Φ M L which restores the initial duality frame choice. We can then compute the full set of fusion rules and the action on the line operators of the theory. Interestingly we find that from the action of D M L on lines we can define a property called rank which almost fixes the structure of the fusion algebra.
A second, complementary approach to study a 5d Symmetry TFT for the topological operators in our theory. In this approach the SCFT T is expanded into a topological d + 1- 4 In this work we only focus on theories of type A N −1 in the absence of punctures. We expect many of our results to extend to the case of regular punctures, while we have nothing definite to say about the irregular ones. Furthermore for technical reasons we assume N to be a prime number. dimensional slab with topological boundary conditions L on the farther end specifying the global structure of T . The bulk TQFT can be constructed explicitly when an holographic dual of T is known. The symmetry TFT for duality defects in N = 4 SYM has been recently derived in [21,46]. The self-duality symmetry has a simple interpretation in terms of topological twist defects D[M] for a bulk zero-form symmetry G(Ω). At special points in the gravitational moduli space, which correspond to self-dual SCFTs, the Symmetry TFT must be modified by gauging a subgroup of the zero-form symmetry. The twisted sectors then become liber- (1.5) For class S theories the gauged zero-form symmetry corresponds the a subgroup G(Ω) of the large diffeomorphisms of Σ g which is un-Higgsed at low energies. Thanks to this description it is possible to compute the fusion algebra for the non-invertible duality defects by carefully examining the composition laws for D [M]. We explicitly construct the Symmetry TFT and use this approach to confirm our previous results, thus also providing a highly non-trivial check for the holographic proposal of [21].
The structure of the fusion rules is rather simple to describe. The duality defects compose in a group-like manner (i.e. the fusion is graded by G(Ω)) and the categorical structure shows up as either decoupled TQFT "coefficients" N or condensation defects C: (1.6) The TQFT coefficient can be chosen as decoupled minimal A N,N (1,2) TQFTs [47] modulo congruence. For a given rank of N (1,2) there are only two classes for N prime. The condensation instead refers to the higher gauging of a subgroup A of the (Z N ) g one-form symmetry. The appearance of both of this structures follows from some rather simple observations regarding the rank of the defects participating in the fusion process. Interestingly, when the group is non-abelian, the categorical data is also non-commutative, in the sense that D M 1 L × D M 2 L and D M 2 L × D M 1 L can display different categorical structures. They are however consistent with associativity, albeit in a nontrivial way.
The paper is organized as follows: in Section 2 we discuss in detail the classification of different global forms for the class S theories we will study. In Section 3 we give a precise definition of the non-invertible duality defects and describe in detail the algebra of discrete topological manipulations Φ, its action on global variants and the way in which it can be used to extract the fusion rules. In Section 4 we introduce the concept of rank of a noninvertible duality defect, we describe how to compute it and how it can be used to (almost) fix the form of the fusion algebra. In Section 5 we give an alternative method to extract such data from a 5d TQFT description, following the analysis of [21]. In Section 6 we give some explicit applications of our methods to low genus cases. We conclude in Section 7 with open questions and prospects for future investigations. Various technical details and tables of some fusion rules can be found in the Appendices.
While this work was being completed [48] appeared, in which non-invertible duality defects for class S theories are also studied. Our work should be viewed as complementary to theirs as it mostly focuses on computing the fusion algebras of these defects. We thank the authors of [48] for acknowledging our project in their manuscript prior to publication.

Global variants and Lagrangian lattices
We consider 4d gauge theories with semi-simple gauge algebra g. Let g * be the Langlands dual algebra, which is isomorphic to g in the simply-laced cases. If we denote by G and G * the simply connected groups with algebra g and g * respectively, in absence of charged matter the full set of line operators is labelled by a lattice Γ = Z( G) × Z( G * ), which comes with a natural non-degenerate antisymmetric pairing , . Z( G) and Z( G * ) are isomorphic, and label respectively electric and magnetic charges. Γ includes mutually non-local operators and therefore, as pointed out in [49,50], the set of genuine line operators W l∈L of the theory is specified by the choice of a maximal isotropic (i.e. Lagrangian) sublattice L ⊂ Γ. The one-form symmetry instead is identified with S can also be understood as the set labelling the non-genuine line operators T s∈S , which live in the twisted sectors of the one-form symmetry. The reason why S is a quotient is that by adding a genuine line to a non-genuine one, the resulting line remains in the same twisted sector. We will focus on the case in which Z( G) does not have non-trivial proper subgroups. Then the exact sequence 1 − → L − → Γ − → S − → 1 splits, so it is always possible to choose a representative of S (by abuse of notation we call it S itself) which is also Lagrangian, and such that Γ = L ⊕ S .
Since we will study class S theories, we will be mostly interested in theories with charged matter which can partially screen the line operators. In this case Z( G) ∼ = Z( G * ) is replaced by a quotient Z( G)/Λ, where Λ ⊂ Z( G) is the subgroup of charges screened by matter. Consider a class S theory of type g, obtained by compactifying the 6d N = (2, 0) theory of type g on a genus g Riemann surface Σ g without punctures. The weakly coupled corners of the conformal manifold where we have Lagrangian descriptions correspond to giving a pair of pants decomposition in terms of 2g − 2 three-punctured spheres glued by 3g − 3 very long tubes. The Lagrangian is written in terms of 3g − 3 N = 2 vector multiples of g coupled to 2g − 2 copies of the T g theory, namely tri-fundamental hypermultiplets, corresponding to the three-punctured spheres [41]. Denote by G 0 the simply connected group with algebra g, so that G = G 3g−3 0 . Each tri-fundamental is charged with respect to the diagonal Z( G 0 ) of the three vector multiplets coupled to it. Since each vector multiplet is coupled to exactly two T g and Σ g has no puncture, the diagonal of all the Z( G 0 ) charges of the hypermultiplets is not acted upon by the center symmetry. This means that Λ has co-dimension one in Z( G 0 ) 2g−2 , and the set of unscreened electric charges is Z( G 0 ) g .
The bottom line is that the classifying lattice for global variants of the class S theory is Γ = Z( G 0 ) 2g , which coincides with H 1 (Σ g , Z( G 0 )) [42,43].
In the case of g = A N −1 , we have Z( G 0 ) = Z N and Γ = (Z N ) 2g . The pairing on Γ is given by In this paper we will restrict to the case where N is a prime number. Then a Lagrangian lattice L specifying a global variant corresponds to the choice of g linearly independent vectors v 1 , .
We will label these lattices by 2g × g matrices L = (v 1 , ..., v g ) of rank g, which satisfy L T J L = 0. One such matrix is and we will call the corresponding theory the electric variant. All the others are obtained by acting on E with matrices M ∈ Sp(2g, Z N ). The action on Sp(2g, Z N ) on Lagrangian lattices L is transitive, and the stabilizer is isomorphic to the group of symplectic matrices leaving E invariant up to a change of basis. These matrices are of the form and generate the parabolic subgroup P(2g, Z N ) ⊂ Sp(2g, Z N ). We conclude that the global variants are labelled by the right coset Sp(2g, Z N )/P(2g, Z N ), and therefore their number is 5 Note that for g = 1 we obtain N + 1, which is indeed the number of global variants of su(N) YM theories for N prime, including the electric variant SU(N) and the N magnetic variants PSU(N) r , r = 0, ..., N − 1. In this case all other variants can be reached from the electric SU(N) variant by gauging the Z N one-form symmetry with an appropriate discrete torsion [1,51]. In order to extend this idea to generic g we rewrite (2.7) using the q-binomial theorem as Here we introduced the Gaussian binomial coefficient which also counts the number of (Z N ) k subgroups of (Z N ) g . After this manipulation, equation (2.8) has a clear interpretation as the number inequivalent ways to gauge a (Z N ) k subgroup of the (Z N ) g one-form symmetry with possible discrete torsion, which for N prime is encoded in a k × k symmetric matrix.
Another convenient way to label the global variants, also used in [48], is to use 2g × 2g symplectic matrices M instead, subject to the identification M ∼ MP , P ∈ P(2g, Z N ). Writing the symplectic matrices in block form the Lagrangian lattice labelling the global variant is L = A C (2.11) 5 We use that |Sp(2g, Z N )| = N g 2 g k=1 (N 2k − 1) and |P(2g, with the identification A ∼ Au, C ∼ Cu where u ∈ GL(2g, Z N ). By abuse of notation we will denote this right action on the 2g × g matrix L as L → LP . The condition A T C = C T A is precisely the requirement L T J L = 0 that the genuine lines are mutually local. This way of labelling the global variants also makes explicit the choice of representative for S = Γ/L. Indeed this is just (2.12) The equation B T D = D T B implies that S is also Lagrangian and the condition A T D−C T B = ½ g is nothing but L T J S = ½ g , namely the fact that the two have canonical pairing.
We will see shortly that there is a natural mapping between this parametrization and the inequivalent ways of gauging the one-form symmetry with a choice of discrete torsion. Roughly speaking C will encode the information about the choice of gauged subgroup, while the choice of discrete torsion is encoded in A.

Duality defects and discrete topological manipulations
In this Section we define generic duality defects in theories with a (Z N ) g one-form symmetry and describe their composition properties. In theories of class S the duality group has a natural Sp(2g, Z N ) action 6 on H 1 (Σ g , Z N ) which sends a Lagrangian lattice L to while acting on the complex structure matrix as Ω → M(Ω) = (AΩ + B)(CΩ + D) −1 .
As remarked in [6,39] in the case of g = 1, the same action on global variants can also be realized by appropriately choosing a topological manipulation Φ M L . This corresponds to gauging a subgroup A of the one-form symmetry, possibly with discrete torsion. The space of topological manipulations forms a central extension of Sp(2g, Z N ), which we denote Sp(2g, Z N ) T . Let us clarify that, despite our notation, the transformation Φ M L is not associated to the element M in Sp(2g, Z N ) T . The group of topological manipulations instead 6 Geometrically this follows from the short exact sequence where MCG(Σ g ) is mapping class group and Tor is the Torelli group.
acts on the right on matrices L of Sp(2g, Z N )/P(2g, Z N ) parametrizing the possible global structures. This assures that the duality action and the topological manipulations commute.
Given a point Ω on the conformal manifold M stabilized by a subgroup G(Ω) ⊂ MCG(Σ g ) and a choice of global variant L, we can define the duality defect D L M , M ∈ G(Ω) by composition 7 The fusion D M 2 L × D M 1 L between duality defects can be understood from the compositions laws for the topological manipulations Φ M L on half space. After expanding both defects into slabs we slide the duality transformation M 1 across Φ Since the left duality action and the right topological actions commute we have (3.5) We will now discuss the structure of Sp(2g, Z N ) T , starting with the example of g = 1 to then move onto the most general case. 7 Our conventions are that defects act on operators on their right. 8 To avoid clutter we leave implicit the labelling L of the original theory. We also use the shorthand 3.1 Topological manipulations for Z N : SL(2, Z N ) T Let us review the structure of SL(2, Z N ) T [1,5,52], the space of topological manipulations for a Z N symmetry. The generators are: P being the Pontryagin square operation P : H 2 (X, Z N ) → H 4 (X, Z gcd(2,N )N ). Strictly speaking the discrete gauging σ maps the Z N 1-form symmetry to its Pontryagin dual (Z N ) * ∼ = Z N . Since we want to perform successive gauging procedures we will always implicitly use this isomorphism. Throughout the rest of the paper we will often omit the overall normalization factor for the discrete gauging. These operations correspond to matrices acting on the matrix (L | S) on the right. The transformations τ (k) and ν(u) do not alter the global structure, i.e. they leave L invariant. ν(u) corresponds to a different choice of basis in the space of lines, while τ (k) amounts to a background discrete theta angle. Together they form the parabolic subgroup P(2, Z N ) of SL(2, Z N ). The algebra of these transformations can be computed straightforwardly. The most interesting relation, which we call the "Kformula" (see appendix B for a derivation), follows from considering a two-fold gauging process and reads is an invertible 4d two-form gauge theory [47]. If instead we have no intermediate torsion Thus, whenever we have subsequent σ insertions, we can use the K-formula to reduce their number. Repeating this process we can bring every element of Φ ∈ SL(2, Z N ) T into the Standard form: Φ = P (u, s) σ τ (k) , P (u, s) = ν(u) τ (s) . Henceforth topological manipulations are always assumed to be in the standard form.
Action on global variants Let us briefly discuss the action of SL(2, Z N ) T on global variants. This will be used to set up a precise dictionary between the matrix L and the discrete operations Φ. Let Φ k = σ τ (k) (3.12) and L be the chosen variant for our 4d gauge theory. This has both genuine lines W l , l ∈ L and twisted sector lines T s , s ∈ S which are attached to open one-form symmetry surfaces U s . Our aim is to understand the spectrum of genuine lines after applying Φ k . This amounts to classify which lines of the ungauged theory are invariant under background Z N gauge transformations B → B + δλ , (3.13) in the presence of a background discrete theta angle e 2πik 2N P(B) . Genuine lines W l are charged under the one-form symmetry and they will pick up a phase e 2πi N l λ = e − 2πi N l λ∪PD(γ) . Due to the presence of the discrete theta angle non-genuine lines T s are not invariant either. Their insertion on a curve γ corresponds to a background B which fulfills δB = sPD(γ). The discrete torsion term then fails to be gauge invariant by a phase e 2πik N s λ∪PD(γ) . Thus gauge invariant operators are generated by the dyonic line D k, 1 ≡ W k T 1 : the generator of the new Lagrangian lattice Φ k L is kL + S.
Fusion rules To derive the fusion rules we analyze two subtleties involving the half-space composition in SL(2, Z N ) T . The first comes from the invertible theories Y k . While on a closed manifold their partition function is just a phase, on a manifold X + with boundary ∂X + , the TQFT Y k becomes the anomaly-inflow theory for a 3d TQFT [47]. This theory is not completely determined by the anomaly alone, however a minimal choice always exists and is given by the minimal TQFT A N,k . 9 The composite system Y k (X + ) × A N,k (∂X + ) is anomaly-free and well defined. Thus on half-space we should interpret the appearance of Y k as an indicator of the presence of a decoupled 3d TQFT A N,k . This gives our first rule: The second subtlety has to do with the appearance of condensates C Z N for the one-form symmetry [2]. As explained in [5] condensates appear when two gauging operations compensate each other in half-space. For instance consider σ σ τ (k) on X + Naively we could integrate out b to enforce c = −B. However on half space this is no longer true: as in the previous case, the theory for the b field is inconsistent on its own in the presence of a boundary. To recover gauge invariance the minimal choice is to add a 3d Z N gauge theory with DW twist α = −kN. Its gauge field a will couple to the bulk one-form symmetry. Now the integral on half space can be performed, leaving behind a boundary term: with β the Bockstein map: 10 This is exactly the condensation defect. Thus the second rule is: Example: Triality defects We give a sample computation for the fusion of defects 10 Since we work with N odd and on spin manifold, such DW term is always trivial and we can safely forget about this label in condensates.
which lead to the fusion rules 11 We now generalize our analysis to the group Sp(2g, Z N ) T describing topological manipulations for 4d theories with (Z N ) g one-form symmetry. These are the relevant ones for the description of self-duality defects in A N −1 theories of class S. As many features mirror the previous discussion will be brief and relegate long computations to Appendix B. In what follows we will be gauging subgroups A of the one-form symmetry (Z N ) g . Let us start by setting up some notation. We describe A as a sub-lattice of (Z N ) g . Since N is a prime number A is isomorphic to (Z N ) r for some r. We will call r the rank of the lattice. A can be specified by choosing r generators A 1 ... A r which we package into a rectangular matrix This description is redundant since C A u, u ∈ GL(r, Z N ) describes the same lattice. The number of distinct lattices of rank r is given by the q-binomial coefficient g r N . Given a lattice A we denote byÃ the quotient (Z N ) g /A. Since the sequence 1 → A → (Z N ) g →Ã → 1 splits, we get (Z N ) g = A ×Ã. We will make a choice for the splitting by specifying a second matrix CÃ. We define duals C * A and C * Ã by the equations The completeness relation reads ½ g = C A C * A + CÃ C * Ã . We also denote the "join" and "meet" operations on lattices by A ∨ B and A ∧ B respectively.
Given a linear map M : (Z N ) g → (Z N ) g we define its restriction onto A by and a lift back to the original space by Given two sub-lattices A and B with trivial meet we also define double restrictions and double lifts An (overcomplete) set of generators for Sp(2g, Z N ) T is given by where the (generalized) Pontryagin square P S is defined as With these conventions gauging A twice leads back to the original theory up to charge conjugation on C A . 12 The transformations (3.27) with (e j ) k = δ jk and E j = (0 ... e j j ... 0). We discuss the representation theory of generic transformations in Appendix A. As before the matrices τ (S) and ν(U), which do not change the global structure of the theory, generate the parabolic subgroup P(2g, Z N ) of Sp(2g, Z N ).
We would now like to prove a generalized the "K-formula" in this setting. We consider a double gauging For simplicity we assume that S = S A A restricts to A. The derivation as well as the general case is given in Appendix B. We introduce the meet C = A ∧ B, the disjoint lattices A ′ = A/C, B ′ = B/C and the corresponding generators and dual generators, with obvious notation. We find: On the other hand the standard isomorphism (V * ) * = V gives a gauging operation such that where and a decoupled invertible C two-form gauge theory When the kernel of S C is non-empty the subgroup of A ∧ B which is annihilated by S A∧B gets "ungauged" instead. For example suppose that S C = 0, then Action on global variants As in the case of g = 1, each global variant L can be reached from a reference boundary E by a gauging operation σ(C A ) with some discrete torsion τ (S A A ). To find the explicit map we consider applying to the electric variant E = ½ 2g . Again the genuine lines after the gauging will be the gauge invariant lines in the presence of the background torsion. In our conventions Wilson lines W l are labelled by an element l of the dual space. Their charge under A gauge transformations From this it follows that lines labelled by dual generators C * Ã are still genuine after the gauging. This fixes the first r(A) columns of L to be: As in the g = 1 case, 't Hooft lines are also charged due to the discrete theta angle. The charge of T s is Therefore neutral dyons must fulfill which is solved by s = C A and l = C * A T S A . These give the last g − r(A) columns of L: It can be shown that, if L = A C , then A T C is symmetric and has rank r(A).
Fusion rules In a similar way as before we can also state the two basic rules for the composition in half-space: and Since the theory is decoupled the only relevant information is contained in S C modulo congruence by GL(r(C), Z N ). When N is prime one can show that there are only two inequivalent choices for each rank r(C) (see appendix C for a proof of this statement), which we denote: As an example, if the rank is r = 1 there are two classes with representatives A N, 1 and A N, q ′ , where q ′ is not a perfect square in Z N . It is always possible to choose the representatives to be A N,1 r for N r,+ and A N,

Action on line operators: the rank
We now describe how duality defects act on line operators and introduce a new concept: the rank of a non-invertible symmetry. This can be used to almost entirely fix the fusion rules of duality defects, apart from the choice of quadratic form in the decoupled TQFT. The action of duality defects on generic line operators for Z N one-form symmetry has been introduced in [39]. The first key feature, already noted in [33], is that non-invertible symmetries can lead to nontrivial maps D M L : H 0 → H s between the untwisted (H 0 ) and twisted (H s ) Hilbert space. In our case the twisting is by the one-form symmetry defect U s . These follow from the existence of nontrivial junctions between D and U s . In radial quantization we represent them in the following way We first discuss the untwisted action. Let us suppose that Φ M −1 L is obtained by gauging A with discrete torsion S A . If W l is charged under A then the operator is killed by the gauging interface. If it is uncharged, it will be mapped by M onto another genuine operator W M l . Consistency implies that Genuine line operators uncharged under A = Sublattice K ⊂ L such that MK ⊂ L.
K can be explicitly computed as Thus we conclude that The gauged group A, which is a subgroup S A ⊂ S must satisfy: It is clear that the ranks of the lattices satisfy r(A) = g − r(K). We call r(A) the rank of the non-invertible defect D M L . 13 Duality defects with r(A) = 0 are invertible. The maps on the twisted sector H s can be understood in a similar way, but now the line W l can be charged under the gauged symmetry. Consistency with the duality transformation requires that Ml = s mod L so: The characterization of the rank of the symmetry using K can be used to understand the structure of the fusion algebra without performing the direct computation. First notice that the rank can be written as where | · | is the dimension of the image of the map inside. After computing the fusion we define Notice that this is different from because the image of (4.7) is spanned by K M 1 ∧ M −1 1 K M 2 while for (4.8) by K M 2,1 which is a larger vector space. When the two do not agree a further object is needed to make the fusion consistent. This is a condensate C 2,1 . It's rank is computed by: This information is readily obtainable as soon as we know K for the various defects.

The 5d Symmetry TFT
Another viable path to compute the fusion algebra of the duality symmetries is using the bulk Symmetry TFT description [21]. The symmetry TFT is a d + 1-dimensional topological theory which encodes the discrete symmetries of a given d-dimensional QFT. More specifically a d-dimensional absolute QFT is isomorphic to a relative QFT living at the boundary of a (d + 1)-dimensional slab where the symmetry TFT lives. At the other boundary one should impose gapped (topological) boundary conditions L which select the given global structure of the absolute theory (see figure 1.4).
In our applications the boundary conditions are of Dirichlet type for the generators of the Lagrangian algebra L 14 . Defects in the quotient S = Γ/L, when pushed to the boundary, are the topological operators of the d-dimensional absolute theory. Operators in L can instead end the topological boundary, and their endpoints describe operators charged under S.
Recently various authors have shown in detail how to derive the Symmetry TFT for theories with an holographic dual starting from from string/M-theory [10,17,21,48,55,56]. The symmetry TFT for the duality defects in N = 4 SYM was first introduced in [46], while in [21] it was embedded in a holographic framework and the fusion rules for such defects are derived from the bulk formalism. In this section we extend this analysis to the case g > 1 and explain how features introduced in Section 3 emerge form the bulk.
The symmetry TFT for 6d N = (2, 0) theories of type A N −1 has a simple holographic derivation, since the theory can be realized by a stack of N M5 branes in flat space-time. These induce N units of G 4 = dC flux on a round S 4 , where C is the 3-form potential. The symmetry TFT can be derived from the reduction of the topological terms in the eleven dimensional supergravity action. The resulting 7-dimensional topological theory is a Chern-Simons theory [57] The operators of the theory are N 3-form symmetry. The TFT (5.2) generically does not have gapped boundary conditions, indicating the fact that 6d N = (2, 0) SCFTs are intrinsically relative [58].
The symmetry TFT for class S theories is obtained by considering a seven-dimensional space-time of the from X 7 = X 5 × Σ g and reducing on Σ g . The 5d symmetry TFT takes the form 15 However this is too naive. In the eleven-dimensional theory all the global symmetries are gauged since gravity is not decoupled. Whenever we choose a vacuum in such a gravity theories part of these gauge symmetries are Higgsed and appear as global symmetries of the IR effective theory. Among these are large diffeomorphisms of Σ g , for which the order parameter can be taken as the complex structure matrix Ω. However, if our choice of Σ g has discrete isometries, we will get a residual gauge symmetry in the compactified theory. Thus, whenever the Riemann surface has a nontrivial automorphism group G(Ω) ⊂ Sp(2g, Z), we get an emergent gauge symmetry in the symmetry TFT. This acts on charge labels of the 2-form gauge fields, transforming in the fundamental representation of Sp(2g, Z N ). We will argue that this emergent gauge symmetry is responsible for the non-invertible duality defects.
An analogous scenario is enjoyed by N = 4 SYM, viewed as the theory on D3 branes in type IIB, at τ = i, e 2πi/3 . From an holographic point of view, the axio-dilaton VEV of type IIB string theory Higgses the SL(2, Z) gauge symmetry which therefore appears as a global symmetry of the supergravity theory. However at τ = i, e 2πi/3 the VEV of such a field is invariant under the Z 4,6 subgroup of SL(2, Z) and then an emergent gauge field is still present in the infrared. In [21] it was shown that this gauge field is responsible for the topological duality (and triality) defects of the dual gauge theory. The same conclusion is reached if we regard N = 4 SYM as the theory obtained by compactifying the 6d N = (2, 0) theory on a torus with appropriate modular parameter τ = i, e 2πi/3 . Indeed M-theory compactified on a small torus is equivalent to type IIB string theory [59], in which S-duality is realized as modular transformation of the torus. Thus we see that from the M-theory perspective, the maximally supersymmetric case analyzed in [21] is not special, and the un-Higgsed subgroup can be embedded in the group of large diffeomorphisms in string theory.

Duality defects from the Symmetry TFT
Let us describe the construction of duality defects in the Symmetry TFT and how to compute fusion rules. Most results are a straightforward generalization of [21], to which we refer for a thorough analysis. The symmetries of (5.4) are a 2-form symmetry (Z [2] N ) 2g generated by 15 We assume that H 2 (X 5 , Z) is trivial. All the topological defects implementing this zero-form symmetry are condensation defects [2] constructed by higher-gauging a subgroup A of the 2-form symmetry on a codimension one manifold with an appropriate choice of discrete torsion.
Given a subgroup A ⊂ (Z N ) 2g and a symmetric torsion matrix T A we can define a condensation defect on a compact four manifold Σ with H 2 (Σ, Z) = Z 2 as a sum with γ and γ ′ being the generators of H 2 (Σ, Z). 16 To construct a topological defect which implements M ∈ Sp(2g, Z N ) we need to impose the correct group action on surface operators U k . That is which implies Notice that since the image of (M − ½ 2g ) is isomorphic to A. Inverting (5.9) we find 17 This determines univocally the zero-form symmetry defects. For a full gauging C A = ½ 2g and we get 12) 16 We will follow the notation of 3 for lattice operations. which generalizes [21].
The fusion of two condensation defects can be computed from (5.7). After some algebra we find that A∨B,A + 2 −1 J A∨B,A (5.14) is the torsion matrix corresponding to the Sp(2g, Z N ) element M 2 M 1 . Following [21] we can give a Lagrangian description of the defect where Φ A , Γ A , Ψ A are auxiliary fields. 18 On a closed Σ 4 this is gauge invariant under 18 Alternatively, in discrete notation it can be written as 19 This is only true if T A is an invertible matrix, in which case the defect theory is an invertible TQFT which has only one allowed boundary condition. Studying twist defects for which T A is not full rank is challenging and we do not consider them in this work. 20 In discrete notation this reads where Γ A and Ψ A are now regarded as auxiliary 3d fields.

If T A is full rank we can obtain a simpler description of D[T A ] by integrating out Φ A . The 4d defect V [T A ] becomes
The corresponding twist defect is described by a minimal A N,−T A TQFT [47]. This is a 3d TQFT hosting N r(A) lines W n , which fuse according to A and have spins A simple way to derive this fact is to interpret (5.20) as an anomaly-inflow action for a A one-form symmetry in 3d. The minimal TQFT A N,−T A is the "smallest" 21 possible MTC saturating the anomaly [47]. If T A is not full-rank this reasoning fails as the 4d theory is not an invertible TQFT and to use such a description one should presumably make a choice of boundary condition on ∂Σ 4 first. We do not discuss such cases here. Notice that if A = (Z N ) 2g the twist defect is not unique as we can always fuse it to a 3d condensate of (Z N ) 2g /A.

Fusion rules for twist defects D[T (1)
A ] and D[T (2) B ] can be computed by noticing that lines W (1) and W (2) are not mutually local, as they are attached to bulk U m surfaces [21]. Taking this into account lines of the composite defect D[T (1) A ] × B D[T (2) B ], where × B reinforces that it is not a naive tensor product, braid through .

(5.22)
To compute the fusion product one must isolate the group of uncharged lines under the bulk 1-form symmetry from the above. The remaining coupled theory is precisely the twist defect D[T (1,2 ]. For instance, when C A = C B = ½, we find as long as T (2,1) also has full rank. In the opposite case, when T (2) = −T (1) and the final zero-form symmetry defect is the identity, we find Fusion on gapped boundaries What we are actually interested in is to discuss the composition laws for twist defects once they are brought onto a gapped boundary L. Before the gauging of the zero-form symmetry G(Ω) these describe fusion rules for duality interfaces Here we will mostly discuss the case in which A = B = (Z N ) 2g . However we give a general algorithm at the end of the Section. In section 2 we have learned that global variants correspond to Lagrangian lattices L of (Z N ) 2g . From the symmetry TFT perspective this is encoded in a boundary condition which sets: There are two cases to discuss, depending on whether the rank of T L is maximal or not. Let us start by assuming that T L is an invertible g × g matrix. We will treat the other cases in 5.2.
Since on the gapped boundary a subgroup L of the (Z N ) 2g two-form symmetry acts trivially, lines W l with l ∈ L of a twist defect D[T ] which are only charged under L completely decouple. These form a A N,−T L minimal theory, which we consider screened on the boundary. 22 The coupled twist defect is described by: If T is full rank, we can faithfully parametrize lines surviving the quotient by S = T −1 L ⊥ , with L ⊥ = J L the dual lattice of L. These lines form a minimal theory A complementary procedure, which leads to the same answer, is to impose the boundary conditions L T B = 0 directly on the "anomaly inflow" action (5.20). The leftover anomaly is precisely captured by the minimal theory A N,−T ⊥ .
Boundary fusion rules can be computed by applying the screening process to the A N,T (1) × B A N,T (2) theory instead. We define: When T (2,1) and its restriction to L are also full rank we can parametrize If the rank of T (2,1) L decreases instead, the fusion is accompanied by a condensation. The next part of this Section will clarify how to treat this case.

Lower rank defects: rank from the bulk
We now discuss the case in which the matrix T L has a kernel. It is a matter of simple algebra to show that T L has a kernel if and only if the sublattice K = L ∧ M −1 L which is mapped inside L by M is non empty. The kernel is then spanned by vectors Let's now discuss the implications of a nontrivial K Ker on the boundary defect D L (T ). It is clear that now our previous algorithm to screen decoupled lines fails, as the A N,−T L theory is ill defined. Instead lines in K Ker form a condensable subgroup of A N,T and are gauged by the boundary conditions. Defining L K = L/K Ker the correct prescription is where we have used that L K × K Ker = L. The same conclusion can be reached also from the anomaly theory (5.20): when K is non-empty the anomaly theory is of lower rank, with a kernel spanned by J (M + ½ 2g ) K. In both cases the rank of the boundary defect decreases by dim(K), which reproduces the result found in Section 4.
We can now state an algorithm to compute fusion rules from the bulk Symmetry TFT.
1. Find the groups K 1 , K 2 and K 2,1 of the ingoing and outgoing defects.

Construct the boundary theory for the fusion
3. Find a splitting: This is tedious but doable, since the condensed lines are neutral under the symmetry of D L [T (2,1) ] .

Rank and Fusion
Having explained how the rank of a duality defect can be understood both from a 4d and 5d perspective, we conclude by giving an explicit application of this concept.
It is rather simple, given defects D M 1 L , D M 2 L and D M 1 M 2 L , to compute the associated groups K 1 , K 2 and K 1,2 . We now argue that this information almost unequivocally fixes the fusion algebra non-genuine line excitations, on which the gauged one-form symmetry surfaces can end: These can be thought of as two-morphisms L m : ½ D M L × U m → ½ D M L and their category is explicitly described in the bulk symmetry TFT by a minimal TQFT (5.34).
The number of these lines cannot change upon performing fusion, so it must be matched on the other side. We have N r(D M 2 M 1 L ) lines from the outgoing defect and N 2r(C 2,1 ) lines from the condensation defect. The factor of 2 comes from regarding the condensate as a DW theory coupled to a dynamical two-form field. The subgroup of the one-form symmetry which is condensed can be computed as a quotient A Cond = (A 1 ∨ A 2 ) /A 1,2 . The remaining lines will necessarily form a decoupled TQFT. This determines the rank of the TQFT coefficient. The only undetermined datum is its class modulo congruence.

The gauged theory
The correct 5d bulk theory describing the special loci of the conformal manifold where we get the duality defects is obtained from (5.4) by gauging the automorphism group G(Ω) ⊂ Sp(2g, Z N ) of the Riemann surface on which we compactify the 6d N = (2, 0) theory and the 7d TQFT. We will henceforth drop the suffix Ω.
The gauging consists in coupling (5.4) to a pure G(Ω) gauge theory, which renders the four-dimensional defects labelled by M ∈ G(Ω) transparent. Their twist defects become genuine three-dimensional operators, provided we dress them by the naive Gukov-Witten operators (GW) of the pure G(Ω) gauge theory, as explained in [21]. A convenient way to describe the gauged theory is through the hybrid formulation introduced in [21], in which the bulk 2-form fields B i are kept continuous, while the 1-form G gauge field A is a singular (or Cech) cochain. The general treatment goes in parallel to the case of N = 4 SYM (namely g = 1) studied in [21]. Here we focus on the main differences when G(Ω) is non-abelian.
The first issue is defining non-abelian discrete gauge fields, which are expected to be described by H 1 (X 5 , G). However this object is not a group and its definition is somewhat subtle. Let us sketch how this is done.
We choose a good cover X 5 = i U i of the manifold, and we assume an ordering for the indices. The covering is dual to a simplicial decomposition: patches are associated with vertices (or 0-simplices) v i ∈ U i , double intersections U ij to 1-simplices v ij , i < j, crossing a co-dimension one plane and oriented from v i to v j , and triple intersections U ijk are associated with co-dimension two planes orthogonal to 2-simplices v ijk , with i < j < k. A zero cochain λ ∈ C 0 (X, G) associates an element λ i ∈ G to each vertex v i , while a 1-cochain A ∈ C 1 (X, G) is an assignment of A ij ∈ G for each 1-simplex v ij , and so on. Given A, B ∈ C p (X, G), the group structure of G is used to construct AB ∈ C p (X, G) (AB) i 0 ,...,ip = A i 0 ,...,ip B i 0 ,...,ip ∈ G .
(5.38) making C p (X, G) a group. We would like to define differentials δ p : C p (X, G) → C p+1 (X, G) such that δ p+1 δ p = 0. For generic p this is not possible, but fortunately we only need the cases p = 0, 1, for which we introduce satisfying δ 1 δ 0 = 0. These maps are not homomorphisms and thus Ker(δ 1 ) and Im(δ 0 ) are not groups. However on Ker(δ 1 ) we can introduce the equivalence relation ∼ as which is well defined since Quotienting by ∼ defines H 1 (X, G). In physical terms the equivalence relation above is a gauge transformation . H 1 (X, G) is not a group, but this does not affect the formalism of [21] in any way.
The second issue is that while the twisted sectors of the four-dimensional defects (and the duality defects) are labelled by elements of G, the GW operators are labelled by conjugacy classes. Indeed a GW operator for the discrete gauge theory is defined by a singular connection A such that around a patch U ijk . Since a gauge transformation (5.40) by λ ∈ C 0 (X, G) on A maps we have to declare that GW operators labelled by elements in the same conjugacy classes are equivalent: thus a GW operator is labelled by a conjugacy class [g] rather than an element of the group.
This fact is reflected on twist defects as follows. For G an abelian group (as in [21]) the 3d action (5.19) defining the twist defect D[T (M)] has a 0-form symmetry G, which acts as which for G abelian is T (M). For a non-abelian G, while the GW operators are labelled by conjugacy classes, the 3d twist defects are labelled by elements M ∈ G. However because of (5.43) the 3d action does not have the G symmetry in the non-abelian case, but the action of M ′ ∈ G on D[T (M)] produces a different defect: Thus we cannot simply covariantize the action to generate a good operator in the gauged theory. What we have to do, instead, is to sum over all defects which are in the same orbits for the adjoint action of G on itself: We conclude that in the gauged theory also the twist defects are labelled by the conjugacy classes of G, and they form a compound with the GW operators defined by the equation (5.42). A convenient way to represent these operators is to start from the naked, non gaugeinvariant three-dimensional operators labelled by elements M ∈ G, then acting on it with gauge transformations and summing over them: The four-dimensional defects implementing M, M ′ are precisely the location of the codimension one plane orthogonal to the 1-simplices associated with the gauge field A ∈ H 1 (X 5 , G), and therefore are transparent in the gauged theory. Notice that in the bulk, the 3d operators of the gauged theory have two sources of non-invertibility. The first one, which we discussed here and in [21], has to do with the appearance of TQFT coefficients and condensates, while the second one comes from the fact that these defects are sum of several defects of the ungauged theory leading to a non-invertibility of orbifold type as in [9,14].
A gapped boundary of the gauged theory can be described as a non-simple but G-invariant boundary in the ungauged theory, tensored with Dirichlet boundary conditions for the G gauge field: Bringing the GW operator onto the gapped boundary liberates the naked GW since fourdimensional surfaces implementing G are absorbed by |ρ/G : Alternatively, we can just think of the gauge transformations also being frozen on the boundary, so that (δ 1 A) ijk = M ∈ G is a well defined boundary condition. This is depicted on the right side of (5.48), with A 13 = A 23 = 1 and A 12 = M. The last specification should be thought of as a boundary condition for the insertion of the boundary defect. Thus we conclude that upon bringing twist defect onto a gapped boundary the non-invertibility of the orbifold type disappears and these operators are labelled by element M ∈ G instead of conjugacy classes, as we expect from the 4d construction.

Applications and Examples
We conclude with some explicit computations for g = 2. The cases of higher genus can be treated similarly, however the number of global variants soon becomes prohibitive and we do not expect any new features to emerge. The list of discrete automorphism groups for g = 2 Riemann surfaces without puntures is the following [45]: We focus on two representative cases: the largest cyclic group Z 4g+2 = Z C 2 × Z 2g+1 and the symmetry enhancement from D 4g+4 to (Z 2g+2 × Z 2 ) ⋊ Z 2 . Both cases are present for every genus. To compute the fusion rules using the discrete gauging description we first determine the matrix Φ M −1 L which sends L to M −1 L (seen as a member of the quotient Sp(2g, Z N )/P(2g, Z N )) via its right action. This is just We then decompose it in the standard form as explained in Appendix A. 23 All the remaining categorical data are extracted by applying the K-formula. 23 Notice that the electric boundary is just L = ½ 2g , to topological manipulations there can be extracted by putting M −1 in standard form.
Cyclic group Z 4g+2 The Riemann surface with such an automorphism group is rather simple to describe, it corresponds to the hyperelliptic curve: The symmetry is comprised by the hyperelliptic involution Z C 2 : Cy = −y and a discrete rotation Z 2g+1 : ρx = e − 2πi 2g+1 x. The action on homology cycles is best seen by representing the curve as a branched cover of the complex plane (here for g = 2): The cycles relate to the standard basis through C interchanges the two sheets, reversing the orientation of cycles, while ρ corresponds to a discrete clockwise rotation. They correspond to matrices M ∈ Sp(4, Z) In this example the only interesting defect is M ρ , since C leaves all the Lagrangian lattices L invariant and is thus invertible. It can be checked that, for all L: where A is subgroup of the one-form symmetry being gauged by Φ For g = 2 this can either be the full Z 2 N , a one dimensional subgroup A or nothing at all, in which case the defect is invertible.
The fusion rules for M ρ with itself are more interesting. For g = 2 there can be several patterns, depending on r(M ρ ) and r(M 2 ρ ). The allowed patterns are given in the Table below: As explained in appendix C we only have two choices N r, ± for the TQFT coefficients at a given rank. In our conventions N r,+ is represented by A N,1 r while N r,− by A N,1 r−1 × A N,q ′ , q ′ not being a perfect square.
Notice that, even if all three defects are non-invertible, they can fuse as an invertible symmetry sometimes. We also give in appendix D the full multiplication table for the case g = 2, N = 3, which we have checked from both the 5d Symmetry TFT and the 4d QFT perspective. Notice that the agreement of the results of the two completely independent computations is a highly non-trivial check of the proposal of [21] for the holographic dual of self-duality symmetries.
Dihedral group D 4g+4 and symmetry enhancement The second example is the simplest non-abelian group D 4g+4 . This example also enjoys two other features of non-invertible symmetries in class S theories, namely the presence of moduli spaces on which the symmetry is realized and its enhancement. As before we can represent the surface hosting such automorphism group by an hyperelliptic curve 24 The symmetry is generated by the hyperelliptic involution Z C 2 , a rotation Z t g+1 : tx = e − 2πi g+1 x and a reflection Z r 2 : r(y, x) = (y x −(g+1) , x −1 ). It is simple to show that they combine into a dihedral group D 4g+4 . The symmetry is enhanced at the special point λ = i by a further Z 2 symmetry Z σ 2 : σx = −x to the group (Z 2g+2 × Z C 2 ) ⋊ Z r 2 . σ should be thought as an emergent S-duality. Again the action of the symmetry group on homology is easier to visualize by employing a branched cover The left picture is the curve for λ ∈ R + , while the right one represents the special point λ = i. The actions of t and σ are just rotations, while r flips the picture around the real axis while also interchanging the two ends of each cut. For g = 2 their matrix representation is In this case the duality group is non-abelian, and one might wonder whether the categorical structure of its fusion rules is also non-commutative.
The answer is positive. For example consider N = 3 and (6.10) The non-commutativity may also involve condensation defects, for example While this happens, associativity must still hold. Let us again consider the second example above and compute D Mr , in the two fusion channels we get To compare the expressions notice that, for N = 3 (N 2,− ) 2 = N 4,+ = (Z N ) 2 while the condensation can be absorbed by the D Mr σ r L defect as it is full rank, leaving behind a (Z N ) 2 partition function. We give a table of the non-commuting cases in Appendix D.

Conclusions
The main goal of this paper was understanding non-invertible duality defects in theories with an extended 1-form symmetry (Z N ) g . These are naturally realized in 4d SCFT of class S whose Riemann surface Σ g has a nontrivial automorphism group G(Ω) which acts as selfdualities. Due to the large 1-form symmetry group the structure of the non-invertible defects is more intricate than e.g. the case of N = 4 SYM. Given two elements M 1 and M 2 in G(Ω) and a choice L of global variant the generic fusion between duality defects takes the form where N r,± are decoupled TQFTs and C A condensation defects for A ⊂ (Z N ) g . We have given two ways to understand this structure: either from a purely QFT perspective or from 5d TQFT description. In the former it can be understood by considering the algebra of the group Sp(2g, Z N ) T of discrete topological manipulations Φ on half space, while in the latter it descends from the description of twist defects in a certain 5d Chern-Simons theory, which become liberated as special points of the gravitational moduli space where G(Ω) remains un-Higgsed. This generalizes the previous analysis of [21]. The validity of our approach is shown in various concrete examples for N = 3 and g = 2, pointing out some interesting new properties such as the non-commutativity of the non-invertible symmetry algebra.
Finally, we have given slick way to derive the fusion rules by analyzing the action of the non-invertible defects on genuine line operators. This has led us to introduce the concept of "rank" of a non-invertible symmetry.
Let us close by commenting on open questions and natural generalizations of our results. Some natural extensions are the addition of punctures on the Riemann surface -both regular and irregular -and the study of class S theories of D and E-type. The one-form symmetry structure in these cases has been studied e.g. in [43,44]. We expect that, as long as only regular punctures are involved, our methods should extend without great novelties. A second question concerns 't Hooft anomalies and the possibility of gauging these duality symmetries. This should have an interpretation in both the 4d SCFT and the 5d Symmetry TFT. Finally, we are left wandering whether preserving these symmetries also gives rise to new exotic RG flows. It is simple to prove, at least under some mild assumptions 25 , that these symmetries cannot generically be realized by an SPT in the IR. It would be interesting to study the existence of such RG flows further.
A Matrix representation of Sp(2g, Z N ) T In this appendix we describe the matrix representation of generic topological manipulations Φ ∈ Sp(2g, Z N ). The matrices generating the parabolic group are Notice that, under right composition 26 as it should be. A generic gauging matrix σ(C A ), satisfying can be constructed in the following way: start with the rank r projector P = r j=1 E j and its complementary P ⊥ = ½ − P . Define the matrix: which describes the gauging of E 1 ∨ E 2 ∨ ... ∨ E r . It is an Sp(2g, Z N ) T matrix and σ(P Then We can also write down the matrix corresponding to σ( From these definitions it is possible to reconstruct the full algebra of Sp(2g , Z N ) T barring the central extension. We also want to prove the standard-form decomposition for elements Φ ∈ Sp(2g, Z N ) T . That is, we want to write 28 : We parametrize Φ = A B C D . A short computation shows that C = u P u T V −1T , so the matrices u and V can be extracted by computing the Smith Normal Form of C. Having done this we find a matrix has solutions. Imposing that Φ is symplectic we get that AV T = Q u P u T for some matrix Q. One finally sets s = u T Q u to solve the equation. With this procedure it is possible to put any discrete manipulation Φ into the standard form.
B Composition laws for topological manipulations K-formula for g = 1. Let us first derive the K-formula for the g = 1 case: . This cancels the minimal coupling between b and c fields, leaving us with where the central extension is K-formula for generic g Let us now treat the general case of σ(C A ) τ (S) σ(C B ). First, we want to restrict to the case in which S = (S A ) A . This can be done straightforwardly by expanding the quadratic form P S leading to the identity We then assume safely that S = S A A . Secondly, we want to change our basis of generators so This can be implemented through right multiplication by a GL(r(A), Z N ) matrix u A and similarly for B. Using the definition of σ it is simple to see that the two are related by ν transformations. With this in mind we can assume that all the matrices are already given in their "split" form.
The double gauging reads, explicitly (B.5) The quadratic function P S expands as eliminating the linear couplings for α C . Expanding: The new torsion is thus given by the matrix while to get the correct couplings we must perform a redefinition on This shows that: Now we consider the case in which S C has a kernel. Since we work at g = 2 we only consider the case in which (I) S C = 0 or (II) C A = C B = ½ and S C has a kernel K.
(I) Since S C = 0 α C enters the equation linearly and imposes a constraint: This is the partition function of a theory in which The background is: and is obtained for the original one by a transformation Therefore in case (I) we have (II) Let K be the kernel of S. The decompose the dynamical field β = C K β K + CK βK. The discrete gauging is: (B.16) Since α K appears linearly we integrate it out, fixing β K = −B K . Thus finding Applying the K-formula the second term becomes Composing σ(C A ) and ν(U) Lastly we need to understand the composition Defining C A U = UC A and CÃ U = UCÃ 30 we can write this as: The original couplings were instead B = C A B A + CÃ BÃ, so we need to compose with ν(U)

C Quadratic forms over Z N
We want to classify all the quadratic forms q : Z g N → Z N for N prime, namely symmetric g × g matrices T with Z N entries, up to the equivalence relation In the case g = 1 it is easy to see that there are three classes: 0, the perfect squares, and the non perfect squares. Consider now g = 2. First we put T in diagonal form with eigenvalues p 1 , p 2 , which can be swapped by a congruence transformation. If T is non singular there are in principle three cases: p 1 , p 2 are both perfect squares, one of the two is a perfect square but the other is not, and both are not perfect squares. A congruence transformation with R = a b c d , a, b, c, d = 0 preserves the diagonal form if and only if abp 1 + cdp 2 = 0, and the new eigenvalues are p ′ 1 = a 2 p 1 + c 2 p 2 , p ′ 2 = b 2 p 1 + d 2 p 2 . If p 1 , p 2 are both perfect squares we can set p 1 = p 2 = 1, and to preserve the diagonal form we must have c = sa, b = −sd with s = 0, implying We conclude that the case in which p 1 , p 2 are both perfect squares is equivalent to that in which they are both not perfect square, while the other case form a distinct class. By taking into account the 3 classes at non-maximal rank we get 5 classes.
For generic g, if T of maximal rank we put it in diagonal form with eigenvalues p 1 , ..., p g . In principle there are g + 1 cases, depending on the number k = 0, ..., g of eigenvalues which are perfect squares. However, using the result at g = 2 the cases k and k + 2 are equivalent, while k and k + 1 are distinct. Thus we get 2 new classes at rank g which we did not have at rank g − 1. Thus the number of classes for g × g matrices is n classes (g) = 1 + 2g . (C.3)

D Fusion Tables
In this appendix we collect generic results for the fusion algebras of duality defects. We only study the case g = 2, N = 3 for definiteness. A generic fusion between non-invertible defects takes the form In the tables below the columns corresponding to the condensate C show the generators of the condensed subgroup A. The numbers r i are the ranks of the respective defects while r c is the rank of the condensate.
L TQFT C r 1 r 2 r 12 r C L TQFT C r 1 r 2 r 12 r C     