(p,q)-webs of DIM representations, 5d N=1 instanton partition functions and qq-characters

Instanton partition functions of $\mathcal{N}=1$ 5d Super Yang-Mills reduced on $S^1$ can be engineered in type IIB string theory from the $(p,q)$-branes web diagram. To this diagram is superimposed a web of representations of the Ding-Iohara-Miki (DIM) algebra that acts on the partition function. In this correspondence, each segment is associated to a representation, and the (topological string) vertex is identified with the intertwiner operator constructed by Awata, Feigin and Shiraishi. We define a new intertwiner acting on the representation spaces of levels $(1,n)\otimes(0,m)\to(1,n+m)$, thereby generalizing to higher rank $m$ the original construction. It allows us to use a folded version of the usual $(p,q)$-web diagram, bringing great simplifications to actual computations. As a result, the characterization of Gaiotto states and vertical intertwiners, previously obtained by some of the authors, is uplifted to operator relations acting in the Fock space of horizontal representations. We further develop a method to build qq-characters of linear quivers based on the horizontal action of DIM elements. While fundamental qq-characters can be built using the coproduct, higher ones require the introduction of a (quantum) Weyl reflection acting on tensor products of DIM generators.


Introduction
Duality has been one of the most fundamental issues in string/gauge theories, and it has been studied from many different viewpoints and in various contexts. One of the standard approaches to the problem is to assign a brane configuration to the gauge dynamics, and interpret the duality in graphical ways. Such an approach has been taken in N = 2 super-Yang-Mills in 4 dimensions (and N = 1 in 5d). The corresponding graphical object, the Seiberg-Witten curve, is expressed through various configurations of D-and NS-branes. For example, supersymmetric gauge theories with N = 1 supercharges in five dimensions can be engineered in type IIB string theory using the methods developed in [1]. Linear quiver gauge theories with U (m) gauge groups are obtained from webs of (p, q)-branes that are bound states of p D5 branes and q NS5 branes [2,3].
A useful algebraic tool to analyze brane configurations is the topological vertex [4]. It has been introduced to reproduce the topological string amplitude on toric Calabi-Yau manifolds. In fact, the toric diagram of Calabi-Yau threefold can be identified with the (p, q)-branes web diagrams of type IIB string theory [5]. From this identification, it is possible to build the instanton partition function of the gauge theory using the machinery of topological string theory. In order to recover the Nekrasov partition function [6] in a general Omega-background, it is necessary to refine the definition of the topological vertex to include the gravi-photon background [7]. The importance of this representation of gauge theories in the context of the BPS/CFT correspondence was first realized in [8,9] where the connection with the decomposition of conformal blocks was also investigated.
In [10,11], Nekrasov partition functions have been studied from a different perspective, namely through the representation of underlying quantum algebras: the spherical double affine Hecke algebra with central charges (SH c ) [12] for the 4d gauge theory, and its quantum deformation, the Ding-Iohara-Miki (DIM) algebra [13,14,15] for the 5d gauge theory. The representations of these algebras coincide with those of (quantum) W N -algebra [16,17,12,18] while the basis of the representation coincides with the set of fixed points which represent the equivariant cohomology of the instanton moduli space. This observation was essential in the proof of the AGT conjecture elaborated in [12]. In addition, the presence of these algebras reflects the integrable nature of the BPS sector of the gauge theory. It led to the construction of R and T matrices satisfying the standard RT T relation of quantum integrable systems [19,20,21,22].
The main focus of our previous works [10,11] was the derivation of the qq-characters from SH c /DIM algebras. These particular correlators of the gauge theory were first introduced in [23], and further studied in [24,25,26,27,28]. They have the essential property to be polynomials, thus defining a resolvent for the matrix model representing the localized gauge partition function. These quantities generalize the q-characters of quantum groups defined in [29,30], and naturally associated to the T -operators of integrable systems. In [10,11], we have shown that the representation theoretical properties of the Gaiotto state and the intertwiner associated with bifundamental matter are directly translated into the regularity property of qq-characters.
A different construction of qq-characters has been presented by Kimura and Pestun (KP) in [31] (see also [32]). While both constructions are based on quantum W-algebras, the action of these algebras is seemingly different. In our approach, a copy of the DIM algebra is associated to each node of the quiver diagram, so that a quantum W m algebra is attached to each gauge group U (m). On the other hand, the quiver W-algebras constructed in [31] is based on a Lie algebra whose Dynkin diagram coincides with the gauge theory quiver. In a sense, the two approaches are S-dual to each-other: in our approach the rank is the number of D-branes while it is the number of NS5-branes in KP's work. On the algebraic level, the S-duality is believed to be realized by Miki's automorphism [14] that exchanges the labels (l 1 , l 2 ) of DIM representations, here identified with the (p, q) charge of the branes. 1 It was realized in [33,34] that the two different pictures can be better understood using the refined topological vertex. Indeed, in [35], Awata, Feigin and Shiraishi (AFS) have reconstructed this object using the generators of the DIM algebra where it plays the role of an intertwiner between vertical (0, m) (associated to m D-branes) and horizontal (1, n) (associated to a NS5-brane bound to n D-branes) representations [35]. Hence, like a string junction, it interpolates between the representations associated to different brane charges. In this way, different representations of DIM algebra can be combined to form a representation web [33,34] that can be identified with the (p, q)-web diagram engineering the gauge theory. 2 This presentation clarifies the two approaches for the construction of qqcharacters: KP employed DIM generators in horizontal representations [36] while we used similar generators but in vertical representations [16,33].
The purpose of this paper is to propose a unified method to build qq-characters and prove their regularity property. As suggested in [33], the method is based on insertions of DIM operators in the horizontal representations. However, it also makes use of the commutation of vertical actions which was instrumental in our previous derivation [11]. The link is made by a set of lemmas that intertwines horizontal and vertical actions on AFS intertwiners. The AFS lemmas can be regarded as an uplift in the horizontal representation space of the relation characterizing Gaiotto state and vertical intertwiners obtained in [11]. With this new method, we derive all the (higher) qq-character of linear quiver theories with U (m) gauge groups, thus largely extending our previous results that were restricted to fundamental qq-characters. In order to achieve this general treatment of quivers, several new insights were necessary. First, we generalized the AFS intertwiner to higher level m of vertical representations, allowing us to treat gauge groups of arbitrary rank. Most of the previous considerations, including results on integrability, were restricted to gauge groups of rank one or two. Then, in order to build higher qq-characters, a Weyl reflection acting on (tensor products of) DIM generators has been introduced. Called quantum Weyl transformation, it keeps the qq-character invariant. In practice, it is used to build operators commuting with a T -operator, the vacuum expectation value (vev) of which reproduces the instanton partition function. This commutation property is directly related to the regularity property of the qq-character, thus providing another link with the manifestation of integrability in supersymmetric gauge theories.
This paper is organized as follows. The second section provides the main properties of DIM algebra and its vertical and horizontal representations. We put some emphasis on the various duality properties, including the SL(2,Z) automorphisms. This section also includes a brief reminder on N = 1 5d gauge theories. The third section starts from the definition of the AFS intertwiners and proposes a generalization obtained from horizontal composition. The generalized intertwiners simplify the computation of amplitudes associated to the brane-web. In sections 3.3 and 3.4, these intertwiners are used to reconstruct the Gaiotto state and the vertical intertwiner built in [11]. In the fourth section, the horizontal intertwiner is defined by taking vertical contractions of generalized AFS vertices. It is shown that it commutes with the co-product of DIM generators. The quantum Weyl transformation is defined in the section 4.2 as an operation on the tensor product of generators.It leads to a systematic method to construct qq-character which is the main result of the paper. Finally, the details of computations can be found in the appendix, along with several useful identities.

DIM algebra and representations 2.1 DIM algebra
The Ding-Iohara-Miki algebra E [13,14] can be presented in terms of the Drinfeld currents The modes x ± k and ψ ± ±k are usually associated to points of a Z ⊗2 -lattice representing the elements of the algebra (see figure 1). We assign Z ⊗2 -degree for generators as deg(x ± n ) = (±1, n), deg(ψ ± n ) = (0, n). The notations and conventions used here are mostly borrowed from [21], up to minor differences in the normalization of operators. The q-commutation relations satisfied by the currents read withγ a central element. This algebra has two independent parameters encoded in the q α with α = 1, 2, 3 under the relation q 1 q 2 q 3 = 1. It is sometimes more convenient to use instead the parameters q = q 2 and t = q −1 1 , in particular in the context of representations over Macdonald polynomials. We will also introduce the notation γ = q 1/2 3 = t 1/2 q −1/2 . These parameters appear through the functions that obey the unitarity properties g(z)g(1/z) = 1 and S(γz) = S(γ/z) necessary to the consistency of the algebraic relations (2.2). Since these functions arise from the exchange of two operators, they are sometimes called scattering factors.
In this paper, representations of level (l 1 , l 2 ) ∈ Z × Z with a weight u will be denoted ρ (l 1 ,l 2 ) u or sometimes simply (l 1 , l 2 ) u . The levels are defined through the representations of the central elementγ and the zero modes ψ ± 0 , Here, we will focus on the so-called vertical representations (0, m) and horizontal representations (1, n). The intertwiner defined in the next section relates three different representations, it will be portrayed as a three-legged vertex. Products and tensor products of such operators can be described using diagrams resembling the (p, q)-web diagrams of brane configurations in type IIB theory, they will be called representation webs. Note however, that here diagrams are rotated by 90 • , such that vertical lines (0, m) are associated to m D5 branes and the horizontal line (1, 0) to a NS5 brane. Note also that we will take no care of the precise slope of horizontal lines: vertical lines in the diagrams will always refer to a vertical representation (0, m), while horizontal and inclined lines can represent any of the horizontal representations (1, n). To avoid confusion, the representation space associated to each line will be explicitly written on every figure.
The DIM algebra is a Hopf algebra with the following coproduct:

Quantum torus and DIM
Before we start the detailed explanation of DIM representations, it is illuminating to mention the simplest representation with level (0, 0) which may be identified with the symmetry of a quantum mechanical system. We consider the noncommutative torus generated by the two operators U, V satisfying where q 1 is not a root of unity. The enveloping algebra of U, V is generated by the elements w rs = U r V s identified as the degree (r, s) generators defining the algebra This algebra has a SL(2, Z) duality realized as the redefinition of the basis, which satisfies V U = q 1 U V as long as ad − bc = 1. 3 In particular, the S-transformation is realized as S : (U, V ) → (V, U −1 ).
In this simple set-up, the DIM algebra with (l 1 , l 2 ) = (0, 0) is realized as with δ(z) = n∈Z z n . In this representation, the expression (2.5) of the coproduct simplifies as ρ (0,0 u (γ) = 1. In the vector representation, the generators U, V are represented on a basis labeled by a single integer, where u is the weight of the representation. It is of some interest to compare the DIM algebra with the loop algebraĝ of a Lie algebra g. The generators ofĝ (without the central extension) are defined in terms of the generator t a of the Lie algebra as J a n = t a U n where U is a formal variable. DIM algebra is a natural generalization of this setting in which two formal variables are introduced. 3 A different but similar duality structure is realized by writing q1 =: e 2πiτ 1 and defining a SL(2,Z) modular transformation for τ1: τ 1 = aτ 1 +b cτ 1 +d . Then, there exists two generatorsŨ ,Ṽ they satisfy the quantum torus algebra with q 1 = e 2πiτ 1 and that commute with the original generators [U n V m ,Ũ rṼ s ] = 0. This duality is known as the Morita equivalence, it plays a fundamental role in non-commutative geometry [37,38], and is also relevant in more recent works such as [39].
It sometimes referred to as a two-loop symmetry. The algebra (2.7) depending on a single deformation parameter q 1 can be extended by two central charges, c 1 , c 2 [14], [w r 1 s 1 , w r 2 s 2 ] = (q s 1 r 2 1 − q s 2 r 1 1 )w r 1 +s 1 ,r 2 +s 2 + δ r 1 +r 2 δ s 1 +s 2 (r 1 c 1 + s 1 c 2 )q r 1 s 1 1 . (2.10) In this formulation, the SL(2,Z) symmetry is manifest, and the S-transformation is realized on the central charges as S : c 1 → c 2 , c 2 → −c 1 . The introduction of a second quantization parameter q 2 leads to the DIM algebra [14]. One may identify the levels (l 1 , l 2 ) with the representation of the two central charges, ρ The vertical representation (0, 1) has been formulated in [15,16], it is equivalent to the rank m representation studied in [11] with m = 1 and up to a normalization. Here we employ conventions similar to the ones used in [11], but with different states normalization (the change of the convention is summarized in appendix A).
The (0, m) representations depend on a m-vector of weights v = (v 1 , · · · v m ) and act on a space spanned by states in one-to-one correspondence with m-tuple Young diagrams λ = (λ (1) , · · · , λ (m) ), where A( λ) and R( λ) denote respectively the set of boxes that can be added to or removed from the set of the Young diagrams λ 1 , · · · , λ m . These expressions involve the functions Ψ λ (z) and Y λ (z) that depend on a m-tuple Young diagram. Their expression can be factorized in terms of individual Young diagram contributions, (2.14) Here, each box x ∈ λ is defined by three integer labels (l, i, j) such that (i, j) indicates the position of the box in λ (l) . The associated box coordinate reads χ x = v l q i−1 1 q j−1 2 . As in [11], it will be important to add a set of diagonal operators Y ± (z) such that (2.15) The notation [· · · ] ± refers to an expansion in powers of z ∓1 of the quantity inside the brackets. They will be used to define the qq-character. The action on the bra states will be referred to as the dual vertical representation. In this representation, the roles of x + and x − are exchanged: (γ) = 1. Strictly speaking, this is not a representation of the DIM algebra because some of the qcommutation relations are no longer satisfied. Instead, it should be seen as a representation on the dual states v, λ| that are orthogonal to the basis | v, λ , 4 v, λ| v, λ = δ λ, λ a −1 λ , (2.17) such that we have the property v, λ|ρ for any element e of the DIM algebra. The norm of the states involves the coefficients a λ which will play an important role in the construction of instanton partition functions. They are defined in terms of the vector multiplet contribution to the instanton partition function Z vect.
( v, λ) as follows, The vector contribution Z vect. ( v, λ) will be defined in the section 2.5 below, it is expressed in terms of the Nekrasov factor (2.34) as a result of localization. As shown in [41,11], the Nekrasov factor obeys a set of discrete Ward identities. Consequently, the coefficients a λ also obey similar identities. They can be written in terms of the function (2.20)

Horizontal (1, n) representations
Horizontal representations [36] of level (1, n) act as a vertex operator algebra in the Fock space of q-bosonic modes with the commutation relations 5 The representations involve the positive/negative modes of the vertex operator and can be defined in terms of the following operators: (2.24) 4 Due to the change of states normalization performed in appendix A, and since the original states were orthonormal, the coefficient a λ is expected to be proportional to N ( λ) −2 . The additional factors are chosen to simplify the formulation of the AFS lemmas below. 5 Here we use parameters q, t instead of qα to follow the convention of [35]: q = q2, t = q −1 1 . The oscillator modes can be represented on symmetric polynomials as follows: where p k denotes the power-sum symmetric polynomials.
Explicitly, we have (2.25) Useful commutation relations involving these operators are presented in appendix B. The horizontal representation (1, n) u reads and ρ (1,n) u (γ) = γ. Similarly, it is possible to define the representation (−1, n) u using the same vertex algebra, By definition, the vacuum state |∅ (1,n)u is annihilated by the positive modes a k , and ϕ + (z)|∅ (1,n)u = |∅ (1,n)u . The dual vacuum state (1,n)u ∅| is annihilated by negative modes, and (1,n)u ∅|ϕ − (z) = (1,n)u ∅|. The normal ordering, denoted : · · · :, corresponds to write all the positive modes on the right, and all the negative modes on the left. Correlators of operators O i (z i ) acting in the Fock space are defined as the vacuum expectation values with the radial ordering |z 1 | > |z 2 | > · · · > |z N |.

Reminder on 5d N = 1 instanton partition functions
The quiver Super Yang-Mills gauge theories with N = 1 in 5d reduced on S 1 are characterized by a simply laced Dynkin diagram Γ. Each node i ∈ Γ is associated to a vector multiplet with gauge group U (m i ), and an exponentiated gauge coupling q i . To each edge < ij >∈ Γ corresponds a bifundamental matter multiplet of mass µ ij that transforms under the gauge group U (m i ) × U (m j ). In addition, a Chern-Simons term of level κ i coupled to the gauge group U (m i ) can be introduced at each node i. Thus, each node bears two integer labels (m i , κ i ) with m i > 0 that will later be related to the levels (l 1 , l 2 ) of DIM representations. Extra matter fields in the fundamental/antifundamental representation of the gauge group U (m i ) can also be attached to each node, and the corresponding masses will be denoted µ i,j with j = 1 · · ·f i respectively. The expression of the instanton contribution to the (K-theoretic) partition function reflects the particle content of the theory. It is written as a sum over m i -tuple Young diagrams λ i , and each term is factorized into vector, Chern-Simons, (anti)fundamental and bifundamental contributions: (2.29) where the (exponentiated) Coulomb branch vevs v i are related to the vacuum expectation value of the scalar field in the gauge multiplets. From this expression, it is possible to define a normalized trace of functions depending on the realization of the set of (tuple) Young diagrams { λ i } as follows, (2. 30) This operation will be very useful in order to express the qq-characters of the gauge theory.
The bifundamental contribution with U (m) × U (m ) gauge group can be decomposed as a product of Nekrasov factors, 6 (2.32) Various expressions of the Nekrasov factors have been written, the one given here has been obtained by solving the discrete Ward identities derived in [41,11], The vector multiplet contribution is expressed in terms of the Nekrasov factors as follows: . (2.34) Finally, the Chern-Simons and fundamental/antifundamental contributions are expressed in terms of a simple product over all boxes in the Young diagrams, and µ ij → (α i /α j )µ ij . This invariance can be used to set the bifundamental masses to a specific value which simplifies the algebraic formulation developed here. Thus, from now on, all bifundamental masses will be set to µ ij = γ −1 .
These N = 1 supersymmetric gauge theories can be engineered in type IIB string theory [1]. Linear quiver gauge theories with U (m) gauge groups are obtained from webs of (p, q)-branes that are bound states of p D5 branes and q NS5 branes [2,3]. The branes occupy the dimensions 01234 corresponding to the space-time of the 5d gauge theory, plus an extra one-dimensional object (line) in the 56-planes. In order to preserve supersymmetry, the lines have the slope ∆x 6 /∆x 5 = p/q, so that the world-volume of D5-branes with charge (1, 0) occupy the dimensions 012346, i.e. they are vertical segments in the 56-plane. On the other hand, NS5 branes of charge (0, 1) are extended in the 012345 directions, and correspond to an horizontal line in the 56-plane. A representation of DIM algebra has been associated to each brane of the (p, q)-web diagram [33,34]. Representations of level (l 1 , l 2 ) correspond to (l 2 , l 1 )branes so that horizontal (1, 0) representations are associated to NS5 branes and vertical (0, 1)-representations to D5 branes. The topological vertex play the role of creation/annihilation operators for the (p, q)-branes, they will be identified with the generalized AFS intertwiners in the next section. 6 The Nekrasov factors enjoy the property

Discrete symmetries of DIM algebra
In [14], Miki has introduced an automorphism of the DIM algebra that he denoted Ψ. Since it can be identified with the action of S-duality on the (p, q)-branes, it will be denoted by S here. This automorphism leaves the DIM algebra invariant, but map degree (r, l) generator into degree (l, −r) and representations of different levels: Although the explicit transformation of the modes is rather complicated (it can be found in [14]), the square of the automorphism takes a rather simple form: By examination of the commutation relations, it is possible to define another transformation T acting on the Drinfeld currents as 37) or, in terms of modes, Again, the DIM algebra is invariant, but representations of different levels are mapped to each-other, Vertical representations are invariant under the action of T , and horizontal representations of level n are mapped to horizontal representations of level n + 1. The operations S and T obey the properties S 4 = 1 and (ST ) 3 = 1, so that they generate a group of SL(2, Z) transformations. To some extent, this group can be identified with the modular group of type IIB string theory. In particular, the Miki automorphism S would correspond to the S-duality that rotates the (p, q)-web diagrams by 90 • , exchanging NS5 and D5 branes. The second duality symmetry in DIM algebra is permutation of three parameters q 1 , q 2 , q 3 , which is manifest at the level of algebra. This S 3 symmetry is sometimes referred to as a "triality" [18] in connection with higher spin gravity [42]. We note that the representations of DIM are constructed with the reference to q 1 , q 2 . In this sense, the exchange between q 1 and q 2 is manifest. In 2D CFT language, such permutation is realized as In terms of the vertical representation basis, it is realized by taking the transpose of each Young diagram, λ ↔ λ . The other transformations, such as q 1 ↔ q 3 , are less obvious. When the parameters are suitably chosen, they are identified with the level-rank duality [43,44,42] where the correspondence between basis is also more involved [18]. While the SL(2,Z) transformation may be regarded as a M-theoretical target space duality since it interchanges D-brane and NS-brane, the S 3 duality may be interpreted as a worldsheet symmetry since it acts on the Hilbert space of equivalent 2D conformal field theories. From the viewpoint of super Yang-Mills, q 1 , q 2 represent the graviphoton background in the Euclidean planes (01) and (23). In this sense, we sometime denotes the symmetry q 1 ↔ q 2 as σ (01) (23) . On the other hand q 1 ↔ q 3 does not have an immediate woldvolume interpretation. Another reflection symmetry σ 5 is obtained by replacing the parameters q α by their inverse, effectively exchanging S(z) with S(q 3 z), and g(z) with g(z) −1 = g(z −1 ). 7 The transformation of DIM generators resemble the action of S 2 , except that x + and x − are not exchanged: ψ ± (z) ↔ ψ ∓ (1/z), x ± (z) ↔ x ± (1/z), and the central parameterγ remains invariant. Thus, representations of level (l 1 , l 2 ) are mapped to representations of level (−l 1 , l 2 ) and vertical representations are left invariant.The σ 5 reflection of vertical (0, m) representations follows from the transformation of the functions provided that the weights transform where the transformation σ 5 sends the background parameters q α → q −1 α together with the modes a k → t k γ |k| a k and the weights u → γ 2n u −1 . In this manner, η(z) and ξ(z) are exchanged but ϕ ± (z) remain invariant.
The action of the σ 5 symmetry on instanton partition functions is closely related to the reflection symmetry studied in [46,47], where it is interpreted as a quantum version of the exchange of the two sheets of the Seiberg-Witten curve. However, here the Coulomb branch vevs behave differently, since v l → 1/v l . Vector and Chern-Simons contributions transform as and the A 1 pure U (m) partition function is invariant provided that the sign of the Chern-Simons level is flipped, and the extra q 3 -factor is absorbed in the transformation q → q m 3 q. On the other hand, the bifundamental contribution transforms into itself, but with the two nodes exchanged: where µ is the reflection of µ (µ = γ when µ = γ −1 ). As a result, the σ 5 symmetry for the instanton partition function of linear A r quiver consists in reflecting the order of the nodes 123 · · · r → r(r − 1) · · · 1. Hence, this S 2 -symmetry can be interpreted as the reflection symmetry of the (p, q)-web diagram with respect to the horizontal (x 5 ) axis. In fact, the symmetry σ 5 also acts as a reflection along the horizontal axis in the graphical representation of the DIM modes x ± n and ψ ± n (see figure 1).

Definition of the generalized intertwiners
The AFS intertwiner operator has been introduced in [35], it generalizes the free fermion presentation [48] of the topological string vertex to the refined case. It is built over bosonic fields that coincide with those introduced in the horizontal representation of DIM algebra, thus providing a direct link with the representation theory. The original intertwiner acts in the tensor product of the representation spaces (0, 1) v and (1, n) u , and takes values in the space (1, n + 1) −uv . The vertical space (0, 1) v is spanned by states in one to one correspondence with Young diagrams λ. Hence, the intertwiner is a vector in this space with index λ, Both horizontal spaces (1, n) u and (1, n + 1) −uv can be identified with the same Fock space of q-bosonic modes, and the elements Φ (n) λ are expressed in terms of the modes as follows: The vacuum component is defined in terms of a new vertex operator which is related to the previous operator V ± (z) defined in (2.23) as In fact, the vacuum operator can be obtained as a (normal-ordered) product of η(χ x ) factors associated to an infinite Young diagram sincẽ Thus, this operator is associated to the perturbative part of the partition function, extending the arguments developed in [46] for the degenerate limit relevant to 4d gauge theories. Indeed, the prefactors obtained from the normal ordering of two vacuum intertwiner and involving the function G(z) (defined in appendix B) should be interpreted as perturbative (one loop) contributions to the gauge theory partition function. However, to keep our arguments simple, we will simply neglect these factors and no longer refer to this interpretation here. The normalization factor t n (λ, u, v) is the vev of the operator Φ (n) . It is chosen in order to recover the exact form of the AFS relations presented below. Its explicit expression depends on the form of the vertical representation, which is slightly different than the original one employed by AFS, The reason for this different choice of normalization is that Awata, Feigin and Shiraishi were using the action on Macdonald polynomials to investigate the connection with the refined topological vertex [49]. On the other hand, here we have chosen to keep a certain symmetry in the way the boxes of Young diagrams enter the formulas. It also makes the connection with our previous results on qq-characters more explicit [11]. The AFS intertwiner can be generalized to vertical representations of higher level, where the vector in the vertical space (0, m) v has components labeled by the m-tuple λ that reads This operator can be constructed as a product of vertical level one intertwiners coupled in the horizontal channel, as represented in the figure 3. The contraction in the horizontal channel simply corresponds to a product of operators in the q-boson Fock space. However, it is only possible if the weights of the intermediate representation spaces coincide. The resulting product can be normal ordered, and commutations produce a bifundamental contribution, . It only depends on the ratio v 1 /v 2 and thus can be easily discarded. The (vertical) level m intertwiner is obtained by repeating this operation m times, The extra factors in (3.10) and in (3.15) below will be absorbed in the replacement of products of a λ (l) by a λ in the definition of the gauge theory operators (see the next section). The AFS dual intertwiner can be generalized in the same way. It is defined as the operator 8 Again, it can be constructed from the original dual intertwiners of vertical level one as a product in the horizontal channel using the relation (3.14) 8 Note that we have exchanged the role of u and v with respect to the original definition so that v is always the weight in the vertical space.
Repeating the operation m times reproduces the dual intertwiner of level m, (3.15) with the intermediate horizontal weights u l such that u l = −v l+1 u l+1 and u m = u: Representation web In order to form a particular web of representations relevant to a given gauge theory, the AFS interwiners can be coupled in two different ways: either along the horizontal (1, n) or the vertical (0, m) channels. These two contraction channels will be discussed below. To anticipate, an horizontal contraction corresponds to the operator product of the q-Heisenberg algebra describing the horizontal representation. On the other hand, the vertical contraction will be associated a scalar product that generates the trace of a tensor product. These contractions are represented by joining the vertex drawn in the figure 2 along horizontal/vertical legs. 9 Taking only AFS intertwiners of rank m = 1, we recover the (p, q)-web diagram giving the brane configuration engineering the gauge theory. From the NS5 brane perspective, the operators Φ and Φ * are interpreted as creation/annihilation operators of D5 branes since they increase/decrease the horizontal level by one respectively. Branes charge conservation takes the form of representation levels conservation, with horizontal edges oriented from left to right, and vertical edges from bottom to top. The introduction of intertwiners with higher rank allows us to simplify the diagram, effectively folding it m times in the horizontal direction. In this way, it describes the creation/annihilation of m coinciding D5 branes in one go. The resulting web diagram corresponds to the (p, q)-web diagram of the gauge theory where all gauge groups have been replaced by U (1) groups. Although the information contained in this diagram become less visible, calculations are much more efficient in this setting.
Mass-deformed intertwiners For simplicity, the parameters of the gauge theory have been rescaled in order to set all the bifundamental masses to γ −1 . It is however possible to keep arbitrary masses upon the introduction of massdeformed intertwiners. This can be achieved by using the twisted operators Then, the interwiner products of the form Φ 1 Φ * 2 reproduces the bifundamental contribution coupled to the nodes 1 and 2 with an arbitrary bifundamental mass µ. Since such a deformation brings only little new insight to our discussion, in the following we will keep all the bifundamental masses set to γ −1 to lighten the notations.

AFS lemmas
In [35], a series of commutation relations were derived, involving the intertwiners Φ, Φ * and the DIM generators in the appropriate representations. These relations can be extended to the generalized intertwiners defined here. They are expressed formally as (3.17) 9 We remind the reader that we call "horizontal" every segment that is not vertical. Figure 4: Representation of the AFS lemma for the intertwiner and its dual, the symbol denotes the insertion of an operator e ∈ E for any element e ∈ E of the algebra. A proof is briefly sketched in appendix C. To be a little more explicit, the lemmas can be expressed as an action in the q-boson Fock space of the horizontal representation of DIM generators on the vertical components Φ λ of the intertwiner operators: In these relations, the representation in the horizontal space of the DIM operators has been omitted: for instance ) on the right of the intertwiner Φ λ , and ρ (1,n+m) u (x ± (z)) on the left. For the dual inter- ) on the left and ρ (1,n+m) u (x ± (z)) on the right. Symmetric relations can be written for the dual intertwiner, (3. 19) In fact, it is possible to re-write the RHS of the relations involving x ± in a slightly more condensed way, where the dot denotes the action in the vertical space. The AFS lemmas are represented on the figure 4, in a very simplified manner. The insertion of the symbol denotes the action of DIM generators e ∈ E, and two insertions the action of the coproduct.

Gaiotto state
The q-deformed Gaitto state is a Whittaker state for the q-Virasoro (or q-W) algebra [50,51,52,53,54], it is a deformed version of the original Gaiotto state defined for the Virasoro algebra [55,56,57,58]. The intertwiners Φ and Φ * defined in the previous section can be interpreted as an uplift of the Gaiotto state to the horizontal representation space. Indeed, the Gaiotto state can be recovered by taking the vacuum expectation value in the horizontal spaces, where we have used the definitions and introduced the closure relation in the vertical space The characterization of the Gaiotto state under the transformation x ± (z) given in [11] can be recovered by taking the vev of the AFS lemmas, evaluating the horizontal action of the generators using the formulas (B.7) given in appendix. As an example, we consider the action of x + (z) on the Gaiotto state. Using the property (2.18), the vertical action on the coordinate Φ * λ becomes the dual action on the Gaiotto state, and the vev of the third relation in (3.20) can be written in the form where the operators Y ± (z) were defined as the diagonal operators in the basis | λ, v with the eigenvalues [Y λ (z)] ± consisting of power series in z ∓1 . In order to compare with the reference [11], we need to change the normalization and define e(z) = z m ρ (0,m) v (x + (z)). The operator e + (z) is the defined as the projection of e(z) on the strictly negative powers of z. Assuming n ≤ 0, the operator z −n+m Y − (zq −1 3 ) does not contribute to the projection as its eigenvalues generate only positive powers, and we recover where P − ∞ as been introduced in [11] as the projection on the strictly negative powers of an expansion at z → ∞. Similarly, e − (z) is defined as the projection of e(z) on positive powers of z. Assuming n > m, this time the operator z −n+m Y + (zq −1 3 ) does not contribute, so that 10 where P + 0 denotes the projection on positive powers of an expansion around z = 0. Hence, up to minor differences in states normalization, we recover here the results previously obtained on the transformation of the Gaiotto state under the DIM symmetry generators. This identification provides an interpretation for the index κ R and κ L associated to the Gaiotto state (and its dual respectively). These two ad hoc parameters were introduced in [11] in order to reproduce the Chern-Simons coupling κ = κ R − κ L of the gauge theory, despite the lack of an interpretation for themselves. From our observation, it is clear that these parameters are identified with the horizontal level of the intertwiners, κ R = n * and κ L = n.

Vertical intertwiner
The contraction of the intertwiner Φ in the horizontal channel is realized as a product in the q-boson space. This product is possible only if the two representations in the intermediate space coincide, e.g. if u 1 = u 2 and n 1 = n 2 for the product Φ 1 Φ * 2 . In the case of the opposite product Φ * 2 Φ 1 , the condition is n 1 + m 1 = n 2 + m 2 and u 1 = u 2 . Both are represented on the figure 5. Using the qcommutation relations from appendix B, the two products can be normal-ordered and reproduce the bifundamental contribution (2.32): 11 where we have introduced the notations (3.29) In fact, the quantity Π (n 1 ,n 2 ,m 1 ,m 2 ) λ 1 , λ 2 [u 1 , v 1 , u 2 , v 2 ] with n α = m α = 1 has already been studied in [21] where it has been interpreted as a T-matrix, and it was further shown that it obeys RTT-relations with the R-matrix canonically associated to the coproduct ∆ defined in (2.5). In this paper, we will not refer to this interpretation anymore, although we expect it to hold beyond the restricted case studied in [21].
Due to the associativity of the product in the q-boson Fock space, the horizontal channel contraction satisfies (Φ λ e)Φ * λ = Φ λ (eΦ * λ ) for any element e in the appropriate representation. This property is depicted on the figure 7 10 When comparing with the results of reference [11], one should keep in mind the difference of notations: . 11 A priori, this result allows us to write the following formal relation between Π and Π * , (3.27) that could be interpreted as the q-commutation of creation and annihilation operators for D5 branes. However, this relation does not make sense in the representation formalism of DIM algebra due to the mismatch of the representation spaces. It only makes sense if all the horizontal representation spaces are identified as the Fock space for the free bosonic modes. We will not use this relation further in this paper.
(right). When combined with the AFS lemmas, it produces some important q-commutation relations: where arguments n α , m α , u α , and v α have been omitted for a better readability.
In [59], Carlsson and Okounkov have introduced an operator intertwining between two vertical (0, 1) representations in order to describe the matter multiplet in the bifundamental representation of U (1) × U (1). This operator was later generalized to U (m 1 ) × U (m 2 ) bifundamental representations in [11], and related to the Gaiotto state in the formal limit m 2 → 0. It is defined as an intertwiner between (0, m 1 ) and (0, m 2 ) vertical representation spaces, obtained as the horizontal vev of the operator Π, will be called the vertical interwiner to distinguish it from the AFS intertwiners. In Toda field theory, V (m,m) 12 is identified with the degenerate primary field [41] multiplied by the Carlsson-Okounkov U (1) factor. By definition, its matrix elements reproduce the bifundamental contribution, Because of a different choice of conventions here, the role of the two nodes is exchanged. This is a feature we will encounter again later when discussing qq-characters. We also observe the presence of the extra prefactor of the form Φ * 1 Φ 2 . Since the dependence on the two nodes is factorized, this term can be absorbed in a renormalization of the basis. Note however that the presence of this prefactor slightly modifies the commutation relations with the action of DIM generators.
The constraint n 1 + m 1 = n 2 + m 2 coming from the horizontal contraction has already been observed in [11]. Furthermore, the q-commutation relations with DIM generators that were obtained there can be recovered by taking the vev of the relations (3.30). For instance, focusing on the first relation in (3.30) that involves x + (z), we find .

(3.33)
Upon projection, we recover here the relations obtained previously in [11], up to the difference in normalization of states and operators.

Definition of the horizontal intertwiner
In contrast with the horizontal contraction, the vertical contraction is defined as a scalar product between the intertwiner and its dual in a shared vertical representation space. Because of this shared vertical space, the weights v and the label m of the two intertwiners must be equal. As a result, we obtain a tensor product of operators acting in two different Fock spaces, traced over the basis of the common vertical space, Here the second equality has been obtained using the definitions (3.22) after introduction of the closure relation (3.23) between the two intertwiners. For later convenience, the two Fock spaces have been exchanged. Since it intertwines two horizontal spaces, it will be referred to as the horizontal intertwiner.
The vertical contraction channel is represented on the figure 6. It defines an operator T U (m) associated to the pure U (m) A 1 gauge theory. Indeed, the instanton partition function of the gauge theory is equal to the vev of this operator T U (m) in the tensored horizontal spaces, under the following identification of the Chern-Simons level and the exponentiated gauge coupling This identification confirms the relation between the horizontal level of representations and the Chern-Simons level. It also leads to interpret the weights u and u * of the two horizontal channels as the position of the NS5 branes (dressed by coinciding D5 branes). The standard expression of the instanton partition function as a scalar product of Gaiotto states can be recovered from the definition (4.1) by introducing the definition (3.21) of the Gaiotto states, Contrary to the expression given in [11], there is no need to insert an extra gauge coupling operator q D in this formula. The reason being that here the gauge coupling dependence is naturally shared between the two Gaiotto states as it appears from the ratio u/u * of the horizontal weights entering in the intertwiners normalization. At first sight, it might seem artificial to inject the vector contribution into the coefficients a λ inside the trace in the definition of the operator T U (m) . However, it should be noted that the form of the vertical representations (and the dual ones) is mostly determined from the constraints of the AFS lemmas, once the horizontal representations and the intertwiners are defined. Then, the equivalence of vertical representations (2.18) imposes the constraints (2.20) on the coefficients a λ (defined as the inverse norm of the states). These recursion relations look very similar to the discrete Ward identities satisfied by the vector contribution. Indeed, up to the few extra factors present in (2.19), the vector contribution solves these constraints. It thus enters naturally in the definition of the T -operator of the U (m) gauge theory through the scalar product. In summary, our construction is very rigid, and the form of this operators is already determined from the choice of horizontal representations and normalization of intertwiners.
R-matrix: In [35], partition functions of U (m) N = 1 gauge theories have been constructed in a similar way if we take into account the decomposition (3.10) and (3.15) of the generalized intertwiners, and the property of the coefficients a λ , (4.5) In the end, the only difference with the operator used in [35] is the harmless prefactor of G-functions depending only on the ratio of the vertical weights (Coulomb branch vevs). The normal ordering of operators involved in the definition of generalized intertwiners brings extra Nekrasov factors that have been interpreted as elements of a diagonal R-matrix in [21]. Here, these factors are absorbed in a change of states normalization, in agreement with the definition (2.11) of the (0, m) vertical representation. More precisely, they are compensated by the replacement of the product over a λ l by the inverse norm coefficient a λ .
Remark on the reflection symmetry: The intertwiner is exchanged with its dual under the σ 5 reflection symmetry, up to a normalization factor that can be absorbed in the transformation of the coefficients a λ . The operator T U (m) = Φ · Φ * becomes Φ * · Φ. The exchange of the horizontal spaces corresponds to a reflection of the representation web with x 5 axis. Since the tensor product is commutative, the vev of the operator T U (m) , and so the instanton partition function, remains invariant. However, in the process n and n * are exchanged, which has the effect to flip the sign of the Chern-Simons level κ.

Horizontal intertwiner as screening current and fundamental qq-character
The contraction in the vertical channel commutes with the action of the DIM generators x ± (z), Here, the product notation · has been introduced to emphasize the action in vertical representation spaces. Explicitly, this identity reads  figure 7 (left), it is the non-trivial equivalent of the associativity property (Φ λ e)Φ * λ = Φ λ (eΦ * λ ) for the horizontal channel. The commutation of x ± (z) in the vertical representation has been exploited in [10,11] in order to establish the regularity property of qq-characters. Here instead, it will prove more convenient to work in the horizontal channel.
Combining this vertical commutation property with the AFS lemmas (3.17) provides the commutation of the coproduct of DIM elements in the tensored horizontal channels: (4.8) The proof is sketched on the figure 8, it follows from the application of the AFS lemma on the dual intertwiner, then the use of formula (4.6) to commute the vertical actions, and finally the application of AFS lemma again but on the intertwiner Φ. This relation generalizes the results obtained in [34] to m > 1. Since the operator T commutes with (the coproduct of) every generator of DIM, it can be interpreted as a screening operator. In order to build the qq-characters, we define the operator X ± (z) as the coproduct of x ± (z), It results from the commutation relation (4.8) that the quantities defined as the vev in the horizontal spaces of the products X ± (z)T U (m) are polynomials, up to a possible multiplication by a negative power of z. This follows from the radial ordering of operators in the q-boson Fock spaces. Indeed, the correlators X ± (z)T U (m) are well-defined for |z| > |χ x |, so that they have to be expanded for z near infinity. Similarly, the correlators T U (m) X ± (z) have to be expanded near z = 0. The non-trivial equality between the two expansions implies that the correlators are polynomials multiplied by a power of z. Just like the equality of the two expansions of any holomorphic function implies the restriction of the summations to a finite extent, f (z) = p k=−q f k z k = z −q ×Poly(z). These polynomial quantities are the qq-characters introduced by Nekrasov in [24,25]. Explicitly, the quantity defined as can be evaluated in the horizontal representation spaces by exploiting the commutation relation of q-bosonic modes and their action on the vacuum state. Doing so, we recover the expression of the fundamental qq-character already obtained in [11], .

(4.12)
Note that the average of operators in the gauge theory defined in (2.30) is in fact a weighted sum over the m-tuple Young diagrams λ so that the LHS is effectively independent of λ. Due to the asymptotic properties of the function Y λ (z), namely Y λ (z) ∼ ∞ 1 and Y λ (z) ∼ 0 (u /u)z −m , the correlator in the RHS of (4.12) is a polynomial of degree m in the physical range |κ| ≤ m of the Chern-Simons level. This asymptotic behavior explains retrospectively the power of z chosen for the prefactor in the definition (4.11). Note that an equivalent qq-character χ − (z) would have be obtained by considering the commutation relations of ∆(x − (z)). On the other hand, the commutations of ∆(ψ ± (z)) only provide trivial identities.
Although the derivation of the qq-character has been performed in the horizontal representation, exploiting the Fock space structure, the final expression coincides with the one obtained in the vertical representation. In fact, this expression is closer to the vertical direction, in the sense that it can be expressed as the expectation value of the operators Y ± (z) in the Gaiotto state (either plus or minus since the resulting expression is a polynomial): The reason for the equivalence of the two derivation is to be found in the AFS lemma that translates between vertical and horizontal actions. The vertical derivation is closer to the AGT dual presentation [50] in terms of q-Virasoro (q-Toda) theory [60]. On the other hand, the main advantage of the horizontal derivation lies in the simplification of the effective calculations since it relies only on q-bosonic modes commutations. It will allow us to propose the expression of higher qq-characters in the following sections. In this paper, our construction is parallel to the one given by Kimura and Pestun in [31]. The precise connection between the two algebraic approaches is discussed in the appendix D. In their work, a partition function state is obtained by application of screening operators to the vacuum. A similar state can be constructed here by applying the T -operator to the tensored horizontal vacuum |∅ ⊗ |∅ . However, a major difference lies in the absence of the (Kadomtsev-Petviashvili) times deformation introduced in [31] and identified with the positive q-bosonic modes of their Fock space. Nevertheless, both approaches consist in constructing a screening operator, together with an operator commuting with it. It is shown in appendix D that the latter coincide with the operator X + (z) used here, up to a q-Heisenberg "U (1)" factor. In both cases, the qq-character is obtained by taking the vacuum expectation value of the product of the two commuting operators.
Remark on a useful identity: The coproduct symmetrizes the insertion of DIM generators in one of the tensor spaces, so that the resulting expression commutes with the operator T U (m) . In fact, it is also possible to define an operator with two insertions of DIM generators such as (4.14) so that it again commutes with T U (m) . This property will play an important role in the construction of qq-characters for linear quivers of higher rank. It can be obtained by normal ordering the products X ++ T and T X ++ independently. The resulting expressions have no extra poles appart from the points z = 0 and z = ∞, so that they can be analytically continued to the whole complex plane in which they are equal. However, due to the absence of any extra singularity, taking the vev of the commutation relation only provides a trivial identity, and no non-trivial qq-character can be associated to this operator.

Higher qq-characters
In our formalism, higher qq-characters are simply obtained by taking products of coproducts of DIM elements.
Since these coproducts commute with T U (m) individually, so will their product. As an illustration, consider the qq-character associated to the symmetric representation that can be obtained using Explicitly, gives where extra scattering factors arise from normal ordering products of DIM operators. Writing z = z 1 ζ, w = z 2 ζ, it is shown that the quantity χ + (z, w) is a polynomial in ζ as a consequence of the commutation between X + and T U (m) . In fact, it is possible to prove a stronger result: the ratio of χ + (z, w) by the scattering factor S(w/z) is a polynomial in both variables z and w.

Quantum Weyl reflection 4.2.1 Horizontal intertwiner for the A 2 quiver
The A 2 quiver gauge theory, with gauge group U (m 2 ) × U (m 1 ) is described by an operator T U (m 2 )×U (m 1 ) involving two vertical contractions (for the vector multiplet contributions), and a single horizontal contraction (the with the constraints n * 2 = n 1 and u * 2 = u 1 in order to match the representation levels and weights in the horizontal channel. Actually, this operator can be obtained from the combination of the operators T U (m 1 ) and T U (m 2 ) associated to the two gauge groups, using a new product • to represent the horizontal contraction, T U (m 2 )×U (m 1 ) = T U (m 1 ) • T U (m 2 ) . The new product corresponds to the concatenation of two chains of tensor products of respective length r and s, in order to form a chain of length r + s − 1: (4.20) As before, the instanton partition function of the gauge theory corresponds to the vev in the horizontal spaces, up to a factor of G-functions depending only on the Coulomb branch vevs, with the identification q α = γ −κα−mα u α /u * α and κ α = n * α − n α for the gauge coupling and the Chern-Simons level associated to the two gauge groups α = 1, 2.

Fundamental qq-character for the A 2 quiver
A different qq-character is associated to each node of the quiver diagram, in correspondence with antisymmetric representations of the Lie algebra. In the case of the A 2 quiver, the two relevant representations are the fundamental and the fully antisymmetric ones. We focus first on the construction of the fundamental qq-character χ + (z), leaving the antisymmetric representation for the next section. Within our conventions, the fundamental representation is associated to the action of x + (z) on the first node.
The commutation property (4.6) of the vertical channel is valid at each node in the form The operator leading to the fundamental qq-character can be obtained using the double coproduct The action of this double co-product on the DIM generators reads

(4.24)
Combining the general commutation properties of the vertical and horizontal contractions, together with the AFS lemmas (3.17), it is possible to show that the horizontal action of the generators commutes with the T -operator: The proof is a tedious but straightforward calculation, using the same method as in the single node case.
Introducing the operator X + (z) = ∆ (x + (z)) that commutes with T U (m 2 )×U (m 1 ) , the fundamental qq-character can be written (omitting the horizontal representations): with ν α = u α /(q mα 3 u α ). Again, this quantity is a polynomial in z because X + commutes with T . The power of z in the prefactor is fixed by consideration of the asymptotic behavior. Evaluating the correlators in the q-bosonic Fock spaces, we recover the expression given in [11] for the fundamental A 2 qq-character with a bifundamental mass µ = γ −1 in the vertical channel: 12 (4.27)

Quantum Weyl reflection and the second qq-character
There are two ways to obtain the second qq-character. The simplest one is to consider the insertion of the operator X − (z) = ∆ (x − (zγ −1 )) that also commutes with the T -operator. Defining gives after evaluation of each horizontal actions, which is indeed the second qq-character of the A 2 quiver found in [11]. In fact, because of the reflection symmetry obeyed by the A 2 quiver, we have χ − (z) = χ + (z) which explains why we have obtained the correct qq-character. This property seems to be a consequence of the σ 5 symmetry of the representation web combined with the S 2 rotation of the DIM algebra.
There is a more natural way to derive the second qq-character, which is to start from insertions of x + (z) in two of the three horizontal lines at the end of the diagram, with spectral parameters fine-tuned to obtain the commutation with the T -operator. Indeed, the first term of the qq-character, that is proportional to Y λ 2 (zγ −2 ), can be obtained from the insertion of the operator on the left of the representation web. The other terms entering the expression of the qq-characters are known to be obtained by acting with the Weyl reflection on the first term [31]. The Weyl reflection for the A 2 quiver diagram sends the co-weight w 2 attached to the second node to where α i denote the roots of the Lie algebra with the Dynkin diagram A 2 . To each intermediate expression has been associated a term of the qq-character. A similar transformation can be defined on the DIM generator x + (z) involved in tensorial expressions like (4.30). It will be called the quantum Weyl reflection. The quantum Weyl reflection with respect to the root α i consists in replacing the insertion of x + in the ith tensor space with an insertion of ψ − in the ith space and x + in the (i + 1)th space, together with the appropriate shifts of the spectral parameters: 13 The transformation is forbidden if two x + were to collide in the same space. In a sense, the generators x + obey a fermionic statistics in the tensor spaces. It is further assumed that the operators ψ − are ordered on the left of operators x + , although this fact does not modify the derivation of the qq-characters. Before applying the quantum Weyl reflection to obtain the operator relevant to the second node of the A 2 quiver, let us review how this transformation works in the known cases. The A 1 quiver is described by two horizontal spaces, 13 The quantum Weyl transformation can be defined in a similar manner on the generator x − (z), i.e. in such a way that it reproduces the coproduct in the case of the fundamental representation: it has a single weight w α − → −w and the qq-character χ + (z) has only two terms. The application of the quantum Weyl reflection on x + (z) ⊗ 1 leads to the coproduct ∆(x + (z)).
Turning to the A 2 quiver, the quantum Weyl reflections of reproduces the three terms in the expression of the operator X + (z) constructed from the application of the squared coproduct ∆ . Thus, the quantum Weyl reflection defines a generalization of the coproduct that implements the action of an operator into three copies of the initial space. Now, we apply the Weyl reflection to the operator (4.30) of the A 2 quiver, and sum over the three terms in order to define (4.35) After a tedious but straightforward computation, it can be shown that the operator X + (z) = ∆ (x + (z)) commutes with T . The commutation of the operator defined in (4.14) with T U (m) (seen here as a subdiagram) is essential for the various cancellations to occur. The corresponding qq-character is defined as The evaluation of the vev in the horizontal spaces reproduces the expression of χ − (z) given in (4.29), showing that indeed χ + (z) = χ − (z).

Generalization to the A r quivers
The results obtained for the A 2 quiver are easily generalized to linear quivers with an arbitrary number of nodes r.
The T -operator is constructed using r − 1 contractions in the horizontal channel, rendered by the product • defined in (4.20), where the order of indices labeling gauge groups has been reversed for convenience. Schematically, it reads where we have omitted all the weights and level parameters. This expression implies the constraints n s = n * s+1 and u s = u * s+1 in order to match the representation spaces in horizontal channels. Then, up to a prefactor of G-functions, the vev reproduces the instanton partition function (2.29) for the quiver Γ = A r under the identification κ s = n * s −n s for the Chern-Simons levels, and q s = γ −κs−ms u s /u * s for the gauge couplings. As before, the fundamental qq-character, attached to the first node, can be obtained by multiple applications of the coproduct. The A r fundamental coproduct ∆ is defined recursively as ∆ = (∆(⊗1) r−1 ) · (∆(⊗1) r−2 ) · · · ∆, (4.39) and acts on the DIM generators as follows: withγ (s)! =γ (1)γ(2) · · ·γ (s) = (γ⊗) s 1(⊗1) r−s , and the tensorial transpose defined as (a 1 ⊗ a 2 ⊗ · · · ⊗ a r+1 ) = a r+1 ⊗ a r ⊗ · · · ⊗ a 1 .
The fundamental coproduct of DIM generators commutes with the T -operator, where we have omitted to indicate the horizontal representations. As a result, the fundamental qq-character defined as is a polynomial. Explicit evaluation of the correlators for each horizontal space provides the formula The qq-character associated to the sth node corresponds to the antisymmetric representation denoted by the Young diagram (s) with s boxes, all in the first column. The corresponding operator X + (s) (z) is obtained by application of quantum Weyl reflections on the operator (4.44) Note that since the operator is evaluated in horizontal representations, the position of the central elementγ in the arguments of operators is somewhat arbitrary here. As an illustration, the A 3 quiver is treated in details in the appendix E. This construction can also be applied to the generator x − (z). Because of the reflection symmetry of the quiver diagram, the corresponding qq-characters are expected to obey the relation χ − (s) (z) = χ + (r+1−s) (z). In fact, it is possible to define qq-characters associated to arbitrary representations of the Lie algebra. To a representation labeled by a Young diagram λ is associated the operator X + λ ( z) obtained by taking the product over the columns λ i of the operators X + (λ i ) (z i ) defined previously. This construction works if the first column of the Young diagram contains at most r boxes. By construction, these operators commute with the T -operator of the gauge theory, and the vev X + λ ( z)T is a polynomial up to multiplication by a monomial of the variables z i . Figure 10: Representation web of the A 1 quiver with antifundamental matter

Inclusion of fundamental/antifundamental matter fields
Matter fields are introduced by semi-infinite D5 branes that are vertical edges in the representation web. These can be inserted either in the bottom or top part of the diagram, leading to fundamental (Φ) or antifundamental (Φ * ) matter respectively. It is well-known in gauge theory that such matter fields can be obtained by introducing extra gauge groups, sending the corresponding gauge coupling q to zero. This constraints the Young diagrams λ associated to this gauge group in the partition function expansion (2.29) to be empty, hence generating the contributions In this spirit, we can regard the massive A 1 quiver as the limit of the A 3 quiver as q 1 , q 3 → 0. This procedure corresponds to send two NS5 branes at infinity. Taking the formula from appendix E for the A 3 qq-character χ + (z) associated to the second node, and sending the gauge couplings q 1 , q 3 → 0 while q 2 = q is held fixed, we indeed recover the massive A 1 qq-character χ + (z) obtained in [11], (4.47) and we have dropped the label 2 of the middle node.
In our formalism, the gauge coupling q is obtained as a ratio of horizontal weights u/u * . The limiting procedure q → 0 corresponds to send either u to zero for some intertwiner Φ λ , or u * to infinity for the dual intertwiner Φ * λ . In either case, the normalization coefficients, t n,m or t * n,m , vanishes except when the Young diagrams λ are empty. The case of the antifundamental matter is the easiest one to consider. Indeed, it is observed from the AFS lemma that since R( ∅) = ∅, the vacuum intertwiner Φ * ∅ commutes with the action of x + (z). As a result, an additional horizontal contraction with this operator, as represented on the figure 10, does not spoil the commutation with the operator X + (z). In this case, the T -operator is simplified as the extra Φ ∅ can be decoupled, 14 (4.48) On the other hand, in the case of fundamental matter, it does not seem possible to fully decouple the extra horizontal channel, and we are forced to define the T -operator within three different Fock spaces, (4.49) in order to observe the commutation relation with the operator X + (z). 15 This problem is related to the noncommutation of Φ ∅ with x + (z), it can be solved by considering the commutation with the operator X − (z) instead. However, the problem persists if both fundamental and antifundamental matter are introduced, in which case the only solution is to consider a third horizontal channel with a trivial vertical contraction as in (4.49). The treatment of fundamental matter here is rather different from the usual brane description. In particular, we do not observe a limitation on the number of fields in this algebraic construction, which may be an effect of the presence of Chern-Simons terms. It would be advisable to achieve a deeper understanding of the precise difference between the two constructions.
Since our understanding of fundamental matter is based on gauging the flavor group, the generalization of these results to all linear quivers would require to construct arbitrary quiver theories, which is way beyond the scope of our paper. However, we hope to be able to address this issue in a near future.

Perspectives
We have proposed an algebraic method to derive qq-characters of linear quiver N = 1 gauge theories with U (m) gauge groups. It is based on the insertion of DIM generators in a tensored horizontal representation, symmetrized in order to define an operator commuting with the T -operator of the gauge theory. This method provides an efficient way to derive the explicit expression of the qq-characters as correlators in the gauge theory.
There are several directions in which this work can be extended. The most natural one is the treatment of DEtype quivers. In the case of D-type quivers, the brane construction of Kapustin [61] involving an orientifold brane seems relevant. Progress along this direction will be reported elsewhere. Affine quivers could also be considered. There, the extra compact dimension seems to impose the consideration of a ring of tensor spaces in the horizontal representations in which an infinite number of quantum Weyl transformations can be applied. A much harder problem would consist in studying gauge theories with DE-type gauge groups, i.e. Sp(m) or SO(m) groups. The recent construction of Hayashi and Ohmori [62] could be helpful in this context.
We hope that the generalized intertwiners introduced here will also be useful in the description of the underlying integrability, leading to a generalization of the R-matrix construction [21,22].
Finally, the action of a similar quantum algebra has been observed in the context of higher spins [63], and it would be interesting to investigate the role played by these fundamental objects that are interwiners and qq-characters.
Part of the results of the paper were announced in the workshop "Progress in Quantum Field Theory and String Theory II" (March 27-31, 2017 Osaka City University). We would like to thank the participants of the workshop, especially H. Awata, H. Itoyama, H. Kanno, Y. Zenkevich with whom very useful discussion was made.

A Different expressions for the vertical representation
In [11], a different-looking vertical representation has been employed. At the level (0, 1), it reads 16 with function Ψ λ (z) defined in (2.12), and the coefficients being the square root of the residues Λ x (λ) 2 = ± Res z=χx Ψ λ (z). However, the normalization of the states can be modified by an arbitrary factor: letting |v, λ = N (λ)|v, λ , we have in general Note that the action of the Cartan is not modified since they are diagonal in this basis. Choosing the normalization factor as 17 using the fact that , Res and the property Λ x (λ) = Λ x (λ − x), the new representation can be written (A.7) 16 Here the generators have been multiplied by a constant factor without altering the commutation relations as follows: The definition of the function Ψ λ (z) has also been modified in order to reflect this change of normalization. 17 The recursive property is inherited from the discrete Ward identity obeyed by the vector contribution [11], The second relation simplifies after a careful treatment of the limit z → χ x in the expression Finally, we notice that the coefficient in front of the commutator [e, f ] is different from the one in (2.2) for [x + , x − ].
In order to recover the same convention, we need to multiply Under the identification of the renormalized f (z) with x − (z), and e(z) with x + (z), we end up with the vertical representation (2.11). In addition, an extra cosmetic factor of γ −1 has been added in front of x − (z) and ψ ± (z) in order to simplify some expressions. It is important to stress that our renormalized vertical representation here does not coincide with the one used in AFS's paper in which the normalization of the intertwiners Φ λ and Φ * λ is also different. Explicitly, the vacuum intertwiners read Summing over the index k with the spectral parameter at the power z −k , we recover the AFS lemma (3.18). This short computation gives some insight on the interpretation of the AFS lemma: it is valid for each power of z in a formal expansion.

D Connection with quiver W-algebras
In [31,32], Kimura and Pestun have introduced quantum W-algebras based on the Dynkin diagram Γ of simple Lie algebras of ADE type. These algebras are constructed upon a set of q-bosonic modes s (i) k with k ∈ Z and i ∈ Γ that obey the commutation relations ii , k > 0, ii denotes the k-th Adams operation applied to the mass-deformed Cartan matrix. For instance, in the case of the A 3 quiver with bifundamental masses µ ii = γ −1 , this matrix reads Since this algebra is also acting on Nekrasov partition functions, it should be related to the DIM algebra considered in our paper. The aim of this appendix is to highlight this connection. It is based on the decomposition of the tensor product of two (1, 0) DIM representations into q-Heisenberg⊕q-Virasoro algebras. This decomposition has been described by Mironov, Morozov and Zenkevich in [33], and this appendix is just a reformulation of their results in our notations. In order to simplify the discussion, we will neglect the role of zero modes, Φ ∅ ,... We will also restrict ourselves to U (1) gauge groups at each node of the quiver diagram. It is an easy exercise to extend the argument to more general cases. We first focus on the A 1 quiver for which the T -operator is built as a vertical contraction of two intertwiners, T U (1) = tr Φ * ⊗ Φ. Since two horizontal spaces are involved, we need two copies of the q-bosonic modes in order to represent the horizontal action of the intertwiner and its dual. We denote these modes a The operator T involves a trace over Young diagram realizations of a product over the box content of the diagram. Each factor contains the following operator evaluated at z = χ x for some x ∈ λ, k γ k − a where we have neglected the boundary terms S(vq i−1 1 ) that can be taken care of using zero modes. In the RHS, the product is taken over the elements of the set X defined in [31], and we can formally identify the state |Z T representing the partition function with the action of T U (m) over the horizontal vacuum states: The modes s k can be used to build the stress-energy tensor of the q-Virasoro algebra. The orthogonal combination kb k = a (1) k + γ |k| a (2) k , which by definition commutes with s k , obeys the q-bosonic commutation relation Hence, up to a U (1) factor, we recover in ∆(x + (z)) the operator T of Kimura and Pestun, identified with the fundamental current (stress-energy tensor) of q-Virasoro [60]. 20 For a general linear quiver diagram A r , the modes s (i) k i = 1 · · · r are associated to the nodes of the diagram. On the other hand, the T -operator is written as an (r + 1)th tensorial product T U (mr)×···×U (m 1 ) = tr (D. 12) In this expression, a different set of modes a (i) k is attached to each tensor space, with i = 1 · · · r + 1. It leads to identify the modes as follows: (D.13) (1, n + m) u (1, n 3 + m 3 ) u 3 (1, n 1 + m 1 ) u 1 E Derivation of the qq-characters for the A 3 quiver The qq-characters associated to the three nodes of the A 3 quiver are labeled by the Young diagrams , and . They can be constructed from the following operators: the operator T U (m 3 )×U (m 2 )×U (m 1 ) . In practice, we have used a short program in Python to perform the algebraic manipulations.