BPS states, crystals and matrices

We review free fermion, melting crystal and matrix model representations of wall-crossing phenomena on local, toric Calabi-Yau manifolds. We consider both unrefined and refined BPS counting of closed BPS states involving D2 and D0-branes bound to a D6-brane, as well as open BPS states involving open D2-branes ending on an additional D4-brane. Appropriate limit of these constructions provides, among the others, matrix model representation of refined and unrefined topological string amplitudes.


Introduction
This review is devoted to some aspects of counting of BPS states in a system of Dpbranes, with even p, in type IIA string compactifications. The problems of BPS counting span a vast area of research in supersymmetric gauge and string theories. Their important feature is a special, non-constant character of BPS multiplicities: their values depend on various moduli and jump discontinuously along some special loci in the corresponding moduli space, so called walls of marginal stability. The pattern of these jumps follows wallcrossing formulas, found from physical perspective by Denef and Moore [1] and, in more general context, formulated mathematically by Kontsevich and Soibelman [2]. The regions of the moduli space in between walls of marginal stability, in which BPS multiplicities are (locally) constant, are called chambers.
The BPS states we are interested in, and which we will refer to as closed BPS states, arise as bound states of a single D6-brane with arbitrary number of D0 and D2-branes wrapping cycles of a toric Calabi-Yau space. More generally, we will also consider open BPS states, which arise when an additional D4-brane spans a lagrangian submanifold inside the Calabi-Yau space and supports open D2-branes attached to it. The closed and open BPS states give rise, respectively, to single-particle states in the effective four-dimensional and two-dimensional theory (in remaining, space-time filling directions of, respectively, D6 and D4-branes). In this context the character of BPS multiplicities can be understood in much detail, and it relates to other interesting exactly solvable models: free fermions, crystal, and matrix models. In brief, these connections arise as follows. Firstly, BPS states we consider turn out to be in one-to-one correspondence with configurations of certain statistical models of melting crystals. The structure of these crystals depends on geometry of the underlying Calabi-Yau space, as well as on the chamber one is considering. In consequence BPS counting functions, upon appropriate identification of parameters, coincide with generating functions of melting crystals. It turns out that the structure of these crystals can be given a free fermion representation. Furthermore, once such free fermion formulation is known, it can also be represented in terms of matrix models. Connection with vast theory of matrix models has many interesting mathematical and physical consequences and allows to shed new light on wall-crossing phenomena. The aim of this review is to explain these connections.
The BPS generating functions which we consider are intimately related to topological string amplitudes on corresponding Calabi-Yau spaces. This relation is most transparent in the physical derivation discussed in section 2, which relies on lifting the D-brane system to M-theory. The M-theory viewpoint makes contact with original formulation of closed topological strings by Gopakumar and Vafa [3,4], and open topological strings by Ooguri and Vafa [5]. In particular, in one specific, so called non-commutative chamber, the BPS generating function is given as the modulus square of the topological string partition function. In all other chamber BPS generating functions can be uniquely determined from that non-commutative result. There is also another special, so called commutative chamber, in which BPS generating function coincides (up to the factor of MacMahon function) with the topological string partition function. For toric manifolds which we consider, such topological string amplitudes can be constructed, among the other, by means of the powerful topological vertex formalism [6]. Relation to crystal models was in fact first understood in this topological string chamber [7,8,9]. One advantage of the formalism presented in this review is the fact that it allows to construct matrix model representation of all these generating functions (so, in particular, matrix model representation of topological string amplitudes).
In more detail, we will consider generating functions of D2 and D0-branes bound to a single D6-brane of the following form form where α ∈ Z is D0-brane charge, and β ∈ H 2 (X, Z) is D2-brane charge. Multiplicities As we will show, generating functions of such open BPS states can be identified with integrands of matrix models mentioned above.
One more important aspect of BPS counting is referred to as refinement, and amounts to refining BPS counting by introducing one more parameter, customarily denoted β. The refinement can be introduced from several perspectives which give rise to identical results, however their fundamental common origin is still not fully understood. We will introduce refinement by distinct counting of states with different SU(2) spins inside spacetime SO (4) rotation group in the generating function (1). In [10] it was argued that this physical viewpoint should agree with the mathematical counterpart of motivic deformation [2], and also a refined version of a crystal model was constructed. Another notion of refinement arises in Nekrasov partition functions, which are defined in a non-trivial gravitational (so called Ω-) background parametrized by two parameters ǫ 1 and ǫ 2 [11]. Nekrasov partition functions can also be defined for five-dimensional gauge theories and then they agree with topological string amplitudes. In particular, the formalism of the topological vertex [6] has also been extended to the refined context in [12], and shown to reproduce relevant Nekrasov partition functions. Also BPS generating functions, in the limit of commutative chamber, are known to reproduce refined topological string amplitudes with β = −ǫ 1 /ǫ 2 [13]. However the worldsheet definition of refined topological string amplitudes is not fully understood.
As an exemplary and, hopefully, inspiring application of the entire formalism presented in this review, in the final section 6 we derive matrix model representation of the refined topological string partition function for the conifold. The refined matrix model which we find has a standard measure, however its potential is deformed by β-dependent terms. It is obtained by constructing appropriate refined crystal model and free fermion representation, and subsequently reformulating this representation in matrix model form. Finally, taking the limit of the commutative chamber, we obtain matrix model representation of the refined topological string amplitude. Even though we demonstrate this result in the conifold case, with some technical effort it can be generalized to other toric manifolds which we consider. 1

Short literature guide
The literature on the topics presented in this paper is extensive and still growing, and we unavoidably mention just a fraction of important developments. The relation between 1 As we recall in section 6, refined topological string amplitudes were also postulated to be reproduced by another type of matrix models, so-called β-deformed ones (whose Vandermonde measure is deformed by raising it to power β); however explicit computations showed that this cannot be the correct representation of refined amplitudes.
Donaldson-Thomas invariants for the non-commutative chamber of the conifold was first found by Szendroi [14]. It was generalized to orbifolds of C 3 , and related to free fermion formalism, by Bryan and Young [15]. The relation to free fermions and crystals was extended to a large class of toric manifolds without compact four-cycles [16,17]. These developments were accompanied by other mathematical works [18,19].
In parallel to the above mentioned mathematical activity, wall-crossing phenomena for local Calabi-Yau manifolds were analyzed from physical viewpoint. The analysis of nontrivial BPS counting for the conifold was described by Jafferis and Moore in [20]. This and more general cases were related to quivers and crystal models in [21,22]. Derivation of BPS degeneracies from M-theory viewpoint and relation to closed topological strings were discussed in [23], and generalized to open BPS counting in [24,25,26,27]. Relations to matrix models, discussed for plane partitions with some other motivation in [28], were extended to other crystal models relevant for BPS counting in [29], and also in [30]. Subsequently it was related to open BPS counting in [27]. Refined BPS counting was related to crystal models in [10,13], and corresponding matrix models were constructed in [31].
Let us also mention some other, related works devoted to crystals and free fermions.
The fermionic construction of MacMahon function for C 3 was originally presented in [7], and its relation to open topological strings and more complicated Calabi-Yau manifolds were discussed in [32,33,34]. Newer ideas, analyzing more complicated systems involving D4-branes, were presented in [35,36]. More expository presentations of various aspects described here can be found in [37,38]. A general introduction to mathematical and physical aspects of mirror symmetry can be found in [39].

Plan
The plan of this paper is as follows. In section 2 we introduce BPS generating functions and present one possible derivation of their form, which relies on the M-theory interpretation of a D-brane system, following [23,24,25,27]. In section 3 we provide a little mathematical background and introduce notation pertaining to toric Calabi-Yau manifolds, free fermion formalism, and matrix models. In section 4 we introduce fermionic formalism for BPS generating functions and present corresponding crystal models, building on earlier ideas of [7,15] and following [16]. In section 5 we reformulate the problem of closed BPS counting in terms of matrix models and relate it to open BPS counting [27,29].
In section 6 we refine our analysis, present refined BPS generating functions and crystals [10], and construct corresponding refined matrix models [31].

BPS generating functions
In this section we introduce generating functions of BPS states of D-branes in toric Calabi-Yau manifolds. Our task in the rest of this paper is to provide interpretation of these generating functions in terms of free fermions, melting crystals and matrix models.
These generating functions can be derived using wall-crossing formulas, as was done first in the unrefined [20] and refined [10] conifold case, and later generalized to arbitrary geometry without compact four-cycles in [18,19]. On the other hand, we will focus on a simpler physical derivation of BPS generating functions which uses the lift of the D- we are also interested in [24,25,27].
We start this section by reviewing the M-theory derivation of (unrefined) closed and open BPS generating functions. Then, to get acquainted with a crystal interpretation of these generating functions, we discuss their crystal interpretation in simple cases of C 3 and conifold. Later, using fermionic interpretation, we will generalize this crystal representation to a large class of toric manifolds without compact four-cycles.

M-theory derivation
We start by considering a system of D2 and D0-branes bound to a single D6-brane in type IIA string theory. It can be reinterpreted in M-theory as follows [23]. When additional S 1 is introduced as the eleventh dimension transversely to the D6-brane, then this D6-brane transforms into a geometric background of a Taub-NUT space with unit charge [40]. The Taub-NUT space is a circle fibration over R 3 , with a circle S 1 T N attaining a fixed radius R at infinity, and shrinking to a point in the location of the original D6-brane.
From M-theory perspective bound states involving D2 and D0-branes are interpreted as M2-branes with momentum on a circle. Therefore the counting of original bound states to the D6-brane is reinterpreted as the counting of BPS states of M2-branes in the Taub-NUT space. While in general this is still a nontrivial problem, for the purpose of counting BPS degeneracies we can take advantage of their invariance under continuous deformations of the Taub-NUT space, in particular under deformations of the radius R. We can therefore consider taking this radius to infinity, whereupon BPS counting is reinterpreted in terms of a gas of particles in R 5 . To make the problem fully tractable we have to ensure that the particles are non-interacting, which would be the case if moduli of the Calabi-Yau would be tuned so that M2-branes wrapped in various ways would have aligned central charges.
This can be achieved when Kähler parameters of the Calabi-Yau space are tuned to zero.
However, to avoid generation of massless states, at the same time one has to include nontrivial fluxes of the M-theory three-form field through the two-cycles of the Calabi-Yau and S 1 T N . In type IIA this results in the B-field flux B through two-cycles of Calabi-Yau. Finally, to avoid creation of the string states arising from M5-branes wrapping four-cycles in Calabi-Yau, we simply restrict considerations to manifolds without compact four-cycles.
For a state arising from D2-brane wrapping a class β the central charge then reads where l counts the D0-brane charge, which is taken positive to preserve the same supersymmetry.
Under the above conditions, the counting of D6-D2-D0 bound states is reinterpreted in terms of a gas of particles arising from M2-branes wrapped on cycles β. The excitations of these particles in R 4 , parametrized by two complex variables z 1 , z 2 , are accounted for by the modes of the holomorphic field Decomposing the isometry group of R 4 as SO (4) We are interested in their net number arising from tracing over SU(2) ′ spins The total angular momentum of a given state contributing to the index is l = l 1 + l 2 + m.
Finally, in a chamber specified by the moduli R and B, the invariant degeneracies can be expressed as the trace over the corresponding Fock space where the subscript chamber denotes restriction to those factors in the above product, which represent states which are mutually BPS As usual, Q = e −T and q s = e −gs above encode respectively the Kähler class T and the string coupling g s (we wish to distinguish carefully q s which encodes string coupling, from a counting parameter q which will arise in what follows in crystal interpretation). The above condition on central charges is crucial in determining a particular form of the BPS generating functions. If we would restrict products in the formula (5)  and positive values of β we would get modulus square of the topological string partition function. Therefore the upshot of [23] is that in general the above BPS generating function can be expressed in terms of the closed topological string partition function where chamber restriction is to be understood as picking up only those factors in Gopakumar-Vafa product representation of Z top for which (6) is satisfied. In this context we will often refer to the choice of a chamber as a closed BPS chamber. The (instanton part of the) closed topological string partition function entering the above expression is given by [3,4] where M(q s ) = l (1 − q l s ) −l is the MacMahon function and χ is the Euler characteristic of the Calabi-Yau manifold.
To be more precise, an identification as a topological string partition function or its square arises if R > 0 in (3). Because R arises just as a multiplicative factor in (3), degeneracies depend only on its sign. Therefore another extreme case corresponds to negative R and B sufficiently small, when only a single D6-brane contributes to the partition function More generally, for R < 0, BPS generating functions often (but not always) take finite form.
In what follows we denote BPS generating functions in chambers with positive R by Z, and in chambers with negative R by Z (and often omit the subscript BPS). Topological string partition functions will be denoted by Z top , while generating functions of melting crystals by ordinary Z.
The above structure can be generalized by including in the initial D6-D2-D0 configuration additional D4-branes wrapping lagrangian cycles in the internal Calabi-Yau manifold and extending in two space-time dimensions [24,25,27]. For simplicity we consider a system with a single D4-brane wrapping a lagrangian cycle. There are now additional BPS states in two remaining spacetime dimensions arising from open D2-branes ending on these D4-branes. Their net degeneracies N s,β,γ are characterized, firstly, by the SO (2) spin s whose origin is most clearly seen from the M-theory perspective [5,41]. Secondly, they depend on two-cycles β wrapped by open M2-branes, as well as one-cycles γ on which these M2-branes can end. 2 Lifting this system to M-theory we obtain a background of the form Taub-NUT × Calabi-Yau × S 1 , with the additional D4-brane promoted to M5-brane. This M5-brane wraps the lagrangian submanifold L inside Calabi-Yau, the time circle S 1 , and R + × S 1 T N inside the Taub-NUT space. A part of this lagrangian L is a torus T 2 = S 1 T N × S 1 , which will lead to some modular properties of the BPS counting functions: this modularity will be manifest in one chamber, where the open topological string amplitude will be completed to the product of θ functions. This M5-brane also breaks the SO(4) spatial symmetry down to SO(2)×SO(2) ′ . We denote the spins associated to both SO(2) factors respectively by σ and σ ′ , and the degeneracies of particles with such spins by N σ,σ ′ β,γ . In addition to closed Kähler parameters Q = e −T , let us also introduce open ones related to discs wrapped by M2-branes z = e −d . The real and imaginary parts of T encode respectively the sizes of two-cycles β and the value of the B-field through them. The real and imaginary parts of d encode respectively sizes of the discs and holonomies of the gauge fields around them. Similarly 2 In case of N D4-branes wrapping the same lagrangian cycle, these states would additionally arise in representations R of U (N ) [5]. In case of a single brane this reduces to U (1), and such a dependence can be reabsorbed into a parameter specifying a choice of γ. as in the closed string case, to get non-trivial ensemble of mutually supersymmetric states, we set the real parts of T and d to zero, and consider non-trivial imaginary parts.
From the M-theory perspective we are interested in counting the net degeneracies of M2-branes ending on this M5-brane In the remaining three-dimensional space, in the R → ∞ limit, the M2-branes ending on the M5-brane are represented by a gas of free particles. These particles have excitations in R 2 which we identify with the z 1 -plane. To each such BPS particle, similarly as in the closed string case discussed above and in [23,40], we can associate a holomorphic field The modes of this field create states with the intrinsic spin s and the orbital momentum l in the R 2 plane. The derivation of the BPS degeneracies relies on the identification of this total momentum σ + l in the R → ∞ limit, with the Kaluza-Klein modes associated to the rotations along S 1 T N for the finite R, following the five-dimensional discussion in [40,42]. The BPS generating functions we are after are given by a trace over the Fock space built by the oscillators of the second quantized field Φ(z 1 ), and restricted to the states which are mutually supersymmetric. In such a trace each oscillator from (9) where the product is over either both positive or both negative (β, γ). The parameters q, Q and z specify the chamber structure: the restriction to a given chamber is implemented by imposing the condition on a central charge, analogous to (6), This condition in fact specifies a choice of both closed and open chambers. The walls of marginal stability between chambers correspond to subspaces where, for some oscillator, the above product becomes 1, and then the contribution from such an oscillator drops out from the BPS generating function.
Similarly as in the closed string case, the above degeneracies can be related to open topological string amplitudes, rewritten in [5] in the form with integer Ooguri-Vafa invariants N σ,β,γ . 3 This formula represents in fact a series of quantum dilogarithms and can be written in the product form Comparing with (10) we conclude that the BPS counting functions take form of the mod- Similarly as in the closed string case, there are also a few particularly interesting chambers to consider. For example, in the extreme chamber corresponding to Im T , Im d → 0, the trace is performed over the full Fock space and yields the modulus square of the open topological string partition function. In this case the quantum dilogarithms arise in pairs, which (using the Jacobi triple product identity) combine to the modular function θ 3 /η; in consequence the total BPS generating function is modular and expressed as a product of such functions.

Crystal interpretation
Closed BPS generating functions (5) turn out to be generating functions of statistical models of crystals, when parameters relevant for both interpretations are appropriately matched. Physical reasons for such relations have been given in [8,21,22], and mathematical interpretation arose from works [9,14,15]. Such crystal interpretation arises also from the fermionic formulation [16,17], as we will review below. These crystals, in a more intricate way [27], encode also open BPS generating functions (10). However, before discussing details of all these constructions, in this introductory section we present crystal models for two simplest toric Calabi-Yau manifolds, i.e. C 3 and conifold. C 3 is the simplest Calabi-Yau manifold. It has no compact two-cycles, so relevant BPS states are bound states of arbitrary number of D0-branes with a single D6-brane wrapping entire C 3 . Their generating function is therefore expressed in terms of a single parameter q s = e −gs . There is just a single non-zero Gopakumar-Vafa invariant N 0 β=0 = −1, and as follows from (5) this generating function coincides with the so called MacMahon function On the other hand, the MacMahon function is a generating function of plane partitions, is made. From (7) it follows that the topological string partition function for C 3 is given by the square root of the MacMahon function which is indeed true. The relevance of the MacMahon function for C 3 geometry was noticed for the first time in [3], and a statistical model interpretation of this result was proposed in [7]. We also discuss its appearance from the matrix model viewpoint at the end of section 5. 3. To write down explicitly BPS generating functions for the conifold in various chambers we can take advantage of their relation to the topological string amplitude (7). The topological string partition function in this case reads with the MacMahon function defined in (15). From this topological string partition function we can read off Gopakumar-Vafa invariants [3,4] N 0 β=0 = −2, N 0 β=±1 = 1.
Using the relation (7) we can now present conifold closed BPS generating functions in several sets of chambers. In the first set of chambers we consider R > 0 and positive B ∈]n, n + 1[ (for n ≥ 0). Firstly, for small B, there is so-called non-commutative chamber discussed first by Szendroi [14], which corresponds to n = 0. In this case the pyramid crystal has just a single ball in the top row, as in the left panel in fig These BPS generating functions are related to pyramid generating functions with two colors q 0 and q 1 upon the identification (which generalizes (16) in C 3 case) Z conif old n chambers : q s = q 0 q 1 , Q = −q n s q 1 .
Indeed, with this identification the above counting functions agree with those of two-colored pyramid crystals with n + 1 yellow balls in its top row In the second set of chambers we have R < 0 and positive B ∈]n − 1, n[ (for n ≥ 1). It extends between the core region with a single D6-brane (8) and the chamber characterized by so-called Pandharipande-Thomas invariants (for the flopped geometry, or equivalently for anti-M2-branes). The BPS generating functions read The corresponding statistical models were shown in [16,21,18] to correspond to finite pyramids with n − 1 stones in the top row, as shown in figure 3. In this case the generating functions of such partitions are equal to The equality Z conif old n ≡ Z pyramid n arises upon an identification There are two other sets of chambers characterized by the negative value of the B-field, for which BPS generating functions are completely analogous to those given above.
Above we presented just the simplest examples of crystal models. Using fermionic formulation presented below one can find other crystal models for arbitrary toric geometry without compact four-cycles. Let us also mention that those models can be equivalently expressed in terms dimers. In particular the operation of enlarging the crystal, as in the conifold pyramids, corresponds to so called dimer shuffling [15]. Dimers are also closely related to a formulation using quivers and associated potentials, which underlies physical derivations in [21,22].

A little background -free fermions and matrix models
In this section we introduce some mathematical background on which the main results presented in this review rely. In section 3.1 we start with a brief presentation of toric Calabi-Yau manifolds and introduce the notation which we use in what follows. In section 3.2 we introduce free fermion formalism. In section 3.3 we introduce basics of matrix model formalism. Our presentation is necessarily brief and for more detailed introduction we recommend many excellent reviews on each of those topics.

Toric Calabi-Yau three-folds
Some introductory material on toric Calabi-Yau manifolds, from the perspective relevant for mirror symmetry and topological string thoery, can be found e.g. in [39]. In this section our presentation is brief and mainly sets up the notation. Toric Calabi-Yau three-folds arise as the quotient of C κ+3 , possibly with a discrete set of points deleted, by the action of (C * ) κ with certain weights. The simplest toric three-fold is C 3 , which corresponds to the trivial choice κ = 0. The resolved conifold, which we already discussed in A closed loop in a toric diagram represents a compact four-cycle in the geometry. As Let us denote independent P 1 's, starting from the left end of the strip, from 1 to N, and introduce corresponding Kähler parameters Q i = e −T i , i = 1, . . . , N. Moreover to each toric vertex we associate a type t i = ±1, so that t i+1 = t i if the local neighborhood of P 1

(represented by an interval between vertices
The type of the first vertex we fix as t 1 = +1.
In figures 4 and 8 these types are denoted by ⊕ and ⊖. The types t i will be used much in the construction of fermionic states in section 4.2.
As explained in section 2.1, the BPS generating functions can be expressed in terms of (the instanton part) of topological string amplitudes. For the above class of geometries, arising from a triangulation of a strip, these amplitudes read

Free fermion formalism
Formalism of free fermions in two dimensions is well known [43,44] and ubiquitous in literature on topological strings and crystal melting [7,15,37,15,45]. The main purpose of this section is therefore to set up the notation which we will follow in the remaining parts of this paper.
The states in the free fermion Fock space are created by the (anti-commuting) modes of the fermion field on the vacuum state |0 . There is one-to-one map between such fermionic states  We introduce vertex operators which act on fermionic states |µ corresponding to partitions µ as [43,44,15] The interlacing relation ≺ between partitions is defined as The operator Γ ′ is the inverse of Γ with negative argument. These operators satisfy commutation relations We also introduce various colors q g and the corresponding operators Q g (a hat is to distinguish them from Kähler parameters Q i ) These operators commute with vertex operators up to rescaling of their arguments

Matrix models
In matrix model theory, or theory of random matrices, one is interested in properties of various ensembles of matrices. Excellent reviews of random matrix theory can be found e.g. in [46] or, in particular in the context of topological string theory, in [47]. In matrix model theory one typically considers partition functions of the form where V = V (U) is a matrix potential, and DU is a measure over a set of matrices of interest U of size N. Typically it is not possible to perform the above integral, however special techniques allow to determine its formal 1/N expansion. These techniques culminated with the formalism of the topological expansion of Eynard and Orantin [48] which, in principle, allows to determine entire 1/N expansion of the partition function recursively.
This solution is determined by the behavior of matrix eigenvalues, whose distribution among the minima of the potential, in the continuum limit, determines one-dimensional complex curve, so-called spectral curve. The spectral curve is also encoded in the leading 1/N expansion of the so-called resolvent, which is defined as the expectation value ω(x) = The issue of infinite matrices is a little subtle, however it can be taken care of by considering matrices of large but finite size N, and subsequently taking N → ∞ limit. For finite N one can find the resolvent, and in consequence the spectral curve, using a standard technique of so-called Migdal integral. This requires redefining V to the standard Vandermonde form [47,29], as well as introducing 't Hooft coupling T The form of the Migdal integral depends on the number of cuts into which eigenvalues condense in large N limit, and this number of cuts determines the genus of the spectral curve. In our context only single-cut situations will arise, for which the spectral curve has genus zero. In this case the Migdal integral determines the resolvent as so that the integration contour encircles counter-clockwise the endpoints of the cut a and b. A proper asymptotic behavior of the resolvent is imposed by the condition Then the spectral curve is determined as a surface on which the resolvent is unambiguously defined, i.e. it is given by an (exponential) rational equation automatically satisfied by p and ω(p). There is also an important consistency condition for the resolvent: when computed on the opposite sides of the cut ω(p) ± , it is related to the potential as On the other hand, a difference of these values of the resolvent on both sides of the cut provides eigenvalue density It has been observed in several contexts that topological strings on toric manifolds can be related to matrix models, whose spectral curves take form of the so-called mirror curves.
Mirror curves arise for manifolds which are mirror to toric Calabi-Yau manifolds [39,45]. For toric manifolds, their mirror manifolds are determined by the following equation embedded in four-dimensional complex space The mirror curve is the zero locus of H(x, y), i.e. it is given as H(x, y) = 0. More precisely, x, y are C * variables, and it is often convenient to represent them in the exponential form For example, for C 3 and the conifold they take the following form where Q encodes the Kähler parameter of the conifold. Schematically mirror curves arise from thickening edges of the toric graphs, as shown in fig. 6.
One of the first relations between topological strings for toric manifolds and matrix models were encountered in [49,50], where it was shown that the spectral curve of a unitary matrix model with a gaussian (i.e. quadratic) potential agrees with the above mirror curve (41), with 't Hooft coupling T = g s N encoded in Q = e −T . At the same time it was shown that the matrix model partition function reproduces the topological string partition function. More recently these ideas became important in view of the remodeling conjecture [51,57], which states that the solution to loop equations in the form found by Eynard and Orantin [48], applied to the mirror curve, reproduces topological string partition functions. The method of [48] works for arbitrary curves, not necessarily originating from matrix models. Nonetheless, it is indeed possible to construct matrix models whose partition functions do reproduce topological string amplitudes, and whose spectral curves coincide with appropriate mirror curves [29,30,52,53,54,55,56].
One of our aims is to provide matrix model interpretation of BPS counting. It is natural to expect such an interpretation in view of an intimate relation between BPS counting and topological string theory discussed in section 2.1, and the above mentioned relations between topological strings and matrix models. As we will see in what follows, there are indeed unitary matrix models which naturally arise in the context of BPS counting and its fermionic formulation. Among the others, our task will be to analyze them using the above mentioned Migdal method.

Fermionic formulation of BPS counting functions
Having introduced all the ingredients above, we are now ready to present fermionic formulation of BPS counting. To start with, in section 4.1 we present the idea of such a formulation in the simplest example of C 3 . In section 4.2 we introduce a general fermionic formalism, and in section 4.3 we provide its crystal interpretation. We illustrate the use of our formalism in section 4.4 revisiting C 3 example, as well as in explicit case of C 3 /Z N , and conifold geometry.

The idea and C 3 example
As explained in section 2.2, the generating function of bound states of D0-branes to a single D6-brane is given by the MacMahon function, and the corresponding crystal model takes form of the counting of plane partitions [7]. Let us slice each such plane partition by a set of parallel planes, as shown in fig. 7. In this way on each slice we obtain a two-dimensional partition µ, and it is not hard to see that each two neighboring partitions satisfy the interlacing condition (27). Recalling that such a condition arises if we apply Γ ± (1) operators (25) to partition states, we conclude that a set of all plane partitions can be built, slice by slice, by acting with infinite sequence of Γ ± (1) on the vacuum. To count each slice µ with appropriate weight q |µ| we also need to apply weight operator Q defined in (32). Therefore the generating function of plane partitions can be represented as follows In the first line we implicitly introduced two states Ω + | and |Ω − , defined by an infinite sequence of Γ + (respectively Γ − ) operators, interlaced with weight operators Q and acting on the vacuum. To confirm that this correlator indeed reproduces the MacMahon function, the second line can be reduced to the final infinite product using commutation relations (28) and (34). We can also represent insertions of Γ ± (1) operators graphically by arrows, so that the above computation can represented as in fig. 7 (right). Directions of arrows → represent interlacing condition ≻ on partitions. We reconsider this example from a new viewpoint in figure 10.
In what follows we present a formalism which allows to generalize this computation to a large class of chambers, for arbitrary toric geometry without compact four-cycles.

Toric geometry and quantization
We wish to reformulate BPS counting in the fermionic language in a way in which we associate to each toric manifold a fermionic state, such that the BPS generating function can be expressed as an overlap of two such states, generalizing C 3 case (42). At the same time the construction of such a fermionic state is supposed to encode the structure of the underlying crystal model (generalizing plane partitions in fig. 7). An important difference between C 3 and other geometries is the existence of many Kähler moduli and correspondingly many chambers, for which BPS generating functions change according to wall-crossing formulas. To take care of these changes in the fermionic formalism we need to introduce special wall-crossing operators.

Toric geometry and fermionic operators
In what follows we use the notation introduced in section 3.1, in particular to each vertex of the toric diagram we associate its type t i = ±1, see also fig. 8. We start with a construction of fermionic states associated to a given toric Calabi-Yau manifold (without compact four-cycles). First we need to introduce several operators which are building blocks of such states. The structure of these operators is encoded in the toric diagram of a given manifold. Namely, these operators are given by a string of N + 1 vertex operators (24)) which are associated to the vertices of the toric diagram; the type t i determines the type of a vertex operator as In addition the string of operators Γ t i ± (x) is interlaced with N + 1 operators Q i representing colors q i , for i = 0, 1, . . . , N. Operators Q 1 , . . . , Q N are associated to P 1 in the toric diagram, and there is an additional Q 0 . We also define Therefore the upper indices of Γ t i ± (x) and a choice of colors of the operators which we introduce below are specified by the data of a given toric manifold. As we will see, a sequence of lower indices ± is determined by the chamber we are going to consider. The first vertex on the left is chosen to be ⊕. Now we can associate several operators to a given toric manifold. Firstly we define Commuting all Q i 's using (34) we also define the following operators In addition, we define the above mentioned wall-crossing operators Here the order of Γ and Γ ′ is the same as for A ± operators, and the difference is that now there are subscripts ∓ on first p operators and ± on the remaining ones.
We often use a simplified notation when the argument of the above operators is x = 1

Fermionic formulation and quantization
Above we associated operators A ± to each toric geometry with a strip-like toric diagram.
From these operators we can build the following states in the Hilbert space of a free fermion which we define as follows These states encode the full instanton part of the topological string amplitudes. Namely, as shown in [16], is equal to the BPS partition function Z in the non-commutative chamber where Z top (Q i ) is given in (23). The above equality holds under the following identification between q i parameters (which enter the definition of |Ω ± ) and physical parameters Q i = e −T i and q s = e −gs : We will provide a proof of (53) in section 6.1.1 in a more general setting of refined invariants.
The states |Ω ± have non-trivial structure and encode the information about the noncommutative chamber. It turns out that the fermionic vacuum |0 itself also encodes some interesting information. We recall that there is another extreme chamber representing just a single BPS state represented by the D6-brane with no other branes bound to it. This multiplicity 1 can be understood as and as we will see below, starting from this expression we can use wall-crossing operators to construct BPS generating functions in an infinite family of other chambers.

Other chambers and wall-crossing operators
In the previous section we associated to toric manifolds the states |Ω ± , whose overlap reproduces the BPS generating function in the non-commutative chamber (53). Now we wish to extend this formalism to other chambers. As discussed in section 2.1, in a given chamber, the allowed bound states we wish to count must have positive central charge (3) Firstly, the information about R and B must be encoded in the fermionic states which we wish to construct. It turns out that the choice of positive or negative R is encoded in the choice of the ground state which generalizes the extreme cases (53) and (56).
On the other hand, the value of the field B is encoded in the insertion of additional wallcrossing operators, such as those defined in (48) and (49). In particular these two types of operators are sufficient if we wish to consider only these chambers, which correspond to a flux of the B-field through only one, but arbitrary P 1 in the manifold. For simplicity below we consider only this set of chambers. Denoting this P 1 as p, it can be shown that insertion of n copies of operators W p or W ′ p creates respectively n positive or negative quanta of the flux through p'th P 1 .
Therefore, schematically, the generating functions in chambers with R > 0 read and those with R < 0 read with appropriate form of wall-crossing operators. More precisely, depending on the signs of R and B, we need to consider four possible situations, which we present below. The proofs of all statements below, corresponding to these four situations, can be found in [16].
• Chambers with R < 0, B > 0 Consider a chamber characterized by positive R and positive B-field through p'th two-cycle The BPS partition function in this chamber contains only those factors which include Q p and it reads This can be expressed as the expectation value of n wall-crossing operators W p under the following identification of variables A special case of this result is the trivial generating function (56) representing a single D6-brane.
• Chambers with R > 0, B > 0 In the second case we consider the positive value of R and the positive flux through p'th P 1 R > 0, B ∈]n, n + 1[ for 0 ≤ n ∈ Z.
Denote the BPS partition function in this chamber by Z n|p . We find that the expectation value of n wall-crossing operators W p in the background of |Ω has the form where Z (0) n|p does not contain any factors (q s · · · q r−1 ) ±1 which would include q p , while Z (1) n|p contains all factors q s · · · q r−1 which do include q p , and Z (2) n|p contains all factors (q s · · · q r−1 ) −1 which also include q p : We see that the identification of variables reproduces the BPS partition function When no wall-crossing operator is inserted the change of variables reduces to (55) and we get the non-commutative Donaldson-Thomas partition function (54), Z 0|p = Z.
• Chambers with R < 0, B < 0 Now we consider negative R and negative B-field For such a chamber the BPS partition function reads Now we find the the expectation value of n wall-crossing operators W ′ p is equal to under the change of variables Now an insertion of W p has an interpretation of turning on a negative quantum of B-field, and the redefinition of Q p can be interpreted as effectively reducing t p by one unit of g s . As already discussed represents a chamber with a single D6-brane and no other branes bound to it.
We denote the BPS partition function in this chamber by Z ′ n|p . We find that the expectation value of n operators W ′ p in the background of |Ω ± has the form where Z ′(0) n|p does not contain any factors (q s · · · q r−1 ) ±1 which would include q p , Z ′(1) n|p contains all factors q s · · · q r−1 which do include q p , and Z

Under the change of variables
this reproduces the BPS partition function We note that both Z ′ 1|p with the above change of variables, as well as Z 0|p given in (62) with a different change of variables in (63), lead to the same BPS generating function Z which corresponds to the non-commutative Donaldson-Thomas invariants.

Crystal melting interpretation
In the previous section we found a free fermion representation of D6-D2-D0 generating functions. The fermionic correlators which reproduce BPS generating functions automatically provide melting crystal interpretation of these functions [16], generalizing models of plane partitions (for C 3 ) or pyramid partitions (for the conifold), presented in section 2.2.
These crystals are also equivalent to those found in [17,22].
The crystal interpretation is a consequence of the fact that all operators used in the construction of states |Ω ± , as well as the wall-crossing operators, are built just from vertex operators Γ ± and Γ ± with argument 1, and color operators Q i . As follows from (25) and (26), insertion of these vertex operators is equivalent to the insertion of two-dimensional partitions satisfying interlacing, or transposed interlacing conditions. An (infinite) sequence of such interlacing partitions effectively builds up a three-dimensional crystal. A relative position of two adjacent slices is determined by a type of two corresponding vertex operators. On the other hand, insertions of color operators have an interpretation of coloring the crystal. The colors Q i appear in the same order in each composite operator, so these colors are always repeated periodically in the full correlators. Therefore, three-dimensional crystals are built of interlacing, periodically colored slices.
To get more insight about a geometric structure of a crystal it is convenient to introduce the following graphical representation. We associate various arrows to the vertex operators, as shown in fig. 9. These arrows follow the order of the vertex operators in the fermionic correlators, and are drawn from left to right, or up to down (either of these directions is independent of the orientation of the arrow). Following the order of the vertex operators in a given correlator, and drawing a new arrow at the end of the previous one, produces a zig-zag path which represents a shape of the crystal. The coloring of the crystal is taken care of by keeping track of the order of Q i operators, and by drawing at the endpoint of each arrow a (dashed) line, rotated by 45 o , colored according to Q i which we come across. These lines represent two-dimensional slices in appropriate colors. In this way the corners of two-dimensional partitions arising from slicing of the crystal are located at the end-points of the arrows. The orientation of arrows represents the interlacing condition (i.e. arrows point from a larger to smaller partition). The interlacing pattern between two consecutive slices corresponds to the types of two consecutive arrows. Finally, the points from which two arrows point outwards represent those stones in the crystal, which can be removed from the initial, full crystal configuration. In fermionic correlators these points correspond to Γ t i + followed by Γ

Revisiting C 3
Let us reconsider C 3 geometry which motivated our discussion in section 4. 1  In consequence the BPS partition function (53) takes exactly the form (42).
The crystal structure can be read off from a sequence of arrows associated to A ± operators, following the rules in figure 9. This gives rise to the crystal shown in fig. 10 (right). This is the same crystal as in fig. 7, which represents plane partitions, however now seen from the opposite side.

Orbifolds C 3 /Z N +1
Now we consider the resolution of C 3 /Z N +1 orbifold. In this case the toric diagram takes form of a triangle of area (N + 1)/2, see fig. 11 (left). There are N independent P 1 's and N + 1 vertices of the same t i = +1, and operators in (45) take the form In the non-commutative chamber the corresponding crystal consists of plane partitions, however with slices colored periodically in N + 1 colors. The partition function in the non-commutative chamber is given by (53).
If we turn on an arbitrary B-field through a fixed P 1 , the structure of wall-crossing operators gives rise to modified containers, see e.g. fig. 11 (middle). In particular enlarging the B-field by one unit adds one more yellow corner to the crystal.
The crystals corresponding to R < 0 are also easy to find. In the extreme chamber we get a trivial (empty) crystal, representing a single D6-brane (56). Adding wall-crossing operators results in a crystal with several corners, finite along two axis (and extending infinitely along the third axis), as shown in fig. 11 (right). The resulting figure (right) represents plane partitions crystal model, the same as in figure 7, but now seen from the bottom.

Resolved conifold
We already presented pyramid crystals for the conifold in section 2.2. They arise from our formalism as follows. The dual toric diagram for the conifold, see fig. 12 (left), consists of two triangles and encodes a single (N = 1) P 1 . Two vertices of the toric diagram correspond to two colors Q 1 and Q 0 , so that The operators (45) in this case read while (46) and (47) are and they satisfy The quantum states (51) and (52) take form and the wall-insertion operators (48) (49) are Therefore the fermionic correlators take form The generating function is given by Z n|1 = 0|(W 1 ) n |0 which reproduces the result (22).

Matrix models and open BPS generating functions
In this section we explain how matrix model formalism can be applied to analyze BPS counting functions. In the first part, 5.1, we explain how to relate fermionic formalism, derived in the previous section, to matrix model representation. In section 5.2, we illustrate how to construct matrix models for the closed non-commutative chamber. In subsection 5.3 we analyze in detail BPS generating functions for the conifold for all chambers with R > 0, and derive corresponding spectral curves. We discuss how these curves relate to (and generalize) mirror curves, which we find (as we should) in the commutative chamber.
In subsection 5.4 we reveal that matrix model representation in fact encodes open BPS generating functions, which can be identified with matrix model integrands.

Matrix models from free fermions
Let us explain how to relate fermionic representation of BPS amplitudes, introduced in section 4.2, to matrix models. This relies on introducing into fermionic correlators representing BPS generating functions, such as (53) or (62), a special representation of the identity operator I. The representation we are interested in also consists of infinite product of vertex operators and arises as follows [29]. Firstly, we can use the representation as a complete set of states I = |R R|, which represent two-dimensional partitions. Using orthogonality relations of U(∞) characters χ R , and the fact that these characters are given in terms of Schur functions χ R = s R ( z) for z = (z 1 , z 2 , z 3 , . . .), we can write When such a representation of the identity operator is introduced into (53) or (62) (or any other correlator of similar structure) we can commute away Γ t i ± operators and get rid of operator expressions. For example, inserting the above identity operator in the string of A + operators in (58), leads to a matrix model with the unitary measure The product over α represents distinct eigenvalues z α . Note that we have inserted I at the position k in the string of A + (1) operators. In particular this affects the form of the resulting potential V k n (z). Moreover, apart from matrix integral, we find some overall factors f k n (q, Q i ) which take form of various infinite products. They arise, in a generic chamber, from commutations between Γ ± ingredients of wall-crossing operators, and Γ ∓ ingredients of |Ω ∓ states. In the closed non-commutative chamber n = 0 these factors are trivial, f n=0 (q, Q i ) = 1, and they largely simplify in the commutative chamber n → ∞.
There is a large freedom in choosing the value of k, and it is natural to ask if this choice has some physical interpretation. It was argued in [27] that this is indeed the case, and half-integer powers of q, to integer powers of q in the fermionic formalism), as well as identification of Kähler parameters considered in M-theory derivation with parameters µ i introduced below. We also note that the BPS generating function in (14) is determined by the open topological string partition function associated to the external axis of the toric diagram, as in figure 14. As we will also see, the value of the above integral (77) can be related to some more general Calabi-Yau geometry Y .

Matrix models for the non-commutative chamber
In this section we illustrate the relation between BPS counting and matrix models in case of the non-commutative chamber n = 0, and the choice of open chamber also k = 0.
This corresponds to the insertion of the identity representation (76) exactly in between |Ω ± states in (53). In this n = 0 case no factor f k n in (77) arises, and we obtain matrix models with potentials which can be expressed in terms of the following version of the theta function For a general geometry of the form shown in fig. 8, with types of vertices given by t i , corresponding matrix models take form where integral is over unitary matrices of infinite size, N = ∞. Special cases of this result include: • for C 3 the result (79) provides a matrix model representation of MacMahon function (1 + zq j )(1 + q j+1 /z) = Θ(z; q).

Matrix model for the conifold -analysis
In this section we illustrate how matrix model techniques can be used in the context of models which arise for BPS counting. We focus on the conifold matrix model in arbitrary closed BPS chamber n, and fixed k = 0. In this case the result (77) takes form (after the redefinition Q = −q 1 q n ) with MacMahon function M(q) defined in (15), and with the following generalized MacMahon function In particular, in the non-commutative chamber f conif old The result (80) implies that the value of the matrix model integral (without the prefactor where µ = q n /Q. Now we wish to analyze the matrix model Z matrix . We parametrize the 't Hooft coupling and the chamber dependence respectively by As our models correspond to U(∞) matrices, ultimately we are interested in the limit for each fixed chamber (i.e. fixed n and therefore τ ). The non-commutative chamber corresponds to τ = 0, while τ → ∞ represents the topological string chamber.
Using the expansion of the quantum dilogarithm and the redefinition of the unitary measure (36) we find, to the leading order in g s , the following matrix model potential so that Now we wish to solve the model (80) in the small g s limit. Firstly we need to find the resolvent ω(p), which can be done using the Migdal integral (37), and careful derivation is presented in [29]. As we expect one-cut solution of our model, from the Migdal integral we get an expression in terms of the end-points of this cut a and b. The normalization condition (38) imposes two constraints, for terms of order p 0 and p −1 in the resolvent, These constraints can be solved in the exact form, with result where we introduced Substituting these end-points back to the formula for the resolvent we find As a check, this result indeed satisfies the consistency condition (39) with V τ given in (87). From the knowledge of the resolvent we can also determine eigenvalue density along the cut (40) as well as the spectral curve. Writing x = pT ω(p) and p = e y , and after a few simple rescalings we find that the spectral curve takes form e x+y + e x + e y + Q 1 e 2x + Q 2 e 2y + Q 3 = 0, where , , .
(96) Figure 15: The spectral curve for the conifold matrix model (80) in arbitrary closed BPS chamber coincides with the mirror curve of the closed topological vertex geometry, whose toric diagram is shown above. This geometry has three P 1 moduli, which encode conifold size Q, the closed BPS chamber via µ, and finite 't Hooft coupling via e −T .
The above curve is given by a symmetric function of Q, µ = Q −1 q n and ǫ 2 = e −T .
Apparently this is a mirror curve of the so-called closed topological vertex geometry, which is a Calabi-Yau manifold arising from a symmetric resolution of C 3 /Z 2 × Z 2 orbifold, see 15. This geometry has three moduli, i.e. the original Kähler moduli Q of the resolved conifold, the chamber parameter n (encoded in µ) and the 't Hooft parameter T , which are all unified in a geometric way in our matrix model. Moreover, the fractional coefficients in the curve equation (95) encode the correct mirror map for the closed topological vertex geometry (and to the linear order, these coefficients are just Q, µ and e −T ).
In the BPS counting problem we are interested in, as follows from the form of the identity operator (76), ultimately we need to consider matrices of infinite size. We also need to keep fixed g s , so we should consider the limit of T → ∞, or equivalently ǫ → 0.
Up to a linear shift of x and y, the equation (95) in this limit becomes µ e 2y + e x+y + e x + (1 + Qµ) e y + Q = 0.
The manifold corresponding to this curve is the suspended pinch point (SPP) geometry, with Q and µ encoding flat coordinates representing sizes of its two P 1 's. Having found the SPP mirror curve, let us also make the following remarks.
Firstly, we see that not only the spectral and mirror curves agree, but moreover the matrix integral (80) reproduces (after the identiciation q = q s ) the full topological string partition function of the SPP geometry at finite g s , which is known to take form for Kähler parameters Q and µ. This confirms that our result makes sense, although this also means that the terms in lowest order in g s in the potential reproduce the full g s dependence of the partition function. It would be nice to prove rigorously that higher g s corrections to the potential indeed do not affect the total partition function. This appears to be a very special feature of matrix models integrands which can be expressed -as is the case for (83) -in terms of infinite products of the form k (1 − xq k ). One proof of such statement in a related situation (although in addition taking advantage of a special phenomenon of the arctic circle) can be found in [52].
Secondly, it is natural to conjecture that the total partition function of the matrix model, for finite T , should reproduce (at least up to some MacMahon factor) the topological string partition function for the closed topological vertex which reads Finally, we also note that in the limit Q, µ → 0 our model reduces to the Chern-Simons matrix model discussed in [47,50]. Indeed, in this limit the potential (87) reproduces gaussian potential [50] In this case the resolvent (94) reduces to and agrees 4 with the resolvent of the old Chern-Simons matrix model found in [47,50], which is known to reproduce the Chern-Simons partition function For finite T , also the spectral curve of the matrix model with the above gaussian potential reproduces the conifold mirror curve (41) of the size given by the 't Hooft coupling Let us also mention that the MacMahon function arising in T → ∞ limit of this model, and in fact the entire Chern-Simons partition function, can be obtained -following the postulate of the remodeling conjecture [51] -from the topological recursion applied to the above curve [57]. It turns out that the topological recursion associates a square root of the MacMahon function to each patch of C 3 , in agreement with (17), and building the toric Calabi-Yau three-fold by glueing such patches is mirrored by the pant decomposition of the mirror curve. However, the behavior of such constant contributions to the partition function in matrix models is subtle, and in general may not agree with the topological string (or topological recursion) result, even if a spectral curve of a matrix model reproduces an appropriate mirror curve. For example, matrix models constructed in [52,53] reproduce correct mirror curves (in particular, for the conifold) and encode correct non-constant contributions to the partition function, however by construction do not involve any factor of MacMahon function.

Matrix models and open BPS generating functions
In this section we finally consider arbitrary closed and open BPS chamber, so that matrix models take most general form. Analyzing the case of C 3 , conifold and C 3 /Z 2 we illustrate the claim (78) that open BPS generating functions can be identified with integrand of matrix models. Also for this reason our analysis is only on the level of these integrands, however it would also be interesting to understand the corresponding spectral curves.

C 3
We recall that the open topological string amplitude for a brane in C 3 is given by the quantum dilogarithm (12). The condition for the central charge (11) and the general formula (14) imply In one extreme chamber k = 0 the generating function is equal (up to the overall q 1/24 ) to a theta function, and so it is a modular form, as explained in section 2. 1 and similarly for Ω + |. There is a single closed string chamber in which the generating function Z = Ω + |Ω − = M(q) is given by the MacMahon function. Following the prescription (77) we insert the operator I at the location k. This gives where the matrix integral is given by

Conifold
Here This result arises from matrix model viewpoint as follows. We take advantage of the results of section 4.4.3 In terms of µ = − 1 q 1 = Q −1 q n the matrix integral takes form .

The integrand of this matrix model indeed agrees with (102) M-theory (again identifying
µ with Kähler parameter used in M-theory derivation, and setting q = q s ). In the limit n → ∞ followed by µ → 0 we get the result for C 3 given in (101). On the other hand, for both n, k → ∞, the integrand reduces to the open topological string amplitude given by a ratio of two quantum dilogarithms. The prefactor above is found as On the other hand, using results of section 4.4.2 The matrix integrand indeed agrees with the M-theory result (when written in terms of the argument µ) above. The prefactor above reads

Refined crystals and matrix models
In the last section we turn our attention to so-called refined BPS amplitudes, and explain how to incorporate the effect of such refinement in the fermionic formalism and matrix models, following [31]. To start with, we recall that there are various definitions of refinements, which arise in the context of BPS counting or topological string theory. Here we focus on closed BPS states and consider the following characterization. We introduce an additional parameter y on which multiplicities of D6-D2-D0 states Ω in the original definition of the generating function (1) may depend For fixed D0-brane and D2-brane charges α and γ, and a choice of closed BPS chamber n, refined degeneracies are defined as where H α,γ (n) denotes a space of BPS states with given charges α, γ and asymptotic values of moduli corresponding to a chamber n, and J 3 represents a generator of the spatial rotation group. For y = 1 these degeneracies reduce to those in (1). These refined degeneracies are interesting invariants if the underlying Calabi-Yau space does not posses complex structure deformations -and this is indeed the case for non-compact, toric manifolds we are interested in. In [10] it was argued that these invariants agree with motivic Donaldson-Thomas invariants of [2], and in the case of the resolved conifold the corresponding BPS generating functions were derived using the refined wall-crossing formula, and encoded in a refined crystal model. From mathematical viewpoint this setup was generalized to the whole class of toric manifolds without compact four-cycles in [13], and shown therein to agree, in the commutative chamber, with refined topological vertex computations. The refined topological vertex was introduced in [12], see also [58,59,60]. For other formulations of refinement see [11,61,62].
Our aim in this section is to construct refined crystal and matrix models, which would encode refined BPS generating functions, and in particular (in the commutative chamber) refined topological string amplitudes. We note that an additional motivation to find such models arises from the AGT conjecture [63] and the results of [64], which state that partition functions of Seiberg-Witten theories in the Ω-background (which are related to topological strings by geometric engineering) are reproduced by matrix models with βdeformed measure (i.e. with Vandermonde determinant raised to the power β). Explicit construction of one class of such β-deformed models, however only to the leading order, was given in [55]; some other works analyzing five-dimensional beta-deformed models include [65,66]. On the other hand, explicit computations for simpler β-deformed model with gaussian potential [67,68], revealed that it does not reproduce refined topological string amplitude for the conifold (even though the unrefined topological string partition function is properly reproduced when β = 1, see [47,50]). Nonetheless, the question whether there exist matrix models which reproduce such refined amplitudes remained valid. As we show below (following [31]) such models can indeed be constructed by appropriate deformation of the matrix model potential (rather than the measure). We note that recently another class of matrix models (with different than above deformation of the measure) was proposed [69], which also reproduce refined generating functions.
Let us also note that in this section we consider the same set of walls as in the unrefined case. More general walls, along which only refined BPS states decay, may also exist [10].
They are called invisible walls and they do not arise in our analysis.
In this section we use the following refined notation. The string coupling g s , related to the D0-brane charge as q s = e −gs in the unrefined case, is replaced by two parameters We also often use the exponentiated parameters and introduce The variable y in (105) is related to t 1 and t 2 as y = t 1 /q s = q s /t 2 , so that y 2 = t 1 /t 2 = q B s . In this notation the unrefined situation y = 1 corresponds to β = 1, for which ǫ 1 = −ǫ 2 = g s and t 1 = t 2 = q s and B = 0.
Let us present now refined BPS generating functions for some Calabi-Yau spaces: • For C 3 we get the refined MacMahon function [12] In this case there is no Kähler parameter, and therefore there are no interesting wall-crossing phenomena. 5 5 In fact one can consider more general family of refinements parametrized by δ, such that M δ (t 1 , t 2 ) = ∞ k,l=0 1 − t In this paper we fix the value δ = 1 (note that in [10] another choice δ = 0 was made).
• For the resolved conifold refined generating functions were computed in [10] using refined wall-crossing formulas. In the closed BPS chamber labeled by n − 1 these generating functions read In the commutative chamber n → ∞ the terms in the last bracket decouple and the BPS generating function agrees (up to the refined MacMahon factor) with the refined topological string amplitude On the other hand, in the non-commutative chamber n = 0 the refined generating function is given by the modulus square of the refined topological string amplitude.
• For a resolution of C 3 /Z 2 singularity there is also a discrete set of chambers parametrized by an integer n. The corresponding BPS generating functions read • Generating functions for an arbitrary toric geometry, in for the non-commutative chamber, are given (as in the unrefined case) by the modulus square of the (instanton part of the) refined topological string amplitude The (instanton part of the) refined topological string amplitude is given by [12,58]

Refining free fermion representation
In the non-refined case to a geometry consisting of N P 1 's we associated in section 4 a crystal which can be sliced into layers in N + 1 colors, denoted q 0 , q 1 , q 2 , . . . , q N . In that case parameters q 1 , . . . , q N encode Kähler parameters of the geometry Q 1 , . . . , Q N , while the product N i=0 q i is mapped to (possibly inverse of) q s = e −gs . In the refined case the assignment of colors must take into account a refinement of a single parameter q s into t 1 and t 2 introduced in (106). In particular, in the non-commutative chamber q i =0 are mapped (up to a sign, as in the non-refined case) to Q i , however we will have to replace q 0 by two refined colors q (1) 0 or q (2) 0 , so that t i = q (i) 0 q 1 · · · q N , for i = 1, 2. The simplest case of C 3 refined plane partitions (discussed also in [12]) is shown in fig. 18. In what follows we will discuss assignment of colors for other manifolds. Now we wish to follow the idea of section 4. Firstly, we wish to construct refined states |Ω ref ± whose correlators would reproduce refined BPS amplitudes in the non-commutative Secondly, we wish to construct refined wall-crossing operators W ref n , such that the BPS generating function in n'th chamber can be written as In section 6 for all chambers of the resolved conifold and a resolution of C 3 /Z 2 singularity.

Arbitrary geometry -non-commutative chamber
Here we construct fermionic states |Ω ref ± , which allow to write the BPS generating functions in the non-commutative chamber as in (112). As in the non-refined case, the states |Ω ref ± are constructed from an interlacing series of vertex operators Γ τ i ± and weight operators. The refinement does not modify the three-dimensional shape of the corresponding crystal, therefore the assignment of vertex operators is the same as in the non-refined case (43), as explained in section 4.2.1. However, this is assignment of colors, encoded in the weight operators, which is modified in the refined case. Let us introduce N operators Now we define refined version of A ± operators Commuting all Q i 's to the left or right it is convenient to use and when the argument of these operators is x = 1 we often use a simplified notation Finally we associate to a given toric manifold two (refined) states where |0 is the fermionic Fock vacuum.
Our claim now is that the refined BPS generating function can be written as with Z top (Q i ) given in (23), and if one identifies q i parameters which enter a definition of and string parameters Q i = e −T i (for i = 1, . . . , N) as follows and with refined parameters t 1,2 identified as in (114).
To prove (115) for general geometry, we first note that commuting operators A + (x) with A − (y) gives rise to a factor Now we write the states |Ω ref ± in terms of A ± operators, and commute Γ ± within each pair of A + and A − separately This last product reproduces modulus square (115) of the refined topological string partition function (111), and therefore proves the claim (112). Moreover, for the special β = 1, we automatically obtain the proof of the analogous statement (53) in the non-refined case from section 4.2.2.

Refined conifold and C 3 /Z 2
We can now extend the fermionic representation to non-trivial chambers, for simplicity restricting our considerations to the case of a conifold and a resolution of C 3 /Z 2 singularity, which both involve just one Kähler parameter Q 1 ≡ Q. Our task amounts to determining appropriate wall-crossing operators, denoted W ref n−1 , so that in the chamber labeled by n−1 the BPS generating function can be written as In these both cases the toric diagram has two vertices, the first one of type τ 1 = 1 and the second one denoted now τ ≡ τ 2 , and τ = ∓1 respectively for the conifold and C 3 /Z 2 . A crystal associated to the expression (116) has n stones in the top row and can be sliced into interlacing single-colored layers. The assignment of colors is analogous as in the pyramid model discussed in [10,13]. The pyramid crystal for the conifold and C 3 /Z 2 are shown in fig. 19 and 20.
The assignment of colors is determined as follows. All stones on one side of the crystal are encoded in The Kähler parameter Q, as well as the parameter t 1 , arise as q 1 = τ Qt 1−n 1 , q 0 = τ t n 1 Q , so that q 0 q 1 = t 1 .
Now the crystal with n − 1 additional stones in the top row arises from an insertion of the operator This operator is made of n − 1 terms of the form Γ − (1) Q 1 q iB Γ τ + (1) Q 0 q −(i+1)B for i = 0, . . . , n − 2, where in each subsequent dark or light slice we insert one additional operator q ±B . This additional operator changes the weight of each stone in this slice by q ±B = (t 1 /t 2 ) ±1 (with respect to the previous slice of the same light or dark color).
Finally, all stones on the right side of the crystal have again the same light or dark color, so that the corresponding state is We see that varying weights in the middle range (along solid lines in fig. 19 and 20) interpolate between fixed weights of light and dark stones on two external sides of a crystal. Figure 20: Refined pyramid crystal for the resolution of C 3 /Z 2 singularity, in the chamber corresponding to n stones in the top row, as seen from the bottom (i.e. a negative direction of z-axis). Even though the three-dimensional shape of the crystal is different than in the conifold case, the assignment of colors is the same, see fig. 19.
We can now commute away all weight operators in the above expressions, using commutation relations from section 3. 2

. This results in
To check that this is a correct representation we commute all vertex operators, and find where τ = ∓1 respectively for the conifold and C 3 /Z 2 . This result reproduces (108) and (109), which confirms that the fermionic representation we started with is correct.

Refined matrix models
In the refined case one can associate matrix models to refined generating functions in the same way as described in section 5.1, i.e. by inserting the representation (76) of the identity operator into fermionic representation (115) or (116). This does not change a unitary character of the matrix model, which is a consequence of the representation (76). However, due to more subtle weight assignments, this is matrix potential which gets deformed by β-dependent factors. In general we will therefore obtain matrix models of the following form where for convenience we introduced a factor √ β in front of the potential V (z; β). We will consider a few examples below.
Repeating the computation described in section 5.1, however starting with the refined representation (115), in the non-commutative chamber for general geometry we find the matrix model i.e. we identify e − √ β gs V (z;β) ≡ N l=0 Θ τ l+1 z(q 1 · · · q l ) −1 ; t 1 , t 2 τ l+1 . The product over l runs over all vertices and we identify Kähler parameters Q p with weights q p via q p = (τ p τ p+1 )Q p .
Using the asymptotics (86) we find the leading order expansion of the potential e − The quadratic term in the potential is the same as in the non-refined case. The term involving Li 2 (−z), as well as all higher order terms O(g s , β), arise as deformations which vanish for β = 1. Therefore, for β = 1, we obtain a Chern-Simons matrix model which indeed gives rise to MacMahon function in N → ∞ limit, as we explained in section 5.3. For arbitrary β, the resolvent ω(p) can also be found using the Migdal integral (37).
In principle one could repeat the computation described in section 5.3, however this is technically more involved. Nonetheless, this would lead to β-deformed end-points of the cut (91) and (92), and in consequence to the β-deformed spectral curve. This curve would be some β-deformation of the mirror curve given in (41). It is still an interesting question to find this curve in the exact form and analyze its properties.

Refined conifold matrix model
Finally we find matrix models for the refined conifold. Starting with the representation (117), inserting the identity representation (76) and following standard by now computations, we find the following matrix model for the conifold in the n'th chamber (corresponding to a pyramid with (n + 1) stones on top) , with the prefactor given by In the limit of the commutative chamber, n → ∞, we get f ∞ = M ref (t 1 , t 2 ). Therefore in the commutative chamber we get a matrix model representation of the refined topological string conifold amplitude .
This is quite an interesting result -as we already explained above, it has been postulated for some time that the refined topological string amplitude for the conifold should have matrix model representation, however it was not clear how to derive it. Here we find an explicit matrix model representation of this amplitude. The corresponding spectral curve would again be a β-deformation of the conifold mirror curve (41). It would be interesting to compare it with other notions of deformed, or quantum mirror curves in literature. We also note that in the limit Q → 0 the above topological string partition function becomes just the refined MacMahon function, and the matrix integral consistently reproduces C 3 result (121).