Quivers, Words and Fundamentals

A systematic study of holomorphic gauge invariant operators in general $\mathcal{N}=1$ quiver gauge theories, with unitary gauge groups and bifundamental matter fields, was recently presented in [1]. For large ranks a simple counting formula in terms of an infinite product was given. We extend this study to quiver gauge theories with fundamental matter fields, deriving an infinite product form for the refined counting in these cases. The infinite products are found to be obtained from substitutions in a simple building block expressed in terms of the weighted adjacency matrix of the quiver. In the case without fundamentals, it is a determinant which itself is found to have a counting interpretation in terms of words formed from partially commuting letters associated with simple closed loops in the quiver. This is a new relation between counting problems in gauge theory and the Cartier-Foata monoid. For finite ranks of the unitary gauge groups, the refined counting is given in terms of expressions involving Littlewood-Richardson coefficients.


Introduction
The study of giant gravitons [2] in the context of AdS/CFT [3] has instigated detailed investigations of BPS operators in four dimensional N = 4 super-Yang-Mills theory (SYM) with U (N ) gauge group [4,5,6,7,8,9,10,11]. These studies focused on the counting of gaugeinvariant operators, an inner product related to 2-point functions and higher point functions for large N as well as at finite N . The connection between U (N ) gauge invariants and permutations was a central theme as well as representation theory of the permutation groups. The studies were extended beyond N = 4 SYM to gauge theories such as ABJM [12] and the conifold [13,14,15,16]. In [1] these problems on counting and inner product were considered for general quiver gauge theories. These theories, often arising in the context of 3-branes transverse to 6-dimensional singular Calabi-Yau, are associated with directed graphs, i.e. collections of nodes with directed edges between them [17]. The gauge group of the theory is a product of unitary groups, one unitary group for each node. The directed edges correspond to bi-fundamental matter fields, which transform according to the anti-fundamental representation of the gauge group corresponding to the starting node and the fundamental of the ending node.
Also of interest in AdS/CFT are gauge theories where some of the matter fields are in fundamental representations, rather than bi-fundamentals, see for example [18,19,20,21,22]. These theories can be associated to directed graphs, where we distinguish two types of nodes: gauge nodes and global symmetry nodes. The global symmetry nodes -which will be drawn as squares -are associated with unitary groups, which are global symmetry groups rather than gauge groups. In this case the local operators of interest are not required to be invariant under the global symmetry groups. Rather they are states in specified representations of these groups. They are still invariant with respect to unitary gauge groups associated to the gauge nodes, which will be drawn as circles. Each of these gauge nodes will have a number of outgoing arrows ending on square (global symmetry) nodes and transforming as fundamentals of the global symmetry. Each gauge node will also have a number of incoming arrows which start from square (global symmetry) nodes and transform as anti-fundamentals of the global symmetry. Since the global symmetry nodes correspond to fundamental or anti-fundamental fields, they are linked to a single gauge node each.
The main result of the present paper is to extend the results of [1] to the case of quiver gauge theories with fundamental matter fields. These are also called flavoured quiver gauge theories. In order to set up this extension, we have completed the proof of a key formula in [1]. We have also found a new connection between the counting of quiver gauge theory operators and a word counting problem associated with the quiver graph. This uncovers a new link between gauge invariant operators of quiver theories and the mathematics of Cartier-Foata monoids [23,24]. The latter is expressed here in terms of a word counting problem where the letters correspond to loops on a graph, with partial commutation relations.
The central insight in [1] is that the quiver, aside from encoding the gauge group and matter content of a gauge theory, is a powerful calculational tool in the application of permutation group techniques to the enumeration of gauge invariant operators, and to the calculation of their correlators. The use of the quiver as calculator starts with the process of splitting all of the gauge nodes into two pieces, one of which has all the incoming edges of the original quiver and the other of which has all the outgoing edges of the original quiver. For each node, a new edge connecting the split copies of each node is introduced. All the edges of this split-node quiver are equipped with Young diagram labels and the nodes are associated with weights which are Littlewood-Richardson coefficients. A sum over all the Young diagram labels, with weights associated to the nodes, gives the counting of gauge invariant operators for finite ranks N of the gauge groups. Here we establish a similar result in the case of quivers with fundamentals. The starting point is the group integral formula for counting gauge invariant operators [25,26]. The group integrals over U (N ) are done by using character expansions. These character expansions introduce characters of permutation groups, because of the Schur-Weyl duality [27,28] link between unitary and symmetric groups.
The finite N counting formulae admit significant simplifications in the limit of large N . At finite N , the counting involves sums over Young diagram labels. The sizes of the Young diagrams are related to the sizes of the local operators. When these sizes are small compared to the ranks, the Young diagram sums run over complete sets of representations of symmetric groups. This allows the use of formulae from Fourier transformation over finite groups such as The delta function is 1 if σ is the identity permutation in S m -symmetric group of all permutations of m objects -and zero otherwise. The result is that the counting formulae can be expressed in terms of sums over multiple permutations, related by delta function constraints. These sums over permutations can be converted into sums over partitions, described by an infinite sequence of integers p 1 , p 2 , · · · . This sequence is related to cycle lengths in the cycle decomposition of permutations. The upshot is that the counting of gauge invariant operators at large rank can be given in terms of a sum over the infinite sequence of integers p i . The general formula takes the form of an infinite product over i, where i is related to the cycle lengths in the above description Each factor in the product is built from a basic function F [n] 0 ({x ab }). The integer n is the number of gauge nodes and the subscript denotes the unflavoured case. The index α runs over the different edges with the same starting gauge node a and the same ending gauge node b. If there is no edge from a to b, we substitute x ab → 0. This structure was derived in [1] for the case without flavour. The function F [n] 0 ({x ab }) was explicitly computed for the case of quivers with small numbers of nodes and a simple general formula was guessed. A general formula for F [n] 0 ({x ab }) was also derived in terms of contour integrals. However, the proof that the contour integrals really give the guessed simple form for the F [n] 0 ({x ab }) was not given. This missing step is completed in this paper. We also find that this function can be written in terms of a determinant: The matrix X n is defined to have variables x ab as the entry in the a-th row and b-th column. We may think of X n as a weighted adjacency matrix associated with the quiver graph which has n nodes and a single directed edge for every specified starting point a and end-point b. We refer to this latter quiver graph as the complete n-node quiver graph. The notion of adjacency matrix, and weighted versions thereof, are commonly used in the context of graph theory [29,30]. The (a, b) entry of the adjacency matrix of a directed graph is equal to the number of oriented edges M ab from node a to node b. In the present studies, it is natural to associate α x ab,α as the weight for a given pair of nodes, which reduces to M ab , the entry of the adjacency matrix, when the x ab,α are set to 1. While the infinite product (1.2) counts gauge invariant operators, the building block F [n] 0 ({x ab }) itself (1.3) has no obvious counting interpretation in terms of the original gauge theory problem. Nevertheless, after applying a well-known identity, the determinant formula (1.3) makes it clear that the expansion coefficients of this building block are positive, which suggests a counting interpretation. We give such an interpretation. It is in terms of a word counting problem involving letters corresponding to simple closed loops on the complete quiver graph. Two letters commute if the loops do not share a node but they do not commute if the loops do share a node. This, we describe as the closed string word counting problem. There is an equivalent word counting problem in terms Its equivalence to the closed string word counting is a highly non-trivial fact, which is the content of a theorem of Cartier-Foata [23] from the sixties! This type of word-counting is of interest in pure mathematics and theoretical computer science, where it is known under the heading of Cartier-Foata monoids [23,24,31]. The monoid structure arises because the words can be composed to form other words, thus giving a product which turns the set of words into a monoid. This new connection between the counting of gauge invariant operators and Cartier-Foata monoids is the first main result of this paper.
The infinite product form and the explicit formula for the building block, for the case of flavoured quivers, is derived using contour integrals in this paper. We find that the building block for the case of flavoured quivers is closely related to the unflavoured case (see equations (2.8) (2.9)). It is worth emphasizing that the contour integrals we deal with for the large N limit are significantly simpler than the original integrals over the U (N ) groups. The contour integrals we use involve n complex variables z a , where n is the number of nodes in the quiver. The equations (2.8)(2.9), which form the second main result of this paper, are derived after finding the correct pole prescription for these n integrals and uncovering the structure of the residues arising when the z a are evaluated at the poles.
We stress that, even though the motivation of this work is to study 4 dimensional N = 1 gauge theories, focusing on the holomorphic gauge invariant operators made from chiral superfields which have a complex scalar as the lowest component of the superspace expansion, the counting techniques we developed do not depend on either the spacetime dimension or on the amount of supersymmetry. The results apply equally to holomorphic gauge invariants of a matrix quantum mechanics, or of a matrix model of multiple complex matrices transforming as bifundamentals.
The paper is organized as follows. Section 2 gives a summary of the main results. Section 3 starts from an integral over a product of unitary groups a U (N a ), which gives the generating function for the counting of gauge-invariant operators [25,26]. This generating function depends on chemical potentials, one for each of the bifundamental fields in the theory, i.e. one for each edge in the quiver joining gauge nodes. In addition, there are chemical potentials for the global charges under the Cartan of the global symmetry groups. The integrand is expanded in terms of characters of the (gauge and global) unitary groups along with characters of permutation groups. The gauge unitary group characters can be integrated using orthogonality of the irreducible characters. The resulting expressions contain sums involving Young diagrams and group theoretic multiplicities called Littlewood-Richardson coefficients [27]. These sums are done in Appendix A.1 and the outcome is an infinite product parameterised by an integer i. For each i there are sums over integers, one for each edge of the quiver. We call these edge variables p ab,α , p a,β ,p a,γ . These sums are constrained by Kronecker delta functions, one for each gauge node of the quiver. The structures of the sums in each factor of the i-product are closely related. Once these sums are performed for i = 1, the expressions for the factor at each i can be written down. The i = 1 factor is the building block function F [n] ({x ab }, {t a }, {t a }) which can be viewed as the generalization of F [n] 0 ({x ab }) for unflavoured quivers to flavoured quivers. The Kronecker delta constraints on the edge variables are expressed by introducing complex variables z a , giving a product of n contour integrals. Section 4 evaluates the contour integrals for the case without fundamental matter, recovering the result written down in [1]. This involves finding the right prescription for picking up poles. The prescription is simple and intuitively very plausible. It is derived from the inequalities which ensure the applicability of the summation formulae leading to the contour integral formula obtained in Section 3. The derivation is presented in Appendix B. With the specified pole prescription in hand, we describe the calculation of the integral. The integrand involves n factors and there are n integration variables z 1 , z 2 , · · · , z n . The recursive evaluation of the integral leads to a formula (4.12) for the poles encountered at each stage. The pole coefficients in this formula can be expressed neatly in terms of paths in the complete quiver graph. This expression is equation (4.25) and is proved in Appendix D. Using this expression we are able to prove the formula for F [n] 0 , an inverse of a signed sum over permutations of subsets of n nodes, guessed in [1]. We then recognise that the denominator is a determinant det(1 n − X n ), which leads to (1.3). Section 4.3 gives the combinatoric meaning of the basic building block in terms of word counting problems. Appendix E illustrates this interpretation in the case of 2-node and 3-node quivers. Section 5 evaluates the n countour integrals for the building block function F [n] ({x ab }, {t a }, {t a }) and expresses it in terms of determinants and minors of the matrix (1 n − X n ). This gives a neat formula (5.16) 0 ({x ab }). Appendix F derives this formula, following a similar strategy to the unflavoured case, namely finding expressions for pole coefficients in terms of paths in a complete n-node quiver. Section 6 gives applications of the general counting formulae by considering explicit quiver gauge theories with fundamental matter.

Basic definitions and summary of results
In this paper we consider quiver gauge theories with gauge group n a=1 U (N a ), and flavour symmetry of the schematic form SU (F ) × SU (F ) × U (1). The quivers have round nodes corresponding to gauge groups, and square nodes corresponding to global symmetries.
Fields leaving gauge node a and arriving at gauge node b will be denoted by Φ ab,α , and will transform in the antifundamental representation of U (N a ) and the fundamental of U (N b ). The third label α taking values in {1, ..., M ab } distinguishes between M ab different fields with the same transformation properties under the gauge group. At every gauge node a we allow M a different families of quarks {Q a,β , β = 1, ..., M a } transforming in the antifundamental of U (N ) a andM a different families of antiquarks {Q a,γ , γ = 1, ...,M a }, transforming in the fundamental of U (N ) a . Here β and γ are the multiplicities of the quarks and antiquarks respectively. The flavour group of the quark Q a,β is denoted by U (F a,β ), while the one for the antiquarkQ a,γ is U (F a,γ ). This configuration is pictorially represented in the figure below, while the gauge and flavour groups representations carried by every field in the quiver are summarised in table 1.
Note that if we consider the free N = 1 theory with chiral (and anti-chiral) multiplets, then all the global symmetry will contain factors SU (F a ) × SU (F a ) × U (1) a for each gauge group, where F a = β F a,β = γF a,γ =F a , and the equality F a =F a is required by cancellation of the chiral gauge anomaly. When interactions are turned on, one may be interested in a subgroup × β U (F a,β ) × γ U (F a,γ ). Our calculations work without any significant modification for this case of product global symmetry, hence we will work in this generality. To recover the results for SU (F a ) × SU (F a ) × U (1) a global symmetry, we just drop the β, γ indices. Strictly speaking the global symmetry SU (F a ) × SU (F a ) × U (1) a of the free theory contains only the determinant one part S(U (F a,1 ) × U (F a,2 ) × · · · U (F a,Ma ) × U (F a,1 ) × · · · × U (F a,Ma )). This means that, although for simplicity we write × β U (F a,β ) × γ U (F a,γ ) as the global symmetry, all the states we count are neutral under the U (1) which acts with a phase on all of the chiral fields and the opposite phase on all of the anti-chiral fields. This U (1) is part of the U (N a ) gauge symmetry. In the generating function Z, the chemical potential of a generic bi-fundamental field Φ ab,α will be denoted by x ab,α , while to each quark Q a,β and antiquarkQ a,γ we will assign the chemical potential matrices T a,β andT a,γ respectively, defined as T a,β = diag(t a,β,1 , t a,β,2 , ..., t a,β,F a,β ) ,T a,γ = diag(t a,γ,1 ,t a,γ,2 , ...,t a,γ,Fa,γ ) . (2.1) The entries of these matrices encode all of the quark and antiquark chemical potentials: t a,β,k = e iθ a,β,k is the chemical potential for a quark Q a,β,k charged under the U (1) k of the maximal torus F a,β j=1 U (1) j ⊂ U (F a,β ), whilet a,γ,k = e −iθ a,γ,k is the chemical potential for an antiquarkQ a,γ,k charged under the U (1) k of Table 1: Gauge and flavour groups representations carried by Φ ab,α , Q a,β andQ a,γ . ,¯ and 1 are respectively the fundamental, antifundamental and trivial representations of the correspondent group.

From gauge invariants to determinants and word counting
For quiver gauge theories with bi-fundamental fields, the generating function Z({x ab }) for local holomorphic gauge invariant operators constructed from the chiral fields, is given by [1] Z It is useful to introduce the complete n-node quiver which is a quiver that has 1 edge for every specified start and end-point. An expression for F [n] 0 ({x ab }) was given as the inverse of a sum over permutations of subsets of the set of nodes of the n-node complete quiver. Equivalently this is an expression in terms of loops in the complete quiver Here V is any subset of nodes of the quiver (except the empty set), and for the cycle (abc · · · d) y (abc···d) = x ab x bc · · · x da . In this we observe, using standard matrix identities, that where X n is an n × n matrix with entries x ab . This formula is the subject of the Mac Mahon master theorem [32]. While the function Z({x ab,α }) counts gauge invariant operators, the gauge theory setup does not immediately offer a combinatoric interpretation for F in terms of word-counting problems associated with the complete nnode quiver. There are in fact two counting problems, one of them is a closed string counting problem. Consider a language where the words are made from letters which correspond to simple loops in the n-node quiver. These are loops that visit each node of the quiver no more than once. These letters equivalently correspond to cyclic permutations of any subset of integers {1, · · · , n}. The words are constructed as strings, i.e. ordered sequences, of these letters with the additional equivalences introduced that letters corresponding to two simple loops c and c commute if the loops do not share a node. We denote these letters byŷ c . Then y cŷc =ŷ c ŷ c , (2.5) if c and c are loops that do not share a node. Any word contains a list of these letterŝ y c 1 ,ŷ c 2 · · ·ŷ c k with multiplicities (m 1 , m 2 , · · · , m k ). With these specified numbers, there is a multiplicity M(m 1 , · · · , m k ), of words since, in general, the order of the letters matters: if two loopsŷ c ,ŷ c do share a node thenŷ cŷc =ŷ c ŷ c . The expansion of F [n] 0 in terms of the loop variables contains terms of the form y m 1 c 1 y m 2 c 2 · · · y m k c k with coefficients, which are precisely the multiplicities of the words M(m 1 , · · · , m k ). This is a remarkable new connection between a counting problem of words built from a partially commuting set of letters and the counting of gauge invariants. Since the letters correspond to simple loops, we call this the closed string word counting problem. Thus F

Generalization to flavoured quivers
We extend the counting results to quivers that have bifundemental matter fields, as well as fundamental matter. We find again that the counting in the limit of large rank gauge groups is given as an infinite product. Each factor is obtained by making a simple substitution in a basic function F [n] ({x ab , t a ,t a }), for the case quivers with n gauge nodes. The function F [n] has an elegant expression in terms of matrices X n and Λ n , whose matrix elements are Le us also define another n × n matrix, In terms of these, F [n] is the determinant The generating function Z can be obtained through the infinite product In the course of our derivation of F [n] , we find the identity where now p = n a,b=1 {p ab }. This formula is interpreted in section 4.3 in terms of the counting of words built from partially commuting open string bits. The open string word counting has previously been studied in [23] and its equivalence to the closed string word counting given.

Group integral formula to partition sums
In this section we will derive a contour integral formulation for the generating function Z. Our starting point is the group integral representation [25,26] Here x ab,α is the chemical potential for the Φ ab,α field, while t a,β,k = e iθ a,β,k is the chemical potential for a quark Q a,β,k charged under the U (1) k of the maximal torus F a,β j=1 U (1) j ⊂ U (F a,β ). Analogously,t a,γ,k = e −iθ a,γ,k is the chemical potential for an antiquarkQ a,γ,k charged under the U (1) k of F a,γ j=1 U (1) j ⊂ U (F a,γ ). Expanding the generating function gives the counting function N ({n ab,α }, {n a,β,k }, {n a,γ,k }) for specified numbers n ab,α of bifundamentals Φ ab,α , n a,β,k of quarks Q a,β,k andn a,γ,k anti-quarksQ a,γ,k : The chemical potentials for the quark/antiquark matter content can be nicely encoded in the unitary matrices T a,β = diag(t a,β,1 , t a,β,2 , ..., t a,β,F a,β ) andT a,γ = diag(t a,γ,1 ,t a,γ,2 , ...,t a,γ,Fa,γ ) respectively, so that 3) Using the shorthand notation ( a d U a ) ≡ and expanding the exponential function we get a,β }a ≡ β,i p a,β,i and {p (i) a,γ }a ≡ γ,i p γ,i . Rearranging sums and collecting like terms, we obtain We now collect powers of x ab,α , T a,β ,T a,γ denoted n ab,α , n a,β ,n a,γ , and introduce the quantities These form partitions of n ab,α , n a,β ,n a,γ , which can be interpreted as cycle lengths of permutations σ ab,α ∈ S n ab,α , σ a,β ∈ S n a,β andσ a,γ ∈ Sn a,γ respectively. These cycle structures determine conjugacy classes denoted [σ ab,α ], [σ a,β ], [σ a,γ ]. We have and similarly for p a,β and p a,γ . The second equation above gives the number of permutations with the specified cycle structure. We also use the identity which follows from Schur-Weyl duality (see e.g. [27]): here R is a partition of n and [σ] (i) is the number of cycles of length i in σ, which is a function of the conjugacy class [σ]. The Young diagrams are constrained to have no more than N rows, which is expressed as l(R) ≤ N . This encodes the constraints following from finiteness of the ranks N a . For n a ≤ N a , these constraints can be dropped, which is the origin of simplifications at large N a . Collecting powers of traces of U † a , this equation can be used to rewrite the traces in (3.5) as and similarly for the other terms. The product of the permutations over b, α, β describes an outer product of permutations acting on subsets of size n ab,α , n a,β of n a . Using these definitions, we can write  r a,β n a,β l(r a,β )≤F a,β a β χ r a,β (σ a,β )χ r a,β (T a,β ) l(ra,γ )≤Fa,γ a γ χr a,γ (σ a,γ )χr a,γ (T a,γ ) where σ ab,α , σ a,β andσ a,γ are representatives of the conjugacy classes specified by p ab,α , p a,β and p a,γ respectively. We can now cast the sums over these vectors into sums over the permutations σ ab,α ∈ S n ab,α , σ a,β ∈ S n a,β andσ a,γ ∈ Sn a,γ . We also use the symmetric group character expansion (3.11) and similarly for χ Sa (× b,α σ ba,α × γσa,γ ). In the formula above, g(∪ b,α r ab,α ∪ β r a,β ; R a ) is a Littlewood-Richardson coefficient. This is the multiplicity of the representation ⊗ b,α r a,b,α ⊗ β r a,β of the subgroup × b,α S n ab,α × β S n a,β when the representation R a of S na is decomposed into irreducibles of the product subgroup. Finally, using use the U (N ) character orthogonality χr a,γ (σ a,γ )χr a,γ (T a,γ ) . Note that we dropped the l(r a,β ) ≤ F a,β constraint on the sum over quark representations, since contributions coming from representations with l(r a,β ) > F a,β are automatically zero due to the vanishing of χ r a,β (T a,β ) (similar comments hold for the sum over antiquark representations as well). Finally, using the orthogonality of the symmetric group characters σ∈Sn χ r (σ)χ s (σ) = n!δ r,s , we get the formula (3.14) a g(∪ b,α r ab,α ∪ β r a,β ; R a ) g(∪ b,α r ba,α ∪ γra,γ ; R a ) β χ r a,β (T a,β ) γ χr a,γ (T a,γ ) .
Note that setting T a,β = t a,β 1 a,β (T a,γ =t a,γ 1 a,γ ) gives an unrefined generating function, in which we no longer distinguish quark (antiquark) states charged under different U (1) factors in the maximal torus of U (F a,β ) (U (F a,γ )). This unrefinement is immediately obtained from (3.14) through the substitutions The dim U (F ) (r) is the dimension of the representation r of U (F ).
For an F dimensional unitary matrix T with eigenvalues (t 1 , t 2 , ..., t F ) and a partition R of n, we have where n = j n j and [n j ] is the single-row totally symmetric representation of S n j . These Littlewood-Richardson multiplicities for single-row representations and a general R are called Kostka numbers [27]. Note also that the Littlewood-Richardson multiplicities satisfy [27,33] s g(r 1 , s; R)g(r 2 , r 3 ; s) = g(r 1 , r 2 , r 3 ; R) . (3.17) Using these identities, we can write the counting function N ({n ab,α }, {n a,β,k }, {n a,γ,k }) as where n a = b,α n ab,α + β,k n a,β,k . We can give a pictorial interpretation of the counting function (3.18) as follows.
i) Choose the set of integers ∪ a,b,α {n ab,α } ∪ a,β,k {n a,β,k } ∪ a,γ,k {n a,γ,k } These determine the numbers of elementary fields of various types in the composite operators under consideration.
ii) To all edges joining the gauge node a to the gauge node b, associate a representation r ab,α of the symmetric group S n ab,α .
ii) Divide each gauge node a into two components, a + and a − : the former collects all the edges coming into the node a, while the latter collects all the edges leaving the node a.
Connect a + to a − by adding a directed edge carrying a representation R a of S na , where n a = b,α n ab,α + β,k n a,β,k . The result is called split-node quiver.
iv) Take the product of all the Littlewood-Richardson coefficients obtained in the previous step and sum over all possible representations {R a } and {r ab,α }, imposing finite N constraints l(R a ) ≤ N a at each gauge node a.

The generating function Z and the building block F [n]
Let us take the large N limit, for all the gauge groups of the theory. In appendix A.1 we show that Z({x ab,α }, {T a,β }, {T a,γ }) can be written as the multiple sum where p p p = ∪ ab,α p ab,α ∪ a,β p a,β ∪ a,γ p a,γ , and the vectors p ab,α , p a,β , p a,γ are defined in (3.6). Crucially, we can now define the quantity From this equation we see that F [n] is the building block of Z. Note that the t coefficients in the RHS of (3.27) are weighted by a i −1 coefficient, while thet coefficients are not: in section 5 we will derive a more symmetric version of this formula, where the weighting for chemical potentials of the quark and antiquark field is the same. In appendix A.2 we derive an expression for F [n] in terms of contour integrals, namely and .
We also obtained a pole prescription for the computation of these contour integrals: in the appendices A and B we explain that only the z a pole coming from the I a term in the integrand has to be enclosed by C a . As a last remark, note that all the variables z a , x ab , t a ,t a in eq. (3.28) are charged under the n a=1 U (1) a ⊂ n a=1 U (N a ) subgroup of the theory as follows: The charge for the x ab coefficients comes from the fact that these variables are associated to fields leaving node a and joining node b, thus transforming under (N a , N b ) in the original theory. Similar comments holds for the charges of t a andt a , while the charge for z a has been chosen in such a way that the function F [n] is neutral under a U (1) a , as it should be.
For completeness, let us write down the contour integral formulation for Z, which can be immediately obtained from (3.26) by means of (3.27), and reads The simplification coming from using F [n] in place of the latter is evident.

The unflavoured case: contour integrals and paths on graphs
We now have to calculate the contour integral in F [n] , that is, calculate residues. In an n-node quiver, each z a variable has n poles, but not all of them have to be included in the contour C a . The constraints from the convergence of the sums in appendix A.2.2 instruct us on which poles to pick and which ones to discard. In appendix B we show that they indeed give us a very simple and intuitive prescription: for all a, only the z a pole coming from the I a integrand has to be enclosed by C a .
We consider here the case in which we set t a =t a = 0 ∀ a in (3.28), to get the quantity where Recall that I a ( z; x a ) is a shorthand, which it will now be convenient to expand: so that we can rewrite (4.1) as We want to compute contour integrals in eq. (4.4). Let us choose an ordering in which to compute such integrals: we choose the simplest one, that is we integrate over z 1 , z 2 , ..., z i , z i+1 , ..., z n in this precise order. We will refer to this ordering as the 'natural ordering'. With the pole prescription discussed in appendix B, the z a integration picks up the z a pole in the I a integrand only. Then, after the first integral (the z 1 integral with our ordering choice) has been computed, eq. (4.4) becomes where we introduced the H 1 coefficient, outcome of the residue calculation, that depends only on the x variables. After the integration has been done, z 1 is replaced by its pole equation in all of the remaining integrands I a (a > 1). The explicit form comes from solving I −1 1 ( z; x 1 ) = 0 for z 1 . In the second step, we can solve In the next step, we calculate . Generally, the explicit equation for each of the z * j (1 ≤ j ≤ n) comes from solving for z j the equation for each j. These pole equations are of the form for some coefficients a i,j , which are functions of x. It is useful however to introduce a different equation for the poles z * j . Note that z * j is a function of the set {z j+1 , z j+2 , ..., z n }. If r integrations have already been done, then the z * j pole equations, with j ≤ r, can be expressed in terms of the remaining set of z a , that is {z r+1 , z r+2 · · · , z n }. The variables z k (j ≤ k ≤ r) appearing in (4.10) can be substituted with their respective pole equations z * k . We can thus write Repeated substitutions to eliminate the variables z * k in favour of z * k , for k < k ≤ r, will lead to an expression of the form for some newâ [r] coefficients, functions of x, that we call pole coefficients. Inserting this equation in (4.11) gives a recursive relation forâ [r] i,j : There is noâ [n] coefficient, as can be seen from (4.12). We will in fact observe that z * n = 0. Comparing (4.10) and (4.12) giveŝ a [r] i,r = a i,r , i > r , (4.13b) and we will shortly derive (4.14) Now, for fixed r, all of the z * [r] j equations (1 ≤ j ≤ r) in (4.12) will be functions of the same set of z a , that is {z k , r < k ≤ n}. With this notation, after r integrations have been done, F where explicitly (4.16) Going back to eq. (4.15), suppose we want now to calculate the z r+1 integral. Consider then the equation and let us solve it for z r+1 . We have Collecting terms we get so that we can finally write Recalling the definition of the pole coefficientsâ [r] i,λ from (4.12) and substituting r → r − 1, this proves eq. (4.14). It also shows that z * n = 0, as there is no z j with j > n to sum over. Inserting this result in (4.15) we get r+1 , z r+2 , ..., z n ; x a ) , where we called, in agreement with our initial definitions, It is clear now that once all the integration have been done, F [n] 0 will simply be the product (4.23) In appendix C we present an explicit example of the application of these formulae to a three node unflavoured quiver. From the last equation we can see how the pole coefficientsâ . Choosing any 1 ≤ r < n, for all n ≥ p > r and 1 ≤ k ≤ r we find an expression which can be interpreted in terms of paths on the complete n-node quiver: 24) or, in a more compact form: with the convention that G [0] = 1. We prove this formula in appendix D. For fixed r < n we now describe the interpretation of each of the terms in the expansion of (4.25) as a path on the complete n-node quiver. Each term is a product of two different pieces. The first one is the G function of a quiver containing a certain subset  From here we also explicitly see that the pole coefficientâ [r] p,k is charged under the U (1) n subgroup of the gauge group of the quiver. Since every G [r] has zero U (1) n charge, and the product of x ab coefficients x p,i 1 x i 1 ,i 2 x i 2 ,i 3 · · · x i t−1 ,it x it,k is charged under the p-th U (1) and the k-th U (1) as (−1, 1) respectively, the whole quantityâ [r] p,k will carry a (−1, 1) charge under U (1) p × U (1) k , just like an x p,k variable would. These quantities are also helpful in writing down a recursive formula for G [r] . Note that G [r+1] can be written as The terms in the sum above are of the form (4.25), so that we can use it to bring G [r+1] into the form and after relabelling some summation variables, we can write the this equation as and since the second term on the RHS of this identity is just the t = 0 term of the following sum, we finally have We can also give a similar formula for each of the H l coefficients in the product (4.23). We know that and using F [n] We again get have terms like l,q x q,l , which have the same structure of the ones encountered in the derivation of eq. (4.29). We can just redo the same steps done previously to bring the equation for the H l ( x) coefficient into the form where in the last step we used eq. (4.29). We can then rewrite eq. (4.23) as with G [0] = 1.

F
[n] 0 and the sum over subsets In this section we will prove the expression for F where V is any subset of the set of nodes V n = {1, 2, ..., n} of the quiver but the empty set, and Sym(V) is the group of all the permutations of elements in V. C σ is the number of cycles in σ. y σ ({x ab }) is a monomial built from the x ab coefficients as where the product runs over the cycles σ (i) of the permutation σ = i σ (i) , and for a single cycle (i 1 , i 2 , · · · , i k ) For example, when σ = (12)(3), the permutation which swaps 1 and 2 and leaves 3 fixed, then This equation has thus an interpretation in terms of loops {y c } on a complete quiver, where each loop y c corresponds to a cycle c = (i 1 , · · · , i k ) as in (4.36).
Since these loops corresponds to cyclic permutations, they do not visit the same node more than once: for this reason we call them simple loops, to distinguish them from more general closed paths. In the following we will write the above formula asG [n] : To prove the identity (4.34) we will show that the sequenceG [n] obeys the same recursion relation (4.29) satisfied by the G [n] coefficients obtained from the residue computations. We haveG If the subset V of {1, · · · , n + 1} does not include n + 1, we have a sum which, together with the leading 1, gives G [n] . The remaining terms involve subsets which include the {n + 1} node. For such subsets, the permutation σ can either be of the product form σ (n + 1), where σ is a permutation of {1, · · · , n} and (n + 1) is a single cycle of length one, or alternatively it is of the form σ (i 1 , i 2 , · · · , i k , n + 1), with σ a permutation of {1, · · · , n} \ {i 1 , · · · , i k } and (i 1 , · · · , i k , n + 1) a cycle of length k + 1. The first type of term gives The second type of term gives Collecting the terms we find This proves that the guessed formulaG [ where 1 n is the n dimensional identity matrix and X n is a n × n matrix defined by The following identity for the expansion of det(1 n − X n ) in terms of sub-determinants of X n , or equivalently characters of X n associated with single-column Young diagrams, is useful: This expansion is organized according to the number of 1's picked up from the matrix (1 n −X n ) in calculating its determinant. When we pick n − k of the 1's, we have the sum of the subdeterminants constructed from blocks of size k from the matrix X n . When we pick n − k of these 1 valued entries, we have the sum of the sub-determinants constructed from blocks of size k from the matrix X n . The sign (−1) σ is the parity of the permutation. Because of the antisymmetrisation σ (−1) σ , the sum over i 1 , i 2 , ..., i k can be restricted to run over the set i 1 = i 2 = ... = i k , so that it can be rewritten as a sum over subsets V k of k different integers from {1, · · · , n}. For each choice of subset there is factor of k! for ways of assigning i 1 , · · · , i k to the elements of the subset. Hence Sym(V k ) is the symmetric group of permutations of elements in V k . Here we have used the fact that the parity of a permutation σ can be written in terms of the number of cycles as (−1) σ = (−1) k−Cσ and we also used the definition of y σ . The expression (4.34) now follows.

Word counting and the building block F
[n] 0 The generating function Z({x ab;α }) for gauge invariant operators for unflavoured quiver theories has been given as an infinite product built from a building block F This strongly suggests that there should be a combinatoric interpretation in terms of properties of graphs. We will find that there are in fact two combinatoric interpretations: both in terms of word counting related to the quiver with one directed edge for every specified start and end-point. We will call the latter the complete n-node quiver. We will refer to these two as the charge conserving open string word (COSW) counting problem and the closed string word (CSW) counting problem. It turns out that the equivalence between these two word counting problems is a known mathematical result! This gives a new connection between word counting problems and gauge theory.
To motivate the CSW interpretation, let us take the simple case of n = 2, for which we have F [2] 0 (x 11 , x 12 , x 21 , .  We describe the CSW interpretation in this simple case. Take the lettersŷ 11 ,ŷ 22 and consider arbitrary strings of these, with the condition that y 11ŷ22 =ŷ 22ŷ11 . 0 , in terms of the cycle variables y c . Consider the complete n-node quiver. To each simple closed loop c on the graph, associate a variableŷ c . If we label the nodes of the graph {1, · · · , n}, every cyclic permutation of a subset of the nodes corresponds to a simple loop on the graph. These simple loops visit each node no more than once. To define the CSWs, we associate a letter toŷ c to every simple loop. We impose the relation y cŷc =ŷ c ŷ c This leads directly to the open string word counting. Consider lettersx ab corresponding to each directed edge, going from a to b in the complete n-node quiver. We will call these open string bits. Then consider words which are sequences of these letters. These words will be called open string words. We impose the commutation condition an open string word will take the form The open string bits with different starting points commute, so we have used that commutativity to place all the ones starting at 1 to the far left, the ones starting from 2 next, and so on. The integers a 1 , · · · , a i p i will contain p 1 copies of 1, p 2 copies of 2 etc. This condition says that the sequence of open string bits that appear in the expansion of F We refer the reader to [23] for the formal proof. Here we explain, with examples, the meaning of this equivalence between the counting of charge-conserving open string words (COSW) and closed string words (CSW). Given an a CSW, it is easy to write down a corresponding COSW. Take for exampleŷ 11ŷ12ŷ11ŷ22ŷ123 =ŷ 11ŷ12ŷ22ŷ11ŷ123 . The word of interest becomeŝ We have used the commutativity to arrange as in (4.60). A CSW determines in this way a unique COSW. The reverse is also true. A COSW determines a unique CSW. The general proof is nontrivial [23]. We just illustrate with some examples here. Consider some COSW with specified numbers of starting (and end-) points of particular types, say three starting and ending at 1, two at 2 and three at 3. These words are of the form (4.64) Here τ is a permutation in S 8 , which should be thought of as moving the integers {1, 2, 3} from their initial positions (1, 1, 1, 2, 2, 3, 3, 3) to a new position. When τ is the identity we have the COSŴ x 11x11x11x22x22x33x33x33 =ŷ 11ŷ11ŷ11ŷ22ŷ22ŷ33ŷ33ŷ33 . If we map this to closed string words, this will involve two copies ofŷ 11 , two copies ofŷ 33 , and y 132 =x 13x32x21 . The unique CSW iŝ In arriving at this, we did a re-arrangement which moves thex 32 across thex 22 . This is allowed, since the open string bits commute when they have different strating point. i.e. different first index. The reader is encouraged to play with different choices of τ . It is easy to see that permutations τ in S 8 are a somewhat redundant way to parametrize the COSW. In fact it is a coset of S 8 by S 3 × S 2 × S 3 that parametrizes the COSW. For any choice of τ , there is always a CSW, i.e a list ofŷ c for different cycles, arranged in a specific order (modulo the commutation relations (4.54)), which agrees with the COSW after re-arrangements allowed by the commutation (4.57). This is guaranteed by theorem 3.5 of [23]. We have focused on the combinatoric interpretation of F [n] 0 ({x ab }), in terms of the complete quiver graph. This basic building block generates the counting of gauge invariants at large N for any quiver, after taking an infinite product with the substitutions in (2.2). If we are interested in a quiver where there is no edge going from a to b, these substitutions involve setting x ab → 0 for that pair of nodes. It is instructive to consider the quantity which is not an infinite product, but knows about the connectivity of any chosen quiver graph, with general multiplicities (possibly zero) between any specified start and end-node. This quantity has an interpretation in terms of word counting of open string words, as it follows immediately from (4.55): 0 ({x ab }), is that it highlights an interesting analogy with a deformation of the counting problems considered here. We have focused on the counting of all holomorphic invariants made from chiral fields in an N = 1 theory. In many of the N = 1 theories of interest in AdS/CFT, the general holomorphic invariants form the chiral ring in the limit of zero superpotential, but beyond that, one wants to impose super-potential relations. In these cases, the counting of chiral gauge invariant operators leads to the N -fold symmetric product of the ring of functions on non-compact Calabi-Yau spaces [36]. In the large N limit, the plethystic exponential gives the counting in terms of the counting at N = 1. The N = 1 counting is a simple building block of the large N counting. It has a physical interpretation as the ring of functions on the CY and the plethystic exponential has an interpreation in terms of the bosonic statistics of many identical branes.
The procedure of taking an infinite product and making substitutions, that we have developed for the N → ∞ counting at zero superpotential, can be viewed as an analog of the plethystic exponential. In this analogy the function F 0 ({x ab }) corresponds to the U (1) counting, which is the same as counting holomorphic functions on a CY. The counting problems we have solved also correspond to some large N geometries: namely the spaces of multiple matrices, subject to gauge invariance constraints. There is no symmetric product structure in this geometry, but there is nevertheless a simple analog of the plethystic exponential. There is no physical interpretation of F 0 ({x ab }) as a gauge theory partition function, but there is nevertheless an interpretation in terms of string word counting partially commuting string letters. A deeper understanding and interpretation of these analogies will undoubtedly be fascinating.

The flavoured case: from contour integrals to a determinant expression
We now turn to the full picture, that is we allow for quarks and antiquarks. Take then eq. (3.28): where I a ( z; x a , t a ,t a ) = exp (z a t a ) Again we have to compute residues. First of all note that the numerator of (5.2) is regular in z a , so that the only poles may come from its denominator. We can simplify the next steps by using a trick: let us renamet a ≡ x 0,a and multiply it by a dummy variable, z 0 . Pictorially, this would consist of taking all the open (fundamental matter) edges in the quiver and joining them to a fictitious node, that we call '0 node'. For consistency, let us also rename t a ≡ x a,0 . Using this notation we can rewrite eq. (5.2) as where it is understood that z 0 will be set to 1 after the z i (1 ≤ i ≤ n) integrals have been done. This means that the intermediate expressions arising from successive integrations will take the same form as in the unflavoured case of Section 4. In particular the pole prescription still holds unaltered. With this formalism, eq. (4.12) becomes and correspondingly eq. (4.19) gets modified as We can then proceed in the exact same fashion as in section 4. The only manifestly different piece in the integrand are the numerators of (5.3). To highlight the similarity to the unflavoured case, we writẽ r , z r+1 , z r+2 , ..., z n ; x a ) exp(z a x a,0 ) , where in exact analogy with (4.22) Again, we see that the only addition in comparison to the unflavoured case is the product over the exponential functions. After the n integrations have been done, using the definition in eq. (5.4), we have i,k ≡ z 0â We can then say that F is the product where x p,0 = t p and x 0,p =t p . As expected, by setting all the fundamental matter field chemical potentials to zero we return to the unflavoured case. In Appendix F we show that the numerator of this formula has the form exp n j=1â [n] 0,j t j = exp n p,q=1 where M p,q is the (p, q) minor 1 of the matrix (1 n − X n ). We can then write A second expression for the same quantity was also given in Appendix F, and it reads where we used Einstein summation on p, q, and ∂ p,q = ∂ ∂xpq .
Note that, as in the unflavoured case, we can write F [n] as a determinant of a suitable matrix, which encodes all the information of the quiver under study. Since if we introduce the n × n matrices χ n and Λ n , defined by  The generating function Z is obtained from F using eq. (3.27). However, from e.g. eq. (5.20) we see that t a ,t b always appear pairwise, so that we can rewrite (3.27) in the more symmetric form already anticipated in eq. (2.9), that is This is the final expression for our large N generating function.

Some examples
We will now present some simple applications of our counting formulae, for the large N limit.

One node quiver
Rewriting the chemical potentials of the fields as x 11 → x, t 1 → t,t 1 →t, we have so that The large N generating function is then For the SQCD model, described by the quiver (1 − t jtk ) −1 , (6.5) where we used T = diag(t 1 , t 2 , ..., t F ) ,T = diag(t 1 ,t 2 , ...,tF ) . (6.6) Note that if in the last example we do not distinguish the U (1) ⊂ U (F ) charges of the quarks and the U (1) ⊂ U (F ) charges of the antiquarks, that is we set T = t 1 F andT =t 1F , we get which was already derived in [37], using different counting methods. An interesting gauge theory can be obtained by adding fundamental matter to N = 4 SYM [18,19]. This operation breaks half of the supersymmetries leaving an N = 2 theory, which in turn we can describe with the N = 1 quiver [38] in figure 7 The N = 2 theory has a vector multiplet V (1 complex scalar φ) and an hypermultiplet H (two complex scalars H 1 , H 2 ) both in the adjoint of U (N ). A second hypermultiplet Q is in the bifundamental U (N ) × U (F ), where U (F ) is a global (non-dynamical) flavour symmetry (two complex scalars Q,Q, transforming in opposite way under the symmetry group). The large N generating function for this quiver, that we denote by Z N =2 (x 1 , x 2 , x 3 , T ,T ), is given by The first terms in the expansion of the unrefined Let us now check explicitly the validity of our generating function for some of these coefficients, in the large N limit. Let us start off by considering just one quark/antiquark pair and one adjoint scalar, say H 1 . The Gauge Invariant Operators (GIOs) we can build out of these fields are where upper and lower indices belong to the fundamental and antifundamental of U (F ) and U (F ) respectively, and round brackets denote U (N ) indices contraction. The total number of GIOs for this given configuration is 2F 2 . We see that this value is the same one of the coefficient ttx 1 , so that we have a first test of the validity of (6.9). Consider now the situation in which we only have two pairs of quarks/antiquarks. The only GIOs we can form are of the form (QQ) k 1 l 1 (QQ) k 2 l 2 , (6.11) using the same convention of the example above for the flavour and gauge indices. This is just a product of two matrix elements of the same F dimensional matrix (QQ). The total number of inequivalent GIOs is then 1 2 F 2 (1 + F 2 ): once again this is the same coefficient of the term (tt) 2 in (6.9). As a last example, suppose added to the last configuration a single field φ. The GIOs we can form would then be The one on the left consists brings a total of F 2 2 (1 + F 2 ) GIOs, while the one on the right adds another F 2 GIOs to the final quantity, which then reads In agreement with the coefficient of (tt) 2 x 1 in (6.9).

Two node quiver
We now present some two-node quiver examples. From the definitions in (2.6) we can immediately write and so that, from (2.8): Finally, recalling (2.9), we can get the large N generating function from F [2] by mapping Tr(T i k,γ ) , k = 1, 2 , (6.17b) and by taking the product over i from 1 to ∞. The most famous two-node quiver is Klebanov and Witten's conifold gauge theory, consisting of the gauge group U (N ) × U (N ) and four bifundamental fields: two of them, A 1 and A 2 , in the representation (¯ , ) and the remaining two, B 1 and B 2 , in the representation ( ,¯ ) of the gauge group. Here we consider the deformation of such a model obtained by allowing flavour symmetries, which is sometimes called 'flavoured conifold' [21,22,34,35]  We now choose a different notation for the chemical potentials of the fields, to accord to more standard conventions: The first terms in the power expansion of ZFlavoured Conifold (a 1 , a 2 , b 1 , b 2 , q 1 , q 2 ,q 1 ,q 2 ) in the large N limit then read The del Pezzo dP 0 gauge theory (obtained from D3 branes on C 3 /Z 3 orbifold singularities [39]) contains nine bifundamental fields charged under the U (N 1 ) × U (N 2 ) × U (N 3 ) gauge group as represented in the following quiver, in which we also added flavour symmetry: Figure 9: Flavoured dP 0 gauge theory.
We refer to this theory as the flavoured dP 0 theory. Using the convention for the chemical potentials of the fields x 12,2 → a 2 , x 12,3 → a 3 , T 1,1 → q 1 ,T 1,1 →q 1 , we can write the generating function for the flavoured dP 0 theory in the large N limit as:

Summary and outlook
In this paper, we have revisited the counting of local holomorphic operators in general quiver gauge theories with bi-fundamental fields, which was started in [1] (see also related recent work [40]), focusing on the infinite product formula obtained for the limit of large N . This was extended to flavoured quivers, which include fundamental matter. 0 ({x ab }). The determinant and cofactors of the matrix (1 n − X n ) played a prominent role in these formulae. We also obtained results for the counting of local operators at finite N in terms of Young diagrams and Littlewood-Richardson coefficients.
The permutation group-theoretic counting of operators at finite N is the first step in the construction of an orthogonal basis of operators for an inner product related to two-point functions between holomorphic and anti-holomorphic operators in free field theory [1]. The next step is the computation of three and higher point functions in the free theory. The orthogonal bases were found to be given by simple rules involving Young diagrams and related group theoretic multiplicities attached to the quiver diagram itself. Three-point functions were given by cutting and gluing of the diagrams. The counting and the construction of the orthogonal bases were given in terms of two-dimensional topological field theories (TFT2) of Dijkgraaf-Witten type, based on permutations and equipped with appropriate defects. Given the close similarity we have found between the counting formulae for flavoured and unflavoured quivers, we expect that the results on orthogonal bases, correlators and TFT2 [1] will also have simple generalizations from unflavoured quivers to flavoured quivers. An interesting avenue would be to explore the links between this permutation group TFT2 approach to correlators with methods based on integrable models (see e.g [41,42]).
The flavoured counting at large N is determined by F [n] , which is closely related to F [n] 0 , which in turn we have related to word counting problems associated to the complete n-node quiver. One formulation of the word counting problem was in terms of words made from letters corresponding to simple closed loops on the quiver. The letters do not commute if they share a node, otherwise they commute. In another formulation, the letters correspond to edges of the quiver. Distinct letters do not commute if they share a starting point. These open string bits form words, a subset of which obey a charge conservation condition. A nontrivial combinatoric equivalence between the open string and closed string counting problems is given by the Cartier-Foata theorem. In this paper, we have come across these string-wordcounting problems in connection with the counting formula for gauge invariants. It is natural to ask if such words, and their monoidal structure, are relevant beyond the counting of gauge theory invariants. One often finds that mathematical structures relevant to counting a class of objects are also relevant in the understanding of the interactions of such objects (see e.g. [33,43] for a concrete application of this idea). Do the string-words found here play a role in interactions, namely in the computation of correlators of gauge-invariant operators in the free field limit and at weak coupling? Since the work of Cartier-Foata has subsequently been related to statistical physics models [31,44], this underlying mathematical structure could reveal new connections between four dimensional gauge theory and statistical physics.
In the context of AdS/CFT, comparisons between the counting of a class of local gaugeinvariant operators and the spectrum of brane fluctuations was initiated in [18,19,20]. These papers considered the simplest quiver gauge theory, namely N = 4 SYM, and the additional fundamental matter corresponds to the addition of 7-branes in the dual AdS 5 ×S 5 background. The results presented here should be useful for generalizations of these results, such as increasing the number of 7-branes, and more substantially, going beyond the N = 4 SYM as starting point to more general quiver theories. The finite N aspects of counting, where operators are labelled by Young diagrams, should be related to giant gravitons. This will require the investigation of 3-brane giant gravitons in AdS 5 × S 5 , in the presence of the probe 7-branes. Some discussion of such configurations is initiated in the conclusions of [45]. Such detailed comparisons for the general class of flavoured quiver theories we considered here would undoubtedly deepen our understanding of AdS/CFT.
In this paper we have counted general holomorphic gauge invariant operators in quiver theories with fundamental matter. These also form the space of chiral operators in the theory in the absence of a superpotential. When we turn on a superpotential, equivalence classes related by setting to zero the derivatives of the super-potential, form the chiral ring [46,47]. This jump in the spectrum of chiral primaries has been discussed in the context of AdS/CFT in [48]. An important future direction is to understand this jump in quantitative detail. We have found that the quiver diagram defining a theory contains powerful information on the counting of operators in the theory, and the weighted adjacency matrix played a key role in giving a general form for the generating functions at large N . It would be interesting to look for analogous general formulae, involving the weighted adjacency matrix, along with the superpotential data, for the case of chiral rings at non-zero superpotential. In a similar vein we may ask if indices in superconformal theories, for general quivers, can be expressed in terms of the weighted adjacency matrix. It will be interesting to investigate this theme in existing examples of index computations for quivers (e.g. [49,50,51]). Beyond counting questions, the transition to non-zero superpotential poses the question of the exact form of BPS operators. In cases where the 1-loop dilatation operator is known, such as N = 4 SYM, we can find the BPS operators by solving for the null eigenstates among the holomorphic operators. Partial results at large N as well as finite N , building on the knowledge of free field bases of operators, are available in [7,8,33,43,52,53,54,55]. A similar treatment should be possible for orbifolds of N = 4. The counting of chiral operators with and without superpotential is of interest in studying the Hilbert series of moduli spaces arising from super-symmetric gauge-theories [37,56,57]. These moduli spaces often have an interpretation in terms of branes. Quiver gauge theories, with and without fundamental matter, have been studied in this context. The formulae obtained here, for finite N as well as large N , will be expected to have applications in the study of these moduli spaces. Another potential application of the present counting techniques is in the thermodynamics of AdS/CFT or toy models thereof, e.g. [58].

A Generating function A.1 Derivation of the generating function
In this appendix we will derive eq. (3.25). Our starting point will be eq. (3.14): in which we will take the large N limit, in such a way that we will be allowed to drop the constraints on the sums over R a . The derivation will involve well known symmetric group identities. In particular, we will use the equation where R is a partition of n, [σ] (i) is the number of cycles of length i in the conjugacy class [σ] of the permutation σ ∈ S n and Tr(U ) is the trace taken in the fundamental representation of U (F ). We will also use the formulae and g(∪ a r a ; R) = a σa Here r a are partitions of n a and δ(σ) is the symmetric group delta function, which equals one iff σ is the identity permutation. With these relations we can rewrite Z in (A.1) as where we defined σ = ∪ a,b,α {σ ab,α } ∪ a,β {σ a,β } ∪ a,γ {σ a,γ } , σ ab,α ∈ S n ab,α , σ a,β ∈ S n a,β ,σ a,γ ∈ Sn a,γ , (A.4) and similarly Summing over the representations R a , r ab,α , r a,β ,r a,γ then gives, using (A.2b) ρ ab,α ∈ S n ab,α , ρ a,β ∈ S n a,β ,ρ a,γ ∈ Sn a,γ . (A.7) If we now sum over the σ permutations we get, redefining the dummy Γ a permutations as Γ a → (× b,α ρ ba,α × γρa,γ ) Γ a (× b,α 1 × β ρ a,β ) −1 : Finally, by summing over the now trivial ρ permutations we obtain where we defined and similarly for p a,β and p a,γ . For notational purposes, it will be convenient to introduce the compact shorthand p p p = ∪ ab,α p ab,α ∪ a,β p a,β ∪ a,γ p a,γ . With this notation we can rewrite (A.9) as where now H a ({ p ab,α }, { p a,β }, { p a,γ }; {T a,β }, {T a,γ }) reads, after summing over the Γ a permutations a,γ ! .
which is eq. where now p ≡ ∪ a,b {p ab } ∪ a {p a ,p a }, we can immediately obtain the generating function Z (A.14) through the relation 16) In fact, the RHS of (A.16) reads and through the identity a,γ }. Summing over p gives, exploiting the second, third and fourth Kronecker deltas in the expression above where in the second equality we used p p p ≡ ∪ ab,α p ab,α ∪ a,β p a,β ∪ a,γ p a,γ and the third one follows from (A.14). We can now appreciate how every property of Z is determined by the F [n] function, which will play the role of fundamental building block of the generating function. In the following we will then focus mainly on the latter, which will improve the clarity of the exposition: the generating function Z can be obtained at any time through the relation (A.16).

A.2 A contour integral formulation for F [n]
All of the Kronecker deltas δ a in eq. (A.15) ensure that, at each node a in the quiver, there are as many fields flowing in as there are flowing out, ensuring the balance of the incoming and outgoing edge variables p ab , p a ,p a . Using the contour integral resolution of the Kronecker delta where C is a closed path that encloses the origin, we can write a contour integral formulation for F [n] , and thus for Z. Let us then use (A.21) in (A.15), to get 22) or, conveniently rearranging the integrands above, Summing over the p a s gives the exponentials pa (z a t a ) pa p a ! = exp (z a t a ) , (A. 24) while it is a little bit trickier to sum over thep a s. Using the identity where (a) n = a(a + 1) · · · (a + n − 1) is the Pochhammer symbol, we can rewrite (A.23) as where we also used (A.24). In the following section A.2.1 we show that where again we impose the absolute convergence of all the sums on the LHS, for the same reason just discussed. Eq. (A.28) has now become .

(A.30)
We can rewrite the latter equation more compactly as Let us then prove the simpler identity Similarly, the condition for absolute convergence (A.40) becomes (A.43) We will prove (A.41) twice, starting from its right hand side, by choosing two different ways of factorising the ratio In the first one we will factor out the term (1 − y)/(1 − z a ) and in the second one the term ). We will then expand in power series the remaining part of each expression, to obtain two different power expansions. The upshot is that we will obtain two different sets of constraints for the convergence of the power series. Both sets of constraints will hold in the region of absolute convergence (A.40), and they will determine the pole prescription for the contour integrals in (3.28).

First factorisation
We start from the RHS of eq. (A.41). We are going to factor out the term (1 − y)/(1 − z a ) and expand in a power series the remaining part of the expression. Let us then write 45) and let us expand the second factor on the RHS above to get with the constraint We now rewrite eq. (A.46) as 48) in order to expand the two terms y + b =a z b n and (1 − z a ) −(n+1) separately. For the first one we get while for the second one, using eq. (A.38), we obtain Eq. (A.53) is exactly eq. (A.41), which becomes our initial proposition (A.39) through the substitutions (A.42). In the steps presented above, we got three constraints: The first one becomes, through the substitutions (A.42), which we can also write as the set We stress that the set of ∪ a {z a } that satisfy the latter constraint includes the region of absolute convergence U a.c ⊂ C n . In this region U a.c , the exchanges of orders of summation we performed earlier are valid by the Fubini's theorem.

Second factorisation
We will now show (A.39) in a different way, again starting from the RHS of eq. (A.41). This time we factor out the term (1 − y)/(1 − (y + b =c z b )), to expand in a power series the remaining part of the expression. Let us then begin by writing 1 − y Now we expand the second term in the line above in power series, to get Then we expand the rational part of the RHS in power series, rearranging the order of the sums in such a way that the sum over k acts first, to get together with the constraint (coming from the first equality) Using eq. (A.62) in (A.61) we get where we again rearranged the order of the sums to let the sum over n act first. Now this equation is identical to eq. (A.51), and we know that if we impose the constraint |y| < 1 (A.65) (A.64) is enough to prove (A.39). Our initial proposition is again proven.
In the derivation we got, among others, the constraint The same quantity can also be described in terms of the set k − c,a , defined as This constraint has to be interpreted in the same manner as the one in (A.57): k − c,a includes the region U a.c that makes (A.41) absolutely convergent.
Fixing node a, the derivation above holds for any c = a. This means that we can obtain constraints like the one in (A.66) for all the nodes c = a of the quiver, that we can impose all at the same time. We can then define the quantity Just like K + a (eq. (A.57)), this constraint will be of central importance when we will compute the integrals in (3.28): the set K a , defined as will in fact determine which poles are to be included by the contour C a .

B Residues and constraints
In this appendix we will present the rule for including/excluding poles when calculating the contour integrals in eq. (3.28), that is We recall that the integrands I a are defined by The prescription is that we have to pick only the z a pole coming from the I a factor in the integrand of (B.1), for each a. Let us show how this rule arises. If the quiver under study has n nodes, each I a will have n poles, one for each z variable. Explicitly From appendix A.2.2 we know however that we have to restrict to the set of ∪ a {z a } that belongs to the intersection of the set (A.70) with the set of ∪ a {z a } satisfying the condition of absolute convergence (A.40): In the same appendix, we also argued that the former constraint (B.4) includes the latter (B.5): this means that if we impose (B.5), then (B.4) is also valid. But this is telling us that for any I a we only have to pick up the pole relative to the z a variable, and discard all the others. However this is a prescription which holds only before we perform any integration: after we do so, the poles for each of the remaining z variables will have a different equation. This problem is anyway easily overcome: the constraint in (B.4) comes from the sums in (A.28) that contribute to the I a piece of the integrand (B.1) alone. So in principle we could have chosen any a in (A.28), performed the sums over ∪ b p ba only, got the I a term together with the constraint above, inferred from the previous discussion that only the z a pole has to be picked up and finally compute the z a integration (all the other z a appearing in (A.28) are regular and have no pole). Let us then imagine to be in such a situation, and for concreteness say that we have chosen to integrate over z 1 . After the z 1 integration has been done, we are left with n − 1 sums (n being the number of nodes in the quiver) of the form already discussed in appendix A.2.2, that is where the last equality follows from noticing that the b and c labels in the products and sums run over the same set of variables. Now multiplying the far right hand side of the above equation by b>1 we get, exploiting the support of the delta function The quantity inside the square bracket is of the form ∞ k1,k2=0 so that we eventually have, relabelling for the LHS of eq. (B.8).
Consider now the RHS of the same formula: it reads Equating the right hand sides of the last two equations we then get Using the substitutions in (B.9) and defining the new quantityx ba ≡ x ba +x ba we immediately obtain This is exactly the equation in (A.39) with the substitution x ba →x ba and the removal of the first node. We have already proven such an equality in appendix A.2.2, where we have also obtained the set of constraints in (B.4). This means that the constraints coming from the convergence of the sums on the LHS of (B.21) can be described by the intersection of the set with the region in C n−1 parametrized by {z 2 , · · · , z n } satisfying the absolute convergence condition b>1 ∞ p ba =0 b>1 We stress once again that the former includes the latter. Such an intersection gives us a prescription on which poles to include/exclude after one integration has been done: in complete analogy to the situation discussed at the beginning of this section, we find that only the z a pole coming from the I a term in the integrand of (B.1) has to be picked up, ∀a = 1. The steps presented here are trivially generalisable, and they can be redone in the exact same way integration after integration. We can then say that, at any level of integration, only the z a pole in the I a factor has to be enclosed by C a in (B.1). This is our pole prescription to perform integrals.

C Three node unflavoured quiver example
In this section we will provide an explicit example of application of the formulae presented in section 4 to the three node unflavoured case. Let us start by writing z * 1 , z * 2 and z * 3 . According to eq. (4.9), the equation for z * 1 (z 2 , z 3 ; x) is obtained by solving for z 1 the equation From (4.10) we then have We now turn to z * 2 (z 3 ; x), which is obtained by solving for z 2 the equation so that We can now write down the pole coefficientŝ a [r] i,p , which we will need in computing F [3] 0 . Following the definition given in (4.13), we havê a [1] i,p = a i,p + 1 λ=p+1 a [1] i,λ a λ,p = a i,p , (C.8) andâ [2] i,p = a i,p + 2 λ=p+1 a [2] i,λ a λ,p = i,2 a 2,1 = a i,1 + a i,2 a 2,1 if p = 1 Using eqs. (C.3) and (C.6), and noting that we can also writê a [2] i,p = By using eq. (4.12), i,j , 1 ≤ j ≤ r , (C. 12) we then obtain , (C. 13) and similarly , (C.14) i,2 = z 3 Finally, we can compute F [3] 0 using formula (4.23). We have Using the equations for a 2,1 and a 3,1 defined in (C.3) and a 3,2 defined in (C.6), we get which concludes our computation.

C.1 Permutation formula
Let us now give an example of the application of formula (4.34) in this simple case of a three node unflavoured quiver. We have already computed the correct answer F [3] 0 in the previous section, so we can explicitly check that (4.34) indeed reproduces the correct result. Let us call the three nodes of the quiver simply 1, 2 and 3. We can immediately write the simple loops y σ (i) ({x ab }) using eq. (4.36): (C.18) From these quantities we can construct y σ ({x ab }), for every σ, by using the definition in eq. (4.35): For example, if we had σ = (12)(3), then the power 2 in the −1 comes from the fact that σ = (12)(3) = −x 1,1 x 2,2 x 3,3 + x 1,2 x 2,1 x 3,3 + x 1,3 x 3,1 x 2,2 Summing all of the terms above we get in perfect agreement with (C.17).

C.2 Determinant formula
To conclude this section we now calculate F [3] 0 yet another time, using the determinant formula: This is the simplest way to calculate F [3] 0 . Since x 11 x 12 x 13 x 21 x 22 x 23 and so we immediately get This is the same result we obtained using other computational methods earlier in this section.

D An equation for the pole coefficients in term of paths
In this section we will prove eq. (4.25): In the case q = r this identity becomes particularly easy to prove, so let us start with this one.
so that we can write eq. (D.2) as Using the last equation we can prove eq. (D.1), for the q = r case, by induction. The identity is trivial for 1 point: it just reads for any i > 1, and since i,1 = a i,1 = The next step is just a relabelling of the summation variables: first relabel λ → i t+1 and then t → t = t + 1 to get (dropping the prime symbol on t) This indeed shows that (D.11) and (D.12) do contain the same set of equations. More precisely, since eq. (D. 16) does not depend on a particular σ, we see that the order in which we compute integrals does not matter: after r integrations, whatever the order, the pole equations will be described by (D.11). Eq. (D. 16 in which the last equality follows from (4.14): with the ordering [r] q , z q is in fact the last variable to be integrated over, so that it plays the role of the starting point (4.13b) in the recursion relation (4.13a). We are therefore in the same configuration discussed at the beginning of this section, where the right lower index ofâ corresponds to the last one in the ordering [r] q : we can therefore redo the steps (D. Eq. (D.1) is then proved.

E The building block F
[n] 0 and closed string word counting: Examples Let us consider the 2-node case. We will verify that the coefficients in the expansion of F [2] 0 count words made from letters corresponding to simple loops in the 2-node quiver, with one edge for every specified start and end point. Thus there are lettersŷ 1 ,ŷ 2 ,ŷ 12 . We require that letters corresponding to loops which do not share a node commute. Thus we here havê y 1ŷ2 =ŷ 2ŷ1 . It is useful to define . (E.2) Expanding this we get and defining N 1 = n 1 + k 1 and N 2 = n 2 + k 2 we can write Finally, using the identity The coefficient counts the number of words made from lettersŷ 1 ,ŷ 2 ,ŷ 12 , with the condition thatŷ 1ŷ2 =ŷ 2ŷ1 . The words containing m copies ofŷ 12 can be built, by writing theŷ 12 letters out in a line, with spaces between them, and then inserting the N 1ŷ1 letters in any of the m + 1 slots. Now build a sequence of N 1 numbers, recording which slot the firstŷ 1 goes into, which the second goes into and so on. Each number in the sequence is something between 1 and m+1. Each such sequence can be mapped to a state e a 1 ⊗e a 2 . . . ...e a N 1 . Sequences related by the symmetrization procedure of shuffling around the N 1 factors correspond to same word, because what matters is what goes in the m + 1 slots, not the order in which the N 1 copies of x 11 were put there. Thus the sequences are in one-one correspondence with a basis for the symmetric tensors Sym(V ⊗N 1 m+1 ). The dimension of this space is precisely Then we can insert theŷ 2 in the m + 1 slots and we get the other factor. This proves that, in the 2-node case, the words in the language we defined are counted by the F [2] 0 -function. Let us now turn to the three node case. Let us define In this case (p 1 + p 2 + · · · + p 5 )! p 1 !p 2 !p 3 !p 4 !p 5 ! × ∞ l 1 ,l 2 ,l 3 =0 (p 1 + p 2 + p 4 + p 5 ) l 1 l 1 ! (p 1 + p 3 + p 4 + p 5 ) l 2 l 2 ! (p 2 + p 3 + p 4 + p 5 ) l 3 l 3 ! y l 1 1 y l 2 2 y l 3 3 = ∞ n 1 ,n 2 ,n 3 =0 ∞ p 1 ,··· ,p 5 =0 y n 1 1 y n 2 2 y n 3 3 y p 1 12 y p 2 13 y p 3 23 y p 4 123 y p 5
Finally we use the identity (E.5) above three times, to get y n 1 1 y n 2 2 y n 3 3 y p 1 12 y p 2 13 y p 3 23 y p 4 123 y p 5
For the closed string words in this case, there are lettersŷ i ,ŷ ij ,ŷ ijk . The five lettersŷ 12 ,ŷ 13 ,ŷ 23 , y 123 ,ŷ 132 do not commute with each other.ŷ 1 ,ŷ 2 ,ŷ 3 commute with each other.ŷ 1 commutes withŷ 23 .ŷ 2 commutes withŷ 13 , andŷ 3 commutes withŷ 12 . We can build an arbitrary word by first fixing the numbers p 1 , p 2 , ..., p 5 of the letters from the set {ŷ ij ,ŷ ijk }. Then choose an order of these. The first multinomial factor (p 1 + · · · + p 5 )! p 1 ! · · · p 5 ! (E.11) gives the number of choices of this order. For each fixed order of these, we can insert theŷ i . Consider the insertion of theŷ 1 and choose the number n 1 of them. We have (p 1 +p 2 +p 4 +p 5 +1) slots which specify where, relative toŷ 12 ,ŷ 13 ,ŷ 123 ,ŷ 132 , we are inserting these. As in the 2-node case, this is the dimension of Sym n 1 (V p 1 +p 2 +p 4 +p 5 +1 ) which is given by p 1 + p 2 + p 4 + p 5 + n 1 n 1 . (E.12) The position relative toŷ 23 is immaterial in the word counting becauseŷ 1 commutes with this. Hence p 3 does not appear in the above formula. In the same way, the insertion of thê y 2 andŷ 3 account for the additional binomial factors. Since theŷ i commute with each other, the insertion of theŷ 2 is insensitive to the previous insertion of theŷ 1 . Likewise the insertion of theŷ 3 is insensitive to the positions of theŷ 1 ,ŷ 2 . Hence the word counting for specified p 1 , · · · , p 5 , n 1 , n 2 , n 3 has separate factors corresponding to insertions ofŷ 1 ,ŷ 2 ,ŷ 3 among the mutually non-commuting set {ŷ ij ,ŷ ijk }. These examples illustrate the general fact that the function F 0 (x ab ) counts words made from letters corresponding to simple loops in the complete n-node quiver, with the condition that letters corresponding to loops without a shared node commute.

F Deriving the flavoured F [n] function
In this section we will prove eq. (5.16): (F.1) We will start from eq. (5.13): We already know that the denominatorof (F.2) is so that we only need to work on its numerator, which is the exponentiation of the sum n k=1â [n] 0,k t k . As we did in section 5, let us now sett p = x 0,p and t p = x p,0 . We can multiply and divide (F.3) by G [n] to get  . (F.20) Furthermore, considering the chain of equalities (−1) p+q M p,q det(1 n − X n ) = − 1 det(1 n − X n ) ∂ p,q det(1 n − X n ) = ∂ p,q log 1 det(1 n − X n ) (F. 21) we finally get to The latter is exactly (5.15).