Wilson loops in 5d $\mathcal{N}=1$ theories and S-duality

We study the action of S-duality on half-BPS Wilson loop operators in 5d $\mathcal{N}=1$ theories. The duality is the statement that different massive deformations of a single 5d SCFT are described by different gauge theories, or equivalently that the SCFT points in parameter space of two gauge theories coincide. The pairs of dual theories that we study are realized by brane webs in type IIB string theory that are S-dual to each other. We focus on $SU(2)$ SQCD theories with $N_f \le 4$ flavors, which are self-dual, and on $SU(3)$ SQCD theories, which are dual to $SU(2)^2$ quiver theories. From string theory engineering we predict that Wilson loops are mapped to dual Wilson loops under S-duality. We confirm the predictions with exact computations of Wilson loop VEVs, which we extract from the 5d half-index in the presence of auxiliary loop operators (also known as higher qq-characters) sourced by D3 branes placed in the brane webs. A special role is played by Wilson loops in tensor products of the (anti)fundamental representation, which provide a natural basis to express the S-duality action. The exact computations also reveal the presence of additional multiplicative factors in the duality map, in the form of background Wilson loops.


Introduction and summary of results
Five-dimensional SCFTs deformed by relevant operators often admit a low energy description in terms of 5d N = 1 SYM gauge theories with matter. The corresponding massive parameters are interpreted in the gauge theory as the Yang-Mills couplings t = g −2 YM for the simple factors in the gauge group and the masses of the matter hypermultiplets. The SCFTs are then viewed as the limit of infinite coupling g YM → ∞ (t → 0) and massless matter of the gauge theories. This was described first in the seminal paper of Seiberg [1] for SU (2) gauge theories with N f ≤ 7 flavor hypermultiplets, where it was argued from their string theory engineering that the SCFTs have enhanced E N f +1 global symmetry. Many more SCFTs have been contructed from 5d N = 1 quiver gauge theories and related to brane systems and geometric engineering in string theory (see [2][3][4][5][6] for some early papers). 1 It can happen that different massive deformations of a SCFT lead to different gauge theory descriptions. Typically a deformation with parameter t > 0 or t < 0 can lead to two different gauge theories with couplings g −2 YM ∼ t . Thus deformations in different "chambers" of the parameter space may be described by different gauge theories. 2 This can be phrased as a duality between the gauge theories which are obtained from deformations of the same SCFT.
One such duality is realized by S-duality in the type IIB brane setup realizing the 5d theories and we will thus call it S-duality. An important class of S-dual theories are SU (N ) M −1 linear quivers and their dual SU (M ) N −1 linear quivers. They can be realized as the low-energy theories of webs of 5-branes in type IIB string theory as described in [5,6] and the action of S-duality exchanges the brane webs of the dual theories. This duality can be tested by computing observables in the dual theories and matching them with appropriate identification of parameters. This assumes that the gauge theory observables in question can be analytically continued in the deformation 1 Recently there were some attempts to classify low rank 5d N = 1 SCFTs based on their Coulomb branch or their engineering in M-theory [7,8]. See also [9] for an analysis of low rank 5d SCFTs based on numerical bootstrap techniques. 2 However this is not a generic phenomenon. Often some regions of parameter space simply do not admit a gauge theory description.
parameters to the full parameter space of the SCFT. Such tests have been performed with exact results from topological strings [10,11] and from supersymmetric localization at the level of the partition function (or supersymmetric index) of the gauge theories [12].
An important challenge is to understand how S-duality acts on loop operators. In this paper we answer this question for half-BPS Wilson loop operators, where A is the one-form gauge potential, σ the adjoint scalar in the vector multiplet and R is a representation of the gauge group. We find that S-duality acts as an automorphism on the space of Wilson loops, namely that Wilson loops are mapped to Wilson loops. This differs from 4d S-duality where Wilson loops are mapped to 't Hooft loops (or in general to dyonic loops), and from 3d mirror symmetry where they are mapped to vortex loops [13]. Our findings are guided by the type IIB brane realization of half-BPS loop operator insertions. We relate Wilson loops to configurations with specific arrays of strings stretched between D5 branes and auxiliary D3 branes. Through standard brane manipulations we identify these configurations across S-duality and deduce a prediction for the S-duality map between Wilson loops. We consider two classes of theories, which are those with lowest gauge algebra rank. In Section 3 and 4 we consider SU (2) theories with N f ≤ 4 flavor hypermultiplets. These theories are self-dual under S-duality. For instance the pure SU (2) theory is dual to another pure SU (2) theory with the gauge couplings related by t = −t (namely the region of negative t is described by the dual SU (2)t =−t theory). In Section 5 we consider examples of SU (3) theories and their SU (2) × SU (2) quiver duals.
An important prediction of the brane analysis is that there is a privileged basis of Wilson loops in which to express the S-duality map: these are Wilson loops in tensor products of fundamental and anti-fundamental representations for each gauge node. 3 They are naturally realized in the brane setup. For these loops we predict a one-to-one S-duality map. For Wilson loops in other representations (which are linear combinations of loops in the privileged basis), each individual loop is mapped to a linear combination of loops in the dual theory. We therefore focus on Wilson loops of the former kind.
To test the proposed duality map we compute the exact VEVs of the Wilson loops wrapping the circle at the origin of the 5d Omega background S 1 ×R 4 1 , 2 , or 'half-index' in the presence of Wilson loop insertions, using supersymmetric localization. This happens to be a challenging computation because the modifications of the instanton corrections (in particular to the moduli space of singular instantons at the origin) in the presence of a Wilson loop are not yet completely understood (to our knowledge). To side-step this problem we follow the approach advocated in [14] (see also [15]) and compute instead the VEVs of certain N = (0, 4) SQM loop operators, which are roughly speaking generating functions for some Wilson loops. They are defined by an array of 1d fermions with a subgroup of the flavor symmetry gauged with 5d fields in an N = (0, 4) supersymmetry preserving manner (they preserve the same supersymmetry as the half-BPS Wilson loops). The relevant SQM loops are those sourced by stacks of n D3 branes placed in the brane web. 4 The Wilson loop VEVs can then be identified as certain residues of the SQM loop VEVs in the SQM flavor fugacities. This property is inferred from string considerations. The virtue of the SQM loops is that one can use their brane realization as a guide to find the appropriate modification of the ADHM quiver quantum mechanics computing instanton corrections. Our results confirm the validity of the procedure by correctly reproducing the classical contributions to the Wilson loop VEVs and by confirming the conjectured S-duality map.
We find however a somewhat surprising feature: Wilson loops in the appropriate tensor product representations do not transform exactly into their dual Wilson loop, but rather come with an extra multiplicative factor which can be interpreted as a background Wilson loop. We say that they transform covariantly under S-duality. Let us summarize our results: • For the self-S-dual SU (2) theories with N f ≤ 4 flavors we consider Wilson loops in the representations 2 ⊗n and find that they transform under S-duality as S.W 2 ⊗n (t, m k ) = Y −n W 2 ⊗n (t,m k ) , (1.2) with t, m k ,t,m k the gauge coupling and mass parameters in the dual theories respectively (see Section 4 and Appendix B for the precise maps), and Y = e t 2 + 1 4 ∑ N f k=1 (−1) k m k =Ỹ −1 . We also find that at each order in the appropriate expansion parameter the contributions to the Wilson loop VEVs are organized into characters of the E N f +1 symmetry, confirming the symmetry enhancement. Sduality is then a transformation in the Weyl group of E N f +1 [11]. The parameter Y can be understood as a charge one background Wilson loop for a U (1) subgroup of E N f +1 . We strongly believe that these results hold for N f = 5, 6, 7 (but we were not able to test it). 4 These SQM loop operators are also known under the name of fundamental (for n = 1 D3) or higher (for n > 1) qq-characters in the language of [16][17][18][19], although the relation to Wilson loops is not discussed in those works.
These results are based on exact computations up to 2 or 3-instanton corrections and for the Wilson loops in the lowest rank representations, namely with n = 1, 2 (sometimes n = 3) and n 1 + n 2 ≤ 2, which is as far as we could reasonably go technically (using Mathematica). We conjecture a generalization of the S-duality map of Wilson loops with the relation (6.2) for the duality relating SU (M ) SQCD theories to SU (2) M −1 quivers. Before moving to the bulk of the discussion it is worth mentioning some related work. Analogous dualities of 5d N = 1 theories for SU (N ) theory with N f flavors and Chern-Simons level N − N f 2 were studied in [20] (with generalization to quiver theories). In that case the theories are self-dual with a map of massive parameters which reverses the sign of the (squared) gauge coupling. The paper describes duality interface theories for this duality, but also study the action of the duality on Wilson loop operators. This involves a dressing factor in the form of a background Wilson loop as well. 5 The enhancement to E N f +1 global symmetry seen from the computation of the superconformal index in SU (2) SQCD theories was also found in [21,22] and with Wilson ray insertions in [23], using closely related computational methods.
The rest of the paper is organized as follows. In section 2 we discuss the brane realization of Wilson loops and SQM loops in IIB string theory, their relations and the action of S-duality inferred from type IIB S-duality. In Section 3 we explain the computation of the half-index with Wilson loops in detail and derive the exact S-duality 5 The map proposed in [20] (Equation (4.2)) is not quite analogous to what we find for S-duality, because it acts covariantly on Wilson loops in irreducible representations, instead of tensor product representations. We observe that the proposal does not seem consistent with the fact that Wilson loops in rank N antisymmetric representations are trivial. The duality studied is not S-duality in general, but it should be S-duality for SU (2) theories (up to E N f +1 Weyl transformations). Moreover the method proposed to compute the half-index in the presence of a Wilson loop differs from the one proposed in this paper and might explain the slightly different results. We believe that the method we present provides a more robust framework to carry out such computations. action for the pure SU (2) theory. Section 4 contains the computation and the results for the SU (2) theory with N f = 1 and N f = 2 flavors. We relegate to Appendix B the study of SU (2) with N f = 3 and 4. In Section 5 we study the duality relating SU (3) theories to SU (2) quivers and we generalize it in Section 6. The remaining appendices contain details about the ADHM instanton computations (Appendix A) and some exact results which were too voluminous to fit in the main text (Appendix C).

Branes and Loops
In this section we give a brief review of the brane realization of 5d N = 1 theories following [6] and we explain how the insertion of half-BPS loop operators can be achieved by adding extra branes or strings to the construction.

Brane setup
The 5d N = 1 theories that we will study are engineered with a 5-brane web in type IIB string theory, with the orientations described in the first entries of Table 1. A 5 (p,q) 0 1 2 3 4 5 6 7 8 9 D5 X X X X X X NS5 X X X X X X 5 (p,q) X X X X X θ θ F1 X X D1 X X D3 X X X X brane spans a line in the x 56 plane defined by cos(θ)x 5 + sin(θ)x 6 = 0 with tan θ = q p . In this convention we have D5 = 5 (0,1) and NS5 = 5 (1,0) . In pictures we stick to the usual convention that D5 branes are horizontal lines, while NS5 branes are vertical lines, which means we draw pictures in the x 56 plane.
The brane setups have parallel D5 branes spanning an interval along x 5 and supporting a 5d Yang-Mills gauge theory at energies lower than the size of the interval. The simplest example is that of Figure 1-a with two parallel D5s supporting an SU (2) gauge theory. 6 There are two distances in this configuration: the distance 2a between the D5s corresponding to the VEV of the real scalar in the vector multiplet ⟨φ⟩ = a 0 0 −a , and the distance t eff ∶= 1 g 2 eff = t + 2a between the NS5s corresponding to the effective abelian coupling on either of the D5 branes, where we denoted t ∶= 1 g 2 the bare Yang-Mills coupling of the SU (2) theory. The brane setup thus describes the gauge theory at  finite coupling t and on the Coulomb branch of vacua. The SCFT is obtained as the configuration where these two sizes are set to zero, namely when the D5s and NS5s are shrunk to zero size and the configuration looks like two intersecting 5 (1,1) and 5 (1,−1) branes.
In this picture one can add strings stretched between 5-branes associated to particle excitations of the 5d N = 1 theory, as shown in Figure 1-b. F1 strings stretched between D5s are W-bosons excitations with mass 2a, while D1 strings stretched between NS5s are instanton particles with mass t + 2a.
To add flavor hypermultiplets to the 5d theory one should add external (semiinfinite) D5 branes to the construction. To increase the rank of the gauge group one should add D5 segments to the construction. We will look at these more elaborate brane setups in later sections.

Half-BPS loop operators
Half-BPS loop operators are realized by adding semi-infinite F1 strings, D1 strings and/or D3 branes to the setup with the orientations given in the second entries of Table  1. The F1 strings, D1 strings and D3 branes all preserve the same four supercharges, so we can consider configurations with all of them together if we wish. The presence of the strings and/or D3 branes break the supersymmetry to a 1d N = (0, 4) subalgebra.
Importantly the D3 and D5 branes are in a Hanany-Witten orientation relative to each other, with a F1 string creation effect, which means that as the D3 brane crosses the D5 brane a F1 string is created stretched between them. Similarly (and remarkably) the D3 and NS5 branes are also in a Hanany-Witten orientation relative to each other, but with a D1 string creation effect: as a D3 brane crosses an NS5 brane a D1 string is created. We illustrate these effects in Figure 2. This will be important since, according to [24], the low energy physics is not affected by moving the D3 brane along x 56 as long as one takes into account these string creation effects. This also comes with an important property, usually called s-rule : at low energies there can be at most one F1 string stretched between a D3 and a D5, and similarly at most a D1 string stretched between a D3 and an NS5. This is because the lowest energy mode on such a string is fermionic.
The interpretation of the semi-infinite F1 and D1 string as operator insertions in the SU (2) gauge theory is the following. A semi-infinite F1 string stretched from infinity (along x 5 ) to the D5s inserts a half-BPS Wilson loop in the fundamental representation of SU (2). There are two configurations -the string ending on one or the other D5 -corresponding to the two states traced over in the fundamental representation. A semi-infinite D1 string stretched from infinity (along x 6 ) to the NS5s inserts a loop operator which should be a 1d defect related to instantons in the 5d theory, however we do not know of any description of these loops in terms of a singularity prescription for the 5d fields. We will not try to characterize them further in this paper, however we observe from Figure 2 that such loops are related to standard Wilson loops through Hanany-Witten moves, therefore it is enough in principle to study Wilson loops.
The interpretation of a D3 brane placed in the middle of the 5-brane array is not strictly speaking as the insertion of a loop operator since the D3 brane support a 4d N = 4 U (1) SYM theory at low-energies. However the 4d theory is coupled to 5d theory along a line, through charged localized 1d fields, and the whole 5d-4d-1d setup preserves the same supersymmetry as a half-BPS loop operator in the 5d theory, namely 1d N = (0, 4) supersymmetry. Moreover the 4d theory will not play a role in our computations and we can consider it as non-dynamical. 7 Therefore we interpret this setup as inserting a loop operator described by coupling a (0,4) SQM to the 5d theory.
At low energies the localized 1d modes are two complex fermions χ a=1,2 (two (0,4) Fermi multiplets), which arise as the lowest excitation of strings stretched between the D3 and D5 branes. They form a doublet of SU (2) which is identified with the 5d gauge group. The 1d fermions χ a are coupled to the 5d 'bulk' theory via gauging the SU (2) symmetries by the 5d vector multiplet at the location of the line defect. 8 This leaves a U (1) f flavor symmetry acting on both fermions with the same charge. The corresponding mixed 5d-1d quiver theory is shown in Figure 3. The 1d action is (in  implicit notation) The VEVs of the vector multiplet scalar φ (5d) and the real mass M can be identified with the positions of the D5s and of the D3 along x 5 respectively. Denoting M the position of the D3 brane and a 1 , a 2 the positions of the D5s along x 5 , the fermions have mass a 1 − M and a 2 − M .
It will be central in our discussion to understand the relation between such 'D3loop operators' or 'SQM loop operators' and the Wilson loop operators that we wish to study. This is because the exact computation of Wilson loop VEVs is at the moment not completely understood, therefore in order to evaluate them we will have to make use of certain relations between the VEVs of SQM operators and the VEVs of Wilson loops on a given manifold. To this purpose we make the following heuristic argument.
We consider the supersymmetric partition function on some manifold of the SQM theory associated to the presence of the D3 brane, by which we mean the partition function of the 5d-1d theory, and we normalize it by the partition function of the 5d theory alone Z 5d-1d Z 5d . We define this as the normalized VEV of the SQM loop. It receives contributions from the degrees of freedom sourced by (fundamental) strings stretched between the D3 and D5 branes. Since there can be at most one F1 string stretched between the D3 and a D5, there are four possible configurations with F1 strings contributing: ), where (n, m) stands for n strings stretched to the top D5 and m strings stretched to the bottom D5. In the configurations (1, 0) and (0, 1), with a single string, one can move the D3 brane to the top or to the bottom of the brane setup so that no string ends on it anymore (taking into account the string annihilation effect). Such configurations carry almost trivial contributions to the SQM loop VEV 9 since the D3 brane is decoupled from the brane web. In the two other configurations, (0,0) and (1,1), by moving the D3 vertically to the top of the brane configuration we obtain a brane configuration with a string stretched between the D3 and one of the D5s, corresponding of the two setups of the fundamental Wilson loop insertion. This is illustrated in Figure 4. Therefore the (normalized) fundamental Wilson loop VEV corresponds to a sector of the SQM loop, which is associated to the two configurations (0,0) and (1,1). These configurations are those with zero net number of strings ending on the D3 (when placed in the middle of the web) 10 and correspond to states with no charge under the U (1) f symmetry. The same considerations apply in the presence of D1 strings stretched between the two NS5s, corresponding to instanton sectors of the gauge theory, and in the presence of extra F1 strings stretched between the two D5s, corresponding to sectors with W-boson excitations. Therefore we arrive at the proposal for the pure SU (2) theory, (2.2) In explicit computations this means that the Wilson loop will be obtained by taking a residue in the U (1) f flavor fugacity. Of course the heuristic argument that we gave is not precise enough to predict the overall coefficient in the above relation and we will find in later sections that it holds up to a sign.
To access Wilson loops in higher representations we need to consider more D3 branes. Let us place n D3 branes in the middle of the 5-brane web, as in Figure 5. The  SQM theory has now Fermi multiplets transforming in the bifundamental representation of SU (2) × U (n) f , with U (n) f flavor symmetry associated to the stack of D3s. Once again we can think of configurations with strings stretched between the D3s and the D5s and try to isolate those corresponding to Wilson loops insertions. We take the D3s separated, namely we give generic masses to the n fundamental Fermi multiplets.
Each D3 brane of type (0,0) or (1,1) (zero or two strings attached) contributes as the insertion of a fundamental Wilson loop. The sum over configurations with D3s of type (0,0) or (1,1) only can be mapped to the trace over states in the tensor product representation 2 ⊗n ∶= 2 ⊗ 2 ⊗ ⋯ ⊗ 2 (n times). It corresponds to the sector of the SQM theory neutral under a U (1) n f maximal torus of U (n) f . We thus arrive at the proposal Finally we may think about identifying configurations related by D3 permutations, which correspond to averaging over U (n) f Weyl transformations. The resulting reduced set of configurations reproduces the states in the symmetric representation of rank n of SU (2), or spin n representation, and corresponds to projecting to the U (n) f invariant sector in the SQM, These are the predictions we can make from the analysis of the brane setup realizing half-BPS loop insertions. As we will see in the next sections, some more refined prescription will be needed to extract the Wilson loop VEVs from the SQM loop VEVs, in the form of a precise residue integration. We will now try to make these claims more precise, to confirm them by exact computations and use the results to understand the S-duality map of Wilson loops.
Before proceeding we should make a comment. In the description of the SQM defect theory there is no excitation corresponding to D1 strings stretched between the D3 and the NS5 branes, although these are present in the brane setup. These should correspond to 't Hooft loops in the 4d SYM theory living on the D3 branes (that we consider as frozen). This means that in our field theory description we are restricting to a sector of the full system which excludes these excitations. One consequence of this is that when applying S-duality to the brane setup we will not be able to map the full SQM operator to a dual SQM operator, but we will only map the Wilson loops which are sectors of the SQM loop.

S-duality
A type IIB brane configuration realizing a 5d gauge theory can be transformed by Sduality, namely the element S = 0 −1 1 0 of the SL(2, Z) symmetry of IIB string theory, to a dual brane configuration, which may realize a different 5d gauge theory. S-duality in type IIB thus implies a duality or equivalence of the two 5d gauge theories and in particular the identification of their infinite coupling SCFT limit. We will refer to the duality of 5d theories as S-duality again.
In the brane picture S-duality transforms a 5 (p,q) brane into a 5 (−q,p) brane. For convenience we combine it with a reflection x 5 ↔ x 6 so that NS5 and D5 branes are still horizontal and vertical respectively in the brane picture. 11 Therefore under S-duality the brane picture is simply flipped around the x 5 = x 6 diagonal.
In many situations the dual brane configuration has no D5 branes and we cannot read a dual field theory. We will only discuss situations where there is a dual 5d field theory. When this is the case, in general the dual 5d gauge theories have different gauge gauge groups and hypermultiplet representations. The Coulomb parameters are exchanged with the effective abelian gauge couplings.
In the simplest cases, and in particular for the pure SU (2) theory, S-duality brings back the brane configuration to itself with the Coulomb parameter and effective coupling exchanged 2a ↔ t + 2a. This means that the theory is mapped to itself under this map of parameters. We say that the pure SU (2) theory is self-dual. We will see that SU (2) theories with N f flavors are also self-dual, while SU (N ) theories with N > 2 are dual to SU (2) quiver theories. We will study both situations in this paper.
The action of S-duality on loop operators can be understood from their realization in the IIB brane picture. F1 strings and D1 strings are swapped under S-duality, which means that in general Wilson loops will be exchanged with the loops created by the D1 strings. However, brane manipulations like those in Figure 2 suggest that these two classes of loops are not independent, but rather form a single class of half-BPS loops which can all be realized with D3 branes placed in the middle of the brane web. One way to phrase this is that Wilson loops of one theory are mapped to Wilson loops of the dual theory under S-duality. This is the conjecture that we wish to verify.
We will make this mapping more precise in examples by providing the map of representations labelling the Wilson loops R A ↔ R B . We will see that the mapping of Wilson 11 The reflection can be seen as a π 2 rotation in x 56 , followed by a parity x 5 → −x 5 reversing the orientation of one type of 5-branes. Combined with IIB S-duality, it ensures that NS5s and D5s are exchanged. This convention is different from part of the literature on the topic where S is only combined with the π 2 rotation. loops is actually slightly more complicated in the presence of massive deformations because it involves some dressing factors corresponding to background Wilson loops.
In the case of a self-dual theory, the brane picture predicts that the set of all Wilson loops gets mapped to itself under the exchange of deformation parameters, with contributions from W-boson excitations exchanged with contributions from instanton excitations. We will see that Wilson loops in certain representations -the tensor products of fundamental representations -are directly mapped back to themselves under the duality, they transform covariantly under S, while loops in other SU (2) representations are mapped to linear combinations of Wilson loops.

Loops in pure SU (2) theory
The simplest theory to analyse is the pure SU (2) theory, whose brane web is shown in Figure 1. According to the discussion in the previous section we expect the set of all Wilson loops to be mapped to itself under S-duality. We now wish to find precisely how S-duality acts on each individual Wilson loop.
To do so we propose to compute the exact half-index of the 5d theory in the presence of a Wilson loop, which is the VEV of a Wilson loop on S 1 × R 4 1 , 2 , where the loop wraps S 1 and is placed at the origin in R 4 1 , 2 . 12 Here R 4 1 , 2 denotes the R 4 Omega background with equivariant parameters 1 , 2 . To be more precise we will be considering the VEVs of Wilson loops normalized by the partition function.
Such supersymmetric observables can in principle be computed by equivariant localization techniques, as discussed for example in [20,[25][26][27] following the seminal works [28,29]. However, in practice one encounters difficulties because the computations reduce to an integration over the moduli spaces of singular instantons localized at the origin of R 4 1 , 2 . The presence of a Wilson loop affects these moduli spaces in a way that is not completely understood to our knowledge. To circumvent this difficulty it has been proposed in particular cases [14] (building on the analysis of [30,31]) that Wilson loop observables can be identified as certain contributions in partition functions of 5d-1d coupled systems, namely contributions in SQM loop observables (aka qq-characters [16][17][18][19]). To compute the SQM loop observables ⟨L SQM ⟩ one then relies on the string theory realization of the defect theory. From the brane construction it is possible to understand how the loop affects each instanton sector, as we will see below. Explicit proposals and computations have been made in [14] for Wilson loops in completely antisymmetric representations in 5d N = 1 * U (N ) theory and 5d N = 1 pure U (N ) theory, as well as in [15] for Wilson loops in more general representations in 5d N = 1 * U (N ) theory. Here we apply the same approach to study Wilson loops in all possible tensor product of antisymmetric representations for a larger class of 5d N = 1 theories with unitary gauge groups. In section 2 we have proposed a relation between Wilson loops and SQM loops. Based on the brane realization of the SQM loops we will be able to carry out the computations and extract the exact results for the Wilson loops. The validity of the method will be ensured by consistency checks, including nice S-duality properties.

Half-index computations from residues
In section 2.2 we predicted the equality (2.3) between the (normalized) VEVs of the Wilson loop in the tensor product representation ⟨W 2 ⊗n ⟩ and the U (1) n f neutral sector of the (normalized) SQM loop VEVs realized with n D3 branes ⟨L SQM ⟩.
The evaluation of the SQM loop on S 1 ×R 4 1 , 2 is obtained from standard equivariant localization techniques. The exact result has the form of a supersymmetric index and depends on various fugacities: • q 1 = e 1 and q 2 = e 2 are the fugacities associated to the symmetry generators 1 2 (j 1 + j 2 + R) and 1 2 (j 2 − j 1 + R) respectively, with j 1 , j 2 the Cartans of the SO(4) 1234 ∼ SU (2) 1 × SU (2) 2 rotation symmetry on R 4 and R the Cartan of the SO(3) 789 ∼ SU (2) R R-symmetry; • α = e a is the fugacity associated to the Cartan generator of global SU (2) gauge symmetries; • Q = e −t is the fugacity associated to the U (1) inst symmetry (instanton counting parameter); • x i = e M i are the U (n) f flavor symmetry fugacities of the defect theory, with M i the masses of the SQM multiplets.
The result of the computation is organized in an expansion in instanton sectors weighted by Q k , k ≥ 0, multiplied by a common perturbative part. Since we normalize the SQM loop by the partition function in the absence of the defect, we have the following structure Since Z pert 5d cancels in the normalization there is no need to compute it. The coefficient Z (α) is computed as the supersymmetric index of the ADHM quantum mechanics of the instanton sector k. The coefficient Z inst,(k) 5d-1d (α, x) arises from a modified N = (0, 4) ADHM quantum mechanics 13 which can be read off from the brane realization of the SQM loop and which is shown in Figure 6 for the SQM loop realized with n D3 branes. The various (0,4) supermultiplets arise from the lowest modes of fundamental strings stretched between various D-branes. We have a U (k) gauge theory with a vector multiplet and an adjoint hypermultiplet (both symbolized by a circle in the figure), 2 fundamental hypermultiplets (continuous line), n fundamental twisted hypermultiplets and n Fermi multiplets with two complex fermions (doubled continuous-dashed lines), and 2n uncharged Fermi multiplets with a single fermion (dashed line). In addition there are potential terms (J and E terms) required by (0,4) supersymmetry and other potentials coupling 1d and 5d fields 14 . The flavor symmetries of the ADHM theory are SU (2) × U (n) f with fugacities α for SU (2), identified with the global SU (2) gauge transformations of the 5d theory, and x i=1,⋯,n for U (n) f . Closely related ADHM quantum mechanics were already considered in [14,15,30,31] in relation to Wilson loops in 5d N = 1 * theories.
We relegate the details of the computations to appendix A. It is still worth mentioning that we obtain our results by first considering the 5d U (2) gauge theory with fugacities α 1 = e a 1 , α 2 = e a 2 , and then projecting onto the SU (2) theory by imposing the traceless conditiona 1 = −a 2 = a with α = e a . There are additional subtleties to this procedure that arise when including matter hypermultiplets (see next sections and appendix A) and we follow [12] for the precise method. To keep the formulas short we show some results only at the one instanton order, although we computed them up to three instanton order. For the n = 1 SQM loop (single D3 brane), we find It is a Laurent polynomial in the U (1) f fugacity x. We can easily relate the various terms in this polynomial to contributions from strings in the brane setup with a single D3 brane ( Figure 3). In particular, the terms x and x −1 can be associated to the contributions with one string stretched from the D3 (placed in the middle) to the upper and to the lower D5 respectively; moving the D3 brane to the top, respectively to the bottom, of the brane web and taking into account the string annihilation effect we observe that the D3 brane decouples from the 5-brane array, explaining the almost trivial contribution to the SQM loop (no instanton correction). The counting parameter x and x −1 can be associated to the presence of fluxes induced by the D5 brane on the D3 worldvolume [24]: with a D3 at (exponentiated) position x and a D5 at (exponentiated) position y we associate a classical contribution x y or y x if the D3 is above or below the D5. In addition, if a string is stretched from the D3 to the D5 we add a factor y x or x y if the D3 is above or below the D5. These rules ensure that the contribution of a given configuration of strings is invariant under Hanany-Witten moves of the D3 brane along x 6 . Using these rules we understand the four classical Following our prescription (2.2) we can extract the fundamental Wilson loop ⟨W 2 ⟩ by taking a residue over x, which selects the contributions from U (1) f neutral states, Here we have fixed the coefficient in the relation to −1, so that the classical contribution to the Wilson loop matches usual conventions. This leads to We can now look at larger values of n, where the SQM loop is defined by coupling n fundamental fermions to the 5d SU (2) theory ( Figure 5), with n flavor fugacities x i . For n = 2 (two D3 branes) the SQM loop evaluates to where we have identified the contribution ⟨W 2 ⟩, given by (3.4), and the contribution ⟨W 2 ⊗2 ⟩ for the Wilson loop in the tensor product representation 2 ⊗ 2, with (3.6) with the contour C for x 1 , x 2 being circles around the origin with radii such that x 2 < q 1 q 2 x 1 and x 2 < (q 1 q 2 ) −1 x 1 (see explanation below). Here again the classical contributions to ⟨L n=2 SQM ⟩ (zero-instanton level) can be understood as associated to the possible configurations of strings stretched between the two D3s and the two D5s. The Wilson loop VEV ⟨W 2 ⊗2 ⟩ corresponds, according to our prescription (2.3), to the U (1) 2 f invariant sector, which can be isolated by taking the residue over the two fugacities x 1 , x 2 (3.6). Indeed we recognize the classical contribution as that of the 2 ⊗ 2 SU (2) character.
The appearance of the fundamental Wilson loop ⟨W 2 ⟩ can be understood as the contribution from string configurations where one D3 brane has a single string attached. We can move and decouple such a D3 brane from the brane web, leaving a single D3 in the middle of the web, sourcing a fundamental Wilson loop. There are four such configurations (with one D3 in the middle and one D3 moved outside) corresponding to the four factors ⟨W 2 ⟩ appearing in (3.5).
In addition to the classical and Wilson loop factors there is a extra contribution in ⟨L n=2 SQM ⟩ at one-instanton level (but not at higher instanton levels) in the form of a rational function of x 1 , x 2 . We notice that this term has poles at x 2 x 1 = q 1 q 2 and x 2 x 1 = (q 1 q 2 ) −1 . We interpret this term in the string/brane language as arising from the motion of a D1 segment stretched between the two D3 branes. Indeed, such modes have (exponentiated) mass parameters (x 2 x 1 ) ±1 when the D3 branes are in flat space (corresponding to q 1 q 2 = 1), explaining the presence of the poles. They contribute to the VEV of a line operator in the D3 brane theory 15 and should a priori not contribute to the Wilson loop VEV of the 5d theory that we would like to compute.
If we take a naive contour of integration C as two unit circles, we would pick a residue contribution from these terms at x 2 = (q 1 q 2 ) ±1 x 1 . Based on the above discussion, we believe that these residues should be excluded. One way to achieve this is to define the contour C as described above. We illustrate this in Figure 7. This choice provides a consistent picture in the study of S-duality in the later sections. The method generalizes to any n. The Wilson loop in the tensor product represen- 15 By taking a residue over α we can isolate this extra factor and recognize it as a monopole bubbling contribution for an 't Hooft loop of minimal magnetic charge in the 4d U (2) SYM theory living on the D3 branes, with x 1 , x 2 identified with the 4d Coulomb branch parameters (see [33][34][35]). tation 2 ⊗n is extracted from the SQM loop by the residue computation with a contour C around the origin such that poles at x i = (q 1 q 2 ) ±1 x j are excluded. For instance one can pick contours as circles around zero radii such that This reproduces the prediction from the heuristic brane argument (2.3).
Let us give one more explicit results for n = 3, (3.8) The fact that we always recover the correct classical part for the Wilson loop VEVs is a confirmation of the validity of our residue procedure.
From the evaluation of the Wilson loops in the tensor product representation 2 ⊗n , one can compute Wilson loops in any representation. For instance the Wilson loop in the rank two symmetric representation (spin 1/2) is given by where we used the fact that the rank two antisymmetric representation A 2 is trivial.
Although we will focus only on Wilson loops in tensor product representations in this paper, we can also compute directly the VEV of Wilson loops in rank n symmetric representations S n , which are simply the irreducible spin n representations of SU (2), by a different residue prescription. Following the logic of section 2.2 we expect that such Wilson loops can be extracted from the SQM loop ⟨L n SQM ⟩ by projecting onto the U (n) invariant sector. This is achieved by computing the residue in x 1 , x 2 , ⋯, x n with the U (n) Haar measure, Once again we define the contour C as unit circles with residues at x i = (q 1 q 2 ) ±1 x j removed. In explicit computations we recover, for instance, the identity W 2 ⊗2 = 1+W S 2 . Before concluding this section, for the sake of completeness, we should also mention that different string theory realizations of the 5d N = 1 pure SU (2) theory appear to have different SQM loop operators, but same Wilson loop observables. Consider for example the brane configuration in Figure 8: as argued in [12,[36][37][38] this describes the same pure SU (2) theory as Figure 1, after removing the contribution of extra decoupled states associated to the parallel external NS5-branes 16 The partition functions of the two brane configurations coincide, modulo a factor which is independent of the SU (2) gauge fugacity α but only depends on the instanton fugacity Q [12,21,22]. The situation is somehow similar, although slightly more complicated, for our SQM loop operator. For example, when adding one D3 brane the configuration in Figure 8 gives with ⟨W 2 ⟩ as in (3.4). Comparing with (3.2) we see that the only difference appears in the x sector, which receives a single instanton correction (due to the interaction between D1 stretched along the parallel external NS5 branes and the D3 inside of them), while the fundamental SU (2) Wilson loop is the same. With two D3 branes we find instead (3.6) respectively. Comparing with (3.5) we again notice that although the sectors involving positive powers of x 1 , x 2 receive Q corrections (and the extra rational function is also slightly modified), the Wilson loops still coincide. A similar pattern can be observed at higher number of D3 branes, as well as in more complicated theories. It is however not clear to us whether only one SQM loop VEV is the correct result, or whether the different options correspond to several SQM loops in the SU (2) theory.

S-duality of Wilson loops
As we explained in the previous section the pure SU (2) theory is self-dual under Sduality with the exchange of massive parameters 2a ↔ 2a+t, which is the map (2a, t) → (2a + t, −t). We see here that S-duality relates the theory at coupling t to the theory at coupling −t, i.e. at negative 1 g 2 . It is not obvious how to make sense of the 5d theory at negative t. One needs to analytically continue the theory to negative t, assuming that observables are holomorphic in t. This may be possible, however we only need to assume something weaker, which is that the theory is well-defined as long as the effective coupling t + 2a is positive, which can be seen as a constraint on the space of vacua (a > −t 2). This condition ensures for instance that instantons on the Coulomb branch have positive mass.
It is convenient to introduce the exponentiated parameters, or "fugacities", in terms of these variables the S-duality map is The terminology Q F , Q B refer to the fiber-base duality of toric Calabi-Yau three-folds, realizing the 5d SCFTs in M-theory, studied in [11]. The M-theory realization is dual to the type IIB brane realization and the fiber-base duality of the Calabi-Yaus is the S-duality that we want to study.
In the previous section we evaluated the Wilson loop VEVs in a small Q = Q B Q F expansion. To check S-duality we should further expand in small Q F and write the result as a double expansion in Q F , Q B . We find 17 14) SU (2) (∼ A 1 ) characters for various representations. Indeed q + and q − are fugacities for two SU (2) symmetries of the theory: SU (2) diag =diag(SU (2) 2 × SU (2) R ) and SU (2) 1 respectively.
Every term in the above expansions is invariant under the S-duality map Q F ↔ Q B . However we had to multiply each Wilson loop by a factor Q n 2 F to obtain this result. We therefore have the identity This means that the Wilson loops are not invariant under S-duality, but rather covariant with the transformation with "S." denoting the action of S-duality. In the CFT limit t → 0, the Wilson loops become invariant under S-duality. The multiplicative factor e − nt 2 can be interpreted as background Wilson loop of charge −n for the a U (1) inst global symmetry associated with the instanton charge.
We thus find that Wilson loops in tensor product representations 2 ⊗n transform covariantly under S-duality. From here we can deduce the transformation of Wilson loops in any representation. What we find is that in general Wilson loops do not transform covariantly, but rather pick up an inhomogeneous part in the transformation. In particular all the Wilson loops in spin n representations are mapped to combinations of Wilson loops involving various representations with different multiplicative factors.

E 1 symmetry
This is not the whole story since the pure SU (2) theory is conjectured to have an E 1 = SU (2) I global symmetry in the CFT limit (t = 0), enhanced from the U (1) inst symmetry, and S-duality should correspond to the Z 2 Weyl transformation in SU (2) I . To make the SU (2) I symmetry manifest one should introduce a different set of variables, The parameters Q F , Q B are re-expressed as Q F = A 2 y and Q B = A 2 y . The S-duality (or Weyl transformation) then corresponds to S-duality map ∶ (A, y) → (A, y −1 ) . (3.20) The parameter y is the SU (2) I fugacity. Expanding observables in powers of A 2 , one expects coefficients f n (y) which are SU (2) characters. This was checked at the level of the S 1 × R 4 1 , 2 partition function or "half-index" in [11] at the first few orders in A, using the topological vertex formalism.
Expanding the Wilson loops in this new set of parameters we find

22)
The SU (2) I characters do appear, but only after multiplying the Wilson loop by a factor (A 2 y) n 2 .

Loops in SU (2) theories with matter
The discussion of Wilson loops in the pure SU (2) theory generalizes to SU (2) theories with N f fundamental flavors. These are realized via 5-brane webs with extra external D5 and NS5 branes. They are again self-dual under S-duality and we will show that the Wilson loops in the 2 ⊗n representations transform covariantly under S-duality. It is well-known that the SU (2) theories with N f flavors enjoy a conjectured symmetry enhancement U (1) inst × SO(2N f ) → E N f +1 at the CFT locus. The S-duality is again a Weyl transformation in E N f +1 [11]. We check this remarkable conjecture by showing that the Wilson loop VEVs on S 1 × R 4 1 , 2 admit an expansion in E N f +1 characters. Because of technical limitations we studied only the cases N f = 1, 2, 3, 4, however we strongly believe that the Wilson loops in the remaining theories with N f = 5, 6, 7 have qualitatively identical properties. In this section we provide the results for N f = 1 and N f = 2 flavors, while the theories with N f = 3, 4 are discussed in Appendix B to shorten the presentation. Our results strongly support the general relation (4.20) for the action of S-duality on Wilson loops in tensor product representations 2 ⊗n at finite massive deformations.
We start by considering the SU (2) gauge theory with one fundamental hypermultiplet. The brane web realizing the theory is shown in Figure 9-a. It is useful to see it as arising from the U (2) −1 2 theory with N f = 1, by ungauging the diagonal U (1). The index − 1 2 indicates a Chern-Simons at level − 1 2 for the diagonal U (1). 18 This U (2) theory is used to facilitate explicit half-index computations (see appendix A).
The vertical positions of the internal D5 branes are a 1 , a 2 for the Coulomb parameters, and the vertical position of the external D5 brane is m 1 for the mass parameter of the hypermultiplet. The horizontal distance between the two NS5 branes is the effective gauge coupling t eff of the abelian theory on a single D5. At a generic point on the Coulomb branch the adjoint real scalar is φ =diag(a 1 , a 2 ), with say a 1 > a 2 , and the prepotential evaluates to [4] where we assumed m 1 > a i for i = 1, 2, as in the figure. The effective coupling on a D5 brane is We now impose the traceless condition a 1 = −a 2 = a and define the fugacities α = e a , µ 1 = e m 1 . The half-index in the presence of a Wilson loop in the tensor product representation 2 ⊗n is computed using the same technology as for the pure SU (2) theory. We identify the Wilson loop VEVs with sectors of the SQM loop realized by the addition of n D3 branes in the center of the brane web. This SQM loop L n SQM is described, as for the pure SU (2) SYM theory, by a (0,4) SQM theory with 2n Fermi multiplets with flavor symmetry SU (2) × U (n) f and the SU (2) flavor gauged with 5d fields.
The SQM loop VEV ⟨L n SQM ⟩ is computed with the modified ADHM quiver for the k-instanton sector shown in Figure 9-b, deduced from the brane setup with n D3 branes and k D1 branes. This ADHM quiver is not the same as in the pure SU (2) theory (there are (0,4) Fermi multiplets from strings stretched between the D1s and the external D5 and superpotential terms identifying 1d and 5d flavor symmetries). Finally the Wilson loop in 2 ⊗n is extracted by the residue computation (the same as (3.7)) where x 1 , ⋯, x n are the fugacities for the U (n) f SQM flavor symmetry and the contour C is chosen such that x i+1 < (q 1 q 2 ) ±1 x i , for i = 1, ⋯, n − 1.
We find for n = 1,

(4.5)
For n = 2, (4.6) Acting with S-duality in the brane setup (x 5 ↔ x 6 reflection) we find that 2a is exchanged with t eff = t + 2a − m 1 2 and m 1 becomes m 1 − a + t eff 2 = 3m 1 4 + t 2. The S-symmetry is the Weyl transformation in the full E 2 = SU (2) × U (1) global symmetry (enhanced from SO(2) × U (1)). To make this symmetry apparent, we define giving the map of fugacities The parameter A captures the Coulomb branch moduli, while y and v are fugacities for the SU (2) and U (1) global symmetries respectively. S-duality corresponds to the action y → y −1 , with A and v invariant. Expanding further the above results (at 3-instanton order) at small A, we find The coefficients are expressed as characters of SU (2) as in the previous section.
Here again the characters of the SU (2) ⊂ E 2 global symmetry arise only after multiplying the Wilson loops by a factor (A 2 y) n 2 . We deduce that under S-duality the Wilson loops transform covariantly, with the S action S.W 2 ⊗n (A, y, v) = y −n W 2 ⊗n (A, y −1 , v) .

N f = 2
The brane realization of the SU (2) theory with N f = 2 fundamental hypermultiplets is shown in Figure 10. We can regard the theory as arising from the U (2) theory with N f = 2 (without Chern-Simons term), by ungauging the diagonal U (1). We denote m 1 , m 2 the masses of the fundamental hypermultiplets. The prepotential of the theory on the Coulomb branch, with parameter ranges m 2 < a 1 , a 2 < m 1 (corresponding to the brane configuration of Figure 10), is 11) and the effective abelian coupling is corresponding to the distance between the NS5 branes in the brane configuration. In the last equality we imposed the traceless condition a 1 = −a 2 = a. We define the fugacities α = e a , µ 1 = e m 1 , µ 2 = e m 2 . (4.13) The Wilson loops W 2 ⊗n are evaluated from the residue formula (3.7) from the SQM loop L n SQM defined as before, but with the modified k-instanton ADHM SQM shown in Figure 10-b. We find for n = 1 while for n = 2 S-duality, implemented by the x 5 ↔ x 6 reflection, acts on the parameters as follows: satisfying y 1 y 2 y 3 = 1. The y i are the SU (3) fugacities and u is the SU (2) fugacity. In terms of the new parameters, the S action is simply y 1 ↔ y 2 (with the other parameters invariant) and corresponds to a Weyl transformation in SU (3). In particular it does not commute with the flavor symmetry m 1 ↔ m 2 , which is the Weyl transformation y 2 ↔ y 3 . The full group of Weyl symmetries of SU (2) × SU (3) corresponds to the action u → u −1 for SU (2) and the permutations of y 1 , y 2 , y 3 for SU (3). Expanding further the above results (at 3-instanton order) at small A, we find . The flavor symmetry transformation F exchanges S and S ′ .
We study similarly the SU (2) theories with N f = 3 and N f = 4 flavors in Appendix B. We find again that the Wilson loop VEVs ⟨W 2 ⊗n ⟩ are computed from the residue formula (3.7), with appropriate SQM loop L n SQM derived from the brane configurations with n D3 branes. The results for n = 1, 2 are again consistent with the enhanced E N f +1 flavor symmetry at the CFT point.
Under S-duality we find that the Wilson loops W 2 ⊗n transform covariantly, (4.20) with ⃗ y the fugacities, ⃗ y ′ their S-transform, and Y = e 19 The parameter Y can be understood as a charge one background Wilson loop for a U (1) subgroup of E N f +1 . This is our main result for SU (2) theories with N f ≤ 4 flavor hypermultiplets. We conjecture that this will hold for N f = 5, 6, 7 and n ≥ 3 as well.

SU (3)-SU (2) 2 dualities
We now explore the action of S-duality in theories which are not self-dual. The lowest rank examples relate SU (3) theories with flavor hypermultiplets to SU (2) × SU (2) quiver theories. They are part of a larger group of dualities relating SU (N ) M −1 quivers to SU (M ) N −1 quivers, proposed in [5,6,39] and studied e.g. in [10,11]. We will discuss two instances of such dualities and find how the Wilson loops of one theory are mapped to the Wilson loops of the dual theory.
First we consider the SU (3) theory with N f = 2 fundamental hypermultiplets. Its brane realization is shown in Figure 11-a. Acting with S-duality on the brane configuration we obtain the web diagram of Figure 12-a, which realizes the quiver theory SU (2) π × SU (2) π , which has one bifundamental hypermultiplet. The index π indicates that the SU (2) gauge nodes have a non-trivial theta angle. 20 Indeed in five dimensions an SU (2) gauge theory admits a Z 2 valued deformation, parametrized by θ = 0, π, which affects the weight of instanton contributions in the path integral. We refer to [2] for a more detailed discussion on the theta angle deformation and to [12] for the determination of the theta angles from the brane configuration.
We will see that the exact computations of the half index with Wilson loop insertions support the S-duality map between loops that one can read from the brane picture. We start by computing the Wilson loop VEVs in the two dual theories from residues of SQM loops.

SU (3), N f = 2 loops
To start with we would like to compute the VEVs of Wilson loops on S 1 × R 4 1 , 2 in the SU (3) theory. In particular, in analogy with the SU (2) case, we will focus on Similarly, for a Wilson loop in R n 1 ,n 2 the string configurations contributing are those with n 1 D3s between the top and middle D5s and n 2 D3s between the middle and bottom D5s, and with zero net number of strings attached. These configurations match the SQM sector of charge ( 1 2 , ⋯, 1 with n = n 1 + n 2 . Here a charge 1 2 or − 1 2 is a flavor U (1) charge associated to a single D3 brane in the upper or lower central region of the web.
We thus arrive at the following proposal for the residue relation between the SQM loop and the Wilson loops, isolating the relevant charge sector: where n = n 1 + n 2 , x i are the U (n) fugacities, and the contour C needs to be fixed to avoid spurious residues. As before, we will take C to be unit circles with residues at x i = (q 1 q 2 ) ±1 x j , i < j, excluded. The sign in (5.1) is fixed a posteriori from the explicit computations.
The evaluation of the SQM loop VEV proceeds with the k-instanton ADHM quiver of Figure 11-b, derived from the brane picture. We start from the computation for the U (3) theory with N f = 2 flavors and then impose the traceless condition a 1 + a 2 + a 3 = 0 on the Coulomb branch parameters.
We denote m 1 , m 2 the flavor masses and work in the chamber a 1 > a 2 > m i > a 3 as in the figure. We define a 12 = a 1 − a 2 , a 23 = a 2 − a 3 and the fugacities α 12 = e a 12 , α 23 = e a 23 , µ 1 = e m 1 , µ 2 = e m 2 . (5. 2) The formulas that we find in terms of these parameters are too long to be reported here (we provide some explicit results in terms of other variables below). Still we find the expected structure, for n = 1, 2, The appearance of Wilson loops VEVs in (5.3), with the correct classical part (zero instanton sector), is in agreement and confirms the residue formula (5.1). Here again we see spurious terms at one-instanton level in ⟨L n=2 SQM ⟩ (last line in (5.3)), whose poles are avoided by the contour prescription in 5.1.
In order to check S-duality we introduce a new set of variables corresponding to (exponentiated) distances between D5 branes (Q F i ) and between NS5 branes (Q B i ), 21 S-duality exchanges D5 and NS5 branes in the brane web, therefore it will map Q B parameters of the SU (3) theory to Q F parameters of the SU (2) 2 theory and vice-versa.
To compare the vevs we will need a double expansion in Q B and Q F parameters. Thus we want to express the Wilson loop VEVs in terms of the new parameters and expand further in small Q F . We show here the results at order two in Q F , Q B , and at order three in Appendix C.1, 5) The VEV of the Wilson loop ⟨W Rn 1 ,n 2 ⟩ ∶= ⟨W Rn 2 ,n 1 ⟩ is obtained from ⟨W Rn 1 ,n 2 ⟩ by exchanging Q F 1 ↔ Q F 2 , Q B 1 ↔ Q B 2 and inverting Q m → (Q m ) −1 (reflection about the x 5 axis in the brane picture). 21 The distances between NS5 branes are, in this case, the lengths of D5 segments and correspond to the effective abelian couplings on the Coulomb branch. They can be computed as the second derivative of the prepotential as in previous sections. Here We have multiplied the VEVs by appropriate factors Q 2n 1 +n 2 3 to facilitate the comparison under S-duality. This normalization always corresponds to having expansions starting with a term 1. This indicates that they are normalized indices counting some BPS states. It would be interesting to understand what these states are in detail in a future work.
In the SU (2) π × SU (2) π theory we consider Wilson loops in the tensor product rep-resentationsR n 1 ,n 2 = (2 ⊗n 1 , 2 ⊗n 2 ). Again other Wilson loops can be obtained as linear combination of those. These Wilson loops are related to the natural SQM loop that is engineered with n 1 D3 branes in the right-central region (between the middle and the rigth NS5 segment) and n 2 D3 branes in the left-central region (between the left and middle NS5 segments), as shown in Figure 12-b. This SQM loop corresponds to a (0,4) SQM theory with 2n 1 + 2n 2 Fermi multiplets transforming in the (2, 1, n 1 , 1)⊕(1, 2, 1, n 2 ) of SU (2)×SU (2)×U (n 1 ) f 1 ×U (n 2 ) f 2 with U (n 1 ) f 1 ×U (n 2 ) f 2 the flavor symmetries and SU (2)×SU (2) gauged with 5d fields (this is the SQM theory in Figure 12-b when k 1 = k 2 = 0). Following the usual heuristic argument, we say that the string configurations con-tributing to the Wilson loop VEV ⟨WR n 1 ,n 2 ⟩ are those with n 1 D3s in the central right-region, n 2 D3s in the left-central region, and with zero net-number of strings attached. These contributions are extracted from the SQM loop VEV by selecting the U (1) n 1 × U (1) n 2 ⊂ U (n 1 ) f 1 × U (n 2 ) f 2 neutral sector, namely by performing the residue computation ⟨WR n 1 ,n 2 where x i and z j are the U (n 1 ) f 1 and U (n 2 ) f 2 fugacities, respectively, and the contour C is chosen as unit circles with residues at x i = (q 1 q 2 ) ±1 x j and z i = (q 1 q 2 ) ±1 z j excluded.
The computation of ⟨L (n 1 ,n 2 ) SQM ⟩ is performed using the (k 1 , k 2 )-instanton ADHM quiver of figure 12-b, read from the brane setup with k 1 + k 2 D1 segments. In the presence of a non-zero theta angle for the SU (2) gauge factors the computation of the half-index must be modified. We follow the prescription of [12], appendix A (see also Appendix A).
We start from the U (2)×U (2) theory (without Chern-Simons terms) with Coulomb parameters a ij , i = 1, 2, j = 1, 2, and impose the trace condition a 11 + a 12 = −(a 21 + a 22 ) = m bif the mass of the bifundamental hypermultiplet. We then define the SU (2) × SU (2) Coulomb parametersã 1 = 1 2 (a 11 − a 12 ),ã 2 = 1 2 (a 21 − a 22 ) and the fugacities 22 Here again the formulas are too long to be reported in terms of the gauge theory parameters. The result that we find from the residue formula (5.6) reproduce the known classical parts of the Wilson loop VEVs.
To compare with the dual SU (3) Wilson loops we introduce the new set of variables Q F i ,Q B j corresponding to (exponentiated) distances between D5 segments and between NS5 segments respectively.
We then express the results in terms a double expansion inQ F i ,Q B j . We show here the expansions up to order two, and in Appendix C.2 up to order three, with appropriate 22 To be precise the a ij parameters corresponds to the x 6 positions of the D5 segments in the brane picture. They are related to the a (I) j of Appendix A as a 1j = a (1) j + m bif 2 and a 2j = a (2) j − m bif 2. multiplicative factorsQ 9) The Wilson loops ⟨W Rn 2 ,n 1 ⟩ are obtained from ⟨W Rn 1 ,n 2 ⟩ by the exchangeQ F 1 ↔Q F 2 , Q B 1 ↔Q B 2 and the inversionQ m → (Q m ) −1 , corresponding to a reflection about the x 6 axis in the brane picture.

S-duality
We are now ready to compare Wilson loops across S-duality and find the exact map. The map of parameters is simply the exchange of the (5.10) From the brane realization of the loops we can already predict the map up to multiplicative factors. The Wilson loops realized with n 1 and n 2 D3 branes in the two central regions of the brane web, with zero net number of strings attached, are related across S-duality. We thus expect the duality to map the SU (3) loop W Rn 1 ,n 2 to the SU (2)×SU (2) loop WR n 1 ,n 2 (we chose the notations purposefully). From the low n 1 , n 2 exact computations above we find the exact relation Q 2n 1 +n 2 3 which, expressed in terms of gauge theory parameters, yields . Therefore the S-duality action can be expressed as (5.13) The parameters Y 1 , Y 2 can be understood as background Wilson loops of charge one for U (1) subgroups of the global symmetry. For instance Y 1 is a charge one Wilson loop in U (1) diag ⊂ U (1) inst × U (2) flavor in the SU (3) theory. The fact that explicit computations are in agreement with the above simple formula is remarkable and provides a strong validation of the procedure we devised for extracting the Wilson loops VEVs.
Importantly we focused on Wilson loops in the tensor product of (anti)fundamental representations R n 1 ,n 2 ,R n 1 ,n 2 . From this results one can deduce the S-duality map involving any chosen representation, however the map will be more complicated, in the sense that a given SU (3) Wilson loop in representation R will be mapped to a linear combination of SU (2) × SU (2) Wilson loops and vice-versa.
As a second example we consider the SU (3) theory with N f = 6 fundamental hypermultiplets (without Chern-Simons term). Its brane realization is shown in Figure 13-a. The S-dual brane configuration is that of Figure 14-a, which realizes the quiver theory SU (2) × SU (2), with two fundamental hypermultiplets in each gauge node. We will call it the SU (2) 2 N f =2+2 theory. We first compute the VEVs of Wilson loops on S 1 × R 4 1 , 2 in the SU (3) theory, and we focus on Wilson loops in tensor product representations R n 1 ,n 2 = 3 ⊗n 1 ⊗ 3 ⊗n 2 .
The computation is essentially the same as for the SU (3) N f = 2 theory. The Wilson loop VEVs will arise from residues of the SQM loops realized with n = n 1 + n 2 D3 branes placed in the central regions of the brane web. The SQM loop 1d theory is the same as for the SU (3) N f = 2 theory, but the k-instanton ADHM quiver is modified. It is given by the (0, 4) quiver of Figure 13 The relation between the SQM loop and the Wilson loops is still given by (5.1).
We start from the computation for the U (3) theory with N f = 6 flavors and then impose the traceless condition a 1 + a 2 + a 3 = 0 on the Coulomb branch parameters. We denote m i=1,⋯,6 the flavor masses and work in the chamber m 1 > a 1 > (m 2 , m 3 ) > a 2 > (m 4 , m 5 ) > a 3 > m 6 as depicted in the figure. We define a 12 = a 1 − a 2 , a 23 = a 2 − a 3 and the fugacities α 12 = e a 12 , α 23 = e a 23 , Q = e −t , µ i = e m i . (5.14) The formulas that we find in terms of these parameters are again too long to be reported here.
To check conveniently S-duality we express the results in terms of the new variables A 1 , A 2 , w, z and y i , satisfying ∏ 6 i=1 y i = 1, defined as It is believed that the global symmetry group at the SCFT point is enhanced from U (6) flavor × U (1) inst to SU (2) × SU (2) × SU (6) [11,12] (see also [40]). Our choice of parameters is such that w and z will be the fugacities of the two SU (2) factors, while the y i will be the fugacities of the SU (6).
The new "Coulomb branch" parameters are A 1 , A 2 and in order to check S-duality we need to expand further the results in small A 1 , A 2 . Using the ADHM quivers described in Figure 13-b and the residue relations, we obtain for 0 ≤ n 1 , n 2 ≤ 1,

16)
18) As expected the coefficients in the expansion are characters of SU (2) 2 × SU (6), providing a strong support to the symmetry enhancement proposal.
Expanding at small A 1 , A 2 we find . The exact computations above support the precise relation The Wilson loops transforming covariantly under S-duality are the SU (M ) loops W (n 1 ,⋯,n M −1 ) in tensor product of rank i antisymmetric representations A i and their dual SU (2) M −1 loops W (n 1 ,⋯,n M −1 ) in the representation 2 ⊗n i for each quiver node: The associated SQM loops are realized with stacks of n 1 , n 2 , ⋯, n M −1 D3 branes placed in the M − 1 central regions of the brane system. The results in this paper generalize to the S-duality map with parameters Y i which are background Wilson loops, for which we conjecture the expressions in terms of , wherem k , m k andm k are the masses of the N f 1 , 2M − 4 and N k2 fundamental hypermultiplets respectively.
Further generalization to the SU (M ) N −1 − SU (N ) M −1 duality can also be worked out along the same lines.

A.1 Single gauge node case
Let us start by considering the half-index Z 5d for a 5d N = 1 U (N ) κ theory with N f fundamental matter (without loop operators), which is just the partition function of the 5d theory on the Omega-deformed background R 4 1,2 ×S 1 . This is known to factorize as contains the perturbative (classical + 1-loop) contribution to the partition function whose explicit form will not be needed in the following, while Z inst 5d contains non-perturbative corrections due to instantons. The instanton part of the partition function takes the form of a series expansion in the instanton fugacity Q = e −t : is the partition function of the N = (0, 4) ADHM quantum mechanics for k instantons. This reduces to the contour integral (A.4) In this expression 1,2 are the Omega background deformation parameters of R 4 1,2 × S 1 , and we define ± = 1 ± 2 2 , while diag(a 1 , a 2 , ⋯, a N ) correspond to the Cartan VEV of the real scalar in the 5d vector multiplet, and m b are the masses of the 5d fundamental matter multiplets. In terms of SQM symmetries, + is the SU (2) = diag(SU (2) 2 × SU (2) R ) R-symmetry equivariant parameter, while − is a flavor symmetry parameter. The above factors combine contributions from various 1d N = (0, 4) multiplets of the ADHM SQM. Z with (i, j) box in the tableau Y r . As explained in [12,36], the SU (N ) κ partition function (or SU (2) partition function with some discrete θ-angle for N = 2) is obtained from the U (N ) κ one after we impose the traceless condition ∑ N r=1 a r = 0, redefine Q → (−1) κ+N f 2 Q and remove (by hand) additional U (1) factors if parallel external NS5 branes are present [37,38].
These results are modified by the presence of the SQM loop realized by the addition of n D3 branes in the brane setup. The half-index Z 5d-1d computes the partition function of a 5d N = 1 U (N ) κ theory with N f flavors coupled to the 1d N = (0, 4) SQM by gauging 1d flavor symmetries with 5d fields. It factorizes as here Z pert 5d is as in (A.1), while Z inst 5d-1d contains the non-perturbative instanton corrections to the 5d-1d system. The instanton part can again be written as a series expansion in Q, where this time Z inst,(k) 5d-1d is the partition function of a modified (0,4) ADHM quantum mechanics for k instantons, the modifications being due to additional matter multiplets arising from strings stretched between D3 and D1 or D5 branes. This takes the contour integral form As before, SU (N ) κ results can be obtained from U (N ) κ ones after imposing the traceless condition ∑ N r=1 a r = 0, redefining Q → (−1) κ+N f 2 Q and removing additional U (1) factors if parallel external NS5 branes are present. However, in the main text we always work with the normalized VEV of the SQM loop observable where we divided by the partition function of the 5d theory. In addition to removing the Z pert 5d factor, this procedure also eliminates extra U (1) factors due to parallel external NS5 branes; the normalized SU (N ) κ observable is therefore obtained from the U (N ) κ one (A.12) simply by imposing the traceless conditions and redefining Q → (−1) κ+N f 2 Q.

A.2 Linear quiver case
We can now move to the half-index Z 5d for a 5d N = 1 ∏ p I=1 U (N I ) κ I linear quiver gauge theory with p nodes and bifundamental fields (without SQM loop). This is simply the partition function of the 5d quiver theory on R 4 1,2 × S 1 , which factorizes as We will only be interested in the instanton part, which takes the form of a series expansion in the instanton fugacities Q i = e −t i , i = 1, . . . , p, of the p gauge groups: is the partition function for a generalized quiver ADHM quantum mechanics of ⃗ k instantons, which reduces to the contour integral with the various factors entering the integrand given by , bif is also a combination of factors arising from (0,4) SQM multiplets in the ADHM quiver. In this expression a (I) r are the VEV of the real scalar field in the 5d U (N I ) κ I vector multiplet, while m (I) can be identified with the mass of the I-th 5d bifundamental matter multiplet, because of constraints from potentials coupling ADHM and 5d matter fields. The integration contour for (A.15) is determined by the Jeffrey-Kirwan prescription; similarly to the single gauge node case, the relevant poles to be considered for the integration variables φ The computation is modified by the insertion of the SQM loop, associated with the presence of n I D3 branes for each set of N I D5 branes. The half-index Z 5d-1d computes the partition function of a 5d N = 1 ∏ p I=1 U (N I ) κ I linear quiver gauge theory with bifundamental matter fields coupled to a 1d SQM, which lives at the intersection of the D3 and D5-branes, in the usual way. The half-index factorizes as Z 5d-1d = Z pert 5d Z inst 5d-1d . (A.20) Z inst 5d-1d is expressed as a series expansion in the instanton fugacities Q 1 , . . . , Q p of the 5d gauge groups, Z inst 5d-1d = k 1 ,...,kp⩾0 is the partition function for a quiver (0,4) ADHM quantum mechanics of ⃗ k instantons modified by additional matter multiplets sourced by strings between D3 and D5 or D1 branes; this can be written as the contour integral The brane realization of the SU (2) theory with N f = 3 flavors is shown in Figure 15. We can regard the theory as arising from the U (2) theory with N f = 3 with Chern-Simons term κ = − 1 2 , by ungauging the diagonal U (1). We denote m 1 , m 2 , m 3 the masses of the flavor hypermultiplets. With a 1 = −a 2 = a, we define the fugacities The Wilson loops W 2 ⊗n are evaluated from the residue formula (3.7) with the SQM loop L n SQM associated to the k-instanton ADHM SQM shown in Figure 15-b. ⟨L n SQM ⟩ is evaluated following the recipe of Appendix A, taking into account the corrections due to the U (2) → SU (2) projection and the presence of parallel external NS5 branes. We find ⟨W 2 ⟩ = α + α −1 + Q q 1 q 2 µ 1 µ 2 µ 3 (1 + q 1 q 2 )(µ 1 + µ 2 + µ 3 + µ 1 µ 2 µ 3 ) ( (1 − q 1 )(1 − q 2 )(1 + q 1 q 2 ) − 2q 1 q 2 (α 2 + 2 + α −2 ) (1 − α 2 q 1 q 2 )(1 − α −2 q 1 q 2 ) + Q µ 1 µ 2 µ 3 + µ 1 + µ 2 + µ 3 √ µ 1 µ 2 µ 3 √ q 1 q 2 (1 + q 1 )(1 + q 2 )(α + α −1 ) (1 − α 2 q 1 q 2 )(1 − α −2 q 1 q 2 ) + O(Q 2 ) .

(B.2)
To exhibit the E 4 = SU (5) enhanced flavor symmetry we introduce the fugacities A = e − 2t 5 −a , y 1 = e B.2 N f = 4 The brane realization of the SU (2) theory with N f = 4 flavors is shown in Figure 16.
We can regard the theory as arising from the U (2) theory with N f = 4 (without Chern-Simons term), by ungauging the diagonal U (1). We denote m i the masses of the flavor hypermultiplets, with fugacities µ i = e m i . The Wilson loops W 2 ⊗n are evaluated from the residue formula (3.7) with the SQM loop L n SQM associated to the k-instanton ADHM SQM shown in Figure 16-b. ⟨L n SQM ⟩ is evaluated following the recipe of Appendix A, taking into account the corrections due to the U (2) → SU (2) projection and the presence of parallel external NS5 branes. We find where y i are the so(10) fugacities. In terms of the new parameters, the S action is S-duality ∶ y 1 ↔ y 2 , y 3 ↔ y 4 . (B.10) We then expand further the Wilson loop VEVs at small A, Ay 1 2

C Results
In this appendix we collect various results which are too long to be presented in the main text. (3), N f = 2 theory

C.1 Wilson loops in SU
Using the notations of the main text, we have