{'fraction_non_alphanumeric': 0.0314528785000413, 'fraction_numerical': 0.013347650119765424, 'mean_word_length': 4.285327629109006, 'pattern_counts': {'":': 1, '<': 2, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 31, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The Virtue of Defects in 4D Gauge Theories and 2D CFTs

We advance a correspondence between the topological defect operators in Liouville and Toda conformal field theories - which we construct - and loop operators and domain wall operators in four dimensional N=2 supersymmetric gauge theories on S^4. Our computation of the correlation functions in Liouville/Toda theory in the presence of topological defect operators, which are supported on curves on the Riemann surface, yields the exact answer for the partition function of four dimensional gauge theories in the presence of various walls and loop operators; results which we can quantitatively substantiate with an independent gauge theory analysis. As an interesting outcome of this work for two dimensional conformal field theories, we prove that topological defect operators and the Verlinde loop operators are different descriptions of the same operators.


Introduction and Summary
Solving exactly four dimensional non-supersymmetric gauge theories is currently out of reach. Presently, we can at best compute observables in gauge theories in a perturbative expansion. These observables include the S-matrix, the correlation function of local, gauge invariant operators and the expectation value of non-local gauge invariant operators, such as Wilson loops, 't Hooft loops and surface operators. Little is known about the behaviour of these observables in the strong coupling regime.
The recent observation [1] that the partition function of a class of four dimensional N = 2 gauge theories on S 4 as computed by Pestun [2] is captured by a correlation function in two dimensional Liouville CFT, has provided a novel arena in which to obtain new exact results in four dimensional gauge theories. In [3,4] the exact expression for the expectation value of certain Wilson-'t Hooft operators in these gauge theories were found by computing correlation functions in the presence of Verlinde loop operators [5] in Liouville CFT. These connections link the study of supersymmetric four dimensional gauge theories to the beautiful subject of two dimensional CFTs, and provide a new toolkit in which to study gauge theories.
In this paper we give the four dimensional gauge theory interpretation of a rather rich and interesting class of observables supported on curves on a Riemann surface in two dimensional CFTs: topological defect operators. We present exact results for the expectation value of various defect operators in four dimensional N = 2 supersymmetric gauge theories on S 4 from the computation of correlation functions in the presence of topological loop operators (and generalized loop operators) in Liouville/Toda CFTs.
Topological loop operators [6] are labeled by a (homotopy class of a) curve on the Riemann surface where the CFT is defined and by a representation of the chiral algebra A of the CFT (the Virasoro algebra for Liouville theory and a W -algebra for Toda CFTs). We construct the topological loop operators in Liouville/Toda CFTs and show that they correspond to the following observables in four dimensional gauge theory: • Domain Wall Operators • Loop Operators depending on which type of representation of A (non-degenerate vs. degenerate) labels the associated topological loop operator in Liouville/Toda CFTs.
The key result that allows us to establish these correspondences relies in the explicit construction of the topological loop operator in Liouville/Toda CFTs. The explicit formulae for the topological defect operators for Liouville/Toda CFTs, found in Section 3, allows us to identify correlation functions with an insertion of a topological defect operator with the partition function of four dimensional gauge theories in the presence of domain wall and loop operators. In our study of topological defect operators we make a new connection with another class of interesting loop operators in 2d CFT, the Verlinde loop operators. We establish a correspondence between these two operators by proving that Verlinde loop operators [5] are isomorphic to topological defect operators [6]. This result, which we prove in Section 2, is a consequence of the associativity of the operator product expansion in 2d CFTs. 1 This observation results in a drastic simplification in the CFT calculation of the Verlinde loop operators, as topological defects are formulated in terms of more accessible data of the CFT: the modular matrices for the characters of the CFT. We believe that this novel connection may find interesting applications in 2d CFTs.
We show that all classes of loop operators we construct in Liouville/Toda CFTs are realized as a combination of a domain wall and a Wilson loop in at least one duality frame of the four dimensional gauge theory. 2 Therefore, in other duality frames -obtained by the action of S-duality -topological loop operators in Liouville/Toda CFTs describe a combination of a domain wall and a Wilson-'t Hooft loop operator in gauge theory. We describe in detail the gauge theory domain walls in a choice of duality frame (Lagrangian description), while in other duality frames it is defined implicitly through S-duality.
Topological loop operators in Liouville/Toda CFTs provide a framework in which to study gauge theory loop operators. We prove that topological defect operator labeled by a degenerate representation of the chiral algebra of Liouville/Toda CFTs -that is a representation 3 of the gauge group of the corresponding four dimensional gauge theory -precisely inserts a Wilson loop operator in an arbitrary represention R of the gauge group Tr R e 2πia (1.1) into the gauge theory partition function on S 4 [2]. These results clinch the Liouville/Toda CFT description of gauge theory loop operators in terms of topological defect operators in the CFT. We show that certain other topological loop operators in Liouville/Toda CFT admit an interpretation as domain walls localized at the equatorial S 3 inside the S 4 where the four dimensional gauge theory is defined: • Janus Domain Walls: We construct generalized loop operators in CFTs that have the effect of changing the complex structure of the Riemann surface on the holomorphic sector with respect to the complex structure on the antiholomorphic sector of the CFT. Insertion of these operators define CFT correlators where the holomorphic and antiholomorphic sectors live on different Riemann surfaces. The correlation function of these generalized loop operators are shown to exactly reproduce the partition function of the supersymmetric Janus domain walls of the corresponding four dimensional N = 2 gauge theories on S 4 , which we compute using localization. These are domain walls across which the complexified coupling constant of the theory jumps, such that the coupling constant on the northern hemisphere of S 4 is different from that on the southern hemisphere of S 4 . • Symmetry Breaking Domain Walls: A very large family of topological defect operators in Liouville/Toda CFTs are labeled by non-degenerate and semi-degenerate representations of the chiral algebra A. We make a rather explicit identification of the effect of inserting these loop operators in CFT correlators with the partition function of a supersymmetric domain walls supported on the equatorial S 3 of the corresponding N = 2 gauge theory. These gauge theory domain walls reduce the gauge group G of the four dimensional gauge theory down to a subgroup H at the location of the wall. By analyzing the effect of the insertion of such a domain wall to the gauge theory partition function on S 4 we exactly reproduce the formula the semi-degenerate topological defect operators in Liouville/Toda CFTs. • Duality Walls: These are domain walls between two four dimensional gauge theories, where the theory on one side of the wall is the S-dual of the other. These walls have the property that operators transported across them are acted on by the action of S-duality. We propose that these duality walls correspond to Liouville/Toda CFT correlation functions enriched by the action of an element of the Moore-Seiberg groupoid G [8] (which corresponds to the S-duality group of the corresponding four dimensional gauge theory). This correspondence predicts that the partition function of the three dimensional N = 2 superconformal field theory on the equatorial S 3 is captured by the integral kernel that implements the transformation on the CFT conformal blocks of the associated Moore-Seiberg groupoid element.
In summary, we have found a rather complete realization of topological defect operators in Liouville/Toda CFTs in terms of defect operators (loop and domain wall operators) in four dimensional N = 2 supersymmetric gauge theories on S 4 . Our computations in Liouville/Toda CFTs allow for the exact computation of these interesting observables in four dimensional gauge theories.
The plan of the rest of the paper is as follows. In Section 2 we prove that Verlinde loop operators are isomorphic to topological loop operators in a general CFT using the Moore-Seiberg relations of 2d CFT. Section 3 contains the explicit construction of topological loop operators in Liouville theory and arbitrary Toda CFTs as well as generalized loop operators, which change the complex structure of the Riemann surface. This entails determining the characters of these CFTs for the various representations as well as computing the associated modular matrices. In Section 4 it is shown that topological defect operators based on degenerate representations exactly capture the insertion of a Wilson loop operator in the partition function of the four dimensional gauge theory on S 4 . Section 5 shows that the other topological defects in Liouville/Toda CFTs admit an interpretation as domain wall operators in the four dimensional gauge theory. In section 6 we use the construction of the four dimensional gauge theories using M5-branes to shed further light on the identification between topological defects and gauge theory defects presented in the previous sections. Some extra calculations are given in appendices. In Appendix A we present the different subgroups of the 4d N = 2 supergroup that are preserved by 1/2 BPS domain walls, surface operators, loop operators and local operators. In Appendix B we present some more information on the construction of boundaries and domain walls in 4d N = 2 gauge theories and in particular the Janus domain wall. Appendix C discusses the duality wall associated to the S-duality of N = 4 SYM.

Topological Defects and Loop Operators in 2D CFT
In this section we establish a novel correspondence between two seemingly unrelated loop operators in 2d CFT -known as topological defect operators and Verlinde loop operatorsby proving that they are isomorphic. This new connection is of interest and relevance for 2d CFTs and does not rely on their physical interpretation in 4d N = 2 gauge theories, which is the main focus of the rest of the paper. This section and Section 3 are self-contained and may be read independently.

Topological Defect Operators
Topological defect operators [6] (see also e.g. [9,10,11]) in a 2d CFT are operators supported on closed curves characterized by the property that they commute with both the holomorphic and antiholomorphic energy-momentum tensor of the CFT. 4 Since the energy-momentum tensor generates arbitrary conformal transformations, which can deform the curve, the geometric characterization of topological defect operators is in terms of homotopy classes of non-intersecting curves on the punctured Riemann surface where the CFT is defined. 5 In formulae, a topological defect operator supported on an (oriented) curve p, which we denote by O µ (p), is defined by where T and T denote the holomorphic and antiholomorphic energy-momentum tensors of the CFT, which generate the two copies of the Virasoro algebra Vir ⊗ Vir preserved by the topological defect operator. The label µ in O µ (p) specifies the quantum number (i.e. the representation) of the operator. Topological defect operators in a CFT can be mapped to conformally invariant boundary conditions (BCFTs) of the doubled theory CFT ⊗ CFT using the folding trick, whereby the CFT on one side of the defect is mapped to the other one (see Figure 2). 6 Nontrivial 4 More generally, topological defect operators can glue two different CFTs with the same central charge [12]. In this paper we focus our attention to the case where the same CFT appears on both sides of the defect. 5 A important natural generalization are topological defect webs, which we will consider only briefly. 6 The bar on the folded copy of the CFT reflects that unfolding acts by parity and exchanges the holomorphic and antiholomorphic sectors of the folded CFT. p p ′ Figure 1: Two curves on a genus-2 Riemann surface with one puncture. The curve p separates the surface into two regions on which two distinct CFTs can be defined, joined by a topological defect. The curve p ′ does not split the surface into two disconnected surfaces, but rather to a single surface with two boundaries. One can define a topological defect identifying two copies of the same CFT along p ′ . Figure 2: Locally a topological defect can always be represented as separating two CFTs on the cylinder. This is equivalent to a boundary condition for the tensor product of the two CFTs.
topological defect operators correspond to the so-called permutation BCFTs, defined by gluing the stress-energy tensor of CFT with that of CFT on the boundary. BCFTs which are a direct product of a BCFT of CFT and CFT yield trivial topological defect operators upon folding, as the CFTs at the two sides of the defect are completely decoupled. The construction of topological defects is therefore tantamount to the construction of permutation BCFTs of CFT ⊗ CFT. Rational CFTs (RCFTs) provide a special class of theories for which topological defects can be completely understood. The holomorphic data of a CFT depends on the choice of a chiral algebra A, which necessarily contains the Virasoro algebra Vir in its enveloping algebra U(A). 7 A RCFT is characterized by having a finite set I of irreducible representations V α of the algebra A, with associated characters χ α (q), where α ∈ I. Topological defect operators invariant under A ⊗ A can be classified in RCFTs and are determined by the equations where the operators W (z) and W (z) generate A ⊗ A. For diagonal RCFTs, defined by the torus partition function where α * labels the representation conjugate 8 to V α , the number of linearly independent topological defect operators O µ (p) is given by the cardinality |I| of the representation set I: In the doubled theory the commutation relations (2.2) become the equations defining the permutation Ishibashi states. Indeed, in radial quantization the equation reads 10 where s is the spin of the generator and the superscript 1, 2 refers to the two copies of the CFT. A complete basis of permutation Ishibashi states is given by with α ∈ I any of the representations of A and {k},{l} is the sum over all orthonormalized descendant states 11 in the representation V α ⊗ V α * of A . The overlap of permutation Ishibashi states yield the product of the holomorphic and antiholomorphic characters µ, µ * |q L 0 −c/24 q L 0 −c/24 |α, α * = δ µα χ α (q)χ α * (q) . (2.7) The fact that O µ (p) commutes with both copies of the chiral algebra A in (2.2) implies that a topological defect operator is proportional to the identify operator in each subspace V α ⊗ V α * of the Hilbert space. Therefore O µ (p) must be a sum of projectors The product of a representation α with its conjugate α * contains the identity (vacuum) representation 1, i.e. V α ⊗ V α * ⊃ V 1 . They are the unique pair of representations for which the fusion coefficient N 1 αα * = 1. 9 For a general RCFT, defined by the partition function Z = α,ᾱ∈I Z αᾱ χ α (q)χᾱ(q), where Z αᾱ ∈ Z + , the number of linearly independent topological defect operators is given by the cardinality |E| of the set E = {α|Z αα * = 0}, known as the set of exponents. 10 In this formula the overline denotes the antiholomorphic sector. 11 If the states are not orthonormalized the inverse matrix of inner products should be inserted into the expression.
The coefficients D µα are determined by demanding that the partition function on the torus in the presence of a topological defect admits a consistent Hilbert space interpretation, akin to the familiar Cardy condition in the context of BCFT. Consistency requires that 12 [6] where S µα is the modular matrix of the CFT, defined by the way the characters of A behave under a modular transformation where q = exp(2πiτ ) andq = exp(−2πi/τ ), and where 1 ∈ I denotes the trivial (vacuum) representation of the chiral algebra A. Therefore, we find that topological loop operators are labeled by a representation µ ∈ I of the chiral algebra A.
Reversing the orientation of the curve p in C g,n changes the representation label of the topological line operator to the conjugate representation, that is O µ (p −1 ) = O µ * (p). It is therefore important to keep track of the orientation of curves supporting topological defect operators in CFTs based on chiral algebras A admitting complex representations.
Even though no general classification of topological defects in non-rational CFTs or in RCFTs preserving Vir ⊗ Vir is available, some explicit constructions are known. We will later show that topological defect operators in some non-rational CFTs -such as Liouville and Toda theories -share similarities with the corresponding operators in RCFTs.
Topological defect operators can be used to construct observables that go beyond the usual CFT correlation functions, thereby enriching the familiar correlation functions of local operators. On a genus g Riemann surface with n punctures, which we denote by C g,n , topological defect operators supported on curves in C g,n can be inserted. For instance, one can define the expectation value of the topological defect operator O µ (p) in the presence of the n local operators Topological defect operators have important physical implications and have provided insights into symmetries, duality transformations, RG flows and boundary states in CFTs (see e.g. [13,14,15,16,17,18,19]).
There is an interesting generalization of the correlation function (2.11) involving topological webs of line operators. Indeed three topological line operators can meet at a topological junction whose support can also be arbitrarily deformed in the Riemann surface without 12 In contrast, the expression for the Cardy boundary states in RCFT is given by |µ = α∈I Sµα √ S1α |α . The change of power in the denominator is due to the fact that, as already mentioned, a topological defect in a CFT is directly related to a boundary state for the doubled CFT. Figure 3: Two examples of topological defect webs on a genus two surface with one puncture. Both have a pair of topological defect junctions. In (a) they combine the defects with representations µ 1 , µ * 2 , µ 3 and µ * 1 , µ 2 , µ * 3 . In (b) they combine µ 1 , µ 2 , µ * 3 and µ * 1 , µ * 2 , µ 3 .
changing the value for the correlator (see Figure 3). Topological junctions joining more than three topological line operators can be split into products of trivalent junctions. Therefore, an arbitrary web of topological line operators on a Riemann surface can be generated by a "lego" construction connecting oriented topological lines at trivalent topological junctions. The number of topological junctions joining incoming topological line operators labeled by representations µ 1 , µ 2 and µ 3 is given by N µ * 3 µ 1 µ 2 , the fusion coefficients of the chiral algebra A. It is also possible for a line operator with label µ to end on a vertex operator V i,j if the representationj * appears in the fusion of µ and i. We will denote by O a generic topological web operator, made of strands of line operators ending either at triple intersections or on appropriate vertex operators.

Conformal Blocks and Topological Loop Operators
An arbitrary CFT correlation function can be constructed by combining the three-point function of primary fields on the sphere with the so-called conformal blocks. The correlator can be reduced to a product of three-point functions by appropriately inserting complete sets of intermediate states, which includes a sum over the primary fields of the CFT as well as the descendants. The contribution to the correlator of the descendants, which factorizes into a holomorphic and antiholomorphic contribution, is captured by the conformal blocks, and what is left is a sum over the primary labels and, possibly, over the different ways of fusing the primaries inside each three point function.
Associativity of the operator product expansion (OPE) in the CFT implies that the decomposition of a correlator into three-point functions and conformal blocks is not unique. Each decomposition of a correlator in C g,n can be associated with a trivalent graph Γ σ , corresponding to a choice of sewing σ of the Riemann surface C g,n from 2g − 2 + n pairs of pants (trinions) and 3g − 3 + n tubes (see Figure 4). The sewing σ of C g,n defines the Figure 4: Two different pants decomposition of the surface C 2,1 of genus 2 with one puncture and the two associated trivalent graphs.
The conformal block carries three types of labels: representations on the external edges, representations on the internal edges and the choice of fusion channel at each trivalent vertex, which runs from 1 to N µ * 3 µ 1 µ 2 if µ i are the labels on the three incoming edges. We use the notation α ≡ (α 1 , . . . , α 3g−3+n , u 1 , . . . , u 2g−2+n ): α i are the labels of the representations associated with the internal edges of Γ σ and u i label the fusion channels. Finally, E ≡ (m 1 , . . . , m n ) label the representations of the external edges.
Therefore, a CFT correlator in C g,n admits the following holomorphically factorized representation 13 where the measure factor ν(α) includes the product of three-point functions corresponding to each vertex in Γ σ . The integral is over the quantum numbers labeling the internal edges and trivalent vertices of Γ σ , which capture the sum over intermediate states and their selection rules. Associativity of the OPE implies that the correlator is the same for any two choices of trivalent graphs Γ σ and Γ σ ′ of C g,n . Since any two trivalent graphs are mapped into each other by an element of the so-called Moore-Seiberg groupoid G [8] (see [20] for a review), the CFT correlators are also invariant under G, which includes the mapping class group of C g,n as an important subgroup.
This general construction applies in the presence of topological loop operators or webs as well. The main difference is that we will generally need to cut tubes through which topological lines run. As the generators of the chiral algebra A commute through the topological lines, the states propagating in the tubes can be still decomposed in irreducible representations of the chiral and antichiral algebras. Hence the correlation function still factorizes in holomorphic and antiholomorphic conformal blocks where O is an arbitrary topological loop or web operator. The kernel O(α ′ , α) can be computed from the product of appropriate three point functions in the CFT. From this expression, it is clear that we can interpret O as an operator acting on the space of conformal blocks: Given two topological line operators or webs O and O ′ we can "compose" them, by concatenating the action on conformal blocks: can be rewritten as a sum over topological webs, or line operators! If the strands of O and O ′ are disjoint, the composition simply corresponds to inserting both O and O ′ in the correlation function, but if the strands of O and O ′ intersect at some points z i on the Riemann surface, the composition is rather more interesting. We will discuss it briefly at the end of Section 2.4. In particular, these topological line and web operators form an interesting algebra, and provide a link between conformal field theory and other mathematical constructions, such as quantization of Teichmüller space and its higher rank generalizations.

Verlinde Loop Operators
While CFT correlators are single-valued functions of the positions of the vertex operators, conformal blocks F (σ) α,E are multivalued functions. 14 The conformal blocks F α,E by analytic continuation. The existence of monodromies in conformal blocks was first exploited by E. Verlinde to define an interesting class of observables in CFT that are supported on homotopy classes of curves on the Riemann surface C g,n [5].
The basic idea is to calculate the monodromy acquired by a chiral operator V µ (z) as it circumnavigates a path p in C g,n . V µ (z) can be any chiral operator in the CFT. 15 The α,E associated with the trivalent graph Γ σ by adding an external edge corresponding to the trivial (vacuum) representation of the chiral algebra A. This does not change the value of the conformal block. In order to define the monodromy of V µ (z) we rewrite the identity operator as the projection to the trivial representation of the OPE of the chiral operator V µ with its conjugate V µ * . This has the effect of adding a trivalent vertex to the original trivalent graph Γ σ where two of the new edges are external and are labeled by the quantum numbers µ and µ * while the third new one, which carries the trivial representation 1, is attached to Γ σ . We denote the enriched trivalent graph Γσ.
Given a path p in C g,n , the loop operator L µ (p) is defined as the monodromy acquired by V µ (z) as it moves around the projection of p on the trivalent graph Γ σ . These loop operators are represented in terms of their action on conformal blocks Transporting the chiral field V µ (z) around the trivalent graph Γ σ involves intermediate steps with different trivalent graphs Γσ′, where V µ (z) is connected to different edges in Γ σ . Calculating the monodromy requires relating the conformal blocks associated to different trivalent graphs. These are related by analytic continuation. The Moore-Seiberg groupoid G, whose elements relate any two trivalent graphs associated with a given Riemann surface, also relate the conformal blocks corresponding to different trivalent graphs. By concatenating the moves that span the motion of V µ (z) along a closed path in Γ σ the monodromy attained by circumnavigating along p can be computed. Since the monodromy is invariant under continuous deformations of the curve p on the Riemann surface, Verlinde loop operators L µ (p) only depend on the homotopy class of p.
Just as in the case with topological defect operators, these loop operators can be used to define novel observables in CFT. For instance, the expectation of a loop operator L µ (p) in the presence of n local operators is given by Just like the usual CFT correlation functions, correlators involving loop operators L µ (p) are invariant under a change of pants decomposition of the Riemann surface C g,n , and provide an interesting class of observables in CFTs.

Topological Defect Operators = Verlinde Loop Operators
Both topological defect operators and Verlinde loop operators constitute an interesting class of CFT operators supported on curves on C g,n and are labeled by the homotopy class of the curve p and a representation µ of the chiral algebra A. We now prove that when defined along non-intersecting curves, these two seemingly different objects, in fact define the same loop operator. 16 Let's consider O µ (p) and L µ (p) supported on a curve p of C g,n . In order to prove their equivalence it is sufficient to analyze the action of these operators on correlation functions of local operators for a specific choice of pants decomposition of the punctured Riemann surface, given that these operators transform in the same way under the Moore-Seiberg groupoid. Assuming that the curve p has no self-intersections, it is always possible to choose a pants decomposition σ of C g,n using p as one of the curves along which the surface is sewn. In this pants decomposition, the path p corresponds to a curve encircling one of the internal edges of the corresponding trivalent graph Γ σ .
By abuse of notation we denote the quantum number labeling this internal edge in Γ σ by α. Then the topological defect operator O µ (p), described by eqns. (2.8)(2.9), inserts into 16 Our definition of the topological loop operators requires them to have no self intersections. The Verlinde loop operators can be defined also along self-intersecting paths. There should be a generalization of this isomorphism to include topological defect webs and more general Verlinde loop operators. Figure 6: The fusion move exchanges s-channel and t-channel graphs associated to two different pants decompositions of the 4-punctured sphere.
where α is a quantum number that must be summed over to obtain the complete correlator We now want to determine the effect of the Verlinde loop operator L µ (p) on the same correlation function. As explained earlier, this is encoded by the monodromy of the chiral operator V µ (z) as it circumnavigates the path p. Since this loop wraps around a single internal edge of Γ σ , we can focus our attention on this edge, as the rest of the trivalent graph Γ σ is unaffected by the operator L µ (p).
In order to evaluate the monodromy, we must determine how the conformal blocks based on the inequivalent trivalent graphs generated by the motion of V µ (z) around p are related. As mentioned earlier, elements in the Moore-Seiberg groupoid G map any two such trivalent graphs, while relating the corresponding conformal blocks by analytic continuation. It is an important result of CFT that the groupoid G is generated by three basic moves: 17 Each move acts locally on the graph and affects only the edges involved by the move, while the rest of edges remain untouched. We will suppress the u i labels in our pictures, which specify the choice of fusion channel at each vertex. The fusion move relates the conformal blocks associated to the following two trivalent graphs where F αα ′ α 3 α 2 α 4 α 1 is the fusion matrix of the CFT. The two relevant pants decompositions of the four-punctured sphere are illustrated in Figure 6.
Braiding, which exchanges two consecutive edges in the trivalent graph, acts by multiplication by a phase factor where ∆(α) is the conformal dimension of the primary operator with quantum number (representation) α. This is a bit clearer when drawn on the trinion, see Figure 7. Finally, the S-move relates the following two trivalent graphs where S µα (γ) is the modular matrix on the once-punctured torus. While the trivalent graphs on the left and right hand sides look identical, they actually represent different cycles on the once-punctured torus, see Figure 8.
We are now ready to compute the action of L µ (p) on the conformal blocks F (σ) α,E when p is a path encircling one of the internal edges of the corresponding trivalent graph Γ σ . The pictorial representation capturing the monodromy is given in Figure 9. In the figure we have While the cycles carrying labels µ and α are different, the associated trivalent graphs look identical.
allowed for arbitrary external states µ 1 and µ 2 and internal initial and final states η and γ. For the purpose of computing the Verlinde loop operator, we will take η and γ to be the identity representation and therefore 18 µ * 2 = µ 1 = µ. Then it is also natural to glue the upper two punctures into a torus, as we illustrate below in Figure 12.
The first move in Figure 9 is a fusion, expressing the t-channel conformal blocks in terms of the s-channel ones. The next steps, which are the hardest to visualize, are two braiding moves on the pair of pants labeled by representations β, α and µ 2 . Lastly another fusion move returns us to a t-channel graph similar to the original one. The combined action of these moves act on the conformal blocks on the surface C g,n+2 with the extra two punctures. It generates the monodromy In order to derive the action of the loop operator L µ (p) we need to project down to the original conformal blocks on C g,n , so we impose in the initial and final configurations in Figure 9 that the intermediate channel carries the identity representation η = γ = 1. We get the action of the Verlinde loop operator on the conformal blocks of the CFT on C g,n

19
[ This is to be contrasted with the effect of the topological loop operator O µ (p), which inserts Is there any relation between the two expressions? It turns out that the monodromy in (2.25) is identical to (2.26). This follows from the fact that the fusion, braiding and modular matrices of a CFT are not independent, rather they satisfy the so-called Moore-Seiberg groupoid relations [8]. These relations can be obtained by manipulating trivalent graphs for the cases g = 0 with n = 4, 5 as well as g = 1 with n = 1, 2.
The relation that is relevant for us is one that arises for the twice-puntured torus (g = 1, n = 2) (see [22] for a review). It is illustrated in Figures 10 and 11. We use the twicepunctured torus, where cutting the torus would give the four punctured sphere used in the calculation of the Verlinde loop operator in Figure 9. As a first step we take an S-move S δα (η) and then continue with the steps of the Verlinde loop operator, which are a fusion, two braidings and a further fusion.
The same result is achieved by a different sequence of steps in Figure 11. There are first two fusions, then a braiding, and finally an S-move. These steps are represented by the monodromy This is therefore equal to the expression in (2.24) multiplied by S δα (η). Figure 10: When connecting the two bottom punctures in Figure 9, we get a twice punctured torus. In order to derive the relation (2.27) we act first by one further S-move. Figure 11: The same result as in Figure 10 is achieved by doing two fusion steps, a braiding and an S-move.
Specializing to our case, when η = γ = 1 we get the relation where S δα ≡ S δα (1). We now further restrict to the case when δ = 1, which imposes ν = µ and eliminates the sum on the right hand side of (2.28). Using the expression for d µ , the quantum dimension of the representation labeled by µ we finally find which is precisely the expression for the topological defect.
Since, topological defect operators and Verlinde loop operators transform the same way under elements of the Moore-Seiberg groupoid G, their equivalence extends to an arbitrary choice of pants decomposition. We conclude that topological defect operators and Verlinde loop operators are isomorphic: This result, apart from identifying two seemingly different classes of operators in 2d CFTs, provides a very effective tool for computing the correlation functions of loop operators. The fusion and braiding matrices of a CFT are given by complicated expressions involving quantum deformations of 6j symbols and are unknown for most CFTs. However, our identification reduces the correlators to the computation of the modular matrices of the CFT, which can be much more easily derived (see Section 3). Let us make one more observation. If we connect the two upper punctures of the fourpunctured sphere (which is quite natural, since they carry conjugate representations) the starting configuration has the state µ running around the torus and the state α along a line between the two punctures, with nothing (i.e. the identity state) connecting them. After the monodromy we get a similar configuration, only that now, if viewed in an embedding 3d space, the torus wraps the line. This is illustrated in Figure 12 and is closely related to the realization of topological defects using topological field theories (see e.g. [23,24,10]). If the CFT has a 3d topological field theory realization, then the topological defect operators are realized as closed curves in the bulk that are linked to the curves associated to the local operators, 20 which are represented by curves ending on the boundary.
This approach makes quite clear that topological line operators and webs will satisfy properties analogous to the properties of the conformal block trivalent graphs. For example, Figure 13: A pair of intersecting topological defects (a) can be resolved (after including the extra trivial line carrying the identity state) to a defect web with no intersections, but with two junctions (b).
a web containing four strands with labels α i connected through two trivalent vertices by a strand of label α in an "s-channel" configuration or similar web where the four strands are connected through a strand of labelα in a "t-channel" configuration will be related through a fusion matrix coefficient exactly as in eqn. (2.21)! This is illustrated in Figure 13. Also, we learn how to "resolve" the intersection between the webs O and O ′ in O•O ′ . If we focus on the region near an intersection, and add a line carrying the identity representation and joining the two crossing strands, the intersection looks like a "u-channel" four point conformal block. Through a fusion and a braiding operation, this can be resolved to a web with no self-intersections. Hence we have an algebra (2.32) Here α,α ′ ,α ′′ denote the labels of representations on the webs O,O ′ ,O ′′ respectively. The skein relations for loop operators in Liouville CFT discussed in [4] are an example of this operation. In that case, when the lines carry the first degenerate representation, they can be resolved into a linear combination of a "t-channel" and "s-channel" graph with a trivial intermediate state, i.e., into pairs of non-intersecting curves.

Loop Operators in Liouville Theory and Toda
In this section we study topological defect operators in an interesting class of non-rational CFTs. We start with an analysis of topological defects in Liouville theory and then explicitly construct topological defects in Toda CFTs. We find that these operators are labeled by representations (degenerate and non-degenerate) of the Virasoro algebra.
In order to compute the topological defects in Toda CFTs we first calculate the characters for arbitrary representations in Section 3.2 and present the explicit formula for the operators in Section 3.3. In Section 3.4 we construct an interesting class of generalized topological line operators, which when inserted in a CFT correlator, effectively change the complex structure moduli of the Riemann surface C g,n where a CFT correlator is defined in the holomorphic (or antiholomorphic) sector. Insertion of these loop operators yield CFT correlators where the holomorphic and antiholomorphic sectors are based on different Riemann surfaces.

Topological Defect Operators in Liouville CFT
Topological defect operators in Liouville can be obtained via the unfolding trick from the boundary states of Liouville ⊗ Liouville. Boundary states in Liouville theory [26,27,28] are labeled by the representations of the Virasoro algebra, akin to the Cardy classification of boundary states in RCFTs in terms of representations of the chiral algebra A.
A representation of the Virasoro algebra is characterized by the Liouville momentum α of the primary field, which has dimension ∆(α) = α(Q − α), where Q determines the CFT central charge through c = 1 + 6Q 2 . There are two families of boundary states in Liouville theory labeled by different representations of the Virasoro algebra: • ZZ boundary states [28]. Labeled by a pair of integers (r, s) ∈ Z + × Z + describing a degenerate representation, 21 with momentum The corresponding character is given by • FZZT boundary states [26,27]. Labeled by a real parameter m ∈ iR describing a non-degenerate representation with momentum The corresponding character is given by Recently, an investigation of topological defect operators in Liouville theory has been carried out in [29] by unfolding the permutation boundary states in Liouville ⊗ Liouville. These boundary states, which where obtained by extending the boundary conformal bootstrap approach in [26,27,28], yield defect operators also classified by degenerate and non-degenerate representations of the Virasoro algebra: 21 An (r, s) degenerate representation contains a Virasoro descendant at level rs that is a null state.
• FZZT topological defect: . (3.8) and We now show that despite that Liouville theory is not a RCFT, the expression for the topological defects can be written in terms of the modular matrices of the corresponding characters as in eqn. (2.9). Performing the modular transformation of the degenerate characters (3.2) and non-generate characters (3.4) the following modular matrices can be derived [28] S (r,s)α = −2 √ 2i sin(2πar/b) sin(2πasb) (3.9) and Therefore, by comparing with (3.6)(3.8) we find that This computation highlights the simplicity of topological defect operators (or Verlinde loop operators) even for non-rational CFTs.

States in Toda CFTs and Characters
Toda CFTs are based on a Lie algebra g, with the choice g = A 1 corresponding to Liouville theory. ADE Toda CFTs are conjectured to capture observables in four dimensional gauge theories based on ADE gauge groups. Here we construct topological defect operators in these theories. But first we must construct the characters of arbitrary representations in Toda CFTs.
Toda CFTs have a W-algebra symmetry. This is generated by K − 1 currents W (l i +1) with spin l i +1, where the set {l i } i=1,...,K−1 is the set of exponents 22 of g and K −1 = rank(g). The generator W (2) = T denotes the usual energy-momentum tensor of a CFT and generates the Virasoro subalgebra Vir ⊂ W .
Vertex operators of primary operators in Toda CFTs are constructed out of K −1 scalars, and are given by e µ,φ , (3.12) where , is the bilinear form on h * , the dual to the Cartan subalgebra h of g. The conformal dimension of the primary operator (3.12) is given by Q is the background charge for the K − 1 scalars where ρ is the Weyl vector 23 of g and ρ * is the dual Weyl vector. The background charge determines the central charge of the CFT through There is a variety of possible representations in Toda CFTs. The spectrum of delta function normalizable states in Toda CFT is given by the non-degenerate representations. These are generated by primary states with 24 µ = Q + m , (3.16) where m is an arbitrary K − 1 dimensional vector with imaginary entries. Notice that momenta related by the Weyl group W action m → w(m), where w ∈ W, correspond to the same representation. These representations consist of a full Verma module built out of the W-algebra descendants of the highest weight vector.
To calculate the character we note that the states created by the W-algebra generators are just like those created by the free action of K − 1 copies of the Virasoro generators. Therefore using (3.13) we get the characters for these representations The set of exponents {l i } of g is related to the set of the order {ν i } of the Casimirs of g by l i = ν i − 1. 23 The Weyl vector is the sum over positive roots of g; that is ρ = 1/2 e>0 e, while the dual Weyl vector ρ * = 1/2 e * >0 e * is the sum over positive coroots. 24 For K = 2 this agrees with (3.3), only that in Liouville theory different conventions are used and in particular Q Liouville = 2Q Toda .
In addition to these non-degenerate representations, other interesting representations in Toda CFTs can be constructed which contain null descendant states, known as semidegenerate representations. A null vector at level rs in the Verma module is visible in the Kac determinant (see eqn. (6.72) in [30]), together with a whole Verma module of descendants, if there are positive integers r and s such that the inner product of the Toda momentum with a root e ∈ g satisfies − m, e = 1 2 e, e rb + s/b .
Without loss of generality, we can classify semi-degenerate representations by a collection of simple roots I, 25 and a set of conditions The components of the momentum in directions orthogonal to the simple roots in I are free to assume arbitrary imaginary valuem (and as before, they are identified if related by a Weyl reflection). The simplest semi-degenerate representations have a single null vector at level 1, i.e. a momentum µ orthogonal to a single simple root. In other words, the highest weight vector is annihilated by some linear combination of the level 1 W-algebra generators . The character of this representation takes the form Similarly, the character of a representation with a single null vector at level rs takes the form In particular, for K = 2 we recover the character of the degenerate representations of Liouville theory (3.2) (wherem = 0). An extreme case are the fully degenerate representations, where I consists of all the simple roots in the Lie algebra g. The momentum of such a state is constructed out of a weight vector and a coweight vector of g multiplied by b and 1/b respectively. 26 Therefore, completely degenerate representations are labeled by two highest weight states λ 1 and λ 2 , corresponding to a representation R 1 of g and a representation 27 L R 2 of L g, the GNO or Langlands dual Lie algebra of g These representations have K − 1 independent null vectors, which occur at Virasoro descendent level The simplest of the fully degenerate representations is the identity representation, for which r i = s i = 1, so all the level 1 vectors are null. Regularity of the operators W (l i +1) at the origin of the complex plane imply the existence of the following null states 28 The irreducible Verma module associated to the vacuum is constructed by modding out by the descendants generated by the action of W (l i +1) −n for 0 < n ≤ l i . Therefore, the character is given by Using the Weyl denominator formula one can write this as follows Here W is the Weyl group of g and w(·) denotes the action of the element w on a vector. The extension of this formula to other completely degenerate representations (3.22) is It is even more subtle to compute the character for a generic semi-degenarate representation (3.19) in Toda theory as the Verma modules of different null vectors may intersect. We derive the characters by generalizing the examples above.
For a semi-degenerate representation, a subset I of the simple roots in g has a distinguished role related to the null vectors. Consider the subgroup W I of the Weyl group W of g generated by reflections by the simple roots in I. Notice that W I is the Weyl group of the subsystem of roots ∆ I which are linear combinations of the simple roots in I. We can define a restricted Weyl vector ρ I as half the sum of the positive roots in ∆ I and write m =m − (ρ I + λ 1 )b − (ρ * I + λ 2 )/b, where m, ρ I = m, ρ * I = 0. The vector λ 1 can be thought as a highest weight labeling an irreducible representation R 1 of the Lie algebra g I 28 Out of these, K − 1 are independent and generated by {W built from ∆ I and λ 2 as a highest weight labeling an irreducible representation L R 2 of L g I , the GNO or Langlands dual Lie algebra g I .
Then the semi-degenerate character can be written as (3.28) These formulae have a rather intuitive meaning. The term where w is the identity represents the full Verma module. The terms where w is a reflection by a simple root have ǫ(w) = −1 and subtract off the Verma modules of the null vectors whose levels can be read from (3.19).
The remaining terms deal with the intersections between the Verma modules. The formula is essentially fixed by invariance under W I . When λ 1 = λ 2 = 0 we can use the Weyl denominator formula to rewrite the sum as Since β, ρ I simply counts the number of simple roots in β, we see the expected level 1 singular vectors, and some more.

Topological Defect Operators in Toda CFTs
We now construct the topological defect operators corresponding to the various representations in Toda CFTs. In order to determine the topological defect operator for a representation, we must first calculate the modular matrix of the associated character. An elementary computation yields 29 where m = µ − Q and a = α − Q.
Using that η(−1/τ ) = √ −iτ η(τ ), we arrive at the modular matrix for the non-degenerate representation labeled by µ where C is the Cartan matrix of g. 29 In deriving this formula we used that w(a), w(a) = a, a .
In order to write down the formula for the topological defect (2.26) we also need S 1µ , obtained from the modular transformation of the character (3.26) for the identity (vacuum) representation. Each term in the sum in (3.26) corresponds to the non-degenerate character (3.17) evaluated at momentum Therefore, (3.33) which by Weyl's denominator formula can be written as where e > 0 denote the positive roots of g, while e * > 0 are the positive coroots of g.
For the completely degenerate representations the character is given in equation (3.27). Each term in the sum corresponds to the character (3.17) evaluated at momentum Therefore, (3.36) We can now use the Weyl character formulae where χ R 1 (e x ) is the character in representation R 1 of g while χL R 2 (e x ) is the character in representation L R 2 of L g. We therefore find that (3.36) can be expressed as Finally, for semi-degenerate representations the character is given in (3.28), where each term in the sum corresponds to the non-degenerate character (3.17) evaluated at momentum It is useful to split the sum over w ∈ W into a sum overw in W/W I andw ′ in W I . The action of W I onm is trivial, hence we can repeat the above steps to obtain Equipped with these formulae, we can write down the explicit expressions for the topological defects in Toda CFTs (we recall that µ = Q + m): where • Non-degenerate topological defects (m purely imaginary): where D µ (α) = w∈W exp (2πi w(m), a ) e>0 4 sin (πb a, e ) sin π b −a, e * . (3.44) • Semi-degenerate topological defects (m =m − (ρ I + λ 1 )b − (ρ * I + λ 2 )/b withm purely imaginary): where Therefore, topological defects in Toda theory insert the expressions (3.42)(3.44)(3.46) into Toda CFT correlation functions, depending on the choice of representation for the topological line operator. These simple insertions arise for any pants decomposition of C g.n for which the closed curve p on which the topological defect operator is supported corresponds to an internal edge on the associated trivalent graph Γ σ .

Generalized Topological Line Operators
There is a useful generalization of the notion of a topological line operator: line operators which effectively change the complex structure of the Riemann surface they are inserted in. A CFT correlation function on a Riemann surface in the presence of such lines operators compute the CFT correlation function on the same Riemann surface but with a different complex structure.
Recall that the complex structure moduli of a Riemann surface can be identified with the length and twist coordinates associated to the 3g − 3 + n tubes that comprise a pants decomposition of the surface from 2g − 2 + n trinions. The moduli arise from the transition functions between local coordinate patches z and z ′ near two punctures as z = q/z ′ . A different local coordinate system given by the conformal transformation z → f (z) will give a surface with a different complex structure.
Consider a non-self-intersecting path p on the Riemann surface, and thicken it to a strip. We assume that under the locally defined conformal transformation z → f (z) the image and counterimage of p under f belong to the strip. Then we can define line operators such that the energy momentum T on one side of the line operator equals f • T on the other side of the line operator, and analogously identifyT andf •T . The symbol f • T denotes the action of the conformal transformation f on the energy momentum tensor T where {f (z), z} denotes the Schwarzian derivative. Such a generalized line operator can be written as where |f • α,f • α * ≡ {k},{l} |f • α, k;f • α * , l ⊗ |α, l; α * , k are the permutation Ishibashi states which implement the twisted gluing conditions across the curve p The coefficient D µα here is the same as for the standard topological line operators (2.9). Even if D µα is trivial, the insertion of this line operator in a CFT correlation function modifies the holomorphic and antiholomorphic conformal blocks such that they correspond to a Riemann surface with a different complex structure.
Notice that it is possible to choose functions f,f which are not related by complex conjugation. This requires a little bit of care: the action of f,f on primary fields of generic conformal dimension is ill defined because of choice of branch in the Jacobian (∂f ) ∆(α) (∂f ) ∆(α * ) . We really need to specify the path we follow in deformingf away from the conjugate to f . This fixes the choice of branch, but forces us to think in terms of Teichmüller space rather than complex structure moduli space.
Inserting such a generalized loop operator in a CFT correlation function results in a correlation function which pairs holomorphic and antiholomorphic conformal blocks defined at different values of the (Teichmüller) complex structure moduli. The expression corresponding to the insertion of O µ,f (p) for the identity representation is given by where q and q ′ denote two points in Teichmüller space. This pairing makes sense because the space of conformal blocks is a flat bundle over Teichmüller space, so that conformal blocks at different values of the complex structure can be paired up as long as a path is specified between the two choices of complex structure.
Although the deformation of the Rieman surface complex structure moduli through generalized line operators is only local in Teichmüller space, the pairing between holomorphic and anti-holomorphic blocks defined at different values of the complex structure moduli in (3.50) makes sense, by analytical continuation, also for values of the moduli which are arbitrarily far in Teichmüller space. There is one aspect about eqn. (3.50) which is somewhat unnatural, that the same pants decomposition is used in both conformal blocks, even if they describe the Riemann surface at very different points in Teichmüller space.
It is more natural at a given point to use the pants decomposition along "short" cycles, so if the trivalent graph Γ σ is associated with a natural pants decomposition σ at q we can choose the graph Γ σ ′ for a natural pants decomposition σ ′ at q ′ . The two graphs are related to each-other by a sequence of steps in the Moore-Seiberg groupoid G, which describes the evolution from a trivalent graph Γ σ to the trivalent graph Γ σ ′ mirroring the precise path g (σ ′ ,σ) from the point q to q ′ in Teichmüller space.
The analytic continuation of the holomorphic conformal block is then captured by a representation of the element of the Moore-Seiberg groupoid G as a matrix g (σ ′ ,σ) acting on the holomorphic conformal blocks. The result can be written as (3.51) A special case is when q and q ′ are image points under the mapping class group, i.e., they map to the same point in moduli space. Then we can take σ = σ ′ and F α ′ ,E (q) and the above expression would differ from the usual correlation function by the inclusion of the matrix g.
There is a second way to generalize the notion of topological line operator, which will not play a role in this paper, but is relevant in matching four dimensional N = 2 gauge theories with 2d CFT correlation functions. It is possible to twist the definition of a topological line operator by an outer automorphism of the chiral algebra A, so that the chiral algebra currents on the two sides of the line operator are related by the action of the outer automorphism. In the case of Toda theories, important outer automorphisms are induced by the symmetries of the corresponding Dynkin diagram. The theory of twisted line operators is closely related to the theory of orbifold constructions.
In the rest of the paper we will advance the four dimensional N = 2 gauge theory interpretation of the topological defect operators in Toda CFTs we have constructed. We will find that they admit a rather elegant description in terms of loop operators and domain walls in gauge theory.

Degenerate Topological Defects in Gauge Theory
We would like now to apply our results on topological defects in Liouville and Toda theories to the study of observables in four dimensional N = 2 gauge theories. The relevant theories are denoted T g,n (g) [31], and are associated to a Riemann surface C g,n . The partition function of these theories on S 4 [1] as well as certain interesting observables [3,4] may be calculated by Liouville/Toda CFT on C g,n . In particular, the partition function of T g,n (g) on S 4 conjecturally captures the correlation function of Liouville/Toda CFT on C g,n : In this section we provide the gauge theory interpretation of the topological defect operators corresponding to fully degenerate representations in these CFTs.

Liouville CFT
The Wilson and 't Hooft loop operators in the 4d N = 2 theories T g,n (A 1 ) were identified in [3,4] with the Verlinde loop operators L µ (p) obtained by transporting the degenerate fields of Liouville theory around closed curves 30 on the Riemann surface C g,n . Given a choice of duality frame for T g,n (A 1 ) or equivalently a choice of pants decomposition of C g,n , the electric and magnetic charges of the gauge theory loop operator associated to a curve p in C g,n are given by the Dehn-Thurston parameters (p i , q i ) i=1,...,3g−3+n of the curve. 31 The Dehn-Thurston parameters depend on the choice of pants decomposition just as the electric and magnetic charges of a loop operator in the 4d gauge theory T g,n (A 1 ) depend on the choice of duality frame [32]. We recall that the identification between the 4d N = 2 theories T g,n (A 1 ) on S 4 and Liouville CFT on C g,n holds for the value b = 1, corresponding to Liouville theory with 30 Homotopy classes of curves to be precise. 31 These gauge theory loop operators are supported on a fixed equatotial S 1 ⊂ S 4 . Changing the curve on the Riemann surface corresponds to changing the charges of the loop operator in gauge theory. central charge c = 25. At b = 1, the degenerate fields depend only on r + s, as can be seen by looking at their Liouville momentum (3.1). The degenerate fields labeled by (1, s) serve as a basis of such operators.
The proposal that the Verlinde loop operators correspond to Wilson and 't Hooft loop operators was explicitly verified by computing the expectation value of the Verlinde loop operator along a curve p wrapping around an internal edge in the graph Γ σ corresponding to a pants decomposition of C g,n in Liouville theory. For this class of curves the corresponding gauge theory operators are the Wilson loop operators. This was then compared with Pestun's exact formula [2] 32 for the expectation value of a Wilson loop operator in the 4d N = 2 gauge theory T g,n (A 1 ) on S 4 .
For g = A 1 , a Wilson loop operator for one of the gauge groups is labeled by its SU(2) spin j, and we denote it by W j . Explicit computation of the monodromy acquired by the V 1,2j+1 (z) degenerate field defining the Liouville theory Verlinde loop operator using the CFT fusion matrices confirmed that [3,4] W j Tg,n(A 1 ) = L j (p) Cg,n . (4.2) Since the explicit form of the fusion matrices for the non-minimal (j > 1/2) degenerate fields is rather complicated to compute, the proposal could only be explicitly checked up to j ≤ 5/2. Using the identification between Verlinde loop operators L µ (p) and topological defect operators O µ (p) proven in Section 2 and the explicit expressions for the Liouville topological defect operators described in Section 3, we can now demonstrate that the proposal in [3,4] is valid for an arbitrary representation j of the corresponding Wilson loop. We first note that for b = 1 the topological defect operator O 1,2j+1 (p) corresponding to the degenerate field V 1,2j+1 (z) given in (3.6) inserts into the CFT correlator on C g,n precisely the SU(2) character in the spin j representation 33 This result combined with (2.31) confirms the proposal (4.2) put forward in [3,4] for arbitrary spin j: This shows that loop operators in 4d N = 2 gauge theories T g,n (A 1 ) are precisely captured by the topological loop operators in Liouville theory associated with degenerate representations. By choosing loop operators supported on curves p in C g,n traversing edges in the trivalent graph Γ σ (those curves have Dehn-Thurston parameters p i = 0) one can calculate using the formalism of [3,4] the vacuum expectation value of 't Hooft operators. Liouville CFT was used in [3,4] to calculate exactly 't Hooft operators in certain 4d N = 2 gauge theories, extending previous computations of these observables in N = 4 super Yang-Mills [33].

Toda CFTs
For N = 2 theories T g,n (g) with g = A 1 the complete characterization of Wilson-'t Hooft operators and their corresponding description in Toda CFTs is not known. Clutching this correspondence requires, in particular, a generalization of Dehn's theorem classifying homotopy classes of non-self-intersecting curves on a Riemann surface C g,n . In our discussion of topological web operators in 2d CFTs, we observed that such webs can be constructed by combining oriented lines joining at trivalent junctions on the Riemann surface. This suggests that the generalization of Dehn's theorem involves classifying homotopy classes of oriented graphs constructed out of trivalent vertices on a Riemann surface C g,n . Even though we do not know the complete correspondence, we will now identify the dual of a Wilson loop operator in T g,n (g) with topological line operators in g Toda CFT on C g,n associated with completely degenerate representations.
The completely degenerate representations of Toda CFT carry momentum (3.22), which is the sum of two highest weights. For b = 1, where the relation between the 4d gauge theory T g,n (g) on S 4 and the Toda CFT is expected to hold, a basis for the degenerate representations is labeled by a single representation R of g. We now show that a topological defect operator (or Verlinde loop operator) based on such a representation and wrapping an internal edge in the graph Γ σ exactly calculates the Wilson loop in representation R of the gauge group associated to that edge.

(4.6)
This is precisely the insertion of a character in representation R of g. This exactly captures Pestun's result [2] for the expectation value of a Wilson loop in representation R in the corresponding 4d N = 2 theory T g,n (g) (assuming the instanton partition functions are indeed equal to the conformal blocks): This maps the computation of loop operators in 4d gauge theories T g,n (g) to correlation functions in Toda CFTs in the presence of topological defect operators.

Domain Walls, Topological Defects and Localization
In this section we compute the partition function of 4d N = 2 gauge theories in S 4 in the presence of domain walls (three dimensional defects). These include Janus domain walls, symmetry breaking domain walls and duality walls. We then show that our results match the effect of inserting the topological defect operators in Liouville/Toda CFTs discussed in Section 3. This section combined with the previous one advances a 4d gauge theory interpretation for the topological defects in Liouville/Toda CFTs.
We begin by reviewing the basic ingredients of Pestun's localization [2] required to compute the partition function of 4d N = 2 gauge theories in the presence of domain walls. The main idea behind Pestun's localization of correlation functions of 4d N = 2 theories on S 4 is simple: as long as all the observables in the correlation function preserve a common superconformal symmetry Q, one can add a Q-exact term to the Lagrangian without changing the result. If the Q-exact term is chosen carefully, it can freeze out most degrees of freedom, and reduce the calculation to an integral over the surviving modes, with a measure determined by the one-loop determinant of the frozen fluctuations.
Pestun's choice of localization term forces all fields to be constant away from the north and south poles of the S 4 . In the neighbourhood of the poles the localization reduces to Nekrasov's localization [34,35] of the gauge theory in R 4 . The key technical points which had to be carefully accounted for in the calculation were the requirement of an off-shell formulation of the supersymmetry Q, a careful gauge-fixing and the precise computation of the one-loop determinants.
Pestun's choice of localization term for the N = 2 vectormultiplet freezes (away from the poles) the gauge fields and the real part of the adjoint scalar field. The zeromode a of the imaginary part of the scalar field survives. The off-shell formulation for the N = 2 vectormultiplets is the familiar one with three auxiliary fields in a triplet of SU(2) R Rsymmetry. One of the three auxiliary fields D is fixed to be equal to the zero mode ia by localization. This will be important for us later. The choice of Q to use in the localization breaks U(1) R completely, and SU(2) R to an SO(2) R subgroup. This selects which component of the complex adjoint scalar field and which auxiliary field can be non-zero.
We can be a bit more specific: there is an OSp(2|4) subgroup of the SU(2, 2|2) superconformal group 34 which is the symmetry group of mass-deformed N = 2 gauge theories defined on S 4 which includes the rotation group of S 4 , the above-mentioned SO(2) R and 8 supercharges. One can further restrict to an OSp(2|2) subgroup which includes only rota-tions which fix the poles and are chiral at the north pole and can be realized off-shell on the hypermultiplets. Finally, we can select a specific rotation generator J, and a supercharge Q which squares to J + R, where R is the SO(2) R generator.
There are many observables which can be added to the correlation function of the 4d N = 2 gauge theory which preserve Q. A nice set of examples are half BPS defects, which preserve subgroups of SU(2, 2|2) which are defined as the fixed point of some involution σ of SU(2, 2|2). They will preserve Q if Q (and hence J + R) is fixed by the involution. Pestun's original computation focused on supersymmetric Wilson loop operators wrapping an orbit of J. These Wilson loops are constructed with the same component of the adjoint scalar which retains the zero-mode a upon localization. The same symmetries (Q and J + R) can be preserved by supersymmetric Wilson-'t Hooft loops [32,3,4], by surface operators [3] and by domain walls. We describe the appropriate involutions in Appendix A. It would be interesting to understand Pestun's localization in the presence of these defect operators. In this paper we will consider localization in the presence of domain walls wrapping the S 3 equator of S 4 .

Janus Domain Walls
Janus domain walls [36,37] are the simplest: they are defined as some deformation of the 4d N = 2 gauge theory Lagrangian which makes the complexified gauge coupling τ = θ/2π + 4πi/g 2 Y M jump across the domain wall while preserving 3d superconformal invariance (they are usually described as the limit of a smooth profile for the gauge coupling). The Lagrangian deformation for the 4d N = 2 gauge theory Janus is presented in Appendix B.2. It is important for us to note that a jump in g Y M introduces no extra terms involving a or the auxiliary field D at the wall. A jump in θ Y M leads to an extra integral of the instanton density over half the space. This integral is equal (as can be seen by integrating by parts) to a 3d N = 2 supersymmetric Chern-Simons action, with level k = ∆θ Y M 2π . The fields entering in the Chern-Simons action are the gauge field, the scalar a and the auxiliary field D restricted to the domain wall. Furthermore a is continuous across the wall.
Upon localization, the classical Lagrangian 2a 2 − D 2 evaluated on the localization locus integrated over the four-sphere gives rise to In the presence of a supersymmetric Janus domain wall, the classical action is instead given by 2) The first two terms are the integrals of the bulk action on each hemisphere, the third term comes from the N = 2 Chern-Simons Lagrangian coupling aD (B.7). Furthermore, the instanton contributions localized at the north pole are computed with instanton factor q, while the ones localized at the south pole withq ′ . Finally, the one-loop determinant is completely unaffected: it only depends on the localization term. Therefore, the complete partition function of a supersymmetric Janus domain wall in a 4d N = 2 gauge theory takes the form Using the identification between Z Nekrasov and Liouville/Toda CFT conformal blocks F

Symmetry Breaking Walls
A second class of gauge theory domain walls which we can identify with topological loop operators in Liouville/Toda CFTs were first defined for N = 4 SYM in [38], and can be generalized to 4d N = 2 theories: these are domain walls at which the gauge group G is reduced to a subgroup H. The basic idea is to set to zero at the domain wall the gauge fields in g − h. To preserve N = 2 supersymmetry in three dimensions, one should also set to zero their superpartners in the 3d N = 2 supermultiplet. These include again the scalar a and the auxiliary field D in g − h (see Appendix B.1). We will focus on the case where H has full rank. The usual Vandermonde determinant e>0 a, e 2 (where e > 0 denote the positive roots of g) included in the measure [da] in Pestun's formula is naturally combined with part of the one-loop vectormultiplet determinant to the measure e>0 sin 2 π a, e . This is a natural measure for conformal blocks in Toda CFTs (see [39,4] for the case of Liouville). The most immediate effect of the symmetry breaking domain wall in the localization computation of the partition function is that the integral over the zeromode a ∈ g is restricted to a ∈ h. Hence the Vandermonde determinant appearing in the measure [da] is reduced from e>0 a, e 2 to e∈h e>0 a, e 2 . We claim that the one-loop determinant in the presence of the symmetry breaking domain wall combines similarly with the reduced Vandermonde determinant e∈h e>0 a, e 2 to give e∈h e>0 sin 2 π a, e . To see this, we note that such factors arise in the one-loop determinant for 3d N = 2 gauge multiplets on S 3 computed in [40] in a similar context of equivariant localization, based on the same isometries as for the S 4 computation we have here. Indeed, the effect of the domain wall should be to remove exactly such one-loop determinant factors for the 3d N = 2 gauge multiplets on S 3 for the fields in g − h. The final result for the partition function of the symmetry breaking domain wall is (written in the CFT language) 35 dν(α) e∈h e>0 sin 2 π a, e e∈g e>0 sin 2 π a, e F (σ) α,E (q)e 2πi m,a χ R (e 2πia ) .

(5.5)
Just as in the case of the Janus domain wall, we have also included a supersymmetric Wilson loop in a representation R of H, which is allowed to live at the domain wall. The term e 2πi m,a originates from the Fayet-Iliopoulos parametersm/π for the U(1) factors localized on the domain wall, which upon localization yields 2π 2 m/π, D = 2πi m, a . We can compare this computation with the result of inserting a semi-degenerate topological defect operator around a tube of the pair of pants decomposition of the Riemann surface: h can be taken to be the union of the Cartan subalgebra and of g I to obtain a beautiful match with the 2d Liouville/Toda CFT computation (compare with eqn. (3.46)). 36

Duality Walls
We would also like to understand the gauge theory realization of the expression (3.51), obtained by the action of a Moore-Seiberg groupoid element g on the antiholomorphic conformal block. Morally, this should correspond to the result of acting with the corresponding S-duality transformation on a single side of a Janus domain wall. This operation led in the N = 4 case to the notion of a "duality wall", which interpolates in a supersymmetric fashion between two S-dual images of the same theory [41]. In that case, the duality wall for a T operation (a shift of the θ angle by 2π) consisted of an extra supersymmetric Chern-Simons term in the action, involving the restriction of the gauge multiplet to the domain wall. The duality wall for an S operation had to allow the interaction of two theories with gauge groups G and L G at the common interface, where L G is the GNO or Langlands dual group. It admitted a description in terms of a 3d N = 4 SCFT with G × L G flavor symmetry. The two bulk theories had Neumann boundary conditions for the gauge multiplet at the wall, which 35 We recall that α = Q + a. 36 Notice that inside the integral over α the sum over the Weyl group orbits in D µ,R,1 (α) can be removed by the trivial reflection a → w(a). allowed each factor in the flavor group G × L G to be gauged. This is discussed in a bit more detail in Appendix C.
We expect a similar picture to be valid for 4d N = 2 gauge theories. For example, a duality wall corresponding to the shift of the θ angle by 2π will clearly be realized by a 3d N = 2 Chern-Simons term, which already appeared in the description of the corresponding Janus wall, and we already learned that it will contribute an overall factor of exp (2πi a, a ). This exactly agrees with the phase factor associated with a Dehn twist of a tube on the holomorphic conformal block, which inserts a phase exp(2πi∆(α)), where α = Q + a.
The duality wall associated with a general S-duality groupoid element g should correspond to the coupling of a 3d N = 2 SCFT with appropriate flavor symmetry groups to the original theory on one side of the domain wall, and the S-dual theory on the other. If we perform localization in the presence of such a duality wall, the scalar zeromodes a and a ′ of the theories on the two sides will be free to vary (they have Neumann boundary conditions at the wall) and the 3d N = 2 SCFT on the equator will contribute a factor Z S 3 (a, a ′ ): the S 3 partition function of the 3d N = 2 SCFT in the presence of an expectation value for the 3d N = 2 gauge multiplet scalars coupled to the two flavor symmetry groups. These are, by definition, real mass parameters for the 3d SCFT.
The tree-level and instanton contributions from the poles are not affected by the presence of the wall. The most subtle element of the computation is the one-loop factor, as we do not know how the matter hypermultiplets may be coupled to the defect. We encode our ignorance in the measure of integration for the zeromodes a and a ′ dν(α)dν(α ′ ) F Notice that if we ignore the effect of the matter hypermultiplets, and assume that the measure of integration arises from the 1-loop factor for a 3d N = 2 gauge multiplet at the S 3 , we get dν(α) = e>0 sin 2 π a, e da.

(5.7)
This is the natural measure of integration for conformal blocks in Toda theories. We are then led to conjecture that the partition function of the 3d N = 2 SCFT living at a duality wall labeled by an S-duality groupoid element g equals the integral kernel g (σ,σ ′ ) (a,a ′ ) , which implements the Moore-Seiberg groupoid element corresponding to g in eqn. (3.51).
As discussed earlier, the correlation function of topological webs also have the form of a kernel between a holomorphic and an antiholomorphic conformal block (2.15). We conjecture that such kernels are associated with the partition function on S 4 of the 4d N = 2 gauge theory coupled to another class of 3d N = 2 SCFT with G × G flavor symmetry living in the equator (possibly enriched by adding line operators along the wall). In the next section we will suggest a construction of such SCFTs from the compactification of the 6d (2, 0) SCFT on appropriate three manifolds, which is known to produce 3d theories with N = 2 supersymmetry. It would be interesting to give a field theory interpretation of the algebraic structure produced by the composition of webs O • O ′ and of the structure coefficients in the composition product. Two parallel half-BPS domain walls in a four dimensional superconformal theory may be "composed" simply by bringing them together into a new half-BPS domain wall. We conjecture that this operation corresponds to the composition of topological webs in the 2d CFT.

Defects from the 6d Theory and from M-theory
At this point we have a variety of topological defects in the Liouville/Toda CFTs with a proposed four dimensional gauge theory interpretation. In this section we would like to further support the match between the 2d correlation functions and 4d gauge theories. A natural approach to bridge the gap between 4d and 2d is to recall the 6d field theory construction which is at the base of the definition of the 4d gauge theories T g,n (g).
The (2, 0) 6d SCFTs are strongly interacting field theories, with no known description in terms of a Lagrangian or some elementary degrees of freedom. They are labeled by a choice of ADE simply laced Lie algebra g. We have three main sources of information about them. If g = su(N), they can be engineered from a set of N M5 branes in flat space. They have a Coulomb branch of vacua, where the low energy theory reduces to a free theory of self-dual three-form field strengths, fermions and scalars. Compactified on a circle, they have a low energy description as 5d SYM with a gauge group G whose Lie algebra is g. Although we cannot define objects directly in the full (2, 0) theory, we should specify the "image" of those objects in these three pictures.
The theory has a useful half-twist, which allows compactification on a Riemann surface C of any genus g, while preserving N = 2 SUSY in the remaining four dimensions. Codimension 2 defects located at points on C can be added, without breaking any further symmetry. 37 In the IR, one recovers the T g,n (g) 4d theories. In the language of M5 branes, the twisted compactification corresponds to wrapping the M5 branes on C in the space T * C, in the presence of additional M5 branes wrapping the fibers above points on C. The classification of these defects was analyzed as the possible types of conformal quiver tails [41,31]. This was matched with the allowed singularities of the relevant large N "bubbling geometries" [42] and to certain vertex operators in Liouville/Toda CFTs in [1,43,44].
Taken together, these studies suggest that the possible codimension two defects are labeled by a choice of an embedding ρ of su(2) in g. They support a flavor symmetry, the commutant of ρ in g and admit N = 2 mass deformations which live in the Cartan subalgebra of the flavor symmetry algebra. A special case, where ρ is trivial, has flavor symmetry 37 Some other defects can be thrown in: twist lines, which are related to the twisted topological defects in Toda theories where the W-algebra is subject to an outer automorphism, and corresponding twist fields.
G. The A 1 theory has only one type of defect, the trivial embedding, with SU(2) flavor symmetry and a single mass parameter.
The dictionary between T g,n (A 1 ) theories and Liouville correlation functions [1] associates this defect with a Liouville vertex operator, and the Liouville momentum with the mass parameter. More generally, for su(N) the defects are labeled by a partition of N = i N i , where N i are the dimensions of the su(2) irreps in the decomposition of the fundamental representation of su(N) under the embedding ρ. The N eigenvalues 38 of the mass matrix are organized in groups of N i identical values m i . For a trivial embedding, where N i = 1, there are N − 1 mass parameters matching the non-degenerate vertex operators in Toda field theories as discussed in Section 3.2. For more general partitions this matches the classification of the semi-degenerate vertex operators in Toda CFT with λ i = 0 [44].
Indeed in su(N) the simple roots e i can be taken to be vectors with the i-th entry 1, and (i + 1)-th entry −1. A vector orthogonal to e i must have the i-th entry and (i + 1)-th entry equal. Hence we have a correspondence between the partition N i and a set I of simple roots e i : I consists of groups of N i − 1 consecutive simple roots. The Lie subalgebra g I is su(N i ). The T 3 generator of the su(2) embedding appears to concide with the restricted Weyl vector ρ I (hence we will use the same symbol ρ I for the Weyl vector and for the corresponding su(2) embedding). The flavor Lie algebra is the commutant of g I in g. We see a neat correspondence between the data of I modulo the Weyl group action -which defines semi-degenerate representations in Toda -and the data of the su(2) embedding.
We expect this correspondence to extend to general simply laced ADE Toda theories and (2, 0) 6d theories. Going in one direction seems easy: from I one gets a Lie subalgebra g I , then an su(2) embedding ρ I as the sum of the maximal embeddings in the simple factors of g I . The set of mass parameters/Toda momenta orthogonal to the roots in I is also the commutant to the su(2) embedding ρ I . It seems a bit more laborious to go in the opposite direction, though it presumably entails little more work besides a decomposition of the T 3 generator of ρ I in simple weights.

Surface Operators in 6d
Let us review what is known on the codimension 4 defects, which can be described loosely as "M2-brane defects": if the 6d field theory is engineered by a set of coinciding M5 branes, the defect arises as the two-dimensional boundary of a semi-infinite M2 brane ending on the M5-branes.
The surface operators in the 6d theory are a sort of generalized Wilson line operators. In the Coulomb branch they reduce to 6d Wilson surface operators, which couple to the three form field strengths the same way as the usual Wilson line operators couple to gauge fields. Upon compactification on a circle to 5d they can either wrap the circle, giving rise to half 38 There are N eigenvalues and N − 1 mass parameters because the vanishing trace.
BPS Wilson line operators, or not wrap it, giving rise to half BPS 't Hooft surface operators in the 5d SYM theory. Basic M2-brane intersections are the simplest example, giving rise to fundamental Wilson loops upon compactification. Once we consider compactification on a Riemann surface C, the M2-brane intersections lead to the following defects in the 4-dimensional gauge theory: 1. Surface operators: If the two dimensional intersection is entirely in the 4-dimensional space, these are surface operators in the gauge theory. The 6d defects are localized at a point on the Riemann surface and should have the interpretation of extra vertex operator insertions in Liouville/Toda. Indeed in [3] the simplest M2 brane defects in the A 1 theory were identified with (2, 1) degenerate vertex operators in Liouville theory. They were also identified with the simplest surface operators in SU(2) gauge theories, as defined by [45].
We are not aware of a direct 4d construction of surface operators which would correspond to higher degenerate fields in Liouville theory. It may be possible to use the more refined approach in Gukov-Witten, and define a defect by coupling a 2d sigma model to the 4d gauge theory. We do not know of a simple choice of sigma model which would fit the bill.
A parallel reasoning to the Liouville case identifies the simplest M2 brane defects in the A N −1 theory with (N, 1) degenerate vertex operators in Toda theory (N represents the fundamental representation) and also with the simplest surface operators in SU(N), defined by [45], which break the gauge symmetry at the surface to U(1)×SU(N −1). One can also consider defects breaking the gauge symmetry to U(1) × SU(n) × SU(N − n). These will still have a one-dimensional space of parameters. It is far from obvious that this space will coincide with C, but it is reasonable to conjecture that they will correspond again to some degenerate fields, possibly labeled by the rank n antisymmetric representation of SU(N). These surface operators can be described as well by the coupling of the 4d gauge theory to a 2d sigma model with target space the Grassmanian SU(N)/(U(1) × SU(n) × SU (N − n)). The cohomology ring of the Grassmanian is isomorphic to the n-th exterior power of a N dimensional space. It would be nice to verify whether for more general ADE groups the simple surface operators with a single U(1) factor in the unbroken gauge group do match degenerate fields in Toda.

2.
Line operators: If one direction of the intersection is in the 4-dimensional space and the other direction wraps the Riemann surface we get line operators in the gauge theory. These are Wilson, 't Hooft or dyonic loops, and the charges can be read from the homotopy class of the curve on the Riemann surface [32]. In [3,4] these objects were also shown to be represented by degenerate fields in Liouville, not by extra insertions, but by their monodromies. In Section 4 we showed that these can also be identified with ZZ topological defects in Liouville. The statement extends to Toda: the Wilson loop operators correspond to fully degenerate topological defects in Toda CFT. This is consistent with the reduction of the 6d theory to 5d SYM: the basic step to recover a gauge theory interpretation of the 4d theory is to consider a pair of pants decomposition of C, make the handles long and thin, and reduce the 6d theory on the handles to 5d SYM on segments. An M2-brane defect which wraps around a handle descends to a fundamental Wilson loop of the 5d SYM theory, and then to a fundamental Wilson loop of the gauge groups of the 4d gauge theory. The same should be true for the defects which give rise to Wilson loops in other representations of the gauge group.

Codimension 2 Defects and Domain Walls
If a codimension 2 defect is extended along some cycle on C, it will result in a 3d defect in the 4d space. At this point, we are ready for a simple analogy. As discussed in Sections 2 and 3 the classification of topological line operators matches that of primary vertex operators. We saw in the preceding subsection that the same 6d surface operators, upon reduction to 4d, are related to the to a fully degenerate vertex operator, and to the fully degenerate topological line operator in Liouville/Toda CFT. We know that the non-fully-degenerate Liouville/Toda vertex operators on C are associated to M5-brane defects at points in C. Can we give a 6d interpretation to the relation we proposed between the non-fully-degenerate topological defects in Liouville/Toda CFTs and domain-wall defects in the 4d gauge theories? Indeed, the domain walls which arise from M5 intersection seem to have the correct properties to represent the generic topological line operators in Liouville/Toda theory with R 1 = L R 2 = 1. They carry the same labels. We can push the comparison further if we use a certain result about the nature of the codimension 2 intersection. Morally, the 6d defect should admit a description in terms of some N = 2 theory coupled to the 6d theory, but as the 6d theory is strongly interacting this statement makes little sense. Instead, if we compactify on a circle both the bulk theory and the 4d defect, the resulting 5d SYM theory is IR free and it makes sense to claim that a certain 3d SCFT lives on the codimension 2 defect. There is a reasonable guess: the theory living on the 3d defect should coincide with the theory T ρ (G), which was introduced in [41]. This 3d N = 4 SCFT theory has a G flavor symmetry on the "Coulomb branch" which can be coupled to the 5d bulk gauge fields. It also has a flavor symmetry on the Higgs branch, which coincides with he flavor symmetry expected at the location of the 6d defect (the commutant to ρ I in G). If the M5-brane defect wraps a curve around a handle we can try to use the same argument which we used for the M2-defects and Wilson loops, and argue that the domain wall is given by coupling a T ρ (G) to the 4d gauge group corresponding to the handle.
The conclusion is a bit hasty: to go from the coupling of T ρ (G) to the 5d YM on the segment to a coupling of T ρ (G) to the 4d N = 2 gauge theory we have to do an RG flow, and it is unclear that N = 2 SUSY in 3d will be sufficient to protect us from quantum corrections.
One the other hand is we turn on the mass parameters m for the flavor symmetry of the operator, T ρ (G) has a good description as a sigma model whose target space is the orbit of m under the coadjoint action of the complexified G C . Such a sigma model is exactly what one needs to Higgs the G gauge symmetry at the domain wall to the subgroup H we encountered in Section 5. We conclude that the 6d construction is consistent with our direct 4d analysis.

More 6d constructions
It would be interesting to understand the meaning of semi-degenerate representations with general representation R 1 , L R 2 . They may correspond to a combination of a codimension 2 defect and a codimension 4 defect which is allowed to live on the codimension 2 defect only. In gauge theory, we saw they may correspond to line operators which exist only at the domain wall.
As a possible generalization, rather than just adding defects to the 6d theory compactified on C, we can consider a setup where the compactification scheme itself is modified. A half BPS domain wall in a 4d N = 2 theory preserves 3d N = 2. There is a natural twist of the 6d theory which preserves the same amount of SUSY on a manifold of the form R 3 × M, where M is a generic 3-manifold. It corresponds to wrapping M5 branes on M inside T * M. If M = R ×C, we are back to the 4d theories. If M is a cylindrical manifold, which asymptotes to R×C to both ends, we are building some domain wall for the 4d theory. A simple example is a Janus domain wall, where M is topologically R × C but the complex structure of C (i.e. the gauge couplings) evolves from one end to the other. If the two endpoints of M differ in the topology of C, the result is a domain wall interpolating between different gauge theories. Furthermore, the M5 brane defects can be added along any curves in the geometry.
An extreme case would be a boundary condition: a three manifold which is asymptotically R + ×C but closes off at the other end. Topologically, this is a three-manifold which is "filling in" some of the handles of the Riemann surface. There is one such manifold for each pair of pants decomposition, suggesting that this should be a rather canonical boundary condition on the gauge fields associated to that pair of pants decomposition. As the handles of the Riemann surface are getting thinner towards the boundary, the gauge couplings are becoming very weak. We conjecture that the boundary condition should correspond to decoupling of all gauge groups, i.e. Dirichlet boundary conditions. Instead of closing off the handles smoothly, as boundaries of contractible disks, we could insert a codimension 2 defect at the center of the disks, which would give a skeleton of line defects in the three manifold, in the shape of the corresponding conformal block diagram and carrying the same labels. We conjecture that this represents a Dirichlet boundary condition with fixed non-zero value of the scalar fields a i . Dirichlet b.c. are a useful tool in studying duality walls: in order to identify which 3d SCFT lives at a domain wall, one can "turn off" the bulk gauge fields by placing the theory on a segment, with Dirichlet b.c. at the two ends, and the domain wall in the middle. If we lift this setup to the 6d theory, we will see a 3 manifold built from the three manifolds which represent the Dirichlet b.c. by gluing the boundaries, upon the action of the appropriate Moore-Seiberg groupoid transformation. The resulting three manifold will contain a network of codimension two defects, obtained by gluing together the two conformal block diagrams at the external legs.
For example, the SCFT associated with the crossing symmetry of a four punctured sphere will arise from an S 3 containing a neat tetrahedron, whose six sides are labeled by the four external labels, and the two internal labels of the initial and final conformal blocks. This setup has the symmetries which are expected for the fusion matrix, which in the natural normalization coincides with a quantum 6j symbol (at least in Liouville theory). Another example is the SCFT associated with the S move on a torus: the three manifold is again an S 3 , with two circular defects linked together. If true, this gives a surprising description of T (G). In this spirit, the SCFT associated to a web O would arise from a three manifold where the union of the two conformal block diagrams is linked to the web.
There is a strong resemblance between the various choices of M and the 3d TFT diagrams which can be used to describe/compute conformal blocks in 2d CFTs. These are some exciting directions in which the constructions in this paper can be generalized.

A Gauge Theory Operators and Localization
The defects in 4d gauge theories can have an arbitrary dimension: domain walls, surface operators, line operators and local operators. In this appendix we focus on maximally supersymmetric defects, which preserve a maximal subgroup of the superconformal group SU (2|2, 2), or if the theory is not conformal, of the superisometry group OSp(2|4) of S 4 . We focus on the subalgebras that contain the supercharge selected by Pestun (together with the associated SU(1|1) symmetry) to perform localization of the path integral. These subalgebras can be described as the fixed locus of an involution of SU(2|2, 2), which extends the obvious geometrical involution which fixes the location of the defect in R 4 or S 4 .

A.1 Involutions and Subalgebras
Our discussion will switch between flat space with Lorentzian signature, and Euclidean space and the four sphere, hopefully raising no serious confusions. In general, a flat d-dimensional defect in a flat D-dimensional spacetime will break all translations and special conformal transformations in directions transverse to the defect. It will also break the rotation group to SO(d)×SO(D−d). The subgroup of the conformal group SO(D, 2) which leaves the location of the defect unchanged is SO(d, 2)×SO(D −d). This is the extension to all spacetime of the d-dimensional conformal transformations, and the rotations of the transverse directions. It is useful to identify this subgroup as the fixed locus of an involution, involving the reflection of the coordinates transverse to the defect. If we extend this involution by an involution on the R-symmetry such that it preserves Pestun's supercharge, then the subgalgebra in SU(2|2, 2) or OSp(2|4) fixed by this involution is the minimal symmetry group that must be preserved by the defect.
Let us construct the subalgebras preserved by the defects of different dimensionality. The supercharges of the N = 2 superalgebra in flat space are Q a α andQ ȧ α . The superconformal generators are S a α andS ȧ α . They satisfy the algebra We shall used the antisymmetric tensor with the convention ǫ +− = −ǫ +− = 1 to raise and lower all indices. J αβ andJαβ are the chiral and anti-chiral rotations and R ab are the R-symmetry transformations.
It is useful to group all the supersymmetry transformations together and write the general supersymmetry transformation as where ǫ 0 and ǫ 1 are constant spinors. In flat space ǫ 0 is a Killing spinor while x µ γ µ ǫ 1 is a conformal Killing spinor. Invariance under the involutions for the different defects is then conveniently expressed as projection equations on ǫ 0 and ǫ 1 . The relevant case for us is when the theory is on S 4 , and not necessarily a conformal theory. In this case the superisometries on the S 4 generate the OSp(2|4) subalgebra of SU(2|2, 2). The supercharges for this supergroup are which means that ǫ 1a = (σ 3 ) b a ǫ 0b . In order to perform Pestun localization, one can pick any real combination of the four chiral supercharges q a α , say q 1 − + q 2 + (in Euclidean signature (q 1 − ) † = q 2 + and (q 2 − ) † = −q 1 + ). 39 This supercharge squares to the sum of the R-symmetry generator and a rotation. After the stereographic projection to flat R 4 , which can be written as C 2 with coordinates z 1 and z 2 , the relevant rotation is the one acting by z i → e iα z i . We shall analyze now all possible submanifolds invariant under this symmetry and the associated superalgebras.
1. Domain walls: The most symmetric domain wall is an S 3 ⊂ S 4 . It is given by the condition |z 1 | 2 + |z 2 | 2 = 1. Under the stereographic projection we get an S 3 of fixed radius, say unity. It is invariant under all rotations J µν as well as the four combinations P µ + K µ . Similarly the supercharges annihilating it involve combinations of Q and S. These are This can be expressed by the condition ǫ 1 = γ 5 σ 3 ǫ 0 . These generate the superalgebra OSp(2|4). When the theory on S 4 is not conformal, we obtain the OSp(2|2) × SU(2) subalgebra of OSp(2|4), containing the chiral supercharges q a α . This is the supersymmetry algebra of an N = 2 3d theory on S 3 .
There are many more possible geometries of domain walls which preserve the U(1) symmetry required for localization. The vanishing locus of any equation of |z 1 | and |z 2 | will be such a hypersurface. Generically they will preserve only U(1) × U(1) symmetry, but there are special cases with extra symmetries. In R 4 one can take the condition |z 2 | = R which gives the geometry R 2 × S 1 ⊂ R 4 preserved by P 1 , P 2 , J 12 and J 34 . On S 4 the condition |z 2 |R = (1 + |z 1 | 2 + |z 2 | 2 ) gives S 2 × S 1 ⊂ S 4 which is fixed by J 12 , J 23 , J 31 and J 45 . It would be interesting to try to find BPS domain walls of these more general geometries. 39 Mass terms for the vector multiplet will lead to theories with N = 1 supersymmetry. The preserved supercharges are Q 1 α ,Q 2 α , S 2 α ,S 1 α , which can also be written as the conditions γ 5 (σ 3 ) b a ǫ 0b = ǫ 0a and γ 5 (σ 3 ) b a ǫ 1b = −ǫ 1a . These deformations preserve an SU (2, 2|1) supergroup, but are incompatible with Pestun's localization 2. Surface operators: The condition z 2 = 0 gives a plane through the origin in flat space (or an S 2 through the poles of S 4 ). This preserves the bosonic generators P 1 , P 2 , K 1 , K 2 , J 12 , J 34 and D.
The surface operator will preserve independently some Poincaré and conformal supercharges. It is convenient to label supercharges with respect to the chirality operator on the worldvolume of the surface operator. Then half of the four dimensional supercharges have positive chirality and half negative chirality. In R 4 , a surface operator can have either (2,2) or (0, 4) two dimensional supersymmetry, but Pestun's choice of supercharge for localization requires a combination of supercharges of positive and negative chirality. Therefore, the (0, 4) surface operators are not compatible with Pestun's localization.
In more detail, we need to impose the conditions There are two consistent choices of signs involving the extra gamma matrices (σ 3 ) a b γ 5 . This results in surface operators with either the same or opposite chiralities in two dimensions. The first case is which gives the supercharges These close onto the SU(1, 1|2) superalgebra, which is the chiral (0, 4) superalgebra in two dimensions. In addition there is an extra SU(1, 1) symmetry preserved by these operators. We can see that this set of supercharges does not intersect those in (A.3).
Again there are more general 2-manifolds which are invariant under the U(1) symmetry, they are given by the vanishing locus of two equations of |z 1 | and |z 2 |. The solutions to this condition are of the form |z 1 | = R 1 and |z 2 | = R 2 which give S 1 × S 1 . It would be interesting to construct BPS surface operators with this geometry.

Line operators:
We impose z 2 = 0 and |z 1 | = R. This leads to an S 1 along a latitude on S 4 or on R 4 . The bosonic symmetries are generated by P 1 + K 1 , P 2 + K 2 , P 3 − K 3 , P 4 − K 4 J 12 and J 34 . The supersymmetry parameters should satisfy The resulting generators are The preserved supergroup is OSp(4 * |2) and its overlap with the supercharges in (A.3) generate SU(2|1).

Local operators:
We impose z 1 = z 2 = 0. This is the origin in R 4 . On S 4 we should consider a pair of operators at the south and north poles. The bosonic symmetries are generated by J µν and D. Primary operators at the origin of R 4 are also annihilated by K µ , but this symmetry is broken by the operators at the north pole.
As for the surface operator, there will be independent conditions on the Poincaré and conformal supercharges ǫ 0 = ±γ 5 ǫ 0 , The preserved supercharges have specific chirality in four dimensions.
There are two independent possibilities, depending on whether the chiralities of the two supercharges are the same or opposite. The chiral choice are the supercharges The preserved symmetry is SU(2) × SU(2|2) and includes Pestun's choice of supercharge. These are the operators created out of the vectormultiplet scalars, whose expectation value parameterizes the Coulomb branch. The non-chiral choice is The preserved supergroup is SU(2|1)×SU(2|1) and is incompatible with Pestun's choice of supercharge. These are operators whose expectation value parameterizes the Higgs branch.

B Gauge theory domain walls
The theory of domain walls and boundary conditions in N = 4 SYM is rather intricate, but can be usefully organized by a simple strategy. The same strategy works for N = 2 theories as well: one can "cut" the gauge theory at some location, say x 3 = 0, and impose Dirichlet boundary conditions on the gauge fields of the theory, in order to decouple the dynamics on the two half spaces. The Dirichlet boundary conditions set the field strengths in the x 3 = 0 plane to zero. In order to preserve at least half of the super(conformal) symmetries one should also impose appropriate b.c. on the fermions and scalar fields in the vector multiplet. The gauge transformations also are restricted to the identity at x 3 = 0. As a result, one has a G flavor symmetry acting on the values of the fields at x 3 = 0 (we denote the gauge group of the bulk theory as G).
One can glue back the theory together by inserting at x 3 = 0 a 3d gauge theory with N = 2 3d SUSY coupled to the two G flavor symmetries of the bulk theories. If no kinetic terms for the 3d gauge multiplet are present, the standard couplings of the 3d gauge multiplet to the two G flavor symmetry currents and moment maps will reconstruct the original Lagrangian. If we modify the setup before gluing back, we can produce defects at x 3 = 0. For example, the complexified gauge coupling on the two sides may be different. The resulting defect is known as a Janus domain wall. We can also add some 3d degrees of freedom at x 3 = 0, say a 3d N = 2 SCFT with G flavor symmetry, and couple them in a standard way to the 3d gauge fields introduced in the gluing procedure. The result is a coupling of the 4d gauge theory to the 3d SCFT. Finally, we may consider a 3d SCFT with G × G flavor symmetry, and add two copies of the 3d gauge fields, one coupled to the bulk theory on x 3 < 0 and the first flavor group of the 3d theory, the other coupled to the bulk theory on x 3 > 0, and to the second flavor group. The latter construction can be clearly generalized to a setup where the gauge theories on the two half spaces differ.

B.1 Dirichlet Boundary Conditions for N = 2 Gauge Theories
Following this logic, before discussing domain walls, we would like to describe how to impose half BPS Dirichlet boundary conditions for N = 2 vectormultiplets and their interplay with Pestun's localization. Here we consider the theory on S 4 and impose the boundary conditions on the S 3 equator such that they preserve the OSp(2|2) × SU(2) subalgebra discussed in Appendix A. This is just the symmetry algebra of a 3d N = 2 theory on S 3 .
The values of the bulk fields (and their normal derivatives) at the boundary transform in multiplets of 3d N = 2 supersymmetry as we discuss in detail in the next subsection (based on [46]). Dirichlet boundary conditions for the gauge fields (parallel to S 3 ) have to be completed to Dirichlet boundary conditions for all the fields in the same 3d multiplet. These gauge fields are in the same multiplet as the scalar field which gets a zero mode upon localization. A simple way to see that, is to compare Pestun's localization formulae with the localization formulae for a 3d gauge multiplet on S 3 [40], which employ the same supercharge. This localization does not set to zero the constant mode of the real scalar field, and sets it to be equal to the value of the auxiliary field in the gauge multiplet. This is exactly the condition imposed by Pestun's localization.
Hence the appropriate Dirichlet b.c. fixes the value of the scalar field in the vectormultiplet whose zero mode is the integration variable in Pestun's localization formula. It is easy to argue (following for example the discussion in N = 4 SYM [38]) that supersymmetry also forces the other real scalar field in the 4d vectormultiplet to have Neumann boundary conditions. We expect that the result of localization will be The proper normalization for the conformal block F α (q) should be fixed by a one-loop calculation, and may depend on the specific boundary condition selected for the matter hypermultiplets. This description of the supersymmetric boundary conditions extends to domain walls which impose Dirichlet boundary conditions on a subset of the gauge fields. An example are the "symmetry breaking walls" discussed in Section 5 which restrict the gauge symmetry to a subgroup at the wall and set the corresponding gauge fields to zero there.

B.2 Janus Domain Wall
As a first example of a half BPS domain wall, we describe in this section the Janus domain wall: a simple deformation of the gauge theory Lagrangian which makes the gauge couplings different on the two sides of the wall [36,37]. We present here the gauge theory construction which in Section 5 is matched with the generalized topological operators constructed in Section 3.4.
If we have a gauge theory, and modify the standard kinetic term to g −2 (x 3 )F µν F µν where g −2 (x 3 ) is a step function, the Bianchi identities and equations of motions require the tangential components F ij of the field strength to be continuous across the wall (i, j indices run over 0, 1, 2 here), while the normal field strengths are rescaled across the wall, so that g −2 (x 3 )F 3i is continuous across the wall (unless matter sources are localized at the wall, in which case the discontinuity of g −2 (x 3 )F 3i equals the source current at the wall).
In order to promote this configuration to a supersymmetric domain wall, we want to pick boundary conditions for the other vector multiplet fields such that the normal component of the supersymmetry current is continuous across the wall, for the subset of the 4d super(conformal) charges which may be preserved by a domain wall. Under that subset of SUSY trasformations, F ij and F 3i do not sit in the same supermultiplet anymore. By supersymmetry, all the fields which appear in the SUSY transformations of F ij will have to be continuous across the wall, while all the fields which appear in the SUSY transformations of F 3i will have to be continuous after rescaling by g −2 . Either by referring to the literature [46], or by splitting the fields into even and odd under the involution of the 4d SUSY algebra which selected the half-BPS subspace, we see that half of the fermions, one of the real scalar fields in the vector multiplet a 1 , and the normal derivative of the second real scalar field D 3 a 2 have to be continuous at the interface, while the other half of the fermions, a 2 and D 3 a 1 are continuous only if mutiplied by g −2 (x 3 ). It is easy to verify that the normal component of the supercurrent is then continuous as well: the supercurrent has an overall g −2 factor and is a bilinear of fields with the two different types of boundary conditions. In the Euclidean theory on S 4 a 1 is related to the scalar field a by a = ia 1 .
It is useful to develop a technology which allows one to write down the most general 4d Lagrangians compatible with the 3d SUSY algebra preserved by the domain wall. This was done in [46], by organizing the 4d fields in supermultiplets of the 3d SUSY. In a sense, the 4d fields are treated (classically!) as 3d fields valued in functions of x 3 . The group of 3d gauge transformations is also taken to be the group of maps from the x 3 line to the 4d gauge group. The 4d vector multiplet decomposes into two 3d supermultipelts: a linear multiplet containing the 3d part of the connection, a 1 and an auxiliary field D which will be related by the equations of motion to D 3 a 2 and a chiral multiplet which includes the complex "scalar" A 3 + ia 2 and has an auxiliary field F which will be set by the equations of motion to D 3 a 1 .
We can write the usual Lagrangian for a pure 4d N = 2 gauge theory in this N = 2 3d language, and it turns out to simply coincide with the sum of the kinetic terms for the 3d linear multiplet and for the 3d chiral multiplet. The chiral multiplet formed by A 3 + ia 2 transforms in a peculiar version of the adjoint representation of the 3d gauge group, including a derivative in the x 3 direction No gauge invariant superpotential can be written in terms of this chiral field alone. The 4d kinetic terms containing covariant derivatives in the 0, 1, 2 directions have an obvious 3d origin, but the terms involving the covariant derivative in the 3 direction arise in a more subtle manner from the 3d auxiliary fields. Remember that, schematically, the bosonic part of the Lagrangian for the 3d gauge multiplet takes the form 1 g 2 dx 3 Tr Here the indices i, j run over 0, 1, 2, D i are covariant derivatives and D the auxiliary field. The kinetic terms for a chiral multiplet with a scalar q and an auxiliary field F take the general form Tr D i qD iq + |a 1 q| 2 + 2qDq + FF .

(B.4)
We suppressed here the gauge indices, the adjoint fields a 1 , D are acting in the obvious way on the chiral multiplet fields. For the case of the chiral multiplet which includes A 3 + ia 2 , the 3d Lagrangian (B.4) takes the form 1 g 2 dx 3 Tr F 3i F 3i + D i a 2 D i a 2 + D 3 a 1 D 3 a 1 + [a 1 , a 2 ] 2 + DD 3 a 2 . (B.5) We see the mixed kinetic terms for the 4d gauge fields, derivatives in the 3 direction of the scalar field a 1 and, integrating out the auxiliary field D, the 3 derivatives of a 2 . We included a prefactor 1 g 2 , so that together with (B.3) we get the full action for the 4d vector multiplet. Let us formulate again the basic strategy: we want a deformation of the Lagrangian of an N = 2 gauge theory, which makes the couplings into functions of the x 3 direction. Initially, we can consider a smooth functional dependence, and aim to preserve N = 2 super Poincare symmetry in three dimensions. Then we can make the profile of the couplings into a sharp step function, in order to localize the wall at a fixed x 3 position. In a 4d SCFT, this step can be identified with an RG flow to the far IR. With a little bit of care, the resulting wall will preserve the whole 3d N = 2 superconformal group in the sharp limit. Terms in the Lagrangian which are proportional to the first derivative of the couplings will simply localize at the wall, as the derivative of a step function is a delta function. Terms with a more complicate coupling dependence, such as higher derivatives, or higher powers of the derivatives, should be reabsorbed into field redefinitions or canceled by extra boundary conditions. If that is not possible, they signal an inconsistency of the sharp limit.
To construct the Janus solution we would like to allow the gauge coupling (and theta angle) to depend on x 3 . The factor of 1/g 2 was introduced in (B.5) by hand to match with (B.3), but since it does not commute with D 3 , we need to be a bit more careful about how the coupling is introduced into the chiral multiplet action (B.5). There is a shortcut: under the rescalings a 2 → λa 2 and x 3 → λ −1 x 3 , the vector multiplet action is homogeneous of degree 1 and the chiral multiplet action is homogeneous of degree −1. This must be a symmetry of the action even when λ is a function of x 3 : the redefinition of x 3 commutes with N = 2 3d SUSY. We can write a Lagrangian where the coefficient of the kinetic term of the chiral multiplet is 1, and the coefficient of the kinetic term of the gauge multiplet is g −4 (x 3 ). This Lagrangian has no ambiguity. Then we can rescale by a factor of λ = g 2 (x 3 ), which restores the familiar normalization, but produces the correct ordering of the DD 3 a 2 term. If the coupling is introduced into (B.5) in this way, the last term is replaced, for a space-dependent coupling, by g 2 D D 3 a 2 g 2 . (B.6) Hence the kinetic term for the scalars will take the form 1 g 2 D µ a 1 D µ a 1 + g 2 D µ a 2 g 2 D µ a 2 g 2 . This is familiar from the N = 4 SYM Janus domain wall [47]. We see that in the sharp interface limit, g −2 a 2 is the correct form of a scalar which is continuous across the interface.
We would like to allow the 4d theta angle to vary as well. A position dependent theta angle is not a total derivative anymore, and affects the equations of motion. The gauge field boundary conditions are modified to the continuity of Imτ F 3i + Reτ 1 2 ǫ ijk F jk across the interface. Hence we expect to see boundary conditions for the scalars which impose the continuity, say, of a 1 and a D 1 = Imτ a 2 + Reτ a 1 . Upon integration by parts the theta angle term in the Lagrangian becomes a Chern-Simons coupling in 3d. This can be completed to the N = 2 CS Lagrangian ∂ 3 θ 8π 2 Tr (A ∧ F + 2Da 1 ) . (B.7) We integrate the first term back by parts to get the desired non-constant 4d F ∧ F instanton term 40 but keep the supersymmetric completion, which modifies the scalar kinetic term.
When we now integrate out the auxiliary field we get the term Here we introduced a new real field a D = a D 1 + ia D 2 = τ a , τ = θ 2π + 4πi g 2 . (B.9) in this notation, for θ = 0, the field appearing in (B.6) is a D 1 . Note that this kinetic term has a very natural form, invariant in the abelian case under electro-magnetic dualities. Although we considered until now a free field Lagrangian, it is natural to conjecture that this expression will be correct for a more general IR prepotential as well, as long as a 1 and a D 1 are the real parts of the periods. Notice that a D 1 is the natural superpartner of the restriction to 3d of the electro-magnetic dual gauge field. For completeness we describe the possible modifications of the matter hypermultiplets Lagrangian. Each hypermultiplet decomposes into two 3d chiral multiplets with scalars q,q and auxiliary fields F,F . The 3d kinetic terms for each of them are as in (B.4). The 4d kinetic term is completed once we include the superpotential term Trq(D 3 + ia 2 )q which leads to the bosonic terms dx 3 Tr D 3 qD 3q + qa 2 2q + iqa 2 D 3q + i(D 3 q)a 2q + (q →q) + g 2 (qq) 2 . (B.10) This expression has some terms of the form ia 2 D 3 (qq +qq) which are not familiar in the 4d Lagrangian. New terms arise also when integrating out the D auxiliary field. With the extra contributions from q andq (and no theta angle term), the D-term is 1 g 2 D 2 = g 2 D 3 a 2 g 2 + qq +qq 2 . (B.11) The mixed terms here combine with those form (B.10) to give g 2 D 3 1 g 2 a 2 (qq +qq) . In the sharp limit this can be integrated by parts to a term localized at the wall. Thus, in the presence of matter, the Janus domain wall includes extra terms localized at the wall. Notice that a 2 and the q,q are set to zero by Pestun's localization, so this term does not affect the 1-loop determinant.
The hypermultiplets will generically have masses associated to flavor symmetries. In flat space they are complex masses, and can be interpreted as constant expectation values for a vectormultiplet scalar coupled to the flavor symmetry. They clearly break conformal invariance. On S 4 , it is also possible to turn on mass parameters in a similar fashion, but only real masses corresponding to constant expectation values of the real scalar in the vectormultiplet, a 1 .
One may further wonder if extra cubic superpotential terms are possible for the chiral multiplets which arise from the hypermultiplets, which would be classically conformal invariant in flat space and could be carried over to S 4 . The coefficient C(x) of such a term should be a function which goes to zero to the left and to the right of the wall, and should go to a δ function in the sharp limit, representing a superpotential integrated on the wall. On the other hand C(x) 2 enters the potential, so some care is needed. The derivative of the overall superpotential with respect toq will be δ(x 3 ) ∂W 3 ∂q + [D 3 + ia 2 , q], and the δ function is eliminated by requiring a discontinuity of q at the sharp wall, proportional to ∂W 3 ∂q . Upon localization, the discontinuity consistently vanishes, and it does not seem to affect the calculation at all.

B.3 Simple Boundary Conditions
There are two natural boundary conditions for a gauge theory: Dirichlet and Neumann. Dirichlet b.c. set F ij = 0 at the boundary, and leave F 3i free. Neumann boundary conditions naively set F 3i = 0 and leave F ij (and gauge transformations) free at the wall. Actually. in the presence of a theta angle, Neumann b.c. are modified to F 3i + g 2 θ 8π 2 1 2 ǫ ijk F jk = 0 [38]. N = 2 SUSY in 3d then extends the Dirichlet b.c. for the gauge field to Dirichlet b.c. to a 1 and Neumann to a 2 or a D 1 , while Neumann b.c. are extended to Dirichlet b.c. for a D 1 and Neumann for a 1 .
This can be easily generalized to describe intermediate types of boundary conditions or domain walls were the gauge symmetry at the wall is reduced to a subgroup. Janus domain walls can be seen as an example of this setup: a domain wall between two identical gauge theories, possibly with different gauge couplings, where the gauge symmetry is reduced to the diagonal subgroup.
Consider a 4d theory on half of S 4 with Neumann boundary conditions at the equator. For Neumann boundary conditions the value of a 1 is not fixed at the equator. Therefore, the partition function on half of S 4 will involve an integral over the Liouville momenta of a single conformal block multiplied by some function of the momenta from the one-loop contributions Z Neumann = dν(α)ḡ α F α (q) . (B.12)

B.4 Coupling to 3d Matter
Whenever some gauge symmetry survives at the wall, one can couple extra degrees of freedom there. In order to write down a Lagrangian, all that is needed is to couple the 3d gauge multiplet arising from the decomposition of the 4d vector multiplet to the extra 3d matter theory. In particular, a 1 couples to the 3d theory as a mass term, and a 2 only through the D 3 a 2 term coupling to the 3d auxiliary fields.

C S-Duality for N = 4 SYM
A full understanding of general duality walls would require us to know the detailed form of the 3d SCFT which lives at the walls. We lack that information for general N = 2 theories: if anything, the explicit form of the fusion and braiding matrices could give suggestions about the nature of such general 3d SCFTs. One relatively simple case is that of a better understood theory: N = 4 SYM. The duality wall which corresponds to the standard S-duality operation in N = 4 SYM couples the theories on the two sides of the wall to a special 3d SCFT called T [G]. This theory has N = 4 SUSY in 3d, a Higgs branch with a G action and a Coulomb branch with a G L action of the dual group to G. The Higgs branch is coupled to the gauge theory on one side of the wall, the Coulomb branch to the gauge theory on the other side of the wall. The scalar fields −ia R and −ia L on either sides of the wall act as mass parameters on the respective branches. For generic values of a R and a L the 3d theory is massive and all the off-diagonal modes of the 4d theory are massive as well, leaving a U(1) r massless abelian gauge theory on both sides of the wall. The massive 3d theory has several vacua, in correspondence with the Weyl group of G. In each of the vacua, the abelian gauge field on the left and the right of the wall A L and A R can be explicitly dualized leading to an extra CS pairing A L , w(A R ) . Here , is the Killing form, and w the Weyl group element associated with the 3d vacuum.
Using the results above we expect the partition function in the presence of the duality wall to take the form exp 2πi w(a L ), a R .
This is exactly the numerator in (3.44) (with m → a L and a → a R ), which is proportional to the modual matrix (3.31). So if N = 4 SYM forces the 1-loop determinants of all the other massive modes to cancel out, the S 4 partition function is This is indeed the modular matrix implementing the S-move on the torus.