The Partition Function of ABJ Theory

We study the partition function of the N=6 supersymmetric U(N_1)_k x U(N_2)_{-k} Chern-Simons-matter (CSM) theory, also known as the ABJ theory. For this purpose, we first compute the partition function of the U(N_1) x U(N_2) lens space matrix model exactly. The result can be expressed as a product of q-deformed Barnes G-function and a generalization of multiple q-hypergeometric function. The ABJ partition function is then obtained from the lens space partition function by analytically continuing N_2 to -N_2. The answer is given by min(N_1,N_2)-dimensional integrals and generalizes the"mirror description"of the partition function of the ABJM theory, i.e. the N=6 supersymmetric U(N)_k x U(N)_{-k} CSM theory. Our expression correctly reproduces perturbative expansions and vanishes for |N_1-N_2|>k in line with the conjectured supersymmetry breaking, and the Seiberg duality is explicitly checked for a class of nontrivial examples.


Introduction
There has recently been remarkable progress in applications of the localization technique [1] to supersymmetric gauge theories, notably in dimensions D ≥ 3: In D = 4 the Seiberg-Witten prepotential of N = 2 supersymmetric QCD [2] was directly evaluated, and the partition functions and BPS Wilson loops of the N = 2 (and 2 * ) and N = 4 supersymmetric Yang-Mills theories (SYM) were reduced to eigenvalue integrals of the matrix model type [3], providing, in particular, a proof of the earlier results on a Wilson loop in the N = 4 SYM [4,5]. In D = 3 similar results were obtained for the partition functions and BPS Wilson loops of N = 2 supersymmetric Chern-Simons-matter (CSM) theories [6,7], including the N = 6 superconformal theories constructed by Aharony, Bergman, Jafferis and Maldacena (ABJM) [8] [9]. More recently, the localization technique was further applied to the partition functions of 5-dimensional SYM with or without matter [10][11][12].
The localization method, resulting in the eigenvalue integrals of the matrix model type, allows us to obtain various exact results at strong coupling of supersymmetric gauge theories. In particular, these results provide useful data for the tests of the AdS/CFT correspondence [13] in the case of superconformal gauge theories. For instance, the precise agreement of the N 3/2 scaling between the free energy of the ABJ(M) theory [14][15][16] and its AdS 4 dual [8] [9] is an important landmark that shows the power of the localization method in the context of AdS/CFT. Rather remarkably, exact agreements were also found in [17] between the N 5/2 scaling of 5d superconformal theories and that of their AdS 6 duals [18]. Furthermore, the tantalizing N 3 scaling of maximally supersymmetric 5d SYM was found in [12,19] in line with the conjecture on (2, 0) 6d superconformal theory compactified on S 1 [20], despite thus far a lack of the precise agreement with its AdS 7 dual. It should, however, be noted that the utility of the localization method, unlike the integrability [21], is limited to a class of supersymmetric observables, such as the partition function and BPS Wilson loops. On the other hand, the localization method has an advantage over the integrability in that it can provide exact results at strong coupling beyond the large N limit, where the integrability has not been as powerful.
In this paper we focus on the partition function of the ABJ theory, i.e., the N = 6 supersymmetric U (N 1 ) k × U (N 2 ) −k CSM theory, which generalizes the equal rank N 1 = N 2 case of the ABJM theory [9]. Over the past few years there has been considerable progress in the study of the partition function and Wilson loops of the ABJM theory, whereas the ABJ case has not been as much understood. The ABJ generalization, for instance, has an important new feature, the Seiberg duality, which, however, lacks a full understanding. Besides being a generalization, it has recently been conjectured that the ABJ theory at large N 2 and k with N 2 /k and N 1 fixed finite is dual to the N = 6 parity-violating Vasiliev higher spin theory on AdS 4 with U (N 1 ) gauge symmetry [22]. Thus a better understanding of the ABJ theory may provide valuable insights into the relation between higher spin particles and strings. It is therefore worth studying the partition function of the ABJ theory in great detail.
As mentioned above, the partition function of the ABJM theory has been well studied. In the large N limit, the planar free energy has been computed, revealing the aforementioned N 3/2 scaling [14][15][16]. In fact, the result in [14,15] is exact in 't Hooft coupling λ = N/k and, in particular, confirms a gravity prediction of the AdS radius shift in [23]. The planar result is not limited to the ABJM case; Drukker-Mariño-Putrov's results include the partition function and Wilson loops of the ABJ theory, and the ABJ version of the radius shift [24] is also confirmed. In the meantime, beyond the large N limit, the 1/N corrections of the ABJM partition function were summed up to all orders by solving the holomorphic anomaly equations of [14,25,26] at large λ in the type IIA regime k 1, and the result turned out to be simply an Airy function [27]. 1 Subsequently, Mariño and Putrov developed a more elegant approach, the Fermi gas approach, without making any use of the matrix model techniques or the holomorphic anomaly equations, to compute directly the partition functions of N = 3 and N = 2 CSM theories including the ABJM theory [29,30]. They found, in particular, a universal Airy function behavior for the N = 3 theories at large N in the small k M-theory regime. These non-planar results were reaffirmed by numerical studies in the case of the ABJM theory [31]. Furthermore, the Fermi gas approach was applied to the Wilson loops, exhibiting again the Airy function behavior [32]. Meanwhile, a number of exact computations of the ABJM partition function were carried out for various values of N and k [33][34][35]. It should also be noted that the nonperturbative effects O(e −N ) of the M-and D-brane type can be systematically studied both in the matrix model [26] and the Fermi gas approaches [29].
In the unequal rank N 1 = N 2 case of the ABJ theory, the Fermi gas approach thus far has not been applicable, and the study of finite N 1 and N 2 corrections to the ABJ partition function has not been as much developed as in the ABJM case. In this paper, we wish to lay the ground for the study of the ABJ partition function at finite N 1 and N 2 . To this end, we first compute the partition function of the L(2,1) lens space matrix model [36,37] exactly. By making use of the relation between the lens space and the ABJ matrix models [38], we map the lens space partition function to that of the ABJ matrix model by analytically continuing N 2 to −N 2 . With our particular prescription of the analytic continuation, the final answer for the ABJ partition function is given by min(N 1 , N 2 )-dimensional integrals and generalizes the "mirror description" of the partition function of the ABJM theory [39]. Our result may thus serve as the starting point for the ABJ generalization of the Fermi gas approach. Meanwhile, we test our prescription against perturbative expansions as well as the Seiberg duality conjecture of [9] and find that our final answer perfectly meets the expectations.
The rest of the paper is organized as follows: In Section 2 we outline our strategy for the calculations of the ABJ partition function and summarize the main result at each pivotal step of the computations. Most of the computational details are relegated to rather extensive appendices. In Section 3 we present a few simple examples of our results in order to elucidate otherwise rather complicated general results. In Section 4 we state the result of perturbative and nonperturbative checks that we carried out and illustrate with a few simple examples how they were actually done. Section 5 is devoted to the conclusions and the discussions.

The outline of calculations and main results
We are going to compute the partition function of the U (N 1 ) k × U (N 2 ) −k ABJ theory in the matrix model form [6,7] obtained by the localization technique [3]: where the ∆ sh factors are the one-loop determinants of the vector multiplets and the ∆ ch factor is the one-loop determinant of the matter multiplets in the bi-fundamental representation (2. 3) The string coupling g s is related to the Chern-Simons level k ∈ Z =0 by g s = 2πi k , (2.4) and the factor N ABJ in front is the normalization factor [15] Note that, because of the relation we can assume N 1 ≤ N 2 without loss of generality.

The outline of calculations
Before going into the details of calculations, we shall first lay out our technical strategy: We adopt the idea employed in the large N analysis of the ABJ(M) matrix model in [14,15]. Namely, instead of performing the integrals in (2.1) directly, (1) we first compute the partition of the L(2,1) lens space matrix model [36,37] Z lens (N 1 , N 2 ) k = N lens with the normalization factor (2) then analytically continue N 2 to −N 2 to obtain the partition function of ABJ theory [38] where the proportionality constant is given in terms of the Barnes G-function G 2 (z), A key observation is that the partition function (2.7) of the lens space matrix model is a sum of Gaussian integrals and can thus be calculated exactly in a very elementary manner. The analytic continuation N 2 → −N 2 , on the other hand, is ambiguous and not as straightforward as one might expect. We find the appropriate prescription for the analytic continuation in two steps: (2.i) In the first step we propose a natural prescription that correctly reproduces, after a generalized ζ-function regularization, the known perturbative expansions in the string coupling g s . The resulting expression, however, is a formal series that is non-convergent and singular when k is an even integer.
(2.ii) To circumvent these issues, in the second step, we introduce an integral representation which renders a formal series perfectly well-defined.
In other words, the integral representation (A) implements a generalized ζ-function regularization automatically and (B) provides an analytic continuation in the complex parameter g s for the formal series.
As we will see later, the final answer in the integral representation passes perturbative as well as some nonperturbative tests and generalizes the "mirror description" [39] of the partition function of the ABJM theory to the ABJ theory.

The main results
We present, without much detail of derivations, the main result at each step of the outlined calculations. Most of the technical details will be given in the appendices.
• The lens space matrix model As emphasized above, the lens space partition function (2.7) is a sum of Gaussian integrals and can be calculated exactly: The symbol (N 1 , N 2 ) denotes the partition of the numbers (1, 2, · · · , N ) into two groups N 1 = (C 1 , C 2 , · · · , C N 1 ) and N 2 = (D 1 , D 2 , · · · , D N 2 ) where C i 's and D a 's are ordered as C 1 < · · · < C N 1 and D 1 < · · · < D N 2 . The computation proceeds in two steps: (1) Gaussian integrals and (2) sums over permutations. The detailed derivation can be found in Appendix B.
As advertised, the result (2.11) can be written as a product of q-deformed Barnes Gfunction and a generalization of multiple q-hypergeometric function: (2.14) The q-deformed Barnes G-function G 2 (z; q) is defined in Appendix A and, as will be elaborated later, S(N 1 , N 2 ) is a generalization of multiple q-hypergeometric function. Recalling that q = e −gs , it is rather fascinating to observe that the string coupling g s is not only the loop-expansion parameter in quantum mechanics but also a quantum deformation parameter of special functions. In Section 3 we will give simple examples of the lens space partition function in order to elucidate the q-hypergeometric structure.
• The ABJ theory The next step in our strategy is the analytic continuation N 2 → −N 2 which maps the partition function of the lens space matrix model to that of the ABJ theory. For this purpose, we find it convenient to work with the second expression of the lens space partition function (2.13). Our claim is that the analytic continuation yields the following expression for the ABJ partition function in a formal series where we defined M = N 2 − N 1 (for N 2 > N 1 ) and (a) n is a shorthand notation for the q-Pochhammer symbol (a; q) n defined in Appendix A. We used an -prescription in continuing N 2 to −N 2 , as explained in detail in Appendix C.2. However, as noted above, there are in principle multiple ways to continue N 2 to −N 2 . It thus requires a particular prescription to fix this ambiguity. Our prescription is to continue N 2 to −N 2 with S(N 1 , N 2 ) written in the form As will be explained more in detail in Appendix C, there are a number of ways to express S(N 1 , N 2 ) that could yield different results after the analytic continuation: The range of the sum in (2.14) runs from 1 to N = N 1 +N 2 . In order to make sense of analytic continuation in N 2 (> N 1 ), the finite sum (2.14) is extended to the infinite sum (2.18). In fact, the summand for s i > N − 1 in (2.16) vanishes after an appropriate regularization. Now the point is that these vanishing terms could yield nonvanishing contributions after the analytic continuation. Clearly, the way to extend the finite sums to infinite ones is not unique, and this is where the ambiguity lies. Our guideline for the correct prescription is to successfully reproduce the perturbative expansions in g s . Indeed, it can be checked that the formal series (2.15) has the correct perturbative expansions, as we will discuss more in Section 4.1.

• The integral representation
As alluded to in the outline, the result (2.15) is not the final answer. It is a formal series that is non-convergent and singular when k is an even integer. It can be rendered perfectly well-defined by introducing an integral representation: Specifically, our final answer for the analytic continuation is where M = N 2 − N 1 (for N 2 > N 1 ) and the integration range I = [−i∞ − η, +i∞ − η] with η > 0. We note that there is a subtlety in the choice of η: For example, when the string coupling g s takes the actual value of our interest, 2πi k with an integer k, as we will elaborate in Section 4.2, the parameter η should be varied so that the partition function remains analytic in k, as one decreases the value of k from the small coupling regime |g s | = |2πi/k| 1. Although we lack a first principle derivation of the integral representation, we can give heuristic arguments as follows: First, this integral representation "agrees" with the formal series (2.15) order by order in the perturbative g s -expansions. The integrals could be evaluated by considering the closed contours C j composed of the vertical line I and the infinitely large semi-circle C ∞ j on the right half of the complex s j -plane, if the contribution from C ∞ j were to vanish; see Figure 1. In the g s -expansions, the poles would only come from the factors 1/ sin(πs j ) and are at s j = n j ∈ Z ≥0 . Thus the residue integrals would correctly reproduce (2.15). In actuality, however, the contribution from C ∞ j does not vanish, and thus this argument is heuristic at best; we will see precisely how the g s -expansions work in an example in section 4.1. We note that, to the same degree of imprecision, the integral representation (2.19) can be thought of as the Sommerfeld-Watson transform of (2.15). 2 Figure 1: "The integration contour" C j = I+C ∞ j for the perturbative ABJ partition function: The only perturbative (P) poles are indicated by red "+". See text for detail.
Second, as implied in the first point, the integral representation (2.19) provides a "nonperturbative completion" for the formal series (2.15). In fact, nonperturbatively, there appear additional poles from the factors 1/(−q s j +1 ) M and 1/(1 + q s k −s j ) 2 in the contour integrals. They are located at s j = − (2n+1)πi gs −m and s j = − (2n+1)πi gs +s k with n ∈ Z and m = 1, · · · , M , as shown in Figure 2. Their residues are of order e 1/gs . Hence these can be regarded as nonperturbative (NP) poles, whereas the previous ones are perturbative (P) poles. Again, these statements are rather heuristic, and we will see how precisely P and NP poles contribute to the contour integral in Section 4.2. A few remarks are in order: (1) As promised, there is no issue of convergence in the expression (2.19). It is also well-defined in the entire complex q-plane. The integrand becomes singular for q = e −2πi/k with even integer k as in the formal series (2.15). However, this merely represents pole singularities and yields finite residue contributions.
(2) It should be noted that our main result (2.19) lacks a first principle derivation. It thus requires a posteriori justification. On this score, as stressed and will be discussed more in Section 4.1, the integral representation (2.19) correctly reproduces the perturbative expansions; moreover, it automatically implements a generalized ζ-function regularization needed in the perturbative expansions of the infinite sum (2.15). Meanwhile, a successful test of the Seiberg duality conjectured in [9] provides evidence for our proposed nonperturbative completion. We will explicitly show a few nontrivial examples of the Seiberg duality at work in Section 4.2.
(3) In the ABJM limit (M = 0), the integral representation (2.19) coincides with the "mirror description" of the ABJM partition function found in [39]. This provides a further support for our prescription and implies that we have found a generalization of the "mirror description" in the case of the ABJ theory. Our finding may thus serve as the starting point for the generalization of the Fermi gas approach developed in [29] to the ABJ theory.
(4) One of the ABJ conjectures is that the N = 6 U (N 1 ) k × U (N 1 + M ) −k theory with M > k may not exist as a unitary theory [9]. It is further expected that the supersymmetries are spontaneously broken in this case [40] (see also [41]). A manifestation of this conjecture is that the partition function (2.19) vanishes when M > k because (2.20) Note that the q-deformed Barnes G-function G 2 (M + 1; q) is precisely a factor that appears in the partition function of the U (M ) k Chern-Simons theory. We thus expect that this property is not peculiar to the N = 6 CSM theories but holds for CSM theories with less supersymmetries as long as they contain the U (M ) k CS theory as a subsector. 3

Examples
In this section we present a few simple examples of the lens space and ABJ partition functions in order to get the feel of the expressions found in the previous section. In particular, these examples clarify the appearance of q-hypergeometric functions in the lens space partition function and how they are mapped to in the ABJ partition function. We also provide a simplest example of the exact ABJ partition function.
• The CS matrix model The first example is the simplest case, the N 1 = 0 or N 2 = 0 case, which corresponds to the Chern-Simons matrix model. From (2.13) one immediately finds for the U (M ) k CS theory that Note that this takes the more familiar form [42,43] (without the level shift) if one uses the formula It should now be clear that the q-deformed Barnes G-function is a contribution from the • The lens space matrix model The next simplest example is the N 1 = 1 case studied in detail in Appendix C.2.1. From (2.13) together with (C.28) and (C.29), the U (1) k × U (N 2 ) −k lens space partition function where the special function 2 φ 1 = Φ(1, N 2 ) is a q-hypergeometric function [44] whose definition is given in Appendix A. Intriguingly, the whole function S(1, N 2 ) in the second line is essentially an orthogonal q-polynomial, the continuous q-ultraspherical (or Rogers) polynomial [45], and very closely related to Schur Q-polynomials [46].
As promised, these examples elucidate that the function S(N 1 , N 2 ) defined in (2.14) is a generalization of multiple q-hypergeometric function.

• The ABJ theory
We now present the ABJ counterpart of the previous two examples. Although we have placed great emphasis on the q-hypergeometric structure of the lens space partition function, we have not found a way to take full advantage of this fact in understanding the ABJ partition function thus far.
In the meantime, as mentioned in the previous section and discussed in great detail in Appendix C.2, we find the expression (C.56) more convenient for performing the analytic continuation N 2 → −N 2 than the q-hypergeometric representation (C.52). The end result is presented in (2.19). In the case of the U (1) k × U (N 2 ) −k ABJ partition function, one finds Note that the U (N 1 ) k ×U (N 2 ) −k ABJ theory with finite N 1 and large N 2 and k is conjectured to be dual to N = 6 parity-violating Vasiliev higher spin theory on AdS 4 with U (N 1 ) gauge symmetry [22,47]. It would thus be very interesting to study the large N 2 and k limit of the N 1 = 1 and 2 partition functions [48]. It may shed some lights on the understanding of the N = 6 parity-violating Vasiliev theory on AdS 4 . 4 Finally, we provide a simplest example of the exact ABJ partition function, i.e., the U (1) k × U (2) −k case. The integral in (3.5) can be carried out by applying a similar trick to the one used in [33]. This yields It may be worth noting that the formal series (2.15) for the U (1) k × U (2) −k theory, albeit nonconvergent, can be expressed in a closed form after a regularization: where ψ q (z) is a q-digamma function defined in Appendix A, and we used the regularization ∞ s=0 (−1) s = 1 2 . This expression is, however, not well-defined for q a root of unity and hence an integer k. On the other hand, this exemplifies the fact that the integral representation (2.19) provides an analytic continuation of the formal series (2.15) in the complex q-plane.

Checks
As mentioned in Section 2, our main result (2.19) lacks a first principle derivation. It thus requires a posteriori justification. In this section we show that our prescription passes perturbative as well as nonperturbative tests. We have, however, been unable to prove it in generality. Although our checks are on a case-by-case basis, we have examined several nontrivial cases that provide convincing evidence for our claim. 5 4 Since higher spin theories are inherently dual to vector models [49][50][51], the ABJ theory apparently contains more degrees of freedom than higher spin fields [52]. Those extra degrees of freedom are the large N 2 dual of the U (N 2 ) Chern-Simons theory and thus topological closed strings [53]. It is then plausible to expect that the higher spin partition function is given by the ratio Z ABJ /Z CS . We thank Hiroyuki Fuji and Xi Yin for related discussions. 5 We also recall that, in the ABJM case N 1 = N 2 , the expression (2.19) reproduces the "mirror description" of the ABJM partition function [39]. Furthermore, for simple cases such as (N 1 , N 2 ) = (1, 2), (1, 3), it

Perturbative expansions
The perturbative expansion of the lens space free energy is presented in [37]. In Appendix D, we extend their result to the order O(g 8 s ). We would like to see if the perturbative expansions of both (2.15) and (2.19) correctly reproduce this result with the replacement N 2 by −N 2 . We have checked the cases N 1 = 1 and N 2 up to 8, N 1 = 2 and N 2 up to 5, N 1 = 3 and N 2 up to 5, and N 1 = 4 and N 2 up to 4, to the order O(g 8 s ) and found perfect agreements with the result in Appendix D. These checks are straightforward, and we will not spell out all the details. Instead, we describe only the essential points in the calculations and illustrate with a simple but nontrivial example how the checks were done in detail.

The formal series
In the case of the formal series (2.15), as remarked in the previous section, the perturbative expansion is correctly reproduced after the generalized ζ-function regularization: where Li s (z) is the polylogarithm and B n are the Bernoulli numbers. We show the detail of the (N 1 , N 2 ) = (2, 3) example to illustrate how the generalized ζ-function regularization yields the correct perturbative expansion to the order O(g 4 s ). In this case there are two infinite sums involved. Now, recall that the summand is a function of q = exp (−g s ). Expanding it as a power series in g s and using the regularization (4.1), one finds The 2nd line of (2.15) = g 4 where we abbreviated the product Li −n 1 (−1)Li −n 2 (−1) by Li 2 −n 1 ,−n 2 . This yields in agreement with the result in Appendix D with the replacement N 2 by −N 2 . Note also that the tree contribution, the first logarithmic term, is in a precise agreement with (C.13).
is possible to explicitly carry out the ABJ matrix integral (2.1) and check that it agrees with the expression (2.19) for all k.

The integral representation
The integral representation (2.19) does not require any regularization. Instead, the generalized ζ-function regularization (4.1) is automatically implemented by the integral where n ≥ 0. It follows immediately from this fact that the 2nd line of (2.19) = the 2nd line of (2.15) (4.5) at all orders in the g s -expansions. Hence the integral representation correctly reproduces the perturbative expansions.

The Seiberg duality
As emphasized before, the integral representation (2.19) provides a "nonperturbative completion" for the formal series (2.15). A way to test this claim is to see if the Seiberg duality conjectured in [9] holds. 6 This duality is an equivalence between the two ABJ theories; schematically, We are going to show, in the simple but nontrivial case of N 1 = 1, that the partition functions of the dual pairs agree up to a phase. In fact, a proof of the Giveon-Kutasov duality including the N = 6 case was proposed in [56], which assumed one conjecture to be proven. In particular, their conjecture gives a formula for the phase differences of the dual pairs. We will explicitly confirm their claim in our examples below.
Seiberg duality for N 1 = 1 For N 1 = 1, the duality relation (4.6) reads In this case, we can actually prove that the integral representation (2.19) indeed gives identical results for the dual pair, up to a phase. Let us rewrite the (1, N 2 ) partition function given in (3.5) in the following form which is essentially the same as (3.1) up to a phase due to difference in the framing [15]. Moreover, We can show that Z 0 CS (N 2 − 1) k and I(1, N 2 ) k are separately invariant under the Seiberg duality while the phase factor e iθ(1,N 2 ) k gives a phase that precisely agrees with the one given in [56].
First, the invariance of Z 0 CS (N 2 − 1) k is nothing but the level-rank duality of the CS partition function, which means the identity Z 0 . Second, the phase difference between the dual theories (4.7) is One can show that this phase difference is exactly the same as the one given in [56]. Now let us move on to the most nontrivial part, i.e., the invariance of the integral (4.10) under the Seiberg duality. One can show that, despite appearances, the integrand is actually the same function for the dual theories (4.7) up to a shift in s. Therefore, the contour integral gives the same answer for the duals, if the contour is chosen appropriately. As explained in section 2.2, the integrand has perturbative (P) poles coming from π sin(πs) and non-perturbative (NP) poles coming from the product factor l tan. Although the integrand remains the same under the Seiberg duality, the interpretation of its poles gets interchanged; i.e., a P pole in the original theory is interpreted as a NP pole in the dual theory, and vice versa. We will see this explicitly in examples below, relegating the general proof to Appendix E.
The integrand of (4.10) is an antiperiodic (periodic) function with s ∼ = s + |k| for odd (even) k, and the P and NP poles occur on the real s axis in bunches with this periodicity. The prescription for the contour is to take it to go to the left of one of such bunches. In Appendix E, we show that this means that (4.13) 7 A proof of the level-rank duality can be found e.g. in Appendix B of [56]. This is required for the Seiberg duality to work, but it is also necessary for the ABJ partition function to be analytic in k, which is clearly the case for the original expression (2.1). In the weak coupling regime |g s | = |2πi/k| 1, the NP poles are far away from the origin (distance ∼ 1/|g s | ∼ |k|) and we can safely take η = 0 + . However, as we decrease |k| continuously, the NP poles come closer to the origin and, eventually, at some even |k|, one of the NP poles that was in the s > 0 region reaches s = 0. As we further decrease |k| continuously, this NP pole enters the s < 0 region. In order for the partition function to be analytic in k, one needs to increase the value of η so that this NP pole does not move across the contour I but stays to the right of it.

Odd k case
The integral (4.10) for odd k is equal to the following contour integral where the integral contour C is given by where the contour I k is parallel to I and shifted by |k|, and the contours I i∞ and I −i∞ are at infinity; see Figure 3. Note that the anti-periodicity of the integrand allows us to write the line integral (4.10) as a closed contour integral, but the contour is different from the tentative contour shown for the sake of sketchy illustration in Figures 1 and 2. By summing up pole residues inside C, one finds (4.15) The first term comes from P poles and the second from NP poles. Although we prove the Seiberg duality in Appendix E, it is quite nontrivial that (4.15) gives the same value for the dual pair (4.7).
Let us look at this in more detail in the following case: Using the above formulas, we obtain the partition functions of this dual pair which can be massaged into . The contour I k is parallel to I and shifted by k, and the contours I i∞ and I −i∞ are at infinity. "+" (red) denotes the P pole and "×" (blue) the NP pole. Some poles and zeros are shown slightly above or below the real s axis, but this is for the convenience of presentation and all poles and zeros are on the real s axis. The choices of the parameter η for the contour I are η = 0 + for (a) and (c), η = 1 2 + 0 + for (b), and η = 1 + 0 + for (d).
These two indeed agree up to a phase and the phase difference agrees with the conjecture made in [56]. Observe that the contributions from the P and NP poles are interchanged under the duality. See Figure 3(a), (b) for the structure of the P and NP poles in the two theories. For discussion on the pole structure in more general cases, we refer the reader to Appendix E.

Even k case
The even k case is technically a little more tricky. Using a trick similar to the one used in [33], the integral (4.10) for even k can be shown to be equal to the following contour integral where a is an arbitrary constant. For |k| 2 − N 2 + 1 ≥ 0, we can evaluate this by summing over pole residues and obtain The first line comes from P poles which are simple, while the second line comes from double poles created by simple NP and P poles sitting on top of each other. We note also that, despite its appearance, this expression does not depend on the constant a. The expression of I(1, N 2 ) k for |k| 2 − N 2 + 1 ≤ 0 is more lengthy and we do not present it, because the Seiberg duality proven in Appendix E guarantees that it can be obtained from (4.20).
Let us study in detail the following duality The partition functions of this dual pair yield These two agree up to a phase. The phase difference is again in agreement with [56]. The pole structure of the two theories is shown in Figure 3(c), (d). In the above, "P+NP" means the contribution from a double pole that comes from P and NP poles on top of each other. Again, the contributions from the P and NP poles are interchanged under the duality. Actually, in the even k case, there is a subtlety in interpreting simple poles as P or NP, but for details we refer the reader to Appendix E.

Conclusions and discussions
In this paper, we have studied the partition function of the ABJ theory, i.e., the N = 6 supersymmetric U (N 1 ) k ×U (N 2 ) −k Chern-Simons-matter theory dual to M-theory on AdS 4 × S 7 /Z k with a discrete torsion or type IIA string theory on AdS 4 × CP 3 with a NS-NS B 2field turned on [9]. More concretely, we have computed the ABJ partition function (2.1) and found the expression (2.19) in terms of min(N 1 , N 2 )-dimensional integrals as opposed to the original (N 1 + N 2 )-dimensional integrals. This generalizes the "mirror description" of the partition function of the ABJM theory [39] and may serve as the starting point for the ABJ generalization of the Fermi gas approach [29]. We have taken an indirect approach: Instead of performing the eigenvalue integrals in (2.1) directly, we have first calculated the partition function of the L(2,1) lens space matrix model (2.7) exactly and found the expression (2.13) as a product of q-deformed Barnes G-function and a generalization of multiple q-hypergeometric function. We have then performed the analytic continuation N 2 → −N 2 of the lens space partition function to obtain the ABJ partition function. As checks we have shown that our main result (2.19) correctly reproduces perturbative expansions and in the N 1 = 1 case, i.e., for the U (1) k × U (N 2 ) −k theories, the Seiberg duality indeed holds. In particular, we have uncovered that the perturbative and nonperturbative contributions to the partition function are interchanged under the Seiberg duality and derived, in the N 1 = 1 case, the formula for the phase difference of dual-pair partition functions conjectured in [56]. It is also worth remarking that the ABJ partition function (2.19) vanishes for |N 1 − N 2 | > k in line with the conjectured supersymmetry breaking [40].
As commented before, we note, however, that the analytic continuation is ambiguous and we have adopted a particular prescription that required a posteriori justification. Especially, our prescription involves an intermediate step, namely an infinite sum expression, (2.15) which is non-convergent and becomes singular for an even integer k. Although the integral representation (2.19) provides a regularization and an analytic continuation of the formal series (2.15) in the complex q-plane, it would be better if we could render every step of the calculation process well-defined. In this connection, it is somewhat dissatisfying that the qhypergeometric structure enjoyed by the lens space partition function becomes obscured after the analytic continuation to the ABJ partition function. It might be that there is a better way to perform the analytic continuation that manifestly respects the q-hypergeometric structure and directly yields a finite sum expression for an integer k without passing to the integral representation.
Although the successful test of the Seiberg duality for the U (1) k × U (N 2 ) −k theories provides compelling evidence for our prescription, a general proof is clearly desired. In this regard, we note, as discussed in Section 4.2, that the Seiberg duality acts on the U (|N 1 −N 2 |) k CS factor and the integral part separately. Namely, apart from a phase factor, the CS and the integral parts are respectively invariant under the duality, where the invariance of the former follows from the level-rank duality. Thus the general proof amounts to showing the invariance of the integral part, i.e., the second line of (2.19). We leave this proof for a future work.
Following this work, there are a few more immediate directions to pursue: It is straightforward to generalize our computation of the partition function to Wilson loops [57][58][59][60][61]. Indeed, we can proceed almost in parallel with the case of the partition function for the most part including the analytic continuation, although the computation becomes inevitably more involved. We hope to report on our progress in this direction in the near future [62]. It may also be possible to apply our method to more general CSM theories with fewer supersymmetries, provided that a similar analytic continuation works. Meanwhile, we have stressed in the introduction that this work may have significance to the study of higher spin theories, especially, in connection to the recent ABJ triality conjecture [22]. As mentioned towards the end of Section 3, it is in fact feasible to analyze the U (1) k × U (N 2 ) −k and U (2) k × U (N 2 ) −k partition functions at large N 2 and k [48]. This may shed lights on the understanding of the N = 6 parity-violating Vasiliev theory on AdS 4 . In particular, for the U (1) k × U (N 2 ) −k theory, the fact that the Seiberg duality separately acts on the U (N 2 −1) CS and the integral parts seems to suggest that it is only the integral part that may be dual to the vector-like Vasiliev theory.
Last but not least, it is most important to gain, if possible, new physical and mathematical insights into the microscopic description of M-theory through all these studies. Although the ABJ(M) theory is a very useful and practical description of maximally supersymmetric 3d conformal field theories, the construction by Bagger-Lambert and Gustavsson based on a 3-algebra [63,64] is arguably more insightful, suggesting potentially a new mathematical structure behind quantum membrane theory. What we envisage in this line of study is to search for a way to reorganize the ABJ(M) partition function in terms of the degrees of freedom that might provide an intuitive understanding of the N 3/2 scaling and suggest hidden structures behind the microscopic description of M-theory such as 3-algebras.

A q-analogs
Roughly, a q-analog is a generalization of a quantity to include a new parameter q, such that it reduces to the original version in the q → 1 limit. In this appendix, we will summarize definitions of various q-analogs and their properties relevant for the main text. q-number: For z ∈ C, the q-number of z is defined by q-Pochhammer symbol: For a ∈ C, n ∈ Z ≥0 , the q-Pochhammer symbol (a; q) is defined by (a; q) n := For z ∈ C, (a; q) z is defined by the last expression: This in particular means For n ∈ Z ≥0 , (a; q) −n = 1 (aq −n ; q) n = 1 n k=1 (1 − a/q k ) .

(A.5)
Note that the q → 1 limit of the q-Pochhammer symbol is not the usual Pochhammer symbol but only up to factors of (1 − q): lim q→1 (q a ; q) n (1 − q) n = a(a + 1) . . . (a + n − 1). (A.6) We often omit the base q and simply write (a; q) ν as (a) ν . 8 Some useful relations involving q-Pochhammer symbols are where µ, ν, z ∈ C and Γ q (z) is the q-Gamma function defined below. For n ∈ Z, we have the following formulae which "reverse" the order of the product in the q-Pochhammer symbol: (aq z ) n = (−a) n q zn+ 1 2 n(n−1) (a −1 q 1−n−z ) n , (A.11) If ν = n + with | | 1, the correction to this is of order O( ): Here we assumed that a = 1 and a − 1 O( ), q-factorials: For n ∈ Z ≥0 , the q-factorial is given by q-Gamma function: For z ∈ C, the q-Gamma function Γ q (z) is defined by The q-Gamma function satisfies the following relations: The behavior of Γ q (z) near non-positive integers is where n ∈ Z ≥0 , and → 0. As q → 1, this reduces to the formula for the ordinary Γ(z), Γ(−n + ) = (−1) n Γ(n + 1) 1 + · · · , Γ(n + 1) = n! . (A.20) q-Barnes G function: For z ∈ C, the q-Barnes G function is defined by [65] G 2 (z + 1; q) : Some of its properties are The behavior of G 2 (z; q) near non-positive integers is where n ∈ Z ≥0 , and → 0. As q → 1, this reduces to the formula for the ordinary G 2 (z), q-digamma and q-polygamma functions The q-digamma function ψ q (z) and q-polygamma function ψ (n) q (z), n ∈ Z ≥0 , are defined by From the definition of Γ q (z), it straightforwardly follows that (A.28) q-hypergeometric function (basic hypergeometric series): The q-hypergeometric function, or the basic hypergeometric series with base q, is defined by [44] r φ s In particular, for r = k + 1, s = k,

B Lens space matrix model
The partition function for the lens space matrix model was defined in (2.7). Here, we explicitly carry out the integral and write the result in a simple closed form as given in (2.11), (2.13). The following computation can be thought of as a generalization of the matrix integration technique using Weyl's denominator formula (see for example [15,37]), explicitly worked out. First, we note that the 1-loop determinant part can be reduced to a single Vandermonde determinant by shifting the integration variables as µ j → µ j − iπ 2 , ν a → ν a + iπ 2 , as follows: where N := N 1 + N 2 and ∆(µ, ν) is the Vandermonde determinant for (µ j , ν a ) which can be evaluated as Here, S N is the permutation group of length N and (−1) σ is the signature of σ ∈ S N . Because each term in (B.2) is an exponential whose exponent is linear in µ j , ν a , the integral in (2.7) is trivial Gaussian. After carrying out the µ i , ν a integrals and massaging the result a little bit, we obtain

C Analytic continuation to ABJ matrix model
Here, we will obtain the ABJ matrix model partition function by analytically continuing the lens space matrix model partition function (B.16) under N 2 → −N 2 .

C.1 Normalization
It has been shown [38] that the partition functions for the lens space and ABJ theories agree order by order in perturbation theory upon analytic continuing in the rank as N 2 → −N 2 .
Our strategy is to apply this analytic continuation to the lens space partition function to obtain the exact expression for the ABJ partition function. However, in order to analytically continue the partition functions, not just their perturbative expansion, we must properly normalize them, which is what we discuss first.
Because we already know [38] that the analytic continuation works perturbatively, all we have to do is to match the tree level part of the partition function. In the weak coupling limit g s → 0, the lens space partition function (2.7) reduces to Z lens,tree := Z lens (g s → 0) This is essentially the product of two copies of Gaussian matrix model partition function: where V (n, g s ) is the U (n) Gaussian matrix model integral, V (n, g s ) can be computed explicitly as [66] V (n, g s ) = g where G 2 (z) is the (ordinary) Barnes function. In the present case we have g s = 2πi k and the integral (C.3) is the Fresnel integral. Similarly, the ABJ partition function (2.1) reduces in the weak coupling limit to In the second equality, we used the fact that, because g s = 2πi/k, the Gauss integrals we are doing are actually Fresnel integrals and therefore (±g s ) Using (C.6), the tree level ABJ partition function (C.5) can be written as Looking at (C.2) and (C.8), one may think that Z lens is analytically continued to Z ABJ under N 2 → −N 2 . However, this does not work because N 2 ! = Γ(N 2 + 1) and V (N 2 , g s ) do not transform in the right way under N 2 → −N 2 . To find the correct way to normalize partition function, we observe that the Gaussian matrix model (C.3) can be thought of as coming from gauge fixing the "ungauged" Gaussian matrix integral, to the eigenvalue basis. Our claim is that it is such ungauged matrix integrals that should be used for analytic continuation between lens space and ABJ theories. Let us make this statement more precise. Note that the relation between the ungauged Gaussian matrix integral (C.9) and its gauge-fixed version (C.3), (C.4) is Based on this observation, we define the ungauged partition function for the lens space theory as follows: where we used the relation G 2 (n + 2) = n! G 2 (n + 1). The weak coupling limit (g s → 0, k → ∞) of this is which does not involve G 2 or N 2 !. In a similar manner, we define the ungauged partition function for the ABJ theory by The weak coupling limit of this is (C. 16) By comparing (C. 13) and (C.16), we find that the tree level partition functions are related simply as Therefore, including the perturbative part, we expect that the full partition functions satisfy We will see that this indeed holds in explicit examples.
In terms of Z lens , our result (B.16) for the lens space partition function can then be written as where we defined B(l, m, n) := G 2 (l + 1; q) G 2 (m + 1)G 2 (n + 1) .
Recall that G 2 (z) has zeros at z = 0, −1, −2, . . . . Therefore, B(l, m, n) for l, m, n ∈ Z is finite if m, n ≥ 0 but can be divergent if m ≤ 0 or n ≤ 0. In going from the lens space matrix model to the ABJ matrix model, we flipped the sign of the quadratic term for ν a . However, we could have flipped the sign of the quadratic term for µ j . This implies a simple relation between Z lens (N 1 , −N 2 ) k and Z lens (N 2 , −N 1 ) k . The relation is (C.21) Here we have −k on the right hand side because flipping the sign of the quadratic term in µ j , not ν a , will change the sign of g s → −g s in perturbative expansion. In view of the relation (C.18), this is nothing but (2.6).

C.2 Analytic continuation
We would like to analytically continue Z lens (N 1 , N 2 ) k in N 2 . The explicit expression for Z lens (N 1 , N 2 ) k is given by (C.19). In particular, we are interested in continuing N 2 to a negative integer −N 2 where N 2 ∈ Z >0 . However, this is not so simple because Barnes G 2 (z) vanishes for negative integral z and hence B(N 1 + N 2 , N 1 , N 2 ) in (C.19) diverges at N 2 = −N 2 . To deal with this situation, let us analytically continue N 2 to and send → 0 at the end of the computation. Using the behavior of G 2 (z; q), G 2 (z) near negative integral z given in (A.25) and (A.26), one can show that B (N 1 +N 2 , N 1 , N 2 ) diverges as → 0 as where we only kept the leading term. Therefore, in order for the entire Z lens to remain finite as → 0, the function S(N 1 , −N 2 + ) should vanish as In the following, we will explicitly carry out analytic continuation of S(N 1 , N 2 ) and find that it indeed behaves as (C.24). We will begin with the simple cases with N 1 = 1, 2 to get the hang of it, and then move on to the general N 1 case.
The simplest case is N 1 = 1, for which (B.17) gives where n = C − 1. (a) n is the q-Pochhammer symbol defined in Appendix A. We want to analytically continue this expression in N 2 . The explicit N 2 dependence of the sum range seems to be an obstacle, but it can be circumvented by the following observation: as a function of z, (q) z has poles of order 1 at z ∈ Z <0 , while (−q) z has no poles. Therefore, the summand in (C.26) vanishes unless 0 ≤ n ≤ N 1 , and we can actually extend the range of summation as This expression can be analytically continued to complex N 2 , including negative integers. 9 We can rewrite (C.27) in different forms which we will find more convenient. First, using (A.10) and (A.11), one can show that This expression is useful because the relation to q-hypergeometric function is manifest. The q-hypergeometric function 2 φ 1 is defined in Appendix A. In addition, this way of writing S is useful because it splits it into β which vanishes for negative integral N 2 ∈ Z <0 and Φ which is finite for all N 2 ∈ Z. It is easy to see that the first factor β vanishes for negative However, we are actually setting N 2 = −N 2 + and we have to keep track of how fast this vanishes as → 0. β(1, −N 2 + ) involves (±q) −N 2 + which, using (A.7) with z = −1 + and (A.12), can be rewritten as The behavior of (±q) −1+ can be seen, using the definition (A.3), as follows: where we kept only leading terms. We will do this kind of manipulation to extract → 0 behavior over and over again below, but we will not present the details henceforth. So, the behavior of β(1, N 2 ) near integral N 2 is The O( ) behavior for N 2 < 0 is the correct one to cancel the divergence of B that we saw in (C.23), (C.24). On the other hand, the second factor Φ in (C.28) is finite for all N 2 ∈ Z. For N 2 > 0, (q −N 2 ) n becomes zero for n ≥ N 2 + 1 and the sum reduces to a finite sum. For N 2 = −N 2 < 0, the sum (q −N 2 ) n = (q N 2 ) n is non-vanishing for all n ≥ 0.
finite finite Table 1: The → 0 behavior of various quantities for N 1 = 1. Although B and S = βΦ = γΨ can be individually singular, the partition function Z ∝ BS is always finite.
There is another useful expression for S(1, N 2 ). Using q-Pochhammer formulas, we can show that and we relabeled n → s. This expression is useful because some symmetries are more manifest, as we will see later in the N 1 ≥ 2 cases. At the same time, however, Ψ is slightly harder to deal with for N 2 > 0 than Φ, because (q s+1 ) −N 2 −1 = 1 (q s−N 2 ) N 2 +1 can diverge. So, in this way of writing S, we should introduce even for N 2 > 0 and set N 2 → N 2 + . Just as we did for β, we can evaluate γ(1, N 2 ) near integral N 2 and the result is For N 2 < 0, this just cancels the −1 divergence from B given in (C.23), while Ψ is finite. For N 2 > 0, for which B is finite, the coming from (C.36) is canceled by Ψ which goes as −1 in this case. In more detail, for N 2 > 0, it is only the 0 ≤ s ≤ N 2 terms in Ψ that behave as −1 and cancel against γ ∼ , whereas the s > N 2 terms are finite and vanish when multiplied by γ ∼ . This is a complicated way to say that, in the sum (C.27), only 0 ≤ s ≤ N 2 terms contribute.
Introduction of all these quantities may seem unnecessary complication, but this will become useful in more general N 1 ≥ 2 cases discussed below. How various quantities behave as → 0 is summarized in Table 1.
Now we are ready to present the expression for the analytically continued partition function Z lens for N 1 = 1 and N 2 = −N 2 < 0. Combining (C. 35) and (C.36), and using (C.23), we obtain the expression for the ABJ partition function Z ABJ (1, N 2 ) k = Z lens (1, −N 2 ) k : For N 1 = 2, the general formula (B.17) gives the following expression for S: Just as we did for the N 1 = 1 case, we want to analytically continue this expression by eliminating the explicit N 2 dependence of the sum range by extending it. However, this turns out to be a non-trivial issue and, in particular, the way to do it is not unique. Before discussing it, let us first consider rewriting S in different forms. First, just as in the N 1 = 1 case, we can rewrite S in a form closely related to qhypergeometric functions. Namely, (q −N 2 ) n 1 +n 2 (−q 2 ) n 1 +n 2 (−q −N 2 ) n 1 +n 2 (q 2 ) n 1 +n 2 (C. 42) and C 1 − 1 = n 1 , C 2 − C 1 − 1 = n 2 . The original range of summation corresponds to n 1 ≥ 0, n 2 ≥ 0, n 1 + n 2 ≤ N 2 , but we did not specify the range here for the reason mentioned above. This expression is the analogue of the N 1 = 1 relation (C.28); β diverges for N 2 < 0 while Φ is finite for both N 2 > 0 and N 2 < 0. Φ has the same form as the double qhypergeometric function defined in [44], if the summation were over n 1 , n 2 ≥ 0. The second expression for S is where γ(2, N 2 ) = − (−q) 2 and s 1 = C 1 − 1, s 2 = C 2 − 1. This expression is the analogue of (C.34). The original range of summation corresponds to 0 ≤ s 1 < s 2 ≤ N 2 + 1. Now let us discuss the issue of the sum range. For the purpose of studying when the summand vanishes, the βΦ expression (C.41) is convenient, because β just cancels the divergence of B while Φ is always finite. So, all we need to know is when the summand in Φ vanishes. Note that, when regularized, (q m ) n with m, n ∈ Z has the following behavior: otherwise. (C.45) Here, regularizing (q m ) n means to replace N 2 entering m, n by N 2 + . Furthermore, when n 1 , n 2 < 0, we must regularize the summand in (C.42) by setting n 1 → n 1 + η, n 2 → n 2 + η with η → 0. In this case, we must replace O( ) in (C.45) by O( , η) and O( −1 ) by O( −1 , η −1 ). Using this, it is straightforward to determine the range of (n 1 , n 2 ) for which the summand in Φ remains non-vanishing after setting , η → 0. In Figure 4, we described the regions in the (n 1 , n 2 ) plane in which the summand appearing in Φ(1, N 2 ) is non-vanishing. Figure 4(a) shows that, for N 2 > 0, the summand is non-vanishing in the original range of summation, n 1 ≥ 0, n 2 ≥ 0, n 1 + n 2 ≤ N 2 (region I), as it should be. We would like to extend the range in order to eliminate the N 2 dependence and thereby analytically continue Φ(1, N 2 ) to negative N 2 . The requirements for the extension are (i) The range specification does not involve N 2 , (ii) For N 2 > 0, it reproduces the original result (C.40).
Clearly, there are more than one ways to extend the range satisfying these requirements. One simple way would be to take n 1 ≥ 0, n 2 ≥ 0 as the extended range. For N 2 > 0, this reduces to region I and reproduces the original result, while for N 2 < 0 this sums over region I in Figure 4(b). (We consider N 2 ≤ −2, since N 2 = −1 is rather exceptional as one can see in Figure 4(c). The latter case will be discussed later.) Another possible extension is n 2 ≥ 0. This also reproduces the original result for N 2 > 0, but for N 2 < 0 this sums over not only regions I but also IIA and IIB.
Therefore, the way to analytically continue Φ(1, N 2 ) is ambiguous and, mathematically, any such choices are good (ignoring the fact that the sum may not be convergent and is only formal). Namely, the data for discrete N 2 ∈ Z >0 is not enough to uniquely determine the analytic continuation for all N 2 ∈ C. Additional input comes from the physical requirement that it reproduce the known ABJ results for N 2 < 0. Furthermore, for N 2 = −1, Z lens (2, −1) k is expected to be related to Z lens (1, −2) −k by the relation (C.21).
Here we simply present the prescription which satisfies these physical requirements. The explicit checks are done in the main text where it is shown that its perturbative expansions agree with the known ABJ result and, when exact non-perturbative expressions for the ABJ matrix integral are known, it reproduces them. Moreover, the fact that the prescription reproduces the relation between Z lens (2, −1) k and Z lens (1, −2) −k is shown for general N 1 below.
The key observation to arrive at such a prescription is that, as we can see from Figure  4(a), the summand is non-vanishing not only in the original region I but also in region IV. The meaning of this is easier to see in the γΨ representation in terms of s 1 , s 2 . In Figure 5, we presented the same diagram as Figure 4 but on the (s 1 , s 2 ) plane. As we can see from the Figure, the non-vanishing regions have the symmetry Actually, as we can immediately see from the explicit expression for Ψ given in (C.44), this is a symmetry of the summand, not just its non-vanishing regions. Therefore, it is natural to relax the ordering constraint s 1 < s 2 in the original range and sum over both regions I and IV, after dividing by 2. If s 1 = s 2 , the summand in (C.44) automatically vanishes. Namely, we can write Ψ as (C.47) Figure 5: The regions that can contribute to Φ(1, N 2 ). These are the same as Figure 4, but plotted for (s 1 , s 2 ) instead.
Here we have extended the sum range so that s 1 , s 2 run to infinity, which is harmless in the N 2 > 0 case. Our prescription is that we use the expression (C.47) even for N 2 = −N 2 < 0. As we can see from Figure 5(b), this sums over regions I and IVA. As we have been emphasizing, it is by no means clear at this point that this is the right prescription. The justification is given in the main text where it is shown that this is consistent with all known results. One can also show that the other possible prescriptions, such as n 1 ≥ 0, n 2 ≥ 0, which covers region I, and n 2 ≥ 0, which covers regions I, IIA and IIB, would not reproduce the known results and hence are not correct.
If we set N 2 → N 2 + , the behavior of γ is γ(2, N 2 + ) = ln q 2 2 for all N 2 ∈ Z. (C.48) Substituting this and (C.23) into (C.19), we finally obtain the expression for the ABJ partition function Z ABJ (2, N 2 ) k = Z lens (2, −N 2 ) k : where it is assumed that N 2 ≥ 2 and Ψ(1, −N 2 ) is given simply by setting N 2 = −N 2 in (C.47): The above formula is valid for N 2 ≥ 2 but not for N 2 = 1. This case is important, because (N 1 , N 2 ) = (2, 1) is related to (N 1 , N 2 ) = (1, 2) by (C.21) and therefore the summation over two variables s 1 , s 2 should truncate to a sum with one variable; this provides a further check of our prescription. We will discuss this more generally below, where we discuss general N 1 .

C.2.3 General N 1
With the N 1 = 1, 2 cases understood, the prescription for general N 1 is straightforward to establish, although computations get cumbersome. Much as in the N 1 = 1, 2 cases, the general expression for S in (B.17) can be rewritten in the following form: In expressions such as this, it is understood that b l=a ... = 0 and b l=a ... = 1 if a > b. Again, we can rewrite this in the βΦ and γΨ representations. The βΦ representation is where we defined n 1 = C 1 − 1, n j = C j − C j−1 − 1 (j = 2, . . . , N 1 ), and n a,b := b l=a n l . Furthermore, we define n N 1 +1,b = n a,N 1 +1 = 0. The original sum range 1 ≤ C 1 < · · · < C N 1 ≤ N corresponds to n j ≥ 0 (j = 1, . . . , N 1 ), n 1 + · · · + n N 1 ≤ N 2 , but we did not specify it in (C.54) for the same reason as in the N 1 = 2 case. Φ has the form of the multi-variable generalization of q-hypergeometric functions, discussed e.g. in [67]. When we analytically continue by N 2 → −N 2 + , β(N 1 , −N 2 + ) goes to zero, while Φ(N 1 , −N 2 ) remains finite. The behavior of β as → 0 is On the other hand, the γΨ representation is where s j := C j − 1, j = 1, . . . , N 1 . The original sum range corresponds to 0 ≤ s 1 < · · · < s N 1 ≤ N − 1. However, because of the s j ↔ s k symmetry of this expression, we can forget about the ordering constraints and let s j run freely, if one divides the expression by N 1 !, which we have already done above. Furthermore, just as in the N 1 = 2 case, we can safely remove the upper bound in the summation for N 2 > 0. Our prescription for analytic continuation to N 2 < 0 is to use this same expression (C.58), by setting N 2 = −N 2 + with → 0. The behavior of γ(N 1 , N 2 ) near integral N 2 can be shown to be By substituting (C.56) and (C.23) into (C. 19), we obtain the expression for the ABJ partition function Z ABJ (N 1 , N 2 ) k = Z lens (N 1 , −N 2 ) k : where we assumed that N 2 ≥ N 1 and The above expression is valid only for N 2 ≥ N 1 . If N 2 < N 1 , then the summation in (C.61) over N 1 variables should reduce to that of Z lens (N 2 , −N 1 ) k over N 2 variables to be consistent with the symmetry (C.21). Let us see how this works by setting N 2 → N 2 − in (C.61). Because of (C.23) and (C.59), only terms that diverge as ∼ −(N 1 −N 2 ) in the s-sum survive. Divergences can appear from where we are keeping only the leading term. For this to give a divergent (∼ −1 ) contribution, it should be that with s j ≥ 0 and multiply the result by a combinatoric factor N 1 By substituting these into (C.61) and massaging the result, we can show Namely, the summation over N 1 variables s 1 , . . . , s N 1 correctly reduced to summation over N 2 variables s 1 , . . . , s N 2 , and the dependence of Ψ, combined with γ ∼ N 1 , is the correct one to cancel the divergence of B ∼ −N 2 (see (C.23)). So, for N 2 < N 1 , the expression for the ABJ partition function Z ABJ (N 1 , (−1) Table 2: The → 0 behavior of various quantities for general N 1 . If N 2 < 0, we define Using the explicit expressions (C.60) and (C.65), It is straightforward to show that the relation (C.21) between Z lens (N 1 , −N 2 ) k and Z lens (N 2 , −N 1 ) −k holds.
In Table 2, we present a summary of how various quantities behave as → 0 for various values of N 2 .

D The perturbative free energy
In this appendix, we present the free energy of the lens space matrix model computed by perturbative expansion, up to eight loop order O(g 8 s ):

.
This perfectly agrees with the result in [37] to the order presented there. Meanwhile, we have explicitly checked that the perturbative free energy of the ABJ matrix model is indeed related to the lens space free energy by including the tree contribution with the normalization discussed in Appendix C.1.

E The Seiberg duality
In this Appendix, we show that the (1, N 1 ) ABJ partition function Z ABJ (1, N 1 ) k given in (4.8) is invariant under the Seiberg duality (4.7) up to a phase. Because in the main text we have shown that Z 0 CS (N 2 − 1) k is invariant and that the phase factor precisely agrees with the one given in [56], all that remains to be shown is the invariance of the integral I(1, N 2 ) k defined in (4.10).
As claimed in the main text, for Seiberg dual pairs, we can show that the integrand appearing in I(1, N 2 ) k is the same up to a shift in s. More precisely, the claim to be proven is that the integrand f N 2 (s) := π sin(πs) has the following property: Therefore, as long as we take the prescription (4.13) for the contour, I(1, N 2 ) k defined by the contour integral (4.10) remains the same. Note that, if two meromorphic functions f (s) and g(s) have poles and zeros at the same points and with the same order, then they must be equal to each other up to an overall constant. This can be shown as follows. If z = α is a pole or a zero, we can write f (s) = a(z − α) n , g(s) = b(z − α) n near z = α by the assumption. This means that f /f = g /g = n(z − α) −1 near z = α. Now, recall that Mittag-Leffler's theorem in complex analysis states that, if two functions have poles at the same points and if the singular part of the Laurent expansion around each of them is the same, then the two functions are identical. So, because f /f and g /g share poles and residues, they must be identical. This means that f (s) = cg(s) with a constant c. In the present case, it is easy to show that the overall scale of f N 2 (s) and f N 2 (s− |k| 2 +N 2 −1) is the same asymptotically, because both tend to 2πi N 2 −2 e −πσ for s = iσ, σ → +∞. So, in order to show that these two functions are equal, we only have to show that they share poles and zeros.
So, let us compare the poles and zeros of the two functions f N 2 (s) and f N 2 (s− |k| 2 +N 2 −1). Recall the expression for f N 2 (s) given by (E.1). First, π sin(πs) gives simple poles at s ∈ Z (P poles) but no zero. On the other hand, tan π(s+j) |k| gives simple poles at s = |k|(p + 1 2 ) − j, p ∈ Z (NP poles), and simple zeros at s = |k|q − j, q ∈ Z (NP zeros). Using this data, we can find the pole/zero structure of the two functions as we discuss now. We should consider odd and even k cases separately, Odd k: For odd k, f N 2 (s) has poles but no zeros. All poles are simple poles and they can be divided into two groups: (b) |k| 2 − N 2 + 1 ≤ 1 (shown is the N 2 = 6, |k| = 7 case). Figure 6: The pole/zero structure of the integrand function for odd k. "+" (red) denotes the P pole, "×" (blue) the NP pole, and "•" (green) the NP zero. Some poles and zeros are shown slightly above or below the real s axis, but this is for the convenience of presentation and all poles and zeros are on the real s axis. If the original theory is in case (a) |k| 2 − N 2 + 1 ≥ 1, then the Seiberg dual is in case (b) |k| 2 − N 2 + 1 ≤ 1, and vice versa. In the figure, actual Seiberg dual theories are shown. In the upper panels, all P poles coming from π sin πs and all NP poles and NP zeros coming from j tan are shown. In the lower panels, P poles and NP zeros that cancel each other are removed. We see that the actual poles are the same in the dual theories (a) and (b), with P and NP poles interchanged.
where periodicity s ∼ = s + |k| is understood; see Figure 6. Note that this is valid even for |k| 2 − N 2 + 1 < 0, for which some of the poles are at s < 0. P means poles coming from π sin πs while NP means poles coming from j tan. Some of the P poles got canceled by NP zeros and reduced to regular points. NP poles are not canceled. P and NP poles never collide, because the former are at integral s while the latter are at half-odd-integral s. This is the same as (E.3), with P and NP interchanged. This proves the identity (E.2) for odd k. Figure 6 shows the explicit pole/zero structure in the specific case of U (1) 7 ×U (3) −7 = U (1) −7 × U (6) 7 .

Figure 7:
The pole/zero structure of the integrand function for even k. See Figure 6 for explanation of the symbols. In the figure, actual Seiberg dual theories are shown. In the upper panels, all P poles coming from π sin πs and all NP poles and NP zeros coming from j tan are shown. In the lower panels, poles that are canceled by NP zeros are removed. If a P pole, a NP pole and a NP zero all collide, the resulting simple pole is interpreted as a NP pole. The surviving poles are the same in the dual theories (a) and (b), with P and NP poles interchanged. where s ∼ = s + |k| is again implied; see Figure 7. For k even, NP zeros can cancel P poles and NP poles, and it becomes ambiguous whether we should call a particular pole P or NP. This happens in the |k| 2 − N 2 + 1 < 0 case, where a P pole, a NP pole and a NP zero all can be at the same point. When this happens, we think of the P pole getting canceled by the NP zero, and group the remaining simple pole into NP, as we did above. This is arbitrary, but it is a unique choice for which the structure (E.6) becomes identical to the odd k case, (E.3).