BPS Partition Functions for S-folds

We derive a formula for the BPS partition functions of arbitrary S-fold theories. We first generalize the known result for the ${\cal N}=4$ $U(N)$ supersymmetric Yang-Mills theory to $SO$ and $Sp$ theories, and then we extend the formula to ${\cal N}=3$ theories. We confirm that the results for rank $1$ and $2$ are consistent to the supersymmetry enhancement from ${\cal N}=3$ to ${\cal N}=4$. We also derive the same formula from the quantization of D3-branes in $\boldsymbol{S}^5/\mathbb{Z}_k$.


Introduction
Four-dimensional superconformal field theories (SCFT) have been studied for many years. We have learned a lot especially in N = 1, 2, and 4 cases. However, N = 3 theories are not well understood. This is because genuine N = 3 theories, which do not have hidden N = 4 supersymmetry, have no Lagrangian description and realized only at the strong coupling regime.
In recent years, some progress has been made toward understanding of the theories. Aharony and Evtikhiev [1] derived some universal properties of N = 3 theories from arguments based on the N = 3 superconformal algebra. In particular, they showed that genuine N = 3 theories cannot have marginal deformations. See also [2] for more comprehensive analysis of marginal deformations. The absence of marginal deformations is consistent to the well-known fact that the only N = 3 free field multiplet is the vector multiplet, which is after the CPT completion equivalent to the N = 4 vector multiplet. Therefore, a construction of a genuine N = 3 theory is necessarily non-perturbative.
A class of N = 3 theories were constructed in [3] as the theories on D3branes in S-fold backgrounds. (See also [4] for a construction of related supergravity backgrounds.) S-folds are generalization of the orientifold. From the viewpoint of F-theory, the orientifold with 3 + 1 dimensional fixed plane (O3-plane) is a Z 2 orbifold accompanied by the rotation of the toric fiber by angle π. If the modulus τ of the toric fiber takes one of the special values τ = exp(2πi/k) (k = 3, 4, 6), we can define the S-fold as the Z k orbifold of the spacetime accompanied by the 2π/k rotation of the toric fiber. This leaves 24 supersymmetries unbroken, and if we put D3-branes parallel to the fixed plane, a four-dimensional N = 3 theory is realized on the worldvolume. We call them S-fold theories.
An S-fold theory is specified by the order k of the S-fold group Z k , the rank N, which is the number of D3-branes, and, in addition, an integer p associated with the discrete torsion of the NS-NS and the R-R three-form fluxes [3,5,6,7]. We denote the theory by S(k, N, p).
Because S-fold theories are defined by using the brane construction, it is natural to analyze them with the AdS/CFT correspondence [8]. For the N = 4 SU(N) supersymmetric Yang-Mills theory (SYM) it was first pointed out in [9] that there is a one-to-one correspondence between BPS operators in the SYM and Kaluza-Klein (KK) modes in AdS 5 ×S 5 [10,11], and the agreement of the superconformal indices and the BPS partition functions calculated on the two sides of the duality were demonstrated in [12]. For S-folds, the gravity background is replaced by AdS 5 × S 5 /Z k , and the superconformal index in the large N limit was obtained by a simple Z k projection in [7].
A relation between wrapped branes around non-trivial cycles in S 5 /Z k and gauge invariant operators was also discussed in [6,7].
In this paper we focus on BPS partition functions of S-fold theories. Particularly, we construct grand partition functions for N = 3 theories associated with operators made of the scalar fields (X, Y, Z). The Taylor expansion of these grand partition functions generates the partition functions for an arbitrary N.
The gauge invariant operators made of the scalar fields form the coordinate ring of the moduli space. The moduli spaces of the S-fold theories are all orbifolds of the form M S(k,N,p) = C 3N /W S(k,N,p) . There is a general formula known as "the Molien series" which gives the partition function for an arbitrary orbifold. See [14] for an application to the theories on D3-branes probing orbifolds. The Molien series is also applicable to S-fold theories, and in this sense our result is not novel. However, the formula we derive in this paper has very simple structure which cannot be seen in the Molien series, and the correspondence to the holographic picture is clearer. In particular, the formula gives separately the contribution of each sector specified by the D3-brane winding number in the internal space S 5 /Z k . We show that the same formula is reproduced from the analysis of D3-branes. This paper is organized as follows. In the next section we review the BPS partition function of the N = 4 U(N) SYM following [12]. The resulting partition function is the same as that of N bosonic particles in a threedimensional harmonic potential. In section 3 we construct grand partition functions for N = 4 SYM theories with SO and Sp gauge groups realized by orientifolds. These can be regarded as S-folds with k = 2. In section 4 we generalize the results of section 3 and construct grand partition functions for k = 3, 4, and 6 theories. We confirm that the partition function is consistent to the supersymmetry enhancement proposed in [13,6]. We also comment on some relations among partition functions via discrete gaugings. In section 5 we reproduce the same formula by quantizing D3-branes in S 5 /Z k . Finally, in section 6 we discuss our results and open questions. In appendix A we give the definition of the Molien series and its application to the U(N) theory.

BPS partition functions of U (N ) SYM
In this section we review the BPS partition function for the N = 4 U(N) SYM , which has been well understood, and define some notations which will be used in the following sections. Analysis in this section is based mainly on [12]. See also [14] for a generalization to a large class of theories associated with Calabi-Yaus.

BPS partition function
The BPS partition function of an N = 4 SYM is defined by where the trace is taken over gauge invariant BPS operators consisting of the adjoint scalar fields X, Y, and Z. J 1 , J 2 , and J 3 are Cartan generators of SU(4) R . We use an so(6) basis for these generators. Namely, J 1 , J 2 , and J 3 count the numbers of X, Y, and Z, respectively. There are several types of BPS operators. Operators consisting of one of the scalar fields, say, Z, preserve half of 16 supersymmetries, and are called 1 2 -BPS operators. In the context of the N = 2 subalgebra Z is regarded as the scalar component of the N = 2 vector multiplet, and the 1 2 -BPS operators are called Coulomb branch operators. The corresponding partition function is often called the Coulomb branch Hilbert series.
BPS operators consisting of X and Y preserve quarter supersymmetry, and are called 1 4 -BPS operators. 1 4 -BPS operators are also called Higgs branch operators because X and Y belong to the N = 2 hypermultiplet, and operators made of them parameterize the Higgs branch. The corresponding partition function is often called the Higgs branch Hilbert series.
The most general BPS operators consisting of the three scalar fields X, Y, and Z preserve only two supersymmetries, and are called 1 8 -BPS operators. Although all gauge invariant operators made of X, Y, and Z are BPS when g YM = 0, some of them become non-BPS if we turn on the coupling constant. In this paper we are interested in BPS operators in theories with non-vanishing coupling constant.
If we take the trace over (2) In the following, we describe BPS operators in two ways. The first is "the Casimir representation" in which we represent operators as polynomials of trace operators (and Pfaffian operators in some cases). The other is "the oscillator representation" in which we give gauge invariant operators as polynomials of diagonal components of scalar fields. The former is convenient to describe 1 2 -BPS operators and we can easily calculate the 1 2 -BPS partition function with this representation for an arbitrary gauge group. The latter is suitable to describe more general BPS operators and enable us to calculate the 1 8 -BPS partition function of the U(N) SYM.

1 2 -BPS partition function
We first discuss the 1 2 -BPS sector. An operator in the 1 2 -BPS sector consists only of one adjoint scalar field Z.
In general the Coulomb branch chiral ring of an N = 4 SYM is freely generated by the Casimir operators made of the scalar field Z. The number of independent Casimir operators is the same as the rank of the gauge group. Let O i (i = 1, . . . , r) be the independent Casimir operators and d i be their scaling dimensions. The 1 2 -BPS partition function is given in terms of d i by where Pexp is the plethystic exponential defined by This is a general formula applicable to the N = 4 SYM with an arbitrary gauge group. The dimensions d i for some groups are shown in Table 1.
Operators tr(Z i ) with i ≥ N + 1 are not independent of them and decomposable into smaller traces. The partition function is To study the 1 4 and 1 8 -BPS sectors the oscillator representation is more suitable. Let us first use this representation to the 1 2 -BPS sector and later generalize it to the 1 8 -BPS sector. We diagonalize the scalar field Z by the gauge transformation and let z i (i = 1, . . . , N) be the diagonal components.
Gauge invariant operators can be regarded as functions in the moduli space, and the symmetric polynomials are generators of the coordinate ring of the Coulomb branch moduli space These basis functions are labeled by a vector of N non-negative integers {m 1 , . . . , m N }. This is the same as the Hilbert space of N one-dimensional harmonic oscillators. Two vectors with different orders of the components are identified, and this is interpreted as the Bose statistics of the particles. Namely, the 1 2 -BPS partition function of the U(N) theory is identical to the partition function of N bosonic particles in the one-dimensional harmonic potential.
The equivalence of two descriptions, the Casimir representation and the oscillator representation, becomes obvious if we use partitions to specify operators. In the Casimir representation, we can adopt the set of operators labeled by a non-ascending series of integers bounded by N with an arbitrary length as a basis of gauge invariant operators. In the oscillator representation, the symmetric polynomials (7) are labeled by N non-negative integers in nonascending order: Elements of both bases are labeled by a non-ascending series of non-negative integers, each of which can be represented as a Young diagram. The two Young diagrams are transposition of each other, and the two descriptions give the same partition function.
In the oscillator representation, it is natural to define the grand partition function We use " * " as a wildcard character to represent the summation over the rank N. The grand partition function is given as the product of the partition function of each state of the harmonic oscillator, We can easily show by the q-binomial formula that (6) is obtained from (11) by the Taylor expansion with respect to t. In (11) k = 0, 1, 2, . . . labels energy eigenstates of the harmonic oscillator. It is important that k starts from zero corresponding to the ground state. When the energy of the whole system of N particles is much smaller than N, only small part of N particles are excited, and the majority of the particles are in the ground state. The finiteness of N affects the degeneracy of states only when the energy is comparable to or greater than N.

1 8 -BPS partition function
Let us move on to the 1 8 -BPS operators. In this case we can use single trace operators made of X, Y, and Z as generators of the chiral ring. However, it is known that unlike the 1 2 -BPS sector the chiral ring is not freely generated and there are non-trivial relations called syzygies [14] among the generators, and it is not so easy to count independent operators in the Casimir representation. The oscillator representation is more suitable. Indeed, it is quite easy to give a set of independent operators in the oscillator representation, and we can find that they are equivalent to the states of N bosonic particles in a threedimensional harmonic potential [12] as is shortly explained.
Thanks to the F -term conditions [X, Y] = [Y, Z] = [Z, X] = 0 we can diagonalize the three fields X, Y, and Z simultaneously by the gauge transformation. Let (x i , y i , z i ) (i = 1, . . . , N) be the diagonal components. The symmetric polynomial (7) is replaced by where Ψ m (x, y, z) = x mx y my z mz is the monomial which is labeled by a threedimensional vector m = (m x , m y , m z ) with non-negative integer components. As in the 1 2 -BPS case these can be regarded as basis functions of the coordinate ring of the total moduli space We regard Ψ m as the wave function of a three-dimensional harmonic oscillator in the state specified by m. The symmetrization is again interpreted as the Bose statistics, and (12) can be regarded as the wave function of N bosonic particles in the three-dimensional harmonic potential. The grand partition function is where I(x, y, z) is the function By picking up the coefficient of the t N term from the Taylor expansion of (13) we obtain Z U (N ) , the 1 8 -BPS partition function of the U(N) theory. In appendix A we show that the BPS partition functions obtained from (13) are equal to those from the Molien series.
Interestingly, this partition function can be reproduced on the gravity side as the contribution of sphere giants [15] or AdS giants [16]. Descriptions of two types of giant gravitons are complementary, and each of them gives the result identical to (13).
We call the function I in (14) "the single-particle partition function" by two reasons: 1. I is the partition function of a single three-dimensional harmonic oscillator.
2. From the viewpoint of the gravity dual in the large N limit I can be regarded as the partition function of a single KK particle in S 5 (up to the difference by 1).
Concerning the second reason, the N → ∞ limit of Z U (N ) can be read off from the pole of Ξ U ( * ) at t = 1 as "−1" in the last expression eliminates the contribution of the harmonic oscillator ground state. Therefore, only the excited states of the harmonic oscillator correspond to the KK gravitons. We can define the "single-particle" partition function I U (N ) for finite N by Z U (N ) = Pexp I U (N ) . For the 1 2 -BPS states, the finite N correction is given as the simple cut-off at O(z N +1 ). (See (6).) For 1 4 and 1 8 -BPS states, the finite N correction becomes more complicated.
We point out that the U(1) partition function agrees with the function I: We also note that the SU(N) partition function can be obtained by removing the U(1) factor from the U(N) partition function: 3 BPS partition functions for SO and Sp theories

1 2 -BPS partition function
Let us extend the derivations of BPS partition functions in the last section to the SO and Sp gauge theories. We first consider the 1 2 -BPS sector. For SO theories, the adjoint fields become anti-symmetric matrices, and the trace operators with odd order become identically zero, and only ones with even order exist. In addition, for SO(2N), the Pfaffian operator Pf Z joins the generators of the chiral ring.
Let us first consider the SO(2N + 1) theory. The generators are These freely generate the Coulomb branch chiral ring, and the corresponding partition function is This is obtained simply by replacing z in Z U (N ) by z 2 . Therefore, the grand partition function is also obtained from (11) by the same replacement: In the SO(2N) case the generators are Although we can of course directly calculate Z  (3), it is instructive to give it by using (19). The difference of the list of generators (21) from (18) is that the Pfaffian Pf Z joins the generators, and instead tr Z 2N becomes a dependent operator which is decomposable into det Z = (Pf Z) 2 and smaller traces. Correspondingly, Z The corresponding grand partition function is where I Z 2 m (z) (m = 0, 1) are defined by These are even and odd part of I(z) ≡ I(0, 0, z), respectively. Namely, I(z) = I Z 2 0 (z) + I Z 2 1 (z), and they satisfy I Z 2 m (−z) = (−1) m I Z 2 m (z).

1 8 -BPS partition function
We can obtain similar expressions to (20) and (23) for the 1 8 -BPS partition functions by using the oscillator description.
Let us consider the SO(2N + 1) case first. Similarly to the U(N) case, we can diagonalize X, Y, and Z simultaneously by the gauge transformation so that they become elements of and (2) factor always appear in pair except a single zero corresponding to the (2N + 1)-th direction. Gauge invariant operators, or functions in the moduli space C 3N /W SO(2N +1) , are expressed as polynomials of 3N variables x i , y i , and z i . We treat a triplet (x i , y i , z i ) as the coordinates of a three-dimensional harmonic oscillator. The Weyl group W SO(2N +1) = S N ⋊ Z N 2 consists of permutations among these N triplets and sign change for an arbitrary i, which is realized by SO(3) rotation acting on the R 3 consisting of the two directions associated with the i-th so(2) factor in (25) and the exceptional (2N + 1)-th direction. Again, we can regard this as a system of N bosonic particles in the three-dimensional harmonic potential. The invariance under the sign change requires the wave function of each particle to be even under the Z 2 action. Namely, the one-particle wave function Ψ must satisfy This condition projects out one-particle states with odd energy eigenvalues, and the grand partition function is given by where On the AdS side, (28) has a clear interpretation at least in the large N limit. We can treat the fugacities x, y, and z as if they are the coordinates of C 3 which contains S 5 . The Z 2 action is nothing but the orientifold action, and (28) can be regarded as the singleparticle partition function of KK modes in S 5 /Z 2 .
In the SO(2N) case, we can again use N triplets (x i , y i , z i ) to describe gauge invariant operators. The difference from the SO(2N + 1) case is that the Weyl group of SO(2N) is W SO(2N ) = S N ⋊Z N −1 2 and we cannot change the signs independently for each i, because there is no room to perform the SO(3) rotation which we used to flip the sign in the SO(2N + 1) case. Although we can change signs of two triplets simultaneously, it is not possible to change the sign of a single triplet. This restriction of the sign change weakens the requirement of the Weyl invariance, and in addition to (26) we have the other solution for the wave function, which satisfies the twisted boundary condition The associated projection leaves odd order terms in the Taylor expansion of the single-particle partition function, and gives the grand partition function Pexp tI Z 2 1 . Namely, the 1 8 -BPS grand partition function of the SO(2N) SYM is the sum of two contributions just like the 1 2 -BPS partition function (23), The twisted boundary condition (30) removes even energy eigenvalues of the harmonic oscillator. In particular, oscillators in the twisted sector cannot be in the zero energy ground state. All N oscillators contribute at least one unit to the energy, and the total energy is at least N. Therefore, it is natural to identify the twisted sector to the contribution of the Pfaffian type operators including the ǫ tensor. This sector decouples in the large N limit, and is effective only for finite N.
How should we interpret this "twisted sector" on the gravity side? It is known that a gauge invariant operator containing the ǫ tensor corresponds to a D3-brane wrapped around the non-trivial three-cycle in S 5 /Z 2 [5]. The mass of the wrapped D3-brane is N/(AdS radius), and the corresponding operator has dimension ∼ N. Therefore, it is natural to identify the twisted sector to the contribution of a wrapped D3-brane.
We can calculate the partition function of the Sp(N) theory in a similar way. The scalar fields X, Y, and Z are 2N ×2N matrices, and we can diagonalize them so that they become elements of sp(1) N ⊂ sp(N). Each sp(1) factor is associated with the coordinates (x i , y i , z i ) of a three-dimensional harmonic oscillator. Unlike the SO(2N) case we can flip the sign of the coordinates of each particle independently by the rotation in the Sp(1) factor, and therefore W Sp(N ) = W SO(2N +1) . The condition imposed on the wave function is the same as (26) in the SO(2N + 1) case, and the partition function is given by (27). This is of course the expected result from the Montonen-Olive duality.
As we saw above, the difference between Ξ SO(even) and Ξ SO(odd) = Ξ Sp( * ) is the choice of sectors summed up. For unified description of these formulas we introduce the parameter p ∈ Z 2 , which is p = 0 for SO(2N) and p = 1 for SO(2N + 1) and Sp(N). Then, the formulas (27) and (32) are unified into The summation is taken over m ∈ {0, 1} satisfying pm = 0. Namely, m = 0, 1 for p = 0 and m = 0 for p = 1. From the viewpoint of the gravity dual, p is related to the discrete torsion of the three-form fluxes [5]. In string theory SO and Sp theories are realized by using O3-planes. There are four types of planes O3 ± and O3 ± , which are distinguished by an element of the discrete torsion group associated with the three-form flux fields: where Z + Z is the sheaf of a pair of integers twisted by the orientifold action. The trivial element corresponds to p = 0, and the others to p = 1.

S-fold theories
A Z k S-fold with k = 3, 4, 6 is defined as a generalization of the orientifold by replacing the Z 2 action (29) by the Z k action which also acts non-trivially on one of the four supercharges in the N = 4 SYM [3]. In the following subsections we study BPS partition functions of such theories. Before starting the analysis let us carefully choose the Z k action on the scalar fields and comment on the relations to the Coulomb branch and Higgs branch Hilbert series. The choice of Z k is not unique and depends on the choice of the eliminated supercharge in the reduction from N = 4 to N = 3. This must be consistent to the definition of the BPS partition function, in which we need to use one supercharge to write down the BPS condition. Each of the choices of a supercharge breaks SU(4) R symmetry to SU(3) × U(1), and the scalar fields in the vector representation 6 split into 3 +1 + 3 −1 , "holomorphic" ones and "anti-holomorphic" ones. Namely, a choice of supercharge fixes a complex structure in R 6 . The scalar fields X, Y, and Z are holomorphic with respect to the complex structure associated with the supercharge used in the BPS condition. What is important is that the supercharge chosen in the construction of the S-fold should be different from the one used in the BPS condition. As a consequence the S-fold action on X, Y, and Z cannot be homogeneous. We adopt the convention with If we are interested in the Coulomb branch or the Higgs branch Hilbert series we need to choose an N = 2 subalgebra in the N = 3 algebra. Again, we need to specify one supercharge from three, that is not contained in the N = 2 subalgebra. This again gives a corresponding complex structure, which is different from the ones appearing above. This splits three scalar fields X, Y, and Z into one belonging to an N = 2 vector multiplet and two belonging to an N = 2 hypermultiplet. This 1 + 2 splitting is different from that associated with the S-folding. Namely, the scalar field belonging to the N = 2 vector multiplet cannot be X. If we adopt the convension in which Z belongs to the N = 2 vector multiplet the Coulomb (Higgs) branch Hilbert series is obrained from the BPS partition function given below by the specialization x = y = 0 (z = 0) as shown in (2).

Grand partition functions for Z 3,4,6 S-folds
Let us generalize the formula (33) to S-folds with k = 3, 4, 6. We use the oscillator representation. Namely, we express gauge invariant operators as polynomials which are invariant under "the Weyl group" W S(k,N,p) . Of course an S-fold theory with k ≥ 3 is not a gauge theory, and we cannot define the Weyl group as a subgroup of the gauge group. However, because an S-fold theory is defined as the theory on D3-branes, we can define W S(k,N,p) as the permutation group of N D3-branes put in the S-fold background. Aharony and Tachikawa [6] proposed the action of W S(k,N,p) on the Coulomb branch coordinates z i by generalizing the Weyl groups for k = 1 and k = 2 cases. We simply generalize it to the total moduli space, and define W S(k,N,p) as the group generated by the following operations.
The integer p in (39) can be assumed to be a divisor of k. We use p = 0 instead of p = k. We want to interpret these operations from the viewpoint of the oscillator description. We regard a function of 3N variables (x i , y i , z i ) as the wave function of an N-particle system, and require it to be invariant under (37), (38), and (39). The first operation (37) generates permutations of N particles, and the invariance under this operation can be implemented as the Bose statistics of the particles, and the N-particle wave function is given in the form (12). The invariance under the second operation requires all single-particle wave functions satisfy a common boundary condition where the integer m ∈ {0, 1, 2, . . . , k − 1} is common for all particles, and specifies one of k sectors. m = 0 is the untwisted sector and the others are twisted sectors. The corresponding single-particle partition function is where the summation nx,ny,nz is taken over the three integers satisfying the conditions n x , n y , n z ≥ 0, −n x + n y + n z = m mod k. (42) and reproduces (28) and (31) for k = 2.
In the m-th sector with m = 0 the Z k projection leaves only single-particle states with non-vanishing energies, and the lowest energy of the N-particle system is of order N. These states are related to the Pfaffian-like operators. On the gravity side we regard m-th sector as the contribution of wrapped D3-brane with the winding number m ∈ H 3 (S 5 /Z k , Z) = Z k .
The grand partition function is obtained by summing up the contribution of sectors. The contribution of the m-th sector is Pexp tI Z k m , and the sectors summed up are determined by the invariance under (39). It requires m to satisfy the condition Namely, the grand partition function is given by Pexp tI Z k m (x, y, z) = pm=0 nx,ny,nz where the product in the final expression is taken over three integers satisfying the conditions (42). This is the main result in this paper.
As is explained in [6], p is related to the discrete torsion in the gravity dual, and it is shown that only p = 0 or p = 1 is allowed for a consistent theory. The discrete torsion group for the Z k S-fold is where Z + Z is the sheaf of a pair of integers twisted by the S-fold action. For each k this is given by [6,7]: The sectors summed up are determined by the condition that the gauge bundle of the corresponding wrapped D3-brane is consistently defined. If the discrete torsion is trivial, this is the case for an arbitrary winding number m ∈ H 3 (S 5 /Z k , Z) = Z k , and this corresponds to p = 0. Otherwise, the nontrivial NS-NS and R-R three-form fluxes induce electric and magnetic charge on the worldvolume of the wrapped D3-brane. This obstructs the definition of the gauge bundle, and only m = 0 sector is allowed. This corresponds to p = 1.
In the large N limit only the m = 0 sector contributes to the partition function and (45) reduces to (The relation (48) holds not only for the BPS partition function but also for the superconformal index. This was used in [7] to calculate the superconformal indices of S-folds in the large N limit.)

SUSY enhancement from N = 3 to N = 4
It is known that in S-fold theories S(k, 1, 0) and S(k, 2, 0) with k = 3, 4, 6 the supersymmetry is enhanced from N = 3 to N = 4 [13,6]. Let us confirm the consistency of our formula to this phenomenon. For the trivial discrete torsion p = 0 the grand partition function is the sum of the contributions of all sectors m = 0, . . . , k − 1: By picking up t 1 terms from (49) we obtain the partition function of the rank one S-fold theories and this is the partition function of the N = 4 U(1) theory. The rank two S-fold theories are expected to be equivalent to N = 4 SYM with the gauge groups shown in Table 2. Table 2: N = 4 SYMs expected to be equivalent to S(k, 2, 0).
S-folds N = 4 SYMs The coefficient of t 2 term in Ξ S(k, * ,0) is For k = 3 and k = 4, the results are . For k = 6 case (51) gives This is expected to be the same as Z G 2 . The specialization of this partition function by x = y = 0 agrees with the 1 2 -BPS partition function obtained from the general formula (3) with {d 1 , d 2 } = {2, 6} for G 2 shown in Table 1.
We can also compare this partition function to the partition function of the Z 2 gauging of the SU(3) SYM. As is pointed out in [17] the 1 2 -BPS partition function of the G 2 SYM is obtained from the SU(3) SYM by the discrete gauging of Z 2 charge conjugation symmetry. This is also the case for the 1 8 -BPS partition function, and the 1 8 -BPS partition function of the G 2 theory is given by It is also possible to use (a refinement of) the Molien series to obtain the same partition function. We can directly confirm the agreement of (55) and (56).

Discrete gauging
The discrete gauging is the prescription to obtain a new theory from a parent theory by gauging a discrete symmetry of the parent theory. It provides another way to construct N = 3 theories [17,18]. We remark that the gauging is different from the S-folding, and S-fold partition functions are not necessarily obtained from Z U (N ) by a gauging. Instead, the gaugings give additional relations among S-fold partition functions as we will show shortly. Some of the relations below belong to the class of discrete gaugings associated with the principal extensions of the gauge groups, which are investigated in [19].
As is pointed out in [6] the S-fold theory S(k, N, p) has a Z p global symmetry. (In this section we use p = k instead of p = 0.) Let q be a divisor of p. We can gauge the subgroup Z q ⊂ Z p to define another theory. Let us denote the new theory by S(k, N, p)/Z q . In terms of oscillator variables Z q is generated by the rotation (39) for a single oscillator with p replaced by p ′ = p/q. This rotates the total wave function (12) by the phase factor ω mp ′ k , and the gauge invariance requires As the result, the partition function of this theory is the same as that of S(k, N, p ′ ): Note that this relation is a reflection of the coincidence of the moduli space, and does not mean the equivalence of the two theories. In general, the two theories are different theories that have different central charges.
and is consistent to the spectrum of Coulomb branch operators given in [6]. We can consider another type of discrete gaugings of S-fold theories that is generated by ( for all oscillators. ℓ may be or may not be a divisor of k. If ℓ is a divisor of k this rotation is realized by repeating N times the rotation of a single oscillator, and this gauging is equivalent to the previous gauging with We can describe the overall rotation of the all oscillators by the rotation of the fugacities (x, y, z) → (ω −1 ℓ x, ω ℓ y, ω ℓ z), and the partition function of the gauged theory is where Z is the partition function before the Z ℓ projection and P Z ℓ is the projection operator that eliminates terms that are not invariant under (62). This is in contrast to the S-fold projection (48) in the large N limit in which the projection is carried out before the plethystic exponential. Let us first confirm if ℓ is a divisor of k (63) reproduces (59) with p ′ given by (61). Let R ℓ be the operator replacing (x, y, z) by (ω −1 ℓ x, ω ℓ y, ω ℓ z). If ℓ is a divisor of k the relation (43) holds. Namely, R ℓ I Z k m = ω m ℓ I Z k m . This relation means that tI Z k m (x, y, z) is invariant under the Z ℓ action (x, y, z; t) → (ω −1 ℓ x, ω ℓ y, ω ℓ z; ω −m ℓ t), and so is the plethystic exponential Pexp tI Z k m . Therefore, the coefficient of the t N term in the Taylor expansion of Pexp tI Z k m satisfies The R ℓ invariance requires mN = 0 mod ℓ, and this is the same as the condition (58) with p ′ given by (61).
By using (64) we can prove the relation P Z 2 Z S(3,2,0) = Z S(6,2,0) , which we mentioned at the end of the previous subsection, as follows. First we divide the single particle partition function I Z 3 m into two parts; I Z 3 m = I Z 6 m + I Z 6 m+3 . With this decomposition we can rewrite the grand partition function as and by picking up t 2 terms we obtain When we apply R 2 the summand is rotated by the phase ω rm 2 ω (2−r)(m+3) 2 = (−1) r , and the corresponding projection P Z 2 leaves the terms with r = 0 and r = 2. We obtain This is the relation we wanted to show.

D3-brane analysis
In this section we reproduce the partition function (45) by quantizing D3branes in S 5 /Z k . The analysis is quite similar to the analysis of sphere giants in [15]. Actually we can use the essential part of the calculation in [15] as it is for our purpose. The analysis in [15] starts from the BPS brane configuration obtained by Mikhailov [20]. Mikhailov showed that an arbitrary BPS solution is given as the intersection of S 5 defined by |X| 2 + |Y | 2 + |Z| 2 = 1 and a holomorphic surface f (X, Y, Z) = 0. We consider the Taylor expansion and treat the coefficients c nx,ny,nz as dynamical variables. Because the overall factor of f is irrelevant to the brane configuration the coefficients are regarded as the projective coordinates of CP ∞ . Due to the coupling of the D3-brane to the background RR flux the wave function is not just a function but a section of the line bundle O(N) over this configuration space. Therefore, the quantization reduces to the simple problem to find holomorphic sections of this line bundle. There are two issues which make the problem complicated. One is that different functions f may give the same brane configuration, and we should remove the redundancy. The other is that the surface f = 0 may not intersect with S 5 , and the parameter region giving such a surface should be removed from the configuration space. The detailed analysis in [15] shows that even if we take account of these issues the result is the same as what we obtained by naive analysis neglecting these issues. Let us assume that this is the case for the S-fold. Then what we should additionally do is to impose the Z k invariance to the surface f = 0. This requires the function satisfy with some m ∈ Z k . We identify m with the winding number of a D3brane around the non-trivial cycle in S 5 /Z k . This is easily shown as follows.
We can deform the function f by continuously changing coefficients to a simple function, say, f = Z m , without violating the property (69). The resulting configutation obviously has the winding number m. Because such a deformation does not change the homology class of the brane configuraion, an arbitrary brane configuration given by a function satisfying (69) has winding number m. Now, let us follow the quantization procedure of [15] under the restriction (69). The configuration space is again CP ∞ with the homogeneous coordinates c nx,ny,nz . The constraint (69) requires (n x , n y , n z ) to satisfy −n x + n y + n z = m mod k, and this is the same as (42). The wave function is a holomorphic section of the O(N) line bundle over this configuration space, and is given by an order N homogeneous function of c nx,ny,nz . We can treat each of c nx,ny,nz as if it is a quantum with angular momentum (J 1 , J 2 , J 3 ) = (n x , n y , n z ). Then a quantum state of D3-branes in S 5 is regarded as a collection of N quanta, and the partition function of D3-branes can be calculated as the partition function of states which include N quanta. Let us introduce (x, y, z) and t as fugacities for the angular momenta (J 1 , J 2 , J 3 ) and the number of quanta N, respectively, and calculate the grand partition function. The contribution of a single quantum of c nx,ny,nz is tx nx y ny z nz , and the grand partition function for a fixed winding number m is Pexp   nx,ny,nz where the sum is taken over non-negative integers (n x , n y , n z ) satisfying (70). By summing up (71) over m allowed by the discrete torsion, we obtain the grand partition function Ξ S(k, * ,p) (x, y, z; t) in (45).

Discussion
In this paper we derived the BPS partition functions for arbitrary S-fold theories. We confirmed that the formula is consistent to the Lie algebra isomorphisms. It is also consistent to the supersymmetry enhancement from N = 3 to N = 4 in rank 1 and 2 theories. Namely, for S(k, 1, 0) the partition function is the same as the U(1) SYM, and for S(k, 2, 0) with k = 3, 4, 6 the partition functions are the same as those of SYM with G = SU (3), SO (5), and G 2 , respectively. We also gave some relations among partition functions via discrete gaugings. The formula gives the partition function as the sum of contributions of sectors. From the holographic point of view, different sectors correspond to different winding numbers of D3-branes around the non-trivial cycle in the internal space S 5 /Z k . We derived the same formula by quantizing D3-branes in S 5 /Z k following the similar analysis of sphere giants [15].
The derivation on the SCFT side is based on the harmonic oscillator description of BPS operators. In the large N limit the sectors with wrapped branes decouple, and only the untwisted sector contributes to the partition function. Each excited state of a harmonic oscillator can be regarded as a KK mode in S 5 /Z k . For finite N, this correspondence is not so obvious. In particular, the twisted sector gives a Pfaffian operator as "a bound state" of N harmonic oscillators. Naively, this may be interpreted on the gravity side that a D3-brane wrapped on the non-trivial cycle in S 5 /Z k is a bound state of KK modes satisfying the twisted boundary condition. However, it is not possible to impose the twisted boundary condition on KK modes due to the absence of gauge fields minimally coupling to gravitons. At present, unfortunately, we have no clear explanation how this is realized. It may be interesting to study the relation between the harmonic oscillator description and the quantization procedure of D3-branes we used in section 5.
Other than the BPS partition function, there is another important quantity reflecting the operator spectrum: the superconformal index. It has many connections to physical quantities. In particular, its Schur limit (the Schur index) are known to be related to the BPS spectrum on the Coulomb branch [21], 2d chiral algebra [22], and correlation functions in 2d topological QFT [23,24]. Furthermore, there is an analytic formula for the Schur index for U(N) SYM with an arbitrary N [25]. It would be very interesting to inves-tigate the relation of our analysis to the superconformal index.
Because the summand takes the same value for permutations in the same class we can replace the summation over permutations g ∈ S N by the summation over conjugacy classes with appropriate multiplicities inserted. We have where C N is the family of conjugacy classes of S N , m(µ) is the number of elements in a conjugacy class µ ∈ C N , and g(µ) is a representative of µ. A conjugacy class µ is uniquely specified by the list of the lengths of cycles in g(µ). Let k j (j = 1, 2, . . .) be the number of j-cycles in g(µ). These satisfy and the weight factor in (74) is given by Note that for a specific N only finite number of k j are non-vanishing due to the constraint (75). Corresponding to the cycle decomposition, the matrix I N − zD(g(µ)) appearing in (74) takes the block-diagonal form. Each block corresponds to each cycle. The block associated with a j-cycle is and det I j = 1 − z j . Therefore, we can rewrite (74) as where the sum is taken over {k j } satisfying (75). It is straightforward to extend the analysis above to the 1 8 -BPS partition function. We define three copies of N-dimensional vector spaces V x , V y , V z corresponding to the three scalar fields and replace the vector space V by the direct product V x × V y × V z , and correspondingly replace D(g) by I 3 ⊗ D(g). As the result, we obtain the Molien series for the full moduli space C 3N /S N , which is given by (78) with the factor 1/(1 − z j ) k j replaced by 1/(1 − z j ) 3k j . This is the 1 8 -BPS partition function with fugacities x = y = z. To obtain the partition function with generic fugacities we need to consider a refinement of the Molien series [14]. It is defined by using diag(x, y, z) ⊗ D(g) instead of zI 3 ⊗ D(g). Namely, . (79) By repeating the same procedure as above we obtain where I(x, y, z) is the function defined in (14). To obtain the grand partition function, we multiply t N = ∞ j=1 (t j ) k j to (80).
Finally, the summation over N = 0, 1, . . . gives the grand partition function. This summation is equivalent to removing the constraint (75) in the summation with respect to {k i }. Then all components in the series {k i } become independent, and the result becomes This is the same as the grand partition function Ξ U ( * ) given in (13).