# Modular bootstrap for D4-D2-D0 indices on compact Calabi-Yau threefolds

Sergei Alexandrov, Nava Gaddam, Jan Manschot, Boris Pioline

► To cite this version:

Sergei Alexandrov, Nava Gaddam, Jan Manschot, Boris Pioline. Modular bootstrap for D4-D2-D0 indices on compact Calabi-Yau threefolds. Advances in Theoretical and Mathematical Physics, 2023, 27 (3), pp.683-744. 10.4310/ATMP.2023.v27.n3.a2. hal-03635855

HAL Id: hal-03635855

https://hal.science/hal-03635855v1

Submitted on 7 Apr 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Modular bootstrap for D4-D2-D0 indices on
compact Calabi-Yau threefolds

Sergei Alexandrov¹, Nava Gaddam², Jan Manschot³, Boris Pioline⁴

¹ Laboratoire Charles Coulomb (L2C), Université de Montpellier, CNRS,
F-34095, Montpellier, France

² Institute for Theoretical Physics and Center for Extreme Matter and Emergent Phenomena, Utrecht University, 3508 TD Utrecht, The Netherlands

³ School of Mathematics, Trinity College, Dublin 2, Ireland

⁴ Laboratoire de Physique Théorique et Hautes Energies (LPTHE), UMR 7589 CNRS-Sorbonne Université, Campus Pierre et Marie Curie, 4 place Jussieu, F-75005 Paris, France

e-mail: sergey.alexandrov@umontpellier.fr, gaddam@uu.nl,
manschot@maths.tcd.ie, pioline@lpthe.jussieu.fr

ABSTRACT: We investigate the modularity constraints on the generating series $h_r(\tau)$ of BPS indices counting D4-D2-D0 bound states with fixed D4-brane charge $r$ in type IIA string theory compactified on complete intersection Calabi-Yau threefolds with $b_2 = 1$. For unit D4-brane, $h_1$ transforms as a (vector-valued) modular form under the action of $SL(2, \mathbb{Z})$ and thus is completely determined by its polar terms. We propose an Ansatz for these terms in terms of rank 1 Donaldson-Thomas invariants, which incorporates contributions from a single D6-D6 pair. Using an explicit overcomplete basis of the relevant space of weakly holomorphic modular forms (valid for any $r$), we find that for 10 of the 13 allowed threefolds, the Ansatz leads to a solution for $h_1$ with integer Fourier coefficients, thereby predicting an infinite series of DT invariants. For $r > 1$, $h_r$ is mock modular and determined by its polar part together with its shadow. Restricting to $r = 2$, we use the generating series of Hurwitz class numbers to construct a series $h_2^{(\text{an})}$ with exactly the same modular anomaly as $h_2$, so that the difference $h_2 - h_2^{(\text{an})}$ is an ordinary modular form fixed by its polar terms. For lack of a satisfactory Ansatz, we leave the determination of these polar terms as an open problem.
# Contents

<table><tr><td>1. Introduction</td><td>1</td></tr><tr><td>2. DT invariants and D4-D2-D0 bound states</td><td>6</td></tr><tr><td>2.1 Generalized DT invariants and spectral flow</td><td>6</td></tr><tr><td>2.2 Rank 1 DT invariants and GV invariants</td><td>7</td></tr><tr><td>2.3 Rank 0 DT invariants and their generating series</td><td>8</td></tr><tr><td>2.4 One modulus case</td><td>10</td></tr><tr><td>3. The space of vector-valued modular forms</td><td>11</td></tr><tr><td>3.1 Modular constraints on polar terms</td><td>11</td></tr><tr><td>3.2 A universal basis</td><td>12</td></tr><tr><td>4. BPS indices for single D4-brane</td><td>13</td></tr><tr><td>4.1 Polar terms</td><td>13</td></tr><tr><td>4.2 Results</td><td>16</td></tr><tr><td>5. BPS indices for D4-brane charge 2</td><td>17</td></tr><tr><td>5.1 General strategy</td><td>17</td></tr><tr><td>5.2 Explicit construction</td><td>19</td></tr><tr><td>5.3 A naive attempt</td><td>21</td></tr><tr><td>6. Discussion</td><td>21</td></tr><tr><td>A. Polar terms of vector valued modular forms</td><td>23</td></tr><tr><td>A.1 Number of polar terms</td><td>23</td></tr><tr><td>A.2 Number of constraints</td><td>24</td></tr><tr><td>B. Generalized Hecke operator</td><td>26</td></tr><tr><td>C. Generating functions for unit D4-brane charge</td><td>30</td></tr><tr><td>D. Comparison with mathematical results</td><td>38</td></tr></table>

## 1. Introduction

Elucidating the microscopic origin of the Bekenstein-Hawking entropy of black holes has been one of the most fruitful endeavours in string theory, with amazing quantitative success for BPS black holes in highly supersymmetric vacua. In trying to extend this program for
type IIA string vacua with $\mathcal{N} = 2$ supersymmetry in four dimensions (the minimal amount of supersymmetry allowing for BPS states), D4-D2-D0 black holes play a special role, as they can be lifted to M5-branes wrapped on divisor $\mathcal{D}$ (i.e. a complex four-cycle) inside the Calabi-Yau (CY) threefold $\mathfrak{Y}$ [1]. This allows an effective description in terms of a two-dimensional (0, 4) superconformal field theory (SCFT) obtained by reducing the (still mysterious) six-dimensional (2, 0) SCFT on the five-brane world-volume [1, 2]. In particular, the generating series of BPS indices for fixed D4 and D2-brane charges is determined by the elliptic genus of the two-dimensional SCFT and is therefore expected to be modular. This fact can be used to bootstrap[^1] the full generating series from some small set of data, such as BPS indices of D4-D2-D0 bound states with the smallest possible values of the D0-brane charge $q_0$. From a mathematical viewpoint, this opens a way to access an infinite set of rank-zero Donaldson-Thomas (DT) invariants, which are notoriously difficult to compute directly, and a straightforward method to extract the asymptotic growth of the BPS indices in the ‘Cardy regime’ $q_0 \to \infty$ with fixed D4 and D2-brane charges.

In practice, this approach requires (i) a complete characterization of the modular properties of the generating series, and (ii) an ability to determine its polar coefficients. So far it has been implemented only for a few examples of compact CY threefolds with one Kähler modulus (such as the quintic threefold) and a single D4-brane wrapping a smooth ample divisor $\mathcal{D}$. For such divisors, the generating series $h_{1,\mu}(\tau)$ of BPS indices, with fixed primitive D4-brane charge $p = [\mathcal{D}] \in H_4(\mathfrak{Y})$, D2-brane charge $\mu \in H_2(\mathfrak{Y})$ (modulo spectral flow) and fugacity $q = e^{2\pi i\tau}$ conjugate to the D0-brane charge, behaves as a vector-valued (VV) modular form of fixed weight $w = -\frac{1}{2}b_2(\mathfrak{Y}) - 1$ and fixed multiplier system under $SL(2, \mathbb{Z})$ transformations $\tau \mapsto (a\tau + b)/(c\tau + d)$ [1, 11, 12]. Since the dimension of the space of such VV modular forms is bounded by the number of polar terms [13, 14, 15], i.e. those with inverse powers of $q$, the knowledge of the latter is sufficient to fix the whole generating series. The computation of $h_{1,\mu}(\tau)$ thus reduces to fixing a finite number of coefficients.

Several techniques for computing the polar coefficients have been developed in the literature, either by directly quantizing the moduli space of D4-D2-D0-brane configurations for low D0-brane charge, as demonstrated for the quintic threefold in [16, 11] and for a handful of other one-parameter models in [17], or by using the AdS/CFT correspondence in the near horizon geometry [11]. A more systematic approach is to view the polar D4-D2-D0 states as bound states of D6-branes and $\overline{D6}$-branes [18], and exploit the relation $Z_{D6} \sim Z_{\text{top}}$ between the partition function $Z_{D6}$ of D6-D2-D0 indices with unit D6-brane charge (also known as rank-one DT invariants) and the topological string partition function $Z_{\text{top}}$ [19], which is in turn determined by the Gopakumar-Vafa (GV) invariants. This approach was applied in [20, 21] to the quintic and a couple of other one-parameter CYs, confirming the analysis in [11, 17]. It however assumes that only a single D6-$\overline{D6}$ pair contributes, an assumption which needs to be verified case-by-case through a detailed analysis of the possible attractor flow trees

<footnote>[^1]: The term ‘bootstrap’ covers a multitude of non-perturbative approaches to determine physical quantities from general consistency constraints and some basic assumptions about the spectrum. In the context of two-dimensional (super) conformal field theories, constraints from modularity are a powerful tool to learn about the (BPS and non-BPS) spectrum, see for example in [3, 4, 5, 6, 7, 8, 9, 10].</footnote>
<table><thead><tr><th>CICY</th><th>χ</th><th>κ</th><th>c<sub>2</sub></th><th>χ(O<sub>D</sub>)</th><th>χ(O<sub>2D</sub>)</th><th>n<sub>1</sub></th><th>n<sub>2</sub></th><th>C<sub>1</sub></th><th>C<sub>2</sub></th><th>type</th></tr></thead><tbody><tr><td>X<sub>5</sub>(1<sup>5</sup>)</td><td>-200</td><td>5</td><td>50</td><td>5</td><td>15</td><td>7</td><td>36</td><td>0</td><td>1</td><td>F</td></tr><tr><td>X<sub>6</sub>(1<sup>4</sup>, 2)</td><td>-204</td><td>3</td><td>42</td><td>4</td><td>11</td><td>4</td><td>19</td><td>0</td><td>1</td><td>F</td></tr><tr><td>X<sub>8</sub>(1<sup>4</sup>, 4)</td><td>-296</td><td>2</td><td>44</td><td>4</td><td>10</td><td>4</td><td>14</td><td>0</td><td>1</td><td>F</td></tr><tr><td>X<sub>10</sub>(1<sup>3</sup>, 2, 5)</td><td>-288</td><td>1</td><td>34</td><td>3</td><td>7</td><td>2</td><td>7</td><td>0</td><td>0</td><td>F</td></tr><tr><td>X<sub>4,3</sub>(1<sup>5</sup>, 2)</td><td>-156</td><td>6</td><td>48</td><td>5</td><td>16</td><td>9</td><td>42</td><td>0</td><td>0</td><td>F</td></tr><tr><td>X<sub>4,4</sub>(1<sup>4</sup>, 2<sup>2</sup>)</td><td>-144</td><td>4</td><td>40</td><td>4</td><td>12</td><td>6</td><td>25</td><td>1</td><td>1</td><td>K</td></tr><tr><td>X<sub>6,2</sub>(1<sup>5</sup>, 3)</td><td>-256</td><td>4</td><td>52</td><td>5</td><td>14</td><td>7</td><td>30</td><td>0</td><td>1</td><td>C</td></tr><tr><td>X<sub>6,4</sub>(1<sup>3</sup>, 2<sup>2</sup>, 3)</td><td>-156</td><td>2</td><td>32</td><td>3</td><td>8</td><td>3</td><td>11</td><td>0</td><td>1</td><td>F</td></tr><tr><td>X<sub>6,6</sub>(1<sup>2</sup>, 2<sup>2</sup>, 3<sup>2</sup>)</td><td>-120</td><td>1</td><td>22</td><td>2</td><td>5</td><td>1</td><td>5</td><td>0</td><td>0</td><td>K</td></tr><tr><td>X<sub>3,3</sub>(1<sup>6</sup>)</td><td>-144</td><td>9</td><td>54</td><td>6</td><td>21</td><td>14</td><td>78</td><td>1</td><td>3</td><td>K</td></tr><tr><td>X<sub>4,2</sub>(1<sup>6</sup>)</td><td>-176</td><td>8</td><td>56</td><td>6</td><td>20</td><td>15</td><td>69</td><td>1</td><td>3</td><td>C</td></tr><tr><td>X<sub>3,2,2</sub>(1<sup>7</sup>)</td><td>-144</td><td>12</td><td>60</td><td>7</td><td>26</td><td>21</td><td>117</td><td>1</td><td>0</td><td>C</td></tr><tr><td>X<sub>2,2,2,2</sub>(1<sup>8</sup>)</td><td>-128</td><td>16</td><td>64</td><td>8</td><td>32</td><td>33</td><td>185</td><td>3</td><td>4</td><td>M</td></tr></tbody></table>

**Table 1:** Relevant data for the 13 smooth CICY threefolds with $b_2(\mathfrak{Z}) = 1$ (the first 4 columns are taken from [33], [34, Table 3.1]). A complete intersection of multidegree $(d_1, \dots, d_k)$ in weighted projective space $\mathbb{P}^{k+3}(w_1, \dots, w_l)$ is denoted $X_{d_1, \dots, d_k}(w_1^{m_1}, \dots, w_p^{m_p})$ where $m_i$ is the number of repetitions of the weight $w_p$. The columns $\chi, \kappa, c_2$ indicate the Euler number of $\mathfrak{Z}$, intersection product $\kappa = \mathcal{D} \cup \mathcal{D} \cup \mathcal{D}$ and second Chern class $c_2 = \int_{\mathcal{D}} c_2(T\mathfrak{Z})$. The columns $\chi(O_{\mathcal{D}})$ and $\chi(O_{2\mathcal{D}})$ indicate the holomorphic Euler characteristic of the structure sheaf on $\mathcal{D}$ and $2\mathcal{D}$, which determine the central charge $c_R$ in the (0, 4) SCFT. The columns $n_1, n_2$ indicate the number of polar terms in the generating series $h_{1,\mu}$ and $h_{2,\mu}$ (assuming the Castelnuovo bound on GV invariants), while $C_1, C_2$ indicate the difference between the number of polar terms and the actual dimension of the space of VV modular forms. Each model has a one-dimensional Kähler moduli space with three singular points, including the standard large volume limit at $\psi = \infty$ and a conifold singularity at $\psi = 1$; the last column of the table indicates the type of singularity at $\psi = 0$ in the terminology of [35].

[22, 18, 23, 24] or more general<fnref n="2" /> multi-centered configurations [31, 29, 30, 32]. An important check is that the proposed polar terms should allow for the existence of a VV modular form with integer Fourier coefficients. This requirement is especially non-trivial when the dimension of the space of VV modular forms is strictly smaller than the number of polar terms, which implies that the polar coefficients must satisfy certain linear constraints for a modular form with this polar part to exist [14, 15].

In this work, our aim is twofold. First, we generalize the analysis of [11, 17, 20, 21] to the complete list [36]<fnref n="3" /> of 13 compact CY threefolds with $b_2(\mathfrak{Z}) = 1$ obtained as a complete

<footnote n="2">²Multi-centered scaling solutions [25, 26, 27, 28] are not accessible by attractor flow tree techniques, but are amenable to localization methods [29, 30].</footnote>

<footnote n="3">³We do not include the 14-th case $X_{2,12}$ from [36], since it does not correspond to a smooth threefold [37]. For brevity we also refrain from considering other types of compact CY threefolds with $b_2(\mathfrak{Z}) = 1$, such as the $\mathbb{Z}_5$ quotient of the quintic [11], Rødland's determinantal and Pfaffian threefolds [38], or the Reye congruence threefold [39], but our analysis applies just as well to these cases.</footnote>
intersection in weighted projective space (CICY, see Table 1). Second, we attempt to extend this analysis to the case of non-primitive $D4$-brane charge $p = 2[D]$. Our main results in the first direction are as follows (the first item being also relevant for the second goal):

a) An explicit overcomplete basis spanning the space $M_r(\mathfrak{Z})$ of $VV$ modular forms characterized by the weight and multiplier system of $h_{r,\mu}$ where $r$ is the wrapping number, i.e $p = r[D]$ with $[D]$ being the primitive generator of $H_4(\mathfrak{Z}, \mathbb{Z})$. This basis is similar in spirit to the one constructed for $r = 1$ in [17], but less contrived and valid for any $r$ and all one-parameter threefolds (the dependence on $\mathfrak{Z}$ arises through the triple intersection number $\kappa$ and the second Chern class $c_2$.) We use it to check the difference between the dimension of $M_r(\mathfrak{Z})$ and the number of polar terms predicted by the Selberg trace formula [15], and to reconstruct $VV$ modular forms from their polar coefficients.

b) An Ansatz (4.10) for the polar terms of $h_{1,\mu}$, in terms of the rank-one Donaldson-Thomas invariants of $\mathfrak{Z}$, which sums the contributions from a single $D6-\overline{D6}$ pair and reproduces the results of [17] for $\mathfrak{Z} \in \{X_5, X_6, X_8, X_{10}, X_{3,3}\}$. A similar Ansatz is proposed for $h_{r,\mu}$ with $r > 1$ in (5.20), but we expect that multiple $D6-\overline{D6}$ pairs in general contribute, so that Ansatz probably captures only part of the contributions to the polar coefficients.

c) For $r = 1$ and all but 3 of the 13 models considered, using the $GV$ invariants computed in [33], we find that the polar coefficients predicted by our Ansatz are consistent with the existence of a $VV$ modular form with integer coefficients. Notably, this includes two cases ($X_{3,3}$, already considered in [17], and $X_{4,4}$) where the dimension of the space of $VV$ modular forms is one less than the number of polar terms, providing a rather strong check on the validity of the Ansatz (4.10).

d) For the remaining 3 models $X_{4,2}$, $X_{3,2,2}$, $X_{2,2,2,2}$, we find that the polar coefficients predicted by the Ansatz do not allow for a $VV$ modular form with integer coefficients. Barring possible errors in the tables of $GV$ invariants in [33], we suspect that for such models there are additional contributions to the polar terms which we have not identified.

Our second goal is to propose a procedure to construct the generating series $h_{p,\mu}(\tau)$ for higher $D4$-charges $p = r[D]$, and make it explicit in the case $r = 2$. The main difficulty, which appears when $D$ is a reducible divisor or when the $D4$-brane charge is a multiple of an irreducible divisor class, is that $h_{p,\mu}$ fails to be a modular form. Instead, it turns out to be a $VV$ *mock* modular form of *higher depth* and *mixed type*, which transforms inhomogeneously under the action of $SL(2, \mathbb{Z})$ [40, 41, 42, 43] (following on earlier works [44, 45, 46, 47]). More specifically, this means that $h_{p,\mu}$ admits a non-holomorphic completion $\hat{h}_{p,\mu}$ that transforms as a $VV$ modular form of the same weight and multiplier system as in the irreducible case, at the expense of being non-holomorphic. In [40, 42, 48], this completion has been constructed explicitly in terms of products of $h_{p_i, \mu_i}$'s such that $p = \sum_{i=1}^r p_i$ (with $r-1$ being the *depth*). The fact that $h_{p,\mu}$ is of *mixed type* (meaning that the $\bar{\tau}$-derivative of $\hat{h}_{p,\mu}$, known as the *shadow*, is not anti-holomorphic) implies that it is necessary to specify both the polar terms and the
shadow<fnref n="4" /> in order to fix $h_{p,\mu}$ uniquely. Given this information, $h_{p,\mu}$ can be reconstructed in two steps. First, one produces an *ad hoc* function $h_{p,\mu}^{(\text{an})}$ with the same modular anomaly as $h_{p,\mu}$, such that $h_{p,\mu}^{(0)} = h_{p,\mu} - h_{p,\mu}^{(\text{an})}$ becomes an ordinary VV holomorphic modular form. Second, one reconstructs $h_{p,\mu}^{(0)}$ from its polar coefficients by expanding on an explicit (possibly overcomplete) basis, thereby obtaining the generating series $h_{p,\mu}$ of interest. Clearly, the second step is straightforward (with the help of a computer), while the first step requires some ingenuity.

In this work we implement this idea for the generating series $h_{2,\mu}$ of D4-D2-D0 indices with D4-brane charge $p = 2[\mathcal{D}]$. Namely, we construct a VV mock modular form $h_{2,\mu}^{(\text{an})}$ with the same modular anomaly as $h_{2,\mu}$, by acting with a suitable Hecke operator $\mathcal{T}_\kappa$ [50] on the generating series of Hurwitz class numbers (the simplest example of a VV mock modular form of depth one).<fnref n="5" /> The latter are well-known to arise as rank 2 Vafa-Witten invariants on the complex projective plane [51], which also count D4-branes wrapped twice on the compact divisor $P^2$ inside the non-compact threefold $K_{P^2}$. We then provide an explicit algorithm that determines $h_{2,\mu}$, assuming that its polar coefficients are known. Unfortunately, when applied to the polar coefficients stipulated by the Ansatz (5.20), it fails to produce satisfactory results: either the polar coefficients do not satisfy the constraints imposed by modularity, or the resulting generating series turns out to have non-integer Fourier coefficients. However, as emphasized above, the Ansatz is unlikely to be correct when $r > 1$ anyway.

A detailed supergravity analysis of the multi-centered D4-D2-D0 bound states contributing to the polar terms is left for future work. Until then, the generating series of DT invariants computed by our method should be considered as tentative. We note however that the idea that rank-zero DT invariants (counting D4-D2-D0 bound states) are determined by rank-one invariants (counting D6-D4-D2-D0 bound states with unit D6-brane charge) is broadly consistent with the OSV conjecture [52] and with recent results in the mathematics literature [53, 54, 55, 56], although the detailed connection remains elusive.

The remainder of this article is organized as follows. In §2 we briefly review the definition of ordinary DT invariants, D4-D2-D0 indices, and the modular constraints that their generating series $h_{r,\mu}$ ought to satisfy, specializing to the one-modulus case. In §3 we construct an overcomplete basis of the space $\mathcal{M}_r(\mathcal{Q})$ of vector-valued modular forms in which these generating series would live if the modular anomaly were absent. In §4, we consider D4-D2-D0 indices with unit D4-brane charge $r=1$, propose an Ansatz for the polar part of the corresponding generating series $h_{1,\mu}$, and determine the corresponding modular forms. In §5, we turn to the $r=2$ case, and develop a strategy for determining the VV mock modular forms $h_{2,\mu}$, assuming their polar part is known. In §6 we discuss the possible origin of additional contributions to the polar terms. In Appendix A we derive an explicit formula for the dimension of the space $\mathcal{M}_r(\mathcal{Q})$, and tabulate the results for low values of $r$. In §B we construct a Hecke operator producing a solution $h_{2,\mu}^{(\text{an})}$ of the modular anomaly equation

<footnote n="4">⁴In contrast, ‘pure’ mock modular forms can be recovered from their polar terms by a Poincaré series-type construction, which produces both the q-expansion and the shadow, see e.g. [14, 49].</footnote>

<footnote n="5">⁵Our construction assumes that $\kappa$ is a power of a prime number, which is the case for all models in Table 1 except $X_{4,3}$ and $X_{3,2,2}$. We leave it as an open problem to extend it to general $\kappa$.</footnote>
from the generating series of Hurwitz class numbers. In §C, for each of the 13 one-parameter CICY threefolds, we provide the rank 1 DT invariants and the resulting VV modular forms $h_{1,\mu}$ together with their q-expansions. Finally in §D, we review some recent results in the mathematical literature on rank 0 DT invariants, and compare them with our Ansatz for polar terms.

Note added in v2, updated in v3: After the first release of this work on arXiv, it became apparent in discussions with Soheyla Feyzbakhsh that the polar coefficients of the generating series $h_{N,\mu}$ can be computed by generalizing the approach of [56], provided GV invariants are known to sufficiently high genus and degree. Recent work using this strategy [84] confirms that the generating series quoted in Appendix C are indeed correct for $X_5, X_6, X_8, X_{3,3}, X_{4,4}, X_{6,6}$, verifying the Ansatz (4.10) in those cases. However, it is found that some of the polar terms for $X_{10}, X_{6,2}, X_{6,4}, X_{4,3}$ and $X_{4,2}$ disagree with this Ansatz. In particular, for $X_{10}$, the suggestion of [21], which was initially dismissed in the first release of the present work, is in fact confirmed (see footnote 17). The polar terms for $X_{3,2,2}, X_{2,2,2,2}$ are currently out of reach by this approach, due to limitations in computing GV invariants. We chose to leave unchanged the results in Appendix C, but to mark with † the results that we now believe to be incorrect.

## 2. DT invariants and D4-D2-D0 bound states

In this section we provide a lightning review of BPS indices counting supersymmetric D4-D2-D0 bound states in type II string theory compactified on a CY threefold $\mathfrak{Z}$, and of the modular properties of their generating series $h_{p,\mu}$, specializing the relevant formulae to the one-modulus case $b_2(\mathfrak{Z}) = 1$. We refer the reader to our previous works [40, 42] for more details.

### 2.1 Generalized DT invariants and spectral flow

Recall that in the large volume limit, D6-D4-D2-D0 bound states on $\mathfrak{Z}$ are described by semi-stable coherent sheaves $\mathcal{E}$ on $\mathfrak{Z}$. Their electromagnetic charge $\gamma$ is identified with the Mukai vector $\mathrm{ch}\,\mathcal{E}\sqrt{\mathrm{Td}\mathfrak{Z}}$. Expanding $\gamma$ on a basis of $H^{\mathrm{even}}(\mathfrak{Z}, \mathbb{Z})$, we obtain components $\gamma = (p^0, p^a, q_a, q_0)$ with $a = 1, \dots, b_2$ satisfying the following quantization conditions [57]:

$$p^0, p^a \in \mathbb{Z}, \quad q_a \in \mathbb{Z} + \frac{1}{2} \kappa_{abc} p^b p^c - \frac{1}{24} p^0 c_{2,a}, \quad q_0 \in \mathbb{Z} - \frac{1}{24} c_{2,a} p^a, \quad (2.1)$$

where $\kappa_{abc}$ are triple intersection numbers of $\mathfrak{Z}$ and $c_{2,a}$ are components of its second Chern class. The mass of such BPS states is proportional to the modulus of the central charge, which is given in the large volume limit by

$$Z_{\gamma} = \int_{\mathfrak{Z}} e^{-z^a \omega_a} \mathrm{ch} \, \mathcal{E} \sqrt{\mathrm{Td} \mathfrak{Z}}, \quad (2.2)$$

where $z^a = b^a + it^a$ are the Kähler moduli conjugate to the basis $\omega_a$ in $H^2(\mathfrak{Z}, \mathbb{Z})$. Under a large gauge transformation $b^a \to b^a + \epsilon^a$, the central charge and hence the mass stay invariant
provided $\mathcal{E}$ is tensored with a line bundle $\mathcal{F}$ with $c_1(\mathcal{F}) = \epsilon^a \omega_a$, an operation known as spectral flow which shifts the charges as follows

$$ 
\begin{align} 
p^0 \mapsto p^0, \quad p^a \mapsto p^a + \epsilon^a p^0, \quad q_a \mapsto q_a - \kappa_{abc} p^b \epsilon^c - \frac{p^0}{2} \kappa_{abc} \epsilon^b \epsilon^c, \tag{2.3} \\ 
q_0 \mapsto q_0 - \epsilon^a q_a + \frac{1}{2} \kappa_{abc} p^a \epsilon^b \epsilon^c + \frac{p^0}{6} \kappa_{abc} \epsilon^a \epsilon^b \epsilon^c. \nonumber 
\end{align} 
$$

We will denote the resulting charge by $\gamma[\epsilon]$.

The BPS index $\Omega(\gamma; z^a)$, or generalized Donaldson-Thomas (DT) invariant, is defined (informally) as the signed Euler number of the moduli space of semi-stable sheaves with fixed charge $\gamma$, where semi-stability requires that all subsheaves $\mathcal{E}' \subset \mathcal{E}$ have $\arg Z_{\gamma'} \le \arg Z_{\gamma}$. Rational DT invariants are defined by the usual multicover formula

$$ \bar{\Omega}(\gamma; z^a) = \sum_{d|\gamma} \frac{1}{d^2} \Omega(\gamma/d; z^a), \qquad (2.4) $$

so that $\bar{\Omega}(\gamma; z^a) = \Omega(\gamma; z^a)$ whenever the charge $\gamma$ is primitive. Both $\Omega(\gamma; z^a)$ and its rational counterpart are invariant under the spectral flow (2.3) provided it is combined with $b^a \to b^a + \epsilon^a$.

## 2.2 Rank 1 DT invariants and GV invariants

While our primary interest is in D4-D2-D0 bound states, an important ingredient will be the ordinary DT invariants which count D6-D4-D2-D0 bound states with a single unit of D6-brane charge, in the large volume limit. Due to the symmetry (2.3), they may be expressed in terms of the invariant D2 and D0 charges<fnref n="6" />

$$ Q_a = q_a + \frac{1}{2} \kappa_{abc} p^b p^c + \frac{c_{2a}}{24}, \quad n = -q_0 - p_a q^a - \frac{1}{3} \kappa_{abc} p^a p^b p^c. \qquad (2.5) $$

Following [18, §6.1.2], we denote the corresponding DT invariants by

$$ DT(Q_a, n) = \lim_{\lambda \to +\infty} \Omega(1, p^a, q_a, q_0; \lambda(b^a + it^a)), \qquad (2.6) $$

where $b^a < -t^a \sqrt{3}$. If instead $b^a > t^a \sqrt{3}$, one has

$$ DT(Q_a, -n) = \lim_{\lambda \to +\infty} \Omega(1, p^a, q_a, q_0; \lambda(b^a + it^a)). \qquad (2.7) $$

Since $DT(Q_a, n)$ vanishes for $n$ negative and large enough (as a result of Castelnuovo-type bounds), one can construct the formal series

$$ Z_{DT}(\xi^a, q) = \sum_{Q_a, n} DT(Q_a, n) e^{2\pi i Q_a \xi^a} q^n, \qquad (2.8) $$

where the sum runs over effective curve classes $Q_a \ge 0$. Up to a factor $M(-q)^{\chi_q}$, where $M(q) = \prod_{k>0} (1 - q^k)^{-k}$ is the Mac-Mahon function, the series (2.8) coincides with the

<footnote n="6">⁶The shift proportional to the second Chern class ensures that $Q_a$ is integer, whereas the integrality of $n$ follows from the integrality of the arithmetic genus $\chi(\mathcal{O}_{\mathcal{D}_p})$ in (2.17).</footnote>
generating function of stable pair invariants (see e.g. [58]). More importantly for our purposes, the series (2.8) can in turn be expressed in terms of GV invariants $N_Q^{(g)}$ using the GV/DT correspondence [19, 59]

$$ Z_{DT}(\xi^a, q) = [M(-q)]^{\chi_Q} \prod_{Q>0} \prod_{k>0} (1 - (-q)^k e^{2\pi i Q_a \xi^a})^{k N_Q^{(0)}} \\ \times \prod_{Q>0} \prod_{g>0} \prod_{\ell=0}^{2g-2} (1 - (-q)^{g-\ell-1} e^{2\pi i Q_a \xi^a})^{(-1)^{g+\ell} \binom{2g-2}{\ell} N_Q^{(g)}}. \qquad (2.9) $$

The right-hand side is well-defined as a formal series, since for any fixed $Q_a$ there is only a finite number of $g$ such that $N_Q^{(g)} \neq 0$. Upon setting $q = e^{i\lambda}$ and expanding as $\lambda \to 0$, it provides the perturbative expansion of the topological string partition function, which can in principle be computed by solving the holomorphic anomaly equations (see e.g. [60]). Thus, (2.9) gives a practical way of computing the rank 1 DT invariants $DT(Q_a, n)$.

## 2.3 Rank 0 DT invariants and their generating series

We now turn to our prime interest, namely D4-D2-D0 bound states with vanishing D6-brane charge, $p^0 = 0$. In this case, the D4-brane charge $p^a$ is invariant under spectral flow, along with the following combination of D0 and D2 charges<fnref n="7" />

$$ \hat{q}_0 = q_0 - \frac{1}{2} \kappa^{ab} q_a q_b. \qquad (2.10) $$

Here $\kappa^{ab}$ is the inverse of $\kappa_{ab} = \kappa_{abc}p^c$, a quadratic form of signature $(1, b_2(\mathfrak{Q}) - 1)$ on $\Lambda \otimes \mathbb{R} \simeq \mathbb{R}^{b_2(\mathfrak{Q})}$ where $\Lambda = H_4(\mathfrak{Q}, \mathbb{Z})$. The Bogomolov-Gieseker bound implies that the BPS index $\Omega(\gamma; z^a)$ vanishes unless the invariant charge $\hat{q}_0$ is bounded from above by

$$ \hat{q}_0 \le \hat{q}_0^{\max} = \frac{1}{24} \chi(\mathcal{D}_p), \qquad (2.11) $$

where $\chi(\mathcal{D}_p)$ is the Euler number of the divisor $\mathcal{D}_p = p^a\gamma_a$ (with $\gamma_a$ a basis of effective divisor classes in $H_4(\mathfrak{Q}, \mathbb{Z})$), given by [1, Eq.(3.3)]

$$ \chi(\mathcal{D}_p) = \kappa_{abc} p^a p^b p^c + c_{2,a} p^a. \qquad (2.12) $$

Using the spectral flow (2.3), one may remove most of the D2-brane charge $q_a$, though not all of it in general. More precisely, one can always decompose

$$ q_a = \mu_a + \frac{1}{2} \kappa_{abc} p^b p^c + \kappa_{abc} p^b \epsilon^c, \qquad (2.13) $$

for some $\epsilon^a \in \Lambda$ (which can be removed by spectral flow) and $\mu_a \in \Lambda^*/\Lambda$ (which is invariant under spectral flow), where we use the quadratic form $\kappa^{ab}$ to identify $\Lambda$ with its image in $\Lambda^*$. The representative $\mu_a$ in the discriminant group $\Lambda^*/\Lambda$ (a finite group of order $|\det \kappa_{ab}|$) is sometimes known as the residual D2-brane charge.

<footnote n="7">⁷Note that our definition of $\hat{q}_0$ differs from [1] by an overall sign.</footnote>
When $p^a$ is irreducible, there are no walls of marginal stability in the large volume limit, and the index $\Omega(\gamma; z^a)$ (equal to the rational DT invariant) is independent of $b^a$ and invariant under spectral flow. In contrast, when $p^a$ is reducible, there are walls of marginal stability extending to large $t^a$, and in this regime $\Omega(\gamma; z^a)$ is only a locally constant function of $z^a$. We define the 'MSW invariants' $\Omega^{\text{MSW}}(\gamma) = \Omega(\gamma; z_{\infty}^a(\gamma))$ as the DT invariants evaluated at the large volume attractor point [61],

$$z_{\infty}^{a}(\gamma) = \lim_{\lambda \to +\infty} (b^{a}(\gamma) + i\lambda t^{a}(\gamma)) = \lim_{\lambda \to +\infty} (-\kappa^{ab}q_{b} + i\lambda p^{a}). \qquad (2.14)$$

The MSW index $\Omega^{\text{MSW}}(\gamma)$ should be distinguished from the attractor index $\Omega_{*}(\gamma)$, though both are by construction moduli-independent. Since $\Omega(\gamma; z^a)$ is invariant under the combined action of the spectral flow (2.3) and $b^a \to b^a + \epsilon^a$, $\Omega^{\text{MSW}}(\gamma)$ is invariant under (2.3) itself, and therefore depends only on $p^a$, $\mu_a$ and $\hat{q}_0$, so we denote it by $\Omega^{\text{MSW}}(\gamma) = \Omega_{p,\mu}(\hat{q}_0)$. Setting $p = rp_0$ such that $p_0$ is primitive, $\Omega_{p,\mu}(\hat{q}_0)$ is given informally by the signed Euler number of the combined moduli space of the divisor $\mathcal{D}_{p_0}$ inside $\mathfrak{P}$, equipped with a stable coherent sheaf $\mathcal{E}$ of rank $r$, slope $\mu/r$ and discriminant $\Delta = \frac{\chi(\mathcal{D}_{rp_0})}{24r} - \frac{\hat{q}_0}{r}$. In particular, it is invariant under $\mu \mapsto -\mu$, corresponding to dualizing the sheaf $\mathcal{E}$.

We can now define $h_{p,\mu}(\tau)$ as the generating series of rational MSW invariants<fnref n="8" />

$$h_{p,\mu}(\tau) = \sum_{\hat{q}_0 \le \hat{q}_0^{\text{max}}} \bar{\Omega}_{p,\mu}(\hat{q}_0) q^{-\hat{q}_0}. \qquad (2.15)$$

As briefly explained in the Introduction, the generating functions $h_{p,\mu}$ possess remarkable modular properties under the standard $SL(2, \mathbb{Z})$ transformations $\tau \mapsto \frac{a\tau+b}{c\tau+d}$. The precise properties depend on the divisor $\mathcal{D}_p$ corresponding to D4-brane charge $p^a$. If the divisor is irreducible, various physical arguments show<fnref n="9" /> [11, 12, 18, 63] that $h_{p,\mu}$ is a weakly holomorphic VV modular form of weight $-\frac{b_2(\mathfrak{P})}{2} - 1$ with the multiplier system determined by the following two matrices for T and S-transformations [48, Eq. (2.10)] (see also [11, 12, 18, 14])

$$\begin{align}
M_{\mu\nu}(T) &= e^{\pi i (\mu + \frac{b}{2})^2 + \frac{\pi i}{12} c_{2,a} p^a} \delta_{\mu\nu}, \nonumber \\
M_{\mu\nu}(S) &= \frac{(-1)^{\chi(\mathcal{O}_{\mathcal{D}_p})}}{\sqrt{|\Lambda^*/\Lambda|}} e^{(b_2 - 2)\frac{\pi i}{4}} e^{-2\pi i \mu \cdot \nu}, \tag{2.16}
\end{align}$$

where $\mu \cdot \nu = \kappa^{ab}\mu_a\nu_b$, $\delta_{\mu\nu}$ is the Kronecker delta on the discriminant group $\Lambda^*/\Lambda$, and $\chi(\mathcal{O}_{\mathcal{D}_p}) = \frac{1}{2}(b_2^+(\mathcal{D}_p) + 1)$ is the arithmetic genus given by

$$\chi(\mathcal{O}_{\mathcal{D}_p}) = \frac{1}{6} \kappa_{abc} p^a p^b p^c + \frac{1}{12} c_{2,a} p^a. \qquad (2.17)$$

However, if the divisor can be decomposed into a sum of $r$ irreducible divisors, the generating function can be shown (using physical reasoning based on S-duality of Type IIB string

<footnote n="8">⁸The definition in terms rational MSW invariants was proposed in [44, 23], motivated by consistency with wall-crossing. Note that the modular parameter $q = \exp(2\pi i \tau)$ in (2.15) is unrelated to $q$ in (2.8), which was not expected to have modular properties. The series $h_{p,\mu}(\tau)$ is invariant under $\mu \mapsto \mu + \epsilon$ with $\epsilon \in \Lambda$ and under $\mu \mapsto -\mu$.</footnote>

<footnote n="9">⁹Even in this simple case, modularity remains conjectural from a mathematical viewpoint, see e.g. [62] for some recent discussion.</footnote>
theory [42]) to transform as a VV mock modular form of depth $r-1$ (of the same weight and multiplier system as above). This implies that its non-holomorphic completion $\hat{h}_{p,\mu}(\tau, \bar{\tau})$, that transforms as a true modular form, is determined by iterated integrals of depth $r-1$ of another modular form. Although in [42] this modular completion has been found explicitly, we do not need it here in full generality and will restrict to the case $r=2$, first analyzed in [40]. But before specifying its explicit form, let us further restrict to CY threefolds with just one Kähler modulus, the class that we analyze in this paper.

## 2.4 One modulus case

Upon restricting to CY threefolds with $b_2(\mathfrak{Z}) = 1$, many of the equations above simplify. Firstly, the indices $a, b, c...$ take a single value so that the D4-brane charge $p^a$, residual D2-brane charge $\mu_a$, intersection numbers $\kappa_{abc}$ and second Chern class $c_{2,a}$ become scalar quantities which we denote simply as $p, \mu, \kappa$ and $c_2$. The discriminant group $\Lambda^*/\Lambda$ coincides with the cyclic group $\mathbb{Z}_{\kappa p}$ so that $\mu$ can be taken to lie in the interval $\{0, \dots, \kappa p - 1\}$.

Denoting by $\mathcal{D}$ the generator of $H_4(\mathfrak{Z}, \mathbb{Z})$, we have $\mathcal{D}_p = p\mathcal{D}$. Therefore, the degree of reducibility $r$ of the divisor coincides with the corresponding D4-brane charge, $r = p$. The modular weight of the generating functions $h_{r,\mu}$ is always $-3/2$ and the multiplier system (2.16) reduces to

$$ 
\begin{aligned}
M_{\mu\nu}(T) &= e^{\frac{\pi i}{\kappa r}(\mu + \frac{\kappa}{2}r^2)^2 + \frac{\pi i}{12}rc_2} \delta_{\mu\nu}, \\
M_{\mu\nu}(S) &= \frac{(-1)^{\mathcal{I}_r}}{\sqrt{i\kappa r}} e^{-\frac{2\pi i}{\kappa r}\mu\nu},
\end{aligned} 
\qquad (2.18) 
$$

where

$$ \mathcal{I}_r = \chi(\mathcal{O}_{r\mathcal{D}}) = \frac{1}{6} \kappa r^3 + \frac{1}{12} c_2 r. \qquad (2.19) $$

For $r > 1$ the generating functions $h_{r,\mu}$ no longer transform as VV modular forms under $SL(2, \mathbb{Z})$, but rather as mock modular forms of depth $r-1$ and mixed type. For $r=2$, their completion $\hat{h}_{2,\mu}$ can be deduced by specializing Eq.(1.3) in [40] to the case $b_2(\mathfrak{Z}) = 1$. This gives

$$ \hat{h}_{2,\mu}(\tau, \bar{\tau}) = h_{2,\mu}(\tau) + \sum_{\mu_1, \mu_2=0}^{\kappa-1} R_{\mu, \mu_1 \mu_2}(\tau, \bar{\tau}) h_{1, \mu_1}(\tau) h_{1, \mu_2}(\tau), \qquad (2.20) $$

where

$$ R_{\mu, \mu_1 \mu_2}(\tau, \bar{\tau}) = \delta_{\mu_1+\mu_2-\mu}^{(\kappa)} (-1)^{\mu'} \Theta_{\mu'}^{(\kappa)}(\tau, \bar{\tau}), \qquad (2.21) $$

with $\mu' = \mu - 2\mu_1 + \kappa$. Here $\delta_x^{(n)}$ is the mod-$n$ Kronecker delta defined by

$$ \delta_x^{(n)} = \begin{cases} 1 & \text{if } x = 0 \mod n, \\ 0 & \text{otherwise,} \end{cases} \qquad (2.22) $$

while $\Theta_{\mu}^{(\kappa)}(\tau, \bar{\tau})$ is the non-holomorphic theta series

$$ \Theta_{\mu}^{(\kappa)}(\tau, \bar{\tau}) = \frac{1}{8\pi} \sum_{k \in 2\kappa\mathbb{Z}+\mu} |k| \beta_{\frac{3}{2}}\left(\frac{\tau_2}{\kappa} k^2\right) e^{-\frac{\pi i \tau}{2\kappa} k^2}, \qquad (2.23) $$
where $\beta_{3/2}(x^2) = 2|x|^{-1}e^{-\pi x^2} - 2\pi \operatorname{Erfc}(\sqrt{\pi}|x|)$. In particular, (2.23) satisfies the holomorphic anomaly equation

$$ \partial_{\bar{\tau}} \Theta_{\mu}^{(\kappa)} = \frac{\sqrt{\kappa}}{16\pi i \tau_2^{3/2}} \sum_{k \in 2\kappa\mathbb{Z}+\mu} e^{-\frac{\pi i \bar{\tau}}{2\kappa} k^2}. \qquad (2.24) $$

In the following sections we shall apply these structural results for the generating functions $h_{r,\mu}$ to the set of one-parameter CY threefolds that can be obtained as complete intersections in weighted projective spaces. The relevant topological data for the corresponding 13 models are specified in Table 1.

# 3. The space of vector-valued modular forms

In this section, we analyze the space $\mathcal{M}_r(\mathfrak{Z})$ of weakly holomorphic vector-valued modular forms transforming with the same weight (namely, $-3/2$) and multiplier system as the generating function $h_{r,\mu}$, As explained in the previous section, for $r = 1$ the generating series $h_{1,\mu}$ belongs to $\mathcal{M}_1(\mathfrak{Z})$, while for $r > 1$ the modular anomaly of $h_{r,\mu}$ only specifies it up to an element in $\mathcal{M}_r(\mathfrak{Z})$. Thus, the results in this section will be relevant for both cases.

## 3.1 Modular constraints on polar terms

It is well known that any weakly holomorphic modular form $f_{\mu}(\tau)$ of weight $w < 0$ is completely fixed by its polar part, i.e. the part of its Fourier expansion

$$ f_{\mu}(\tau) = \sum_{n=0}^{\infty} c_{\mu}(n) q^{n-\Delta_{\mu}} \qquad (3.1) $$

that becomes singular in the limit $\tau \to i\infty$ [14]. It is captured by the terms with $n < \Delta_{\mu}$ and the corresponding $c_{\mu}(n)$ are called ‘polar coefficients’. The remaining coefficients are then uniquely determined, for example by constructing a Poincaré series seeded by the polar terms.

Crucially however, the dimension of the space of modular forms is often smaller (though never larger) than the number of polar terms, which means that the polar coefficients cannot be chosen completely at will. To allow for the existence of a modular form with given polar part (as opposed to a mock modular form), the polar coefficients must satisfy $n$ constraints where $n$ is the dimension of the space of cusp modular forms of weight $2-w$. The latter can be computed, for example, using the Selberg trace formula [64, 15].

In Appendix A we derive the number of polar terms and the number of constraints that they must satisfy for the case relevant to our study, namely, VV modular forms of weight $-3/2$, multiplier system (2.18) and exponents (cf. (2.11))

$$ \Delta_{\mu}^{h} = \frac{\chi(r\mathcal{D})}{24} - \mathrm{Fr} \left[ \frac{\mu^2}{2\kappa r} + \frac{r\mu}{2} \right]. \qquad (3.2) $$

Here $\mathrm{Fr}(x)$ denotes the fractional part $x - \lfloor x \rfloor$ and

$$ \chi(r\mathcal{D}) = \kappa r^3 + c_2 r. \qquad (3.3) $$
Applying these results to the 13 one-parameter CICYs, one finds the data provided in the last four columns of Table 1.

## 3.2 A universal basis

For our purposes, we will need a (overcomplete) basis in $M_r(\mathfrak{Z})$, which is the space of vector-valued modular forms of weight $-3/2$, multiplier system (2.18) and exponents $\Delta_\mu$ specified in (3.2). A convenient choice of a basis can be constructed using the following set of theta series

$$ \vartheta_{\mu}^{(m,p)}(\tau, z) = \sum_{k \in \mathbb{Z} + \frac{\mu}{m} + \frac{p}{2}} (-1)^{mpk} q^{\frac{m}{2}k^2} e^{2\pi i mkz}. \qquad (3.4) $$

They satisfy

$$ \vartheta_{\mu}^{(m,p)}(\tau, z) = \vartheta_{\mu+m}^{(m,p)}(\tau, z) = \vartheta_{-\mu}^{(m,p)}(\tau, z) \qquad (3.5) $$

and transform under $(\tau, z) \mapsto (\frac{a\tau+b}{c\tau+d}, \frac{z}{c\tau+d})$ as a vector-valued Jacobi form of weight $1/2$ and multiplier system given by

$$ \begin{aligned} M_{\mu\nu}^{(m,p)}(T) &= e^{\frac{\pi i}{m}\left(\mu + \frac{mp}{2}\right)^2} \delta_{\mu\nu}, \\ M_{\mu\nu}^{(m,p)}(S) &= \frac{e^{-\frac{\pi i}{2}mp^2}}{\sqrt{im}} e^{-2\pi i \frac{\mu\nu}{m}}. \end{aligned} \qquad (3.6) $$

Note that $\vartheta_0^{(1,1)}(\tau, z)$ coincides with the ordinary Jacobi theta series $\vartheta_1(\tau, z)$. Let us then set $(m, p) = (\kappa r, r)$ and consider ratios of the form

$$ \frac{\theta_{\mu}^{(r, \kappa)}(\tau)}{\eta^{4\kappa r^3 + rc_2}(\tau)}, \qquad \theta_{\mu}^{(r, \kappa)}(\tau) = \begin{cases} \vartheta_{\mu}^{(\kappa r, r)}(\tau, 0), & \kappa r \text{ even,} \\ -\frac{1}{2\pi r} \partial_z \vartheta_{\mu}^{(\kappa r, r)}(\tau, 0), & \kappa r \text{ odd,} \end{cases} \qquad (3.7) $$

where $\eta(\tau)$ is the Dedekind eta function. These functions are modular forms of weight $-\frac{1}{2}(4\kappa r^3 + rc_2 - 1) + \delta_{\kappa r - 1}^{(2)}$. Taking into account that the multiplier system of the Dedekind eta function is given by

$$ M^{(\eta)}(T) = e^{\frac{\pi i}{12}}, \qquad M^{(\eta)}(S) = e^{-\frac{\pi i}{4}}, \qquad (3.8) $$

it is straightforward to check that the multiplier system of (3.7) coincides with (2.18). Furthermore, given that $\eta(\tau) \sim q^{1/24}$ as $\tau \to i\infty$, it is easy to see that they have the Fourier expansion of the form (3.1) with

$$ \Delta_{\mu} = \frac{4\kappa r^3 + c_2 r}{24} - \frac{\kappa r}{2} \left( \mathrm{Fr}' \left[ \frac{\mu}{\kappa r} + \frac{r}{2} \right] \right)^2 = \Delta_{\mu}^h + n, \qquad (3.9) $$

where $\mathrm{Fr}'(x) = |x - \lfloor x \rfloor|$ is the difference with the closest integer, $\Delta_{\mu}^h$ is defined in (3.2), and $n \in \mathbb{Z}$. Importantly, the integer $n$ is non-negative,

$$ n = \frac{\kappa r^3}{8} - \frac{\kappa r}{2} \left( \mathrm{Fr}' \left[ \frac{\mu}{\kappa r} + \frac{r}{2} \right] \right)^2 + \mathrm{Fr} \left[ \frac{\mu^2}{2\kappa r} + \frac{r\mu}{2} \right] \ge \frac{\kappa r}{8} (r^2 - 1) \ge 0, \qquad (3.10) $$

where we used that $\mathrm{Fr}'(x) \le \frac{1}{2}$ and $\mathrm{Fr}(x) \ge 0$. This allows to conclude that the functions (3.7) have the same or larger number of polar terms as we need.
These considerations motivate us to introduce the functions

$$h_{\mu}^{(r,\kappa)}[g_{\ell}](\tau) = g_{\ell}(\tau) \frac{D^{\ell} \theta_{\mu}^{(r,\kappa)}(\tau)}{\eta^{4\kappa r^3 + rc_2}(\tau)}, \quad (3.11)$$

where $g_{\ell}(\tau)$ are modular forms of weight

$$w_{\ell} = 2\kappa r^3 + \frac{1}{2}rc_2 - 2 - 2\ell - \delta_{\kappa r-1}^{(2)}. \quad (3.12)$$

Here, $D$ is the Serre derivative, acting on holomorphic modular forms of weight $w$ through $D = q\partial_q - \frac{w}{12}E_2$, and $E_2$ is the normalized quasi-modular Eisenstein series. The functions (3.11) satisfy all required properties and produce the desired basis upon choosing an appropriate basis of modular forms $g_{\ell}$ of weight $w_{\ell}$. In particular, since $w_{\ell}$ is an even integer$^{10}$, $g_{\ell}$ themselves can be represented as polynomials in Eisenstein series $E_4$ and $E_6$. As a result, any $f \in \mathcal{M}_r(\mathfrak{Z})$ can be represented as

$$f_{\mu} = \sum_{\ell=0}^{\ell_0} \left( \sum_{k=0}^{k_{\ell}} c_{\ell,k} E_4^{\lfloor w_{\ell}/4 \rfloor - \ell_{\ell} - 3k} E_6^{2k + \ell_{\ell}} \right) \frac{D^{\ell} \theta_{\mu}^{(r,\kappa)}(\tau)}{\eta^{4\kappa r^3 + rc_2}(\tau)}, \quad (3.13)$$

where $k_{\ell} = \lfloor w_{\ell}/12 \rfloor - \delta_{w_{\ell}-2}^{(12)}$, $\epsilon_{\ell} = \delta_{w_{\ell}/2-1}^{(2)}$ and $\ell_0$ is sufficiently large so that $\sum_{\ell=0}^{\ell_0}(k_{\ell} + 1)$ is not smaller than the number of polar terms.

# 4. BPS indices for single D4-brane

As explained in §2, the functions $h_{1,\mu}$ are VV modular forms and therefore they are fixed by their polar terms. In §4.1, we propose an Ansatz for these terms and in §4.2 we present the results on the reconstruction of the generating functions $h_{1,\mu}$ on the basis of this Ansatz for 13 one-parameter CICY threefolds.

## 4.1 Polar terms

The BPS indices appearing in the polar terms of the generating functions $h_{r,\mu}$ count black hole states with positive invariant $\hat{q}_0$. Since the area of a single-centered black hole horizon in $\mathcal{N} = 2$ supergravity is given by $S = 2\pi\sqrt{-\hat{q}_0 p^3}$ with $p^3 = \kappa_{abc}p^a p^b p^c > 0$ [65, 1], such single-centered solutions cannot contribute to polar terms. Thus, only multi-centered bound states can contribute to such indices.$^{11}$ In [18] it was shown that such contributions arise from bound states of D6 and anti-D6 branes with vanishing total D6-charge. Moreover, it was observed that the ‘most polar terms’, i.e. the ones with $\hat{q}_0$ sufficiently close to $\hat{q}_0^{\max}$, appear to receive contributions from a single D6-D6 pair only. For the one-parameter threefolds $X_5$, $X_6$ and $X_8$ and unit D4-brane charge, this property was confirmed for all polar terms in [20, 21]. These observations suggest the following

<footnote>$^{10}$The reason of taking the derivative w.r.t. $z$ for odd $\kappa$ in the definition (3.7) was precisely to ensure this property.</footnote>

<footnote>$^{11}$One may wonder then why polar terms are non-vanishing given that there are no bound states at the attractor point (except for the so-called scaling solutions which require at least three constituents). However, the BPS indices entering the definition of the generating functions $h_{p,\mu}$ (2.15) are evaluated at the large volume attractor point, and will in general differ from the genuine attractor indices.</footnote>
**Assumption 1.** The polar coefficients in $h_{1,\mu}$ count the number of bound states of the form

$$ \begin{aligned} & \frac{D6-\mu D2-nD0 + \overline{D6[-1]}}{D6[1] + \overline{D6(-\mu)D2(-n)D0}} && \text{for } 0 \le \mu \le \kappa/2 \\ & \frac{D6[-1]}{D6(-\mu)D2(-n)D0} && \text{for } 0 \le -\mu \le \kappa/2, \end{aligned} \quad (4.1) $$

where $D6[r]$ denotes $D6$-brane with $r$ units of $D4$-flux induced by spectral flow.

Let us evaluate the degeneracy of these bound states explicitly. For the sake of generality, and in order to discuss possible extensions in the following sections, we will consider more general configurations of the form

$$ N D6[r_1]-m_1 D2-n_1 D0 + \overline{N D6[-r_2]-m_2 D2(-n_2) D0}. \quad (4.2) $$

The contribution to the BPS index from a bound state with charges $\gamma_1 + \gamma_2 = \gamma$ is given by the primitive wall-crossing formula

$$ \Delta\Omega(\gamma) = (-1)^{\langle\gamma_1, \gamma_2\rangle} \langle\gamma_1, \gamma_2\rangle \Omega(\gamma_1; z_{12}) \Omega(\gamma_2; z_{12}), \quad (4.3) $$

where $\langle\gamma_1, \gamma_2\rangle = q_{1,0}p_2^0 + q_{1,a}p_2^a - (1 \leftrightarrow 2)$ is the Dirac product of charges, and the BPS indices on the r.h.s. are evaluated at the point $z_{12}$ in the moduli space where the attractor flow corresponding to the charge $\gamma$ hits the wall of marginal stability corresponding to the decay of the bound state. The charge vectors of the constituents in (4.2) can be obtained by applying the spectral flow (2.3) to the charge vector describing a $ND6-mD2-nD0$ bound state which is, consistently with the charge quantization (2.1), given by

$$ \gamma(N, m, n) = \left(N, 0, m - \frac{N}{24} c_2, -n\right). \quad (4.4) $$

Then the spectral flow with $\epsilon = r$ gives

$$ \gamma(N, m, n)[r] = \left( N, Nr, m - \frac{Nc_2}{24} - \frac{N\kappa}{2} r^2, -n - rm + \frac{Nc_2}{24} r + \frac{N\kappa}{6} r^3 \right). \quad (4.5) $$

Choosing $\gamma_1 = \gamma(N, m_1, n_1)[r_1]$ and $\gamma_2 = -\gamma(N, m_2, -n_2)[-r_2]$, we obtain that the total charge reads

$$ \gamma = \left( 0, Nr, m - \frac{N\kappa}{2} r\bar{r}, -n - \frac{1}{2}(\bar{r}m + r\bar{m}) + \frac{N}{24}\chi(rD) + \frac{N\kappa}{8} r\bar{r}^2 \right), \quad (4.6) $$

where $r = r_1 + r_2$, $\bar{r} = r_1 - r_2$, $n = n_1 + n_2$, $m = m_1 - m_2$, $\bar{m} = m_1 + m_2$, and $\chi(rD)$ is given in (3.3). The invariant charge (2.10) evaluates to

$$ \hat{q}_0 = \frac{N}{24} \chi(rD) - \frac{m^2}{2\kappa rN} - \frac{r\bar{m}}{2} - n, \quad (4.7) $$

and the Dirac product of the charges of the two bound states is

$$ \langle\gamma_1, \gamma_2\rangle = -N^2\mathcal{I}_r + N(r\bar{m} + n), \quad (4.8) $$

where $\mathcal{I}_r$ is given in (2.19). Note that both $\hat{q}_0$ and $\langle\gamma_1, \gamma_2\rangle$ do not depend on the parameter $\bar{r}$. This is consistent with the fact that under the spectral flow (2.3) acting on the charge
vector (4.6), this parameter is shifted by $2\epsilon$ so that one can always set it either to 0 or 1. Substituting (4.8) into (4.3) gives the contribution to the BPS index.

According to our Assumption 1, we are interested in much simpler configurations where $N = r = 1$, $m = \mu$, $\bar{m} = |\mu|$ (for both ranges of $\mu$), in which case

$$ \bar{\Omega}_{1,\mu}(\hat{q}_0) = (-1)^{n+|\mu|+\mathcal{I}_1+1} (\mathcal{I}_1 - |\mu| - n) \Omega(\gamma_1; z_{12}) \Omega(\gamma_2; z_{12}), \quad (4.9) \\ \text{where} \quad \hat{q}_0 = \frac{\chi(\mathcal{D})}{24} - \frac{\mu^2}{2\kappa} - \frac{|\mu|}{2} - n > 0, $$

and the problem reduces to evaluating the BPS indices $\Omega(\gamma_i; z_{12})$, $i = 1, 2$. We further assume **Assumption 2.** The BPS indices $\Omega(\gamma_i; z_{12})$ coincide with their values at large volume, i.e. $\Omega(\gamma_i; z_{12}) = \Omega(\gamma_i; z_{\infty}^a(\gamma_i))$.

This conjecture implies that the BPS indices coincide with the standard rank 1 DT invariants $DT(|\mu|, n)$, counting bound states of a single D6-brane with $|\mu|$ D2-branes and $\pm n$ D0-branes (see §2.2). In the present case, either $\gamma_1$ or $\gamma_2$ corresponds to a pure (anti-)D6-brane and the corresponding invariant $DT(0, 0) = 1$. Thus, we arrive at the following expression for the polar part of $h_{1,\mu}$<fnref n="12" />

$$ h_{1,\mu}^{(p)} = q^{-\frac{\chi(\mathcal{D})}{24} + \frac{\mu^2}{2\kappa} + \frac{|\mu|}{2}} \sum_{n \in \mathbb{Z}: \hat{q}_0 > 0} (-1)^{n+|\mu|+\mathcal{I}_1+1} (\mathcal{I}_1 - |\mu| - n) DT(|\mu|, n) q^n. \quad (4.10) $$

Several remarks about this formula are in order:

* Eq. (4.10) is manifestly consistent with the symmetry $\mu \mapsto -\mu$, and expected to hold in the range $-\kappa/2 \le \mu \le \kappa/2$.

* Note that the sum is finite because $n$ is bounded from above by the condition $\hat{q}_0 > 0$, and from below due to the vanishing of $DT(|\mu|, n)$ for large negative $n$. In fact, requiring that the most polar term arises for the component $\mu = 0$ (in which case $n = 0$) leads to a lower bound

$$ n \geq -\frac{\mu^2}{2\kappa} - \frac{\mu}{2} \quad (4.11) $$

on the possible non-vanishing DT invariants $DT(\mu, n)$, which in turn implies an upper bound on the genus

$$ g \leq \frac{Q^2}{2\kappa} + \frac{Q}{2} + 1 \quad (4.12) $$

for non-vanishing GV invariants $N_Q^{(g)}$. This Castelnuovo-type condition is well known to hold for the quintic [66, 34], and is consistent with the tables of GV invariants in [33]. We conjecture that (4.12) is in fact valid for all for one-parameter CICYs.

* As we discuss in Appendix D, the leading polar coefficient in (4.10) (arising from $\mu = n = 0$) agrees with results in the mathematical literature [53, 56], and subleading polar coefficients are also in broad agreement.

<footnote n="12">¹²Note that the second argument of $DT$ is given by $n$ for both cases in (4.1). The reason for this is that $\operatorname{sgn}(b) = -\operatorname{sgn}(\mu)$ due to (2.14) and therefore we must use the definitions (2.6) and (2.7) in the first and second cases, respectively.</footnote>
In the following, we shall take the formula (4.10) as our Ansatz for the polar terms that we use to reconstruct the generating functions $h_{1,\mu}$. A tentative generalization to higher rank is discussed in §5.3.

## 4.2 Results

We perform the reconstruction of $h_{1,\mu}$ from their polar part for 13 CICY threefolds given in Table 1. To this end, for each of these threefolds, we construct the linear combinations (3.13) (for an appropriately chosen $\ell_0$) and match their polar terms against the ones predicted by (4.10) where DT invariants $DT(|\mu|, n)$ are calculated from the known sets of GV invariants in §C. This provides a system of linear equations on the coefficients $c_{m,k}$. If this system has a solution, it gives rise to a VV modular form with the desired polar part. We further require that the coefficients of its Fourier expansion should be integer, in order to be interpretable as BPS indices (or rank-zero DT invariants).$^{13}$ Here are the results of our analysis:

* For 10 out of 13 threefolds, the system of equations on $c_{m,k}$ turns out to have a unique solution with integer Fourier coefficients. The explicit expressions for the resulting VV modular forms and the first terms in their Fourier expansion are given in §C. For $X_5$, $X_6$, $X_8$, $X_{10}$ and $X_{3,3}$, our results reproduce those in [11, 17, 20, 21].

* For the remaining 3 models $X_{4,2}$, $X_{3,2,2}$ and $X_{2,2,2,2}$, the polar coefficients do not allow for the existence of a VV modular form, which indicates that our Ansatz for the polar terms (4.10) needs to be modified in these cases.

* In those cases, it is easy to tweak the polar terms in an *ad hoc* fashion so as to allow for a solution with integer coefficients. In particular, this can be done in a 'minimal' way by changing only the polar terms for the maximal D2-brane charge $|\mu| = \kappa/2$ and, in the case of $X_{2,2,2,2}$, also for $|\mu| \ge \kappa/2 - 2$.

In view of this last point, one might be reluctant to trust the solutions found in the '10 cases that work', especially since in most of them the polar terms do not need to satisfy any constraints to generate a modular form. However, there are three observations in favor of our results:

* As indicated above, they reproduce known results for models already studied in the literature.

* For $X_{3,3}$ and $X_{4,4}$, there are in fact modular constraints on polar coefficients, which turn out to be satisfied by our Ansatz, thanks to uncanny relations between GV invariants (see (C.10) and (C.18)).

* All solutions satisfy the condition of having integer Fourier coefficients, which was not guaranteed at all.

<footnote n="13">¹³Note that for $r = 1$, the D4-D2-D0 charge is always primitive and therefore the rational BPS indices appearing in (2.15) coincide with the integer valued ones.</footnote>
This provides some evidence that our generating series may be correct. However, of course, it leaves open the question as to why and how our ansatz should be modified in the remaining three cases and, in particular, whether the minimal modification that we propose is indeed correct.

# 5. BPS indices for D4-brane charge 2

In this section we go beyond the rank one case and explain how to fix the generating functions $h_{2,\mu}$, assuming that $h_{1,\mu}$ have been previously determined. In §5.1 we present our general strategy and in §5.2 we provide an explicit algorithm. Unfortunately, our lack of control on the polar terms does not allow us to implement this algorithm successfully in concrete examples.

## 5.1 General strategy

The generating functions $h_{2,\mu}$ are VV mixed mock modular forms with completion $\hat{h}_{2,\mu}$ given by (2.20). Such functions are not uniquely specified by the polar part, unless one also specifies the shadow determining the modular anomaly, or equivalently the holomorphic anomaly of its completion. The latter being an inhomogeneous linear equation, its general solution is a sum of a particular solution and a solution of the corresponding homogeneous equation. In our case the homogeneous solution is nothing but a genuine VV modular form.

This observation suggests the following method to reconstruct the generating function from its polar part. First, we need to produce a function $h_{2,\mu}^{(\text{an})}$ that has the same modular anomaly as $h_{2,\mu}$, which will play the role of the particular solution for the modular anomaly equation. Then the full generating function is a sum of $h_{2,\mu}^{(\text{an})}$ and a VV modular form $h_{2,\mu}^{(0)}$,

$$h_{2,\mu} = h_{2,\mu}^{(\text{an})} + h_{2,\mu}^{(0)}. \qquad (5.1)$$

At the second step, this unknown modular form can be determined by its polar terms which are obtained as a difference of the polar terms of $h_{2,\mu}$ (to be determined independently) and the polar terms of $h_{2,\mu}^{(\text{an})}$ (which can be read off from its explicit expression).

Thus, leaving aside the issue of fixing the polar part of $h_{2,\mu}$, which we do not attempt in this paper, the problem reduces to finding a function $h_{2,\mu}^{(\text{an})}$ with the anomaly determined by the shadow of $h_{2,\mu}$, which in turn can be derived from the holomorphic anomaly of its completion $\hat{h}_{2,\mu}$. Since the anomalous term in (2.20) has a factorized form, it is natural to look for $h_{2,\mu}^{(\text{an})}$ of the same form, namely

$$h_{2,\mu}^{(\text{an})} = \sum_{\mu_1, \mu_2=0}^{\kappa-1} g_{2,\mu,\mu_1,\mu_2} h_{1,\mu_1} h_{1,\mu_2}, \qquad (5.2)$$

where $h_{1,\mu}$ are the generating functions considered in the previous section. The ‘normalized functions’ $g_{2,\mu,\mu_1,\mu_2}$ should be chosen such that their completions defined by

$$\hat{g}_{2,\mu,\mu_1,\mu_2} = g_{2,\mu,\mu_1,\mu_2} + R_{\mu,\mu_1\mu_2}, \qquad (5.3)$$
where $R_{\mu,\mu_1\mu_2}$ is the same function (2.21) that appears in the expression for $\hat{h}_{2,\mu}$, must transform as VV modular forms of weight 3/2 and the following multiplier system

$$ 
\begin{aligned}
M_{\mu,\mu_1,\mu_2;\nu,\nu_1,\nu_2}(T) &= e^{\pi i(\frac{1}{\kappa}(\frac{1}{2}\mu^2-\mu_1^2-\mu_2^2)-\mu_1-\mu_2-\frac{\kappa}{2})} \delta_{\mu\nu} \delta_{\mu_1\nu_1} \delta_{\mu_2\nu_2}, \\
M_{\mu,\mu_1,\mu_2;\nu,\nu_1,\nu_2}(S) &= \frac{\sqrt{i}(-1)^{\kappa}}{\sqrt{2}\kappa^{3/2}} e^{\frac{2\pi i}{\kappa}(\mu_1\nu_1+\mu_2\nu_2-\frac{1}{2}\mu\nu)}.
\end{aligned}
\quad (5.4) $$

Furthermore, the function $R_{\mu,\mu_1\mu_2}$ encoding the anomaly is also of the special form (2.21) so that it is expressed through a vector like object. The fact that $g_{2,\mu,\mu_1,\mu_2}$ can be taken in the same form is established by the following proposition:

**Proposition 1.** If $G_{\mu}^{(\kappa)}$ ($\mu = 0, \dots, 2\kappa - 1$) transforms with the multiplier system

$$ 
\begin{aligned}
M_{\mu\nu}^{(\kappa)}(T) &= e^{-\frac{\pi i}{2\kappa} \mu^2} \delta_{\mu\nu}, \\
M_{\mu\nu}^{(\kappa)}(S) &= \frac{\sqrt{i}}{\sqrt{2\kappa}} e^{\frac{\pi i}{\kappa} \mu\nu},
\end{aligned}
\quad (5.5) $$

then

$$ g_{2,\mu,\mu_1,\mu_2} = \delta_{\mu_1+\mu_2-\mu}^{(\kappa)} (-1)^{\mu'} G_{\mu'}^{(\kappa)} \quad (5.6) $$

transforms with the multiplier system (5.4).

*Proof.* Let us verify the T-transformation. Taking into account the $\delta$-symbol in (5.6), the phase factor required to be produced by this transformation from (5.4) is found to be (here $\lambda \in \mathbb{Z}$)

$$ 
\begin{aligned}
& e^{\pi i(\frac{1}{\kappa}(\frac{1}{2}\mu^2-\mu_1^2-\mu_2^2)-\mu_1-\mu_2-\frac{\kappa}{2})} \mu_1+\mu_2=\mu+\lambda\kappa \quad e^{\pi i(\frac{1}{\kappa}(\frac{1}{2}\mu^2-\mu_1^2-(\mu-\mu_1+\lambda\kappa)^2)-\mu-\lambda\kappa-\frac{\kappa}{2})} \\
&= e^{-\pi i\kappa(\lambda+\lambda^2)} e^{-\frac{\pi i}{2\kappa}(\mu-2\mu_1+\kappa)^2} = e^{-\frac{\pi i}{2\kappa} \mu'^2},
\end{aligned}
\quad (5.7) $$

which indeed coincides with the phase factor in (5.5).

Similarly, by computing the Fourier transform implied by (5.4), one finds

$$ 
\begin{aligned}
& \frac{\sqrt{i}(-1)^{\kappa}}{\kappa\sqrt{2\kappa}} \sum_{\nu,\nu_1,\nu_2} e^{\frac{\pi i}{\kappa}(-\mu\nu+2\mu_1\nu_1+2\mu_2\nu_2)} \delta_{\nu_1+\nu_2-\nu}^{(\kappa)} (-1)^{\nu'} G_{\nu'}^{(\kappa)} \\
&= \frac{\sqrt{i}(-1)^{\kappa}}{\kappa\sqrt{2\kappa}} \sum_{\nu,\nu_1} e^{\frac{\pi i}{\kappa}((2\mu_2-\mu)\nu+2(\mu_1-\mu_2)\nu_1)} (-1)^{\nu'} G_{\nu'}^{(\kappa)} \\
&= \frac{\sqrt{i}}{\kappa\sqrt{2\kappa}} \sum_{\nu',\nu_1} e^{\frac{\pi i}{\kappa}(2\mu_2-\mu)(\nu'-\kappa)+\frac{2\pi i}{\kappa}(\mu_1+\mu_2-\mu)\nu_1} (-1)^{\nu'-\kappa} G_{\nu'}^{(\kappa)} \\
&= \delta_{\mu_1+\mu_2-\mu}^{(\kappa)} (-1)^{\mu'} \frac{\sqrt{i}}{\sqrt{2\kappa}} \sum_{\nu'} e^{\frac{\pi i}{\kappa} \mu'\nu'} G_{\nu'}^{(\kappa)}.
\end{aligned}
\quad (5.8) $$

This result is perfectly consistent with the S-duality transformation of $G_{\mu}^{(\kappa)}$ implied by (5.5).

<figure><img src="image_2.png" /></figure>
Due to this proposition, choosing the functions $g_{2,\mu,\mu_1,\mu_2}$ in the form (5.6), we finally reduce the problem to finding a VV mock modular form $G_{\mu}^{(\kappa)}$ such that its completion, transforming with weight 3/2 and multiplier system (5.5), is given by

$$ \hat{G}_{\mu}^{(\kappa)} = G_{\mu}^{(\kappa)} + \Theta_{\mu}^{(\kappa)}, \qquad (5.9) $$

where $\Theta_{\mu}^{(\kappa)}$ is defined in (2.23). The original generating function is then obtained by substituting (5.2) and (5.6) into (5.1) leading to

$$ h_{2,\mu} = h_{2,\mu}^{(0)} + \sum_{\mu_1=0}^{\kappa-1} (-1)^{\mu-2\mu_1+\kappa} G_{\mu-2\mu_1+\kappa}^{(\kappa)} h_{1,\mu_1} h_{1,\mu-\mu_1}. \qquad (5.10) $$

The holomorphic ambiguity $h_{2,\mu}^{(0)}$ can be fixed by matching polar terms.

## 5.2 Explicit construction

The upshot of the previous subsection is that we reduced the problem of finding a VV mixed mock modular form, with a modular anomaly depending on the generating functions for $r = 1$, to a similar problem for the usual VV mock modular form $G_{\mu}^{(\kappa)}$ with an anomaly specified by $\Theta_{\mu}^{(\kappa)}$ (2.23). This is a much simpler problem which we can actually solve using known results in the literature.

The key observation is that the shadow (2.24) of the completion $\hat{G}_{\mu}^{(\kappa)}$ is, up to a trivial factor $\tau_2^{-3/2}$, the complex conjugate of a simple unary theta series. Furthermore, for $\kappa = 1$, it is identical (up to a factor of 3) with the shadow of the generating series of Hurwitz class numbers, which (not coincidentally) appears in the context of rank 2 Vafa-Witten invariants on $\mathbb{P}^2$ [51, Eq.(4.32)]$^{14}$. Thus, for $\kappa = 1$ we can simply choose

$$ G_{\mu}^{(1)} = H_{\mu}, \qquad (5.11) $$

where $H_{\mu}$ is the standard (doublet of) generating series of Hurwitz class numbers, which starts with the following coefficients

$$ \begin{aligned} H_0(\tau) &= -\frac{1}{12} + \frac{q}{2} + q^2 + \frac{4q^3}{3} + \frac{3q^4}{2} + 2q^5 + 2q^6 + 2q^7 + 3q^8 + \frac{5q^9}{2} + 2q^{10} + \dots, \\ H_1(\tau) &= q^{\frac{3}{4}} \left( \frac{1}{3} + q + q^2 + 2q^3 + q^4 + 3q^5 + \frac{4q^6}{3} + 3q^7 + 2q^8 + 4q^9 + q^{10} + \dots \right). \end{aligned} \qquad (5.12) $$

In order to upgrade this solution to $\kappa > 1$, we need an operator acting on VV modular forms which i) preserves their weight but increases the dimension of the vector space in which they are valued, in particular, mapping the multiplier system $M^{(1)}$ to $M^{(\kappa)}$ (5.5), and ii) maps $\Theta^{(1)}$ to $\Theta^{(\kappa)}$. In Appendix §B, we show that when $\kappa$ is a prime number, these properties are satisfied by a generalized Hecke operator $\mathcal{T}_{\kappa}$ introduced in [71, 50]. Unfortunately, for $\kappa$

<footnote>$^{14}$The connection between Hurwitz class numbers and moduli spaces of rank 2 semi-stable sheaves on $\mathbb{P}^2$ was derived earlier in the mathematics literature [67, 68], and the mock modular properties of the corresponding generating series were established in [69, 70].</footnote>
non-prime it fails to satisfy the second property that ensures that the anomalies are properly matched. Nevertheless, when $\kappa$ is a power of a prime number$^{15}$, it is possible to cure the problem and modify $\mathcal{T}_\kappa$ into an operator $\mathcal{T}'_\kappa$ such that

$$G_{\mu}^{(\kappa)} = (\mathcal{T}'_{\kappa}[H])_{\mu}. \qquad (5.13)$$

Substituting (5.13) into (5.10), we finally arrive at the following representation for the generating functions

$$h_{2,\mu} = h_{2,\mu}^{(0)} + \sum_{\mu_1=0}^{\kappa-1} (-1)^{\mu-2\mu_1+\kappa} (\mathcal{T}'_{\kappa}[H])_{\mu-2\mu_1+\kappa} h_{1,\mu_1} h_{1,\mu-\mu_1}, \qquad (5.14)$$

where the action of $\mathcal{T}'_\kappa$ is defined by (B.4) and (B.16). Thus, we only need to fix the holomorphic modular ambiguity $h_{2,\mu}^{(0)}$, which can be determined from its polar part.

Let us assume that we know the polar part of the generating series of integer DT-invariants

$$h_{2,\mu}^{(\text{int})} = \sum_{\hat{q}_0 \ge 0} \Omega_{2,\mu}(\hat{q}_0) q^{-\hat{q}_0}, \qquad (5.15)$$

namely all integer coefficients $\Omega_{p,\mu}(\hat{q}_0)$ for $p = 2$ and $\hat{q}_0 > 0$. The generating series (5.15) differs from the generating function $h_{2,\mu}$ of rational DT-invariants (2.4) due to the contribution of non-primitive charges representable as $\gamma = 2\gamma'$. Since the general form of the charges with $p = 2$ and $p = 1$ is

$$\gamma = (0, 2, 2\kappa\epsilon + \mu + 2\kappa, q_0), \qquad \gamma' = \left(0, 1, \kappa\epsilon + \mu' + \frac{\kappa}{2}, q'_0\right), \qquad (5.16)$$

one must have

$$\mu' = \frac{1}{2}(\mu + \kappa) \in \mathbb{Z}, \qquad q'_0 = \frac{1}{2}q_0 \in \mathbb{Z}. \qquad (5.17)$$

Therefore, the relation between the generating functions of rational and integer BPS indices reads

$$h_{2,\mu}(\tau) = h_{2,\mu}^{(\text{int})}(\tau) + \frac{1}{4} \delta_{\mu+\kappa}^{(2)} h_{1, \frac{\mu+\kappa}{2}}(2\tau). \qquad (5.18)$$

Substituting this relation into (5.14), we find that the polar part of the holomorphic ambiguity $h_{2,\mu}^{(0)}$ is given by the polar part of

$$h_{2,\mu}^{(\text{int})}(\tau) - \sum_{\mu_1=0}^{\kappa-1} (-1)^{\mu-2\mu_1+\kappa} (\mathcal{T}'_{\kappa}[H])_{\mu-2\mu_1+\kappa}(\tau) h_{1,\mu_1}(\tau) h_{1,\mu-\mu_1}(\tau) + \frac{1}{4} \delta_{\mu+\kappa}^{(2)} h_{1,\frac{\mu+\kappa}{2}}(2\tau), \qquad (5.19)$$

which is entirely determined by the polar part of $h_{2,\mu}^{(\text{int})}$ (which serves as input) and by $h_{1,\mu}$ (which by assumption has been previously determined). Assuming that a VV modular form $h_{2,\mu}^{(0)}$ with the required polar part exists, we can plug it into (5.14) to obtain the generating functions $h_{2,\mu}$ of rational DT invariants, and finally obtain the generating functions $h_{2,\mu}^{(\text{int})}$ of integer DT invariants via (5.18). If no such VV modular form $h_{2,\mu}^{(0)}$ exists, or if the Fourier coefficients of $h_{2,\mu}^{(\text{int})}$ turn out to not be integer, one must conclude that the proposed polar part is incorrect, or that a mistake has been made in the previous step of determining $h_{1,\mu}$.

<footnote>$^{15}$Out of the list of 13 CICY, this rules out $X_{4,3}$ and $X_{3,2,2}$, for which the construction of $\mathcal{T}'_\kappa$ is left as an open problem.</footnote>
## 5.3 A naive attempt

Given our partial success at rank 1, it is natural to extend the Ansatz (4.10) to higher D4-brane charge, by keeping only contributions from a single D6-D6 pair (i.e. $N = 1$) with $r = r_1 + r_2 > 1$ units of flux. Then the same reasoning as in §4.1 leads to the proposal

$$h_{r,\mu}^{(p)} \stackrel{?}{=} q^{-\frac{\chi(rD)}{24} + \frac{\mu^2}{2r\kappa} + \frac{r\mu}{2}} \sum_{n \in \mathbb{Z}: \hat{q}_0 > 0} (-1)^{n+r\mu+\mathcal{I}_r+1} (\mathcal{I}_r - r\mu - n) DT(\mu, n) q^n. \quad (5.20)$$

Unfortunately, setting $r = 2$, restricting to the 9 models for which the rank 1 invariants had been determined and $\kappa$ is a power of a prime number, and applying the algorithm outlined in the previous subsection, we find that no solution $h_{2,\mu}^{(0)}$ with the required polar terms exists whenever the polar part is constrained (i.e. $C_2 > 0$ in Table 1), or that the solution does not lead to integer coefficients in $h_{2,\mu}^{(\text{int})}$. This suggests that the Ansatz (5.20) misses some contributions, as we discuss in the next Section.

## 6. Discussion

In this paper we used modular properties of the generating series of D4-D2-D0 BPS indices to determine these functions explicitly in the case of compact CY threefolds with $b_2(\mathfrak{Z}) = 1$. In this case, the generating functions depend on one positive integer $r$ — the wrapping number of D4-brane along the primitive divisor, or D4-brane charge for short. For $r = 1$, when the generating functions are VV modular forms, we proposed an Ansatz (4.10) for their polar terms, which generalizes the known results in the literature [11, 17, 20, 21]. It allowed us to produce the generating functions $h_{1,\mu}$ for 10 out of the list of 13 one-parameter CICY threefolds.

For $r = 2$, when the generating functions are VV mixed mock modular forms, we constructed an explicit solution to the corresponding modular anomaly equation by applying a suitable Hecke operator on the generating function of Hurwitz class numbers, which arises in the similar problem of rank 2 Vafa-Witten invariants on $\mathbb{P}^2$. This determines $h_{2,\mu}$ up to a holomorphic VV modular form which is supposed to be fixed by the polar terms. In principle, the same strategy would also work for $r > 2$, using the rank $r$ VW invariants on $\mathbb{P}^2$ determined in [72, 73, 74] (see also [75]) as a starting point, although the construction of a solution to the modular anomaly equation is likely to be more complicated. However, already for $r = 2$, we found that the naive extension (5.20) of the Ansatz (4.10) does not work. The determination of the correct polar terms (both for rank 1 and higher) is therefore the main open problem for future investigations.

Without trying to solve this problem here, let us discuss the possible origin of the contributions that are missed by the naive Ansatz (5.20). Firstly, for $r > 1$ it is natural to expect that contributions from $N$ D6-D6 pairs with $1 \le N \le r$ may become relevant. Some of these contributions can be easily deduced from the computation presented in §4.1 by combining equations (4.3), (4.7) and (4.8). As in the $N = 1$ case, the BPS indices for each of the two constituents can then be related to rank $N$ Donaldson-Thomas invariants. Those are in principle determined by rank 1 DT invariants [55, 56], although it may be difficult to determine
them in practice. It is also possible that more complicated bound states need to be taken into account where D4-brane charge is not generated by the spectral flow as in (4.5), but at least partially produced by D4-flux on a D6-brane. Then the BPS indices of the constituents are given by generalized DT invariants which are rarely known explicitly. An even more complicated scenario would involve contributions from bound states with multiple constituents, for example, one with two units of D6-branes and two with a single $\overline{D6}$-brane. In that case, it would be difficult to produce any general Ansatz and we would have to rely on a case by case analysis.

Second, despite some success, our Ansatz for $r = 1$ also needs confirmation and improvement, as there are three CICY threefolds for which it fails to produce a modular form. This sheds doubt on its validity in other cases where it does produce a plausible result but is weakly constrained by modularity. We would like to put forward a few observations pointing to possible resolutions:

* The three offending cases correspond to one-parameter families with a singularity at $\psi = \infty$ of type C or M in the terminology of [35], corresponding to a conifold singularity at finite distance (in addition to the conifold singularity at $\psi = 1$, which is common to all models), or a maximal unipotent monodromy at infinite distance (in addition to the large volume point at $\psi = 0$, common to all models). It is conceivable that such singularities give rise to new constituents analogous to the D6-$\overline{D6}$ bound states which could contribute to polar terms. In this respect, it is worth noting that the Ansatz (4.10) seems to work for the models $X_{k,k}$ with $k = 3, 4, 6$ having a K-type singularity at infinite distance.

* In Assumption 1, we assumed that D2 and D0-branes can only bind to the D6 or $\overline{D6}$-brane, depending on the sign of $\mu$. As reviewed in Appendix D, the mathematical results of [53, 56] indicate that this is not true in general, and D2 and D0-branes may bind to both the D6 and $\overline{D6}$-brane, leading to terms quadratic in DT-invariants.

* Even in cases where Assumption 1 is valid, Assumption 2 may fail, in the sense that the BPS indices of the constituents might differ from the rank 1 DT invariants due to wall-crossing between the large volume point and the point on the wall of marginal stability at which they are to be evaluated. This is corroborated by the fact that both Donaldson-Thomas and Pandharipande-Thomas invariants enter in the mathematical results of [53, 56].

* As discussed in §C, one may modify the polar coefficients in an *ad hoc* way so as to produce a modular form with integer coefficients for the three CYs where the original Ansatz fails. An intriguing observation is that it suffices to modify only those coefficients that correspond to *negative* D0-brane charge $n < 0$. Furthermore, the only other case where non-vanishing polar coefficients with $n < 0$ arise is the leading polar term in $h_{1,2}$ for $X_{6,2}$ (see (C.12)), but that coefficient can be changed without affecting modularity. Thus, it might be that contributions from bound states with $n < 0$ need to be treated differently. If so, this would also explain why our Ansatz works in all other cases where negative $n$ does not appear.
Finally, it might happen that the contributions from multiple D6-D6 pairs discussed above are also relevant for $r = 1$. In that case, a careful analysis of multi-centered configurations of D6 and $\overline{D6}$ (potentially including scaling solutions) will be needed, and the modular generating series recorded in Appendix C cannot be trusted. We hope to return to the analysis of the polar coefficients in future work.

## Acknowledgements

We are grateful to Frederik Denef, Charles Doran, Soheyla Feyzbakhsh and Albrecht Klemm for useful correspondence, and to Aradhita Chattopadhyaya and Thorsten Schimannek for discussions. SA, NG and BP appreciate the hospitality of the Hamilton Institute at Trinity College Dublin for hospitality during the course of this work. This collaboration was supported by a Ulysses Award from the Irish Research Council and French Ministry of Europe and Foreign Affairs. The research of NG is supported by the Delta-Institute for Theoretical Physics (D-ITP) that is funded by the Dutch Ministry of Education, Culture and Science (OCW). The research of JM is supported by Laureate Award 15175 "Modularity in Quantum Field Theory and Gravity" of the Irish Research Council. The research of BP is supported by Agence Nationale de la Recherche under contract number ANR-21-CE31-0021.

## A. Polar terms of vector valued modular forms

In this section, we determine the dimension of the space $\mathcal{M}_r(\mathfrak{Z})$ of weakly holomorphic VV modular forms with Fourier expansion of the form

$$h_{r,\mu}^{(0)} = \sum_{n \ge 0} c_{\mu}(n) q^{n-\Delta_{\mu}} \qquad (A.1)$$

with exponents $\Delta_{\mu}$ specified in (3.2), transforming with weight $-3/2$ and multiplier system (2.18) under $\tau \mapsto \frac{a\tau+b}{c\tau+d}$. Equivalently, we determine the number of linear constraints that the polar coefficients $c_{\mu}(n)$ with $n < \Delta_{\mu}$ must satisfy, in order to correspond to an element $h_{r,\mu}^{(0)} \in \mathcal{M}_r(\mathfrak{Z})$. For $r = 1$, $h_{1,\mu}^{(0)}$ coincides with the generating series of DT invariants $h_{1,\mu}$, whereas for $r > 1$, it corresponds to the holomorphic ambiguity, as explained in §5. Throughout this section, we set $m = \kappa r$, providing the normalization of the quadratic form on the relevant lattice.

### A.1 Number of polar terms

Since $h_{r,\mu}^{(0)}$ is by assumption invariant under $\mu \mapsto \mu + m$ and $\mu \mapsto -\mu$, it consists of $d = \lfloor \frac{m+1}{2} \rfloor$ independent components. The number of polar terms is therefore given by

$$n_r(\mathfrak{Z}) = \sum_{\mu=0}^{d-1} [\Delta_{\mu}]. \qquad (A.2)$$
It will be useful to rewrite this formula as

$$n_r(\mathfrak{Z}) = -\frac{1}{2} \mathcal{I}(M) + \sum_{\mu=0}^{d-1} \left( \Delta_{\mu} + \frac{1}{2} - ((\Delta_{\mu})) \right), \qquad (A.3)$$

where $\mathcal{I}(M)$ is the number of exponents $\Delta_{\mu}$ which are integer, and $((\cdot))$ is defined by

$$((x)) = x - \frac{[x] + |x|}{2} = \begin{cases} \xi - \frac{1}{2}, & \text{if } x = \xi + \mathbb{Z}, 0 < \xi < 1, \\ 0, & \text{if } x \in \mathbb{Z}. \end{cases} \qquad (A.4)$$

## A.2 Number of constraints

The constraints on polar terms of a weakly holomorphic modular form of weight $w$ originate from holomorphic cusp forms of dual weight $2-w$ [64, 13, 15]. To obtain the dimension of this space, hence the number of constraints, one uses Selberg's trace formula, which gives the difference of the dimension of the space $\mathcal{M}_w(M)$ of VV holomorphic modular forms of weight $w$ and multiplier system $M_{\mu\nu}$ and the dimension of the space $\mathcal{S}_{2-w}(\bar{M})$ of cusp forms with complex conjugate multiplier system. The trace formula gives [64]

$$\dim[\mathcal{S}_{2-w}(\bar{M})] - \dim[\mathcal{M}_w(M)] = A_s + A_e + A_p, \qquad (A.5)$$

where $A_s$, $A_e$ and $A_p$ are the scalar, elliptic and parabolic contributions which are given by

$$\begin{aligned} A_s &= \frac{1-w}{12} \chi_M(1), \\ A_e &= -\frac{1}{4} \mathrm{Re} \left[ e^{\frac{\pi i w}{2}} \chi_M(S) \right] + \frac{2}{3\sqrt{3}} \mathrm{Re} \left[ e^{\frac{\pi i}{6}(2w-5)} \chi_M(ST) \right], \\ A_p &= -\frac{1}{2} \mathcal{I}(M) - \sum_{\mu=0}^{d-1} ((\Delta_{\mu})). \end{aligned} \qquad (A.6)$$

Here, $\chi_M(g)$ denotes the character $\mathrm{Tr}M(g)$ of the action of $g \in SL(2, \mathbb{Z})$ on the $d$-dimensional vector space of components. Since the relevant weight $w = -3/2$ is negative, the space $\mathcal{M}_{-3/2}(M)$ of holomorphic VV modular forms is empty, and the r.h.s. of (A.5) gives directly the number of constraints on polar terms. Since $\chi_M(1) = d$, it remains only to evaluate the elliptic contribution $A_e$.

To this end, we introduce the Gauss sums $G(n, m)$

$$G(n, m) = \sum_{\nu=1}^{m} e^{\frac{2\pi i n \nu^2}{m}}. \qquad (A.7)$$

Recasting the $m \times m$ matrix $M_{\mu\nu}(S)$ in (2.18) into a $d \times d$ matrix, we obtain

$$\chi_M(S) = \frac{(-1)^{\mathcal{I}_r}}{\sqrt{im}} \begin{cases} 1 - e^{-\frac{\pi i m}{2}} + \sum_{\nu=1}^{m/2} \left( e^{\frac{2\pi i \nu}{m}} + e^{-\frac{2\pi i \nu}{m}} \right), & m \text{ even,} \\ 1 + \sum_{\nu=1}^{(m-1)/2} \left( e^{\frac{2\pi i \nu}{m}} + e^{-\frac{2\pi i \nu}{m}} \right), & m \text{ odd,} \end{cases} \qquad (A.8)$$

with $\mathcal{I}_r$ defined in (2.19). In either case, we find

$$\chi_M(S) = \frac{(-1)^{\mathcal{I}_r}}{2\sqrt{im}} (G(1, m) + G(1, m)^*). \qquad (A.9)$$
Using the well-known values for the Gauss sum $G(1, m)$ [76],

$$G(1, m) = \begin{cases} (1+i)\sqrt{m}, & m \equiv 0 \pmod{4}, \\ \sqrt{m}, & m \equiv 1 \pmod{4}, \\ 0, & m \equiv 2 \pmod{4}, \\ i\sqrt{m}, & m \equiv 3 \pmod{4}, \end{cases} \qquad (A.10)$$

we arrive at

$$\chi_M(S) = \begin{cases} (-1)^{\mathcal{I}_r} e^{-\frac{\pi i}{4}}, & m = 0, 1 \pmod{4}, \\ 0, & m = 2, 3 \pmod{4}. \end{cases} \qquad (A.11)$$

Turning to $\chi_M(ST)$, we have

$$\chi_M(ST) = \frac{(-1)^{\mathcal{I}_r}}{\sqrt{im}} e^{\frac{\pi i}{4}mr^2 + \frac{\pi i}{12}rc_2} \begin{cases} 1 - (-1)^{\frac{mr}{2}}e^{-\frac{\pi i m}{4}} + \sum_{\nu=1}^{m/2} (-1)^{r\nu} \left(e^{-\frac{\pi i \nu^2}{m}} + e^{\frac{3\pi i \nu^2}{m}}\right), & m \text{ even,} \\ 1 + \sum_{\nu=1}^{(m-1)/2} (-1)^{r\nu} \left(e^{-\frac{\pi i \nu^2}{m}} + e^{\frac{3\pi i \nu^2}{m}}\right), & m \text{ odd.} \end{cases} \qquad (A.12)$$

For $m$ even, we can further simplify this to

$$\begin{aligned} \chi_M(ST) &= \frac{e^{\frac{\pi i}{3}mr^2}}{2\sqrt{im}} \sum_{\nu=1}^{m} \left( e^{-\frac{\pi i \nu^2}{m}} + e^{\frac{3\pi i \nu^2}{m}} \right) = \frac{e^{\frac{\pi i}{3}mr^2}}{4\sqrt{im}} \sum_{\nu=1}^{2m} \left( e^{-\frac{2\pi i \nu^2}{2m}} + e^{\frac{6\pi i \nu^2}{2m}} \right) \qquad (A.13) \\ &= \frac{e^{\frac{\pi i}{3}mr^2}}{4\sqrt{im}} \left( G(1, 2m)^* + G(3, 2m) \right). \end{aligned}$$

Using the standard result for the Gauss sum

$$G(3, m) = \begin{cases} (-1)^{(m-4)/4}(1-i)\sqrt{m}, & m \equiv 0 \pmod{4} \\ (-1)^{(m-1)/4}\sqrt{m}, & m \equiv 1 \pmod{4}, \\ 0, & m \equiv 2 \pmod{4}, \\ (-1)^{(m-3)/4}i\sqrt{m}, & m \equiv 3 \pmod{4}, \end{cases} \quad \gcd(3, m) = 1, \qquad (A.14) \\ 3G(1, m/3), \qquad \gcd(3, m) = 3, \\ m \equiv 0 \pmod{3}, \end{cases}$$

along with (A.10), we can rewrite (A.13) as

$$\begin{aligned} \chi_M(ST) &= \frac{e^{\frac{\pi i}{3}mr^2}}{4\sqrt{im}} \left( \sqrt{2m}(1-i) + \begin{cases} \sqrt{6m}(1+i), & m \equiv 0 \pmod{6} \\ \sqrt{2m}(1-i), & m \equiv 2 \pmod{6} \\ -\sqrt{2m}(1-i), & m \equiv 4 \pmod{6} \end{cases} \right) \qquad (A.15) \\ &= e^{\frac{\pi i}{3}mr^2} \begin{cases} e^{-\frac{\pi i}{6}}, & m \equiv 0 \pmod{6} \\ e^{-\frac{\pi i}{2}}, & m \equiv 2 \pmod{6} \\ 0, & m \equiv 4 \pmod{6} \end{cases} = \begin{cases} e^{-\frac{\pi i}{6}}, & m \equiv 0 \pmod{6}, \\ e^{\frac{\pi i}{6}}, & m \equiv 2 \pmod{6}, \\ 0, & m \equiv 4 \pmod{6}, \end{cases} \end{aligned}$$

where in the last step we used that for $m = 2 \pmod{6}$ one has $r = \pm 1, \pm 2 \pmod{6}$.

For $m$ odd, $r$ is necessarily odd as well. We then have

$$\chi_M(ST) = \frac{(-1)^{\mathcal{I}_r}}{\sqrt{im}} e^{\frac{\pi i}{4}mr^2 + \frac{\pi i}{12}rc_2} \left( 1 + \sum_{\nu=1}^{(m-1)/2} (-1)^{r\nu} \left( e^{-\frac{\pi i \nu^2}{m}} + e^{\frac{3\pi i \nu^2}{m}} \right) \right). \qquad (A.16)$$
Substitution of $\mathcal{I}_r$ (2.19) and evaluation for low values of $m$ suggests that this can be further simplified to

$$ \chi_M(ST) = e^{\frac{\pi i}{12} m(r^2-1)} \begin{cases} e^{-\frac{\pi i}{6}}, & m=1 \mod 6, \\ e^{\frac{\pi i}{6}}, & m=3 \mod 6, \\ 0, & m=5 \mod 6. \end{cases} \qquad (A.17) $$

Note that since $r$ divides $m$, $r = \pm 1 \mod 6$ if $m = 1 \mod 6$, while $r = \pm 1$ or $3 \mod 6$ if $m = 3 \mod 6$. Therefore, $m(r^2 - 1) \in 24\mathbb{Z}$ and we arrive at a result similar to (A.15).

$$ \chi_M(ST) = \begin{cases} e^{-\frac{\pi i}{6}}, & m = 1 \mod 6, \\ e^{\frac{\pi i}{6}}, & m = 3 \mod 6, \\ 0, & m = 5 \mod 6. \end{cases} \qquad (A.18) $$

Substituting (A.11), (A.15) and (A.18) into (A.6) for $w = -3/2$, we arrive at the final result for the elliptic contribution, assuming that (A.17) is indeed true,

$$ A_e = \begin{cases} \frac{1}{4}(-1)^{\mathcal{I}_r}, & m = 0, 1 \mod 4, \\ 0, & m = 2, 3 \mod 4, \end{cases} + \begin{cases} -\frac{1}{3}, & m = 2, 3 \mod 6, \\ 0, & m = 0, 1, 4, 5 \mod 6. \end{cases} \qquad (A.19) $$

Inserting this result in (A.5), one finds the number of constraints on the polar terms,

$$ C_r(\mathfrak{Z}) = \frac{5d}{24} - \frac{1}{2} \mathcal{I}(M) - \sum_{\mu=0}^{d-1} ((\Delta_{\mu})) + \frac{1}{4} (-1)^{\mathcal{I}_r} (\delta_m^{(4)} + \delta_{m-1}^{(4)}) - \frac{1}{3} (\delta_{m-2}^{(6)} + \delta_{m-3}^{(6)}), \qquad (A.20) $$

where we recall that $d = \lfloor \frac{m+1}{2} \rfloor$, $\delta_x^{(n)}$ is the mod-$n$ Kronecker delta defined in (2.22) and $\Delta_\mu$ is given by (3.2). The dimension of the space $\mathcal{M}_r(\mathfrak{Z})$ is obtained by subtracting the number of constraints (A.20) from the number of polar terms (A.3):

$$ \dim \mathcal{M}_r(\mathfrak{Z}) = \sum_{\mu=0}^{d-1} \Delta_{\mu} + \frac{7d}{24} - \frac{1}{4}(-1)^{\mathcal{I}_r} (\delta_m^{(4)} + \delta_{m-1}^{(4)}) + \frac{1}{3} (\delta_{m-2}^{(6)} + \delta_{m-3}^{(6)}). \qquad (A.21) $$

In particular, the dimension of $\mathcal{M}_r(\mathfrak{Z})$ grows proportionally to $m^2 r^2 = \kappa^2 r^4$, while the number of constraints grows at most linearly in $m = \kappa r$. In Table 2 we record the number of polar terms $n_r(\mathfrak{Z})$ and constraints $C_r(\mathfrak{Z})$ for rank up to 10 (see Table 1 for $r = 1, 2$).

## B. Generalized Hecke operator

In this appendix we show how one can construct VV mock modular forms $G^{(\kappa)}$ from a given VV mock modular form $G^{(1)}$. These modular forms are defined by the condition (5.9), which fixes the form of the completion, where $\Theta^{(\kappa)}$ is given in (2.23). Essentially, the difference between cases with different $\kappa$ is the representation that the modular forms belong to. It is characterized by the multiplier system (5.5) and is known as the Weil representation associated with the even integral lattice $\Lambda = 2\kappa\mathbb{Z}$ with the discriminant group $\Lambda^*/\Lambda = \mathbb{Z}_{2\kappa}$. Thus, we simply need to find an operator which maps modular forms from one Weil representation to
<table><caption>**Table 2:** The number of polar terms $n_r(Q)$ and the number of constraints $C_r(Q)$ for $3 \le r \le 10$</caption><thead><tr><th>Q</th><th>n<sub>3</sub></th><th>C<sub>3</sub></th><th>n<sub>4</sub></th><th>C<sub>4</sub></th><th>n<sub>5</sub></th><th>C<sub>5</sub></th><th>n<sub>6</sub></th><th>C<sub>6</sub></th><th>n<sub>7</sub></th><th>C<sub>7</sub></th><th>n<sub>8</sub></th><th>C<sub>8</sub></th><th>n<sub>9</sub></th><th>C<sub>9</sub></th><th>n<sub>10</sub></th><th>C<sub>10</sub></th></tr></thead><tbody><tr><td>X<sub>5</sub></td><td>96</td><td>1</td><td>241</td><td>3</td><td>475</td><td>2</td><td>923</td><td>4</td><td>1549</td><td>4</td><td>2595</td><td>6</td><td>3928</td><td>6</td><td>5961</td><td>5</td></tr><tr><td>X<sub>6</sub></td><td>44</td><td>1</td><td>105</td><td>0</td><td>197</td><td>2</td><td>378</td><td>3</td><td>608</td><td>3</td><td>1014</td><td>0</td><td>1497</td><td>3</td><td>2283</td><td>4</td></tr><tr><td>X<sub>8</sub></td><td>32</td><td>1</td><td>65</td><td>1</td><td>117</td><td>1</td><td>203</td><td>0</td><td>333</td><td>2</td><td>519</td><td>3</td><td>774</td><td>3</td><td>1121</td><td>3</td></tr><tr><td>X<sub>10</sub></td><td>11</td><td>0</td><td>26</td><td>1</td><td>37</td><td>0</td><td>71</td><td>1</td><td>98</td><td>1</td><td>165</td><td>1</td><td>217</td><td>1</td><td>336</td><td>1</td></tr><tr><td>X<sub>4,2</sub></td><td>126</td><td>0</td><td>312</td><td>0</td><td>659</td><td>1</td><td>1254</td><td>1</td><td>2192</td><td>2</td><td>3600</td><td>1</td><td>5606</td><td>3</td><td>8370</td><td>2</td></tr><tr><td>X<sub>4,4</sub></td><td>65</td><td>0</td><td>159</td><td>3</td><td>322</td><td>3</td><td>598</td><td>0</td><td>1033</td><td>4</td><td>1681</td><td>4</td><td>2591</td><td>1</td><td>3855</td><td>6</td></tr><tr><td>X<sub>6,2</sub></td><td>77</td><td>1</td><td>177</td><td>3</td><td>349</td><td>2</td><td>637</td><td>0</td><td>1084</td><td>2</td><td>1749</td><td>4</td><td>2679</td><td>3</td><td>3960</td><td>6</td></tr><tr><td>X<sub>6,4</sub></td><td>25</td><td>0</td><td>55</td><td>1</td><td>103</td><td>2</td><td>182</td><td>0</td><td>304</td><td>1</td><td>483</td><td>3</td><td>726</td><td>0</td><td>1066</td><td>3</td></tr><tr><td>X<sub>6,6</sub></td><td>8</td><td>0</td><td>20</td><td>1</td><td>30</td><td>1</td><td>59</td><td>1</td><td>84</td><td>1</td><td>145</td><td>1</td><td>194</td><td>1</td><td>306</td><td>1</td></tr><tr><td>X<sub>3,3</sub></td><td>237</td><td>3</td><td>627</td><td>1</td><td>1339</td><td>5</td><td>2650</td><td>7</td><td>4625</td><td>8</td><td>7770</td><td>2</td><td>12041</td><td>9</td><td>18292</td><td>12</td></tr><tr><td>X<sub>4,2</sub></td><td>208</td><td>0</td><td>525</td><td>4</td><td>1125</td><td>6</td><td>2150</td><td>1</td><td>3793</td><td>6</td><td>6254</td><td>9</td><td>9768</td><td>2</td><td>14630</td><td>10</td></tr><tr><td>X<sub>3,2,2</sub></td><td>399</td><td>3</td><td>1050</td><td>1</td><td>2325</td><td>6</td><td>4551</td><td>2</td><td>8127</td><td>9</td><td>13524</td><td>4</td><td>21285</td><td>11</td><td>32025</td><td>5</td></tr><tr><td>X<sub>2,2,2,2</sub></td><td>650</td><td>1</td><td>1766</td><td>9</td><td>3970</td><td>10</td><td>7840</td><td>4</td><td>14106</td><td>14</td><td>23581</td><td>15</td><td>37230</td><td>7</td><td>56171</td><td>20</td></tr></tbody></table>

another. In addition, we also need to ensure that it properly maps the anomalies for our mock modular forms captured by the functions $\Theta^{(\kappa)}$. This gives rise to the two conditions spelled out in §5.2.

It turns out that an operator satisfying the first condition has already been constructed in [71, 50]:

**Theorem 1** ([50]). Let $\Lambda$ be a lattice of signature $(b^+, b^-)$ with bilinear form $(\cdot, \cdot)$, $A = \Lambda^*/\Lambda$, and $\Lambda(\kappa)$ is the same lattice but rescaled bilinear form $(\cdot, \cdot)_\kappa = \kappa(\cdot, \cdot)$. Let $\phi_{\lambda \in A}$ be a VV modular form of weight $(w, \bar{w})$ and multiplier system

$$ 
\begin{aligned}
M_{\lambda\lambda'}(T) &= e^{\pi i \lambda^2} \delta_{\lambda\lambda'}, \\
M_{\lambda\lambda'}(S) &= \frac{1}{\sqrt{|A|}} e^{-\frac{\pi i}{4} (b^+ - b^-) - 2\pi i (\lambda, \lambda')}. 
\end{aligned} 
\qquad (B.1) 
$$

Then the vector

$$ (\mathcal{T}_\kappa[\phi])_\mu(\tau) = \frac{1}{\kappa} \sum_{\substack{a,d>0 \\ ad=\kappa}} \left(\frac{\kappa}{d}\right)^{w+\bar{w}+\frac{1}{2}(b^++b^-)} \delta_\kappa(\mu, d) \sum_{b=0}^{d-1} e^{-\pi i \frac{b}{a} \mu^2} \phi_{d\mu} \left(\frac{a\tau+b}{d}\right), \qquad (B.2) $$

with $\mu \in A(\kappa)$ and

$$ \delta_{\kappa}(\mu, d) = \begin{cases} 1 & \text{if } \mu \in A(d) \subseteq A(\kappa), \\ 0 & \text{otherwise,} \end{cases} \qquad (B.3) $$

is a VV modular form of the same weight and multiplier system (B.1) where the bilinear form is replaced by the rescaled one.

In our case we take the rescaled bilinear form to be $(k_1, k_2)_\kappa = -2\kappa k_1 k_2$, so that its signature is $(b^+, b^-) = (0, 1)$. Then we replace $\mu$ by $-\frac{\mu}{2\kappa}$ with $\mu \in \{0, \dots, 2\kappa - 1\}$, so that $\mu^2$
becomes $-\frac{\mu^2}{2\kappa}$. After these substitutions and choosing the weight $(w, \bar{w}) = (3/2, 0)$, the action of the generalized Hecke operator becomes

$$ (\mathcal{T}_{\kappa}[\phi])_{\mu}(\tau) = \kappa \sum_{\substack{a,d>0 \\ ad=\kappa}} d^{-2} \sum_{b=0}^{d-1} \delta_{\mu/a}^{(1)} e^{\frac{\pi ib}{2a\kappa}} \mu^2 \phi_{\mu/a} \left(\frac{a\tau + b}{d}\right), \quad (B.4) $$

and the multiplier system (B.1) coincides with the one in (5.5). This agreement justifies the application of the above theorem to our problem. More precisely, acting by $\mathcal{T}_\kappa$ on (5.9) with $\kappa = 1$, we obtain

$$ (\mathcal{T}_{\kappa}[\hat{G}^{(1)}])_{\mu} = (\mathcal{T}_{\kappa}[G^{(1)}])_{\mu} + (\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu}. \quad (B.5) $$

The theorem ensures that the l.h.s. is a VV modular form so that it can be identified (up to a constant factor $c_\kappa$) with $\hat{G}_\mu^{(\kappa)}$. Provided the last term on the r.h.s. coincides with $c_\kappa \Theta_\mu^{(\kappa)}$, the first term can then be identified with $c_\kappa G_\mu^{(\kappa)}$ and the operator generating the solution (5.13) can be taken to be $\mathcal{T}'_\kappa = c_\kappa^{-1} \mathcal{T}_\kappa$.

Let us evaluate the action of the Hecke operator on $\Theta^{(1)}$ explicitly. Substituting (2.23) into (B.4), one finds

$$ \begin{aligned} (\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu} &= \frac{\kappa}{8\pi} \sum_{\substack{a,d>0 \\ ad=\kappa}} \sum_{b=0}^{d-1} \delta_{\mu/a}^{(1)} e^{\frac{\pi ib}{2a\kappa}} \mu^2 \sum_{k \in 2\mathbb{Z} + \frac{d\mu}{\kappa}} \frac{|k|}{d^2} \beta_{\frac{3}{2}}\left(\frac{a\tau_2}{d} k^2\right) e^{-\frac{\pi i}{2}\left(\frac{a\tau+b}{d}\right)k^2} \\ &= \frac{1}{8\pi} \sum_{a|\kappa, \mu} \sum_{k \in 2\mathbb{Z} + \frac{\mu}{a}} |ak| \beta_{\frac{3}{2}}\left(\frac{\tau_2}{\kappa} (ak)^2\right) e^{-\frac{\pi i \tau}{2\kappa} (ak)^2} \frac{a}{\kappa} \sum_{b=0}^{\frac{\kappa}{a}-1} e^{\frac{\pi ib}{2a\kappa} (\mu^2 - (ak)^2)}. \end{aligned} \quad (B.6) $$

Representing $k = 2\epsilon + \mu/a$ where $\epsilon \in \mathbb{Z}$, the last factor becomes

$$ \frac{a}{\kappa} \sum_{b=0}^{\frac{\kappa}{a}-1} e^{\frac{\pi ib}{2a\kappa} (\mu^2 - (ak)^2)} = \frac{a}{\kappa} \sum_{b=0}^{\frac{\kappa}{a}-1} e^{-2\pi ib \frac{a}{\kappa} (\epsilon^2 + \epsilon\mu/a)} = \delta_{\epsilon(\epsilon+\mu/a)}^{(\kappa/a)}. \quad (B.7) $$

Thus, we arrive at the constraint

$$ \epsilon(\epsilon + \mu/a) = 0 \quad \text{mod } \kappa/a. \quad (B.8) $$

Let us denote $S(\mu, a)$ the set of its integer solutions in the range $0 \le \epsilon < \kappa/a$ and note that $S(\mu, a) + n\kappa/a$ also solves (B.8) for any $n \in \mathbb{Z}$. Therefore, (B.6) can be rewritten as

$$ \begin{aligned} (\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu} &= \frac{1}{8\pi} \sum_{a|\kappa, \mu} \sum_{\epsilon \in S(\mu, a)} \sum_{k \in \frac{2\kappa}{a}\mathbb{Z} + \frac{\mu}{a} + 2\epsilon} |ak| \beta_{\frac{3}{2}}\left(\frac{\tau_2}{\kappa} (ak)^2\right) e^{-\frac{\pi i \tau}{2\kappa} (ak)^2} \\ &= \sum_{a|\kappa, \mu} \sum_{\epsilon \in S(\mu, a)} \Theta_{\mu+2a\epsilon}^{(\kappa)}. \end{aligned} \quad (B.9) $$

To proceed further, we need to find $S(\mu, a)$ explicitly. Due to the invariance under $\mu \to -\mu$ and $\mu \to \mu + 2\kappa$, it suffices to consider $\mu = 0, \dots, \kappa$.

First, let us consider the case where $\kappa$ is a prime number. Then for $\mu = 0$ and $\mu = \kappa$, $a$ takes two values, 1 and $\kappa$, and in both cases the only solution of (B.8) is $\epsilon = 0$. So (B.9)
results in $2\Theta_0^{(\kappa)}$. On the other hand, for $1 \le \mu < \kappa$, $a = 1$ and the condition (B.8) has two solutions: $\epsilon = 0$ and $\epsilon = -\mu \bmod \kappa$. Thus, (B.9) results in $\Theta_\mu^{(\kappa)} + \Theta_{-\mu}^{(\kappa)} = 2\Theta_\mu^{(\kappa)}$. Hence, for all $\mu$ one obtains

$$ (\mathcal{T}_\kappa[\Theta^{(1)}])_\mu = 2\Theta_\mu^{(\kappa)}. \qquad (B.10) $$

Thus, one may simply take $\mathcal{T}'_\kappa = \mathcal{T}_\kappa/2$ in this case.

When $\kappa$ is non-prime, we were not able to find a general solution of (B.8). Nonetheless, it is straightforward to analyze small values of $\kappa$ case-by-case, including the values $\kappa = 4, 6, 8, 9, 12, 16$ appearing in Table 1. Rather than listing the solutions of (B.8) in each case, we shall simply state the result of applying the Hecke operator on $\Theta^{(1)}$ (B.9):

$$ (\mathcal{T}_4[\Theta^{(1)}])_\mu = 2\Theta_\mu^{(4)} + \delta_\mu^{(2)}(\Theta_\mu^{(4)} + \Theta_{\mu+4}^{(4)}), \qquad (B.11a) $$

$$ (\mathcal{T}_6[\Theta^{(1)}])_\mu = 4\Theta_\mu^{(6)} - 2\delta_{\mu+1}^{(2)}(\Theta_\mu^{(6)} - \Theta_{\mu+6}^{(6)}). \qquad (B.11b) $$

$$ (\mathcal{T}_8[\Theta^{(1)}])_\mu = 2\Theta_\mu^{(8)} + 2\delta_\mu^{(2)}(\Theta_\mu^{(8)} + \Theta_{\mu+8}^{(8)}), \qquad (B.11c) $$

$$ (\mathcal{T}_9[\Theta^{(1)}])_\mu = 2\Theta_\mu^{(9)} + \delta_\mu^{(3)}(\Theta_\mu^{(9)} + \Theta_{\mu+6}^{(9)} + \Theta_{\mu+12}^{(9)}), \qquad (B.11d) $$

$$ (\mathcal{T}_{12}[\Theta^{(1)}])_\mu = 4\Theta_\mu^{(12)} + 2\delta_\mu^{(2)}(\Theta_\mu^{(12)} + \Theta_{\mu+12}^{(12)}) \qquad (B.11e) $$

$$ -2 \left[ \delta_{\mu+2}^{(4)}(\Theta_{\mu}^{(12)} - \Theta_{\mu+12}^{(12)}) + \delta_{\mu+1}^{(6)}(\Theta_{\mu}^{(12)} - \Theta_{\mu+16}^{(12)}) + \delta_{\mu+5}^{(6)}(\Theta_{\mu}^{(12)} - \Theta_{\mu+8}^{(12)}) \right], $$

$$ (\mathcal{T}_{16}[\Theta^{(1)}])_\mu = 2\Theta_\mu^{(16)} + 2\delta_\mu^{(2)}(\Theta_\mu^{(16)} + \Theta_{\mu+16}^{(16)}) + \delta_\mu^{(4)}(\Theta_\mu^{(16)} + \Theta_{\mu+8}^{(16)} + \Theta_{\mu+16}^{(16)} + \Theta_{\mu+24}^{(16)}). \qquad (B.11f) $$

Thus, unlike for prime $\kappa$, we cannot just take $\mathcal{T}'_\kappa$ to be proportional to $\mathcal{T}_\kappa$. However, upon closer examination one can still find an operator $\mathcal{T}'_\kappa$ that satisfies all the required conditions when $\kappa = 4, 8, 9, 16$ (or more generally, when $\kappa$ is a prime power). Indeed, in those cases, each of the additional terms in (B.11) can be shown to transform in the correct representation due to the following proposition (which is a variant of Proposition 1 from [77]):

**Proposition 2.** Let $\theta_\mu$ ($\mu = 0, \dots, 2\kappa - 1$) be a $VV$ modular form transforming with the multiplier system (5.5) and $d \in \mathbb{N} : d^2$ divides $\kappa$. Then the vector with components

$$ (\Sigma_{\kappa,d}[\theta])_\mu = \delta_\mu^{(d)} \sum_{n=0}^{d-1} \theta_{\mu+2n\kappa/d} \qquad (B.12) $$

transforms according to the same representation.

*Proof.* First, we verify the T-transformation. Acting on each term in the sum (B.12), it produces the following phase factor

$$ e^{-\frac{\pi i}{2\kappa}(\mu + \frac{2n\kappa}{d})^2} = e^{-\frac{\pi i}{2\kappa}\mu^2 - 2\pi i \left(\frac{n\mu}{d} + \frac{n^2\kappa}{d^2}\right)} = e^{-\frac{\pi i}{2\kappa}\mu^2}, \qquad (B.13) $$

where we used that $d$ divides $\mu$ and $d^2$ divides $\kappa$. The result reproduces the phase factor in (5.5). To check the S-transformation, we evaluate

$$ \begin{aligned} & \frac{\sqrt{i}}{\sqrt{2\kappa}} \delta_{\mu}^{(d)} \sum_{n=0}^{d-1} \sum_{\nu=0}^{2\kappa-1} e^{\frac{\pi i \nu}{\kappa} (\mu + \frac{2n\kappa}{d})} \theta_{\nu} = \frac{\sqrt{i}}{\sqrt{2\kappa}} \sum_{m=0}^{d-1} e^{2\pi i \mu \frac{m}{d}} \sum_{\nu=0}^{2\kappa-1} e^{\frac{\pi i \nu}{\kappa} \mu} \delta_{\nu}^{(d)} \theta_{\nu} \\ & = \frac{\sqrt{i}}{\sqrt{2\kappa}} \sum_{\nu=0}^{2\kappa-1} \delta_{\nu}^{(d)} \sum_{m=0}^{d-1} e^{\frac{\pi i \nu}{\kappa} \mu} \theta_{\nu-2m\kappa/d} = \sum_{\nu=0}^{2\kappa-1} M_{\mu\nu}^{(\kappa)}(S)(\Sigma_{\kappa,d}[\theta])_{\nu}, \end{aligned} \qquad (B.14) $$

which confirms the correct transformation. $\square$
Therefore, we can consider each equation (B.11) as a system of linear equations on the quantities $\Theta_{\mu}^{(\kappa)}$ to be expressed through $(\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu}$. As a result, we obtain

$$ \Theta_{\mu}^{(\kappa)} = (\mathcal{T}'_{\kappa}[\Theta^{(1)}])_{\mu}, \qquad (B.15) $$

where

$$ (\mathcal{T}'_{\kappa}[\phi])_{\mu} = \frac{1}{2} (\mathcal{T}_{\kappa}[\phi])_{\mu}, \quad \kappa \text{ -- prime}, \qquad (B.16a) $$

$$ (\mathcal{T}'_{4}[\phi])_{\mu} = \frac{1}{2} (\mathcal{T}_{4}[\phi])_{\mu} - \frac{1}{8} (\Sigma_{4,2}[\mathcal{T}_{4}[\phi]])_{\mu}, \qquad (B.16b) $$

$$ (\mathcal{T}'_{8}[\phi])_{\mu} = \frac{1}{2} (\mathcal{T}_{8}[\phi])_{\mu} - \frac{1}{6} (\Sigma_{8,2}[\mathcal{T}_{8}[\phi]])_{\mu}, \qquad (B.16c) $$

$$ (\mathcal{T}'_{9}[\phi])_{\mu} = \frac{1}{2} (\mathcal{T}_{9}[\phi])_{\mu} - \frac{1}{10} (\Sigma_{9,3}[\mathcal{T}_{9}[\phi]])_{\mu}, \qquad (B.16d) $$

$$ (\mathcal{T}'_{16}[\phi])_{\mu} = \frac{1}{2} (\mathcal{T}_{16}[\phi])_{\mu} - \frac{1}{6} (\Sigma_{16,2}[\mathcal{T}_{16}[\phi]])_{\mu} - \frac{1}{60} (\Sigma_{16,4}[\mathcal{T}_{16}[\phi]])_{\mu}. \qquad (B.16e) $$

So in general for $\kappa = p^m$ where $p$ is a prime number we expect that

$$ (\mathcal{T}'_{\kappa}[\phi])_{\mu} = \frac{1}{2} \sum_{n=0}^{[m/2]} c_{\kappa,n} (\Sigma_{\kappa,p^n}[\mathcal{T}_{\kappa}[\phi]])_{\mu} \qquad (B.17) $$

where $c_{\kappa,0} = 1$ and $c_{\kappa,n}$ with $n > 0$ are some negative rational numbers. Due to Proposition 2, all terms in the sum transform with the same multiplier system (5.5). Hence, $\mathcal{T}'_{\kappa}$ is the operator satisfying all our requirements and allowing the identification (5.13).

Finally, let us consider the case when $\kappa = 6$ or 12. Although it can be checked that all additional terms in (B.11b) and (B.11e) do transform with the proper multiplier system (5.5), it turns out that these equations cannot be solved for $\Theta_{\mu}^{(\kappa)}$ because (B.11b) does not depend on $\Theta_{1}^{(6)} - \Theta_{7}^{(6)}$, while (B.11e) does not involve $\Theta_{1}^{(12)} - \Theta_{7}^{(12)}$ and $\Theta_{5}^{(12)} - \Theta_{11}^{(12)}$. Thus, it seems that when $\kappa$ is a product of different prime integers, our approach based on the generalized Hecke operator $\mathcal{T}_{\kappa}$ does not work and a more complicated construction is required.

### C. Generating functions for unit D4-brane charge

In this section we provide tables of the rank 1 DT invariants $DT(Q, n)$ which enter in the Ansatz (4.10) for the polar part of the generating series $h_{1,\mu}$, and for the 10 models in which a VV modular form with the required polar part exists, give the generating series expressed as in (3.13) and their first few terms in the q-expansion. In presenting these results, we underline the polar terms and put the number $n$ of D0-branes responsible for each polar term as a subscript. We also discuss the remaining three models, in particular, how their polar terms can be corrected to allow for a solution. The invariants $DT(Q, n)$ are computed from the GV invariants listed in [33] (with some corrections kindly pointed out by the authors). All computations can be found in an ancillary Mathematica notebook available on arXiv.
The lowest DT invariants are as follows (extending the table in [20]):

<table><thead><tr><th>Q\n</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>1</td><td>200</td><td>19500</td><td>1234000</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>2875</td><td>569250</td><td>54921125</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>609250</td><td>124762875</td><td>12448246500</td></tr><tr><th>3</th><td>0</td><td>0</td><td>609250</td><td>439056375</td><td>76438831000</td><td>7158676736750</td></tr><tr><th>4</th><td>8625</td><td>2294250</td><td>4004590375</td><td>1010473893000</td><td>123236265797125</td><td>9526578133835000</td></tr></tbody></table>

The generating function is found to be<fnref n="16" />

$$h_{1,\mu} = - \frac{1}{2\pi\eta^{70}} \left[ - \frac{222887 E_4^8 + 1093010 E_4^5 E_6^2 + 177095 E_4^2 E_6^4}{35831808} + \frac{25 (458287 E_4^6 E_6 + 967810 E_4^3 E_6^3 + 66895 E_6^5)}{53747712} D + \frac{25 (155587 E_4^7 + 1054810 E_4^4 E_6^2 + 282595 E_4 E_6^4)}{8957952} D^2 \right] \partial_z \vartheta_{\mu}^{(5,1)}, \quad (C.1)$$

and has the following expansion (which agrees with the results in [11, Eq.(3.10)] and [17, Eq.(2.3)]):

$$ \begin{aligned} h_{1,0} &= q^{-\frac{55}{24}} (5_0 - 800_1 q + 58500_2 q^2 + 5817125 q^3 + 75474060100 q^4 + \dots), \\ h_{1,1} &= q^{-\frac{55}{24} + \frac{3}{5}} (0_0 + 8625_1 q - 1138500 q^2 + 3777474000 q^3 + 3102750380125 q^4 + \dots), \quad (C.2) \\ h_{1,2} &= q^{-\frac{55}{24} + \frac{2}{5}} (0_{-1} + 0_0 q - 1218500 q^2 + 441969250 q^3 + 953712511250 q^4 + \dots). \end{aligned} $$

X₆

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>204</td><td>20298</td><td>1311584</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>0</td><td>7884</td><td>1592568</td><td>156836412</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>7884</td><td>7636788</td><td>1408851522</td><td>136479465324</td></tr><tr><th>3</th><td>6</td><td>1836</td><td>266526</td><td>169502712</td><td>43151185260</td><td>5487789706776</td><td>440955379766460</td></tr><tr><th>4</th><td>-47304</td><td>-24852636</td><td>6684091812</td><td>3616211898459</td><td>597179528504352</td><td>56820950585055180</td><td>3715523804755065780</td></tr></tbody></table>

The generating function is found to be

$$h_{1,\mu} = - \frac{1}{2\pi\eta^{54}} \left[ \frac{7E_4^6 + 58E_4^3E_6^2 + 7E_6^4}{216} + \frac{5E_4^4E_6 + 3E_4E_6^3}{2} D \right] \partial_z \vartheta_{\mu}^{(3,1)}, \quad (C.3)$$

and has the following expansion (which agrees with [17, Eq.(2.7)], up to overall sign):

$$ \begin{aligned} h_{1,0} &= q^{-\frac{15}{8}} (-4_0 + 612_1 q - 40392 q^2 + 146464860 q^3 + 66864926808 q^4 + \dots), \\ h_{1,1} &= q^{-\frac{15}{8} + \frac{2}{3}} (0_0 - 15768_1 q + 7621020 q^2 + 10739279916 q^3 + 1794352963536 q^4 + \dots). \end{aligned} \quad (C.4) $$

<footnote n="16">¹⁶Here and below it is understood that the argument *z* of the theta function $\vartheta_{\mu}^{(\kappa,1)}$ defined in (3.4) is set to zero after taking derivative. The Fourier expansion is given only for the components with $0 \le \mu \le \kappa/2$ as the other components are fixed by the symmetry $h_{1,\mu} = h_{1,-\mu}$.</footnote>
X<sub>8</sub>

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>1</td><td>296</td><td>43068</td><td>4104336</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>29504</td><td>8674176</td><td>1253300416</td></tr><tr><th>2</th><td>6</td><td>2664</td><td>564332</td><td>204456696</td><td>45540821914</td><td>6127608486208</td></tr><tr><th>3</th><td>-177024</td><td>-69481920</td><td>8775447296</td><td>6313618655104</td><td>1225699503521536</td><td>141978726005461504</td></tr></tbody></table>

The generating function is found to be

$$h_{1,\mu} = \frac{1}{\eta^{52}} \left[ \frac{103E_4^6 + 1472E_4^3E_6^2 + 153E_6^4}{5184} + \frac{503E_4^4E_6 + 361E_4E_6^3}{108} D \right] \vartheta_{\mu}^{(2,1)}, \quad (C.5)$$

and has the following expansion (which agrees with [17, Eq.(2.11)], up to overall sign):

$$ \begin{aligned} h_{1,0} &= q^{-\frac{46}{24}} \left( -4_0 + 888_1 q - 86140 q^2 + 132940136 q^3 + 86849300500 q^4 + \dots \right), \\ h_{1,1} &= q^{-\frac{46}{24} + \frac{3}{4}} \left( \underline{0_0 - 59008_1 q} + 8615168 q^2 + 21430302976 q^3 + 3736977423872 q^4 + \dots \right). \end{aligned} \quad (C.6) $$

X<sub>10</sub>

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>288</td><td>40752</td><td>3774912</td></tr><tr><th>1</th><td>0</td><td>0</td><td>3</td><td>1150</td><td>435827</td><td>89103872</td><td>11141118264</td></tr><tr><th>2</th><td>-12</td><td>-5181</td><td>-1529746</td><td>-64916198</td><td>40225290446</td><td>9325643249563</td><td>1112733511380100</td></tr></tbody></table>

The generating function is found to be†

$$ \begin{aligned} h_{1,0} &= \frac{541 E_4^4 + 1187 E_4 E_6^2}{576 \eta^{35}} \\ &= q^{-\frac{35}{24}} \left( \underline{3_0 - 576_1 q} + 271704 q^2 + 206401533 q^3 + 21593767647 q^4 + \dots \right), \end{aligned} \quad (C.7) $$

where we took into account that $\partial_z \vartheta_0^{(1,1)}(\tau, 0) = -2\pi\eta^3(\tau)$. This result agrees with [17, Eq.(2.12)].<fnref n="17" />

X<sub>4,3</sub>

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-6</th><th>-5</th><th>-4</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>156</td><td>11778</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>1944</td><td>299376</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>27</td><td>227772</td><td>36634842</td></tr><tr><th>3</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>161248</td><td>89961744</td><td>12314066208</td></tr><tr><th>4</th><td>0</td><td>0</td><td>0</td><td>0</td><td>81</td><td>240408</td><td>418646475</td><td>90148651920</td><td>9065616005898</td></tr><tr><th>5</th><td>0</td><td>0</td><td>0</td><td>5832</td><td>1100304</td><td>3996193968</td><td>7007431566096</td><td>1058781525672312</td><td>79955621660025792</td></tr><tr><th>6</th><td>10</td><td>2496</td><td>275273</td><td>-21407812</td><td>69458828969</td><td>32461114565928</td><td>5111995215726463</td><td>460091731369849584</td><td>28020271480178497520</td></tr></tbody></table>

<footnote n="17">¹⁷It was suggested in [21] that the second polar coefficient should be modified to -575, but this suggestion was not taken seriously in the initial version of the present work. As explained in the note on page 6, it is in fact confirmed by the mathematical results of [56], hence we have marked (C.7) with a †. The correct expansion can be found in [21, (5.10)].</footnote>
The generating function is found to be†

$$
\begin{equation}
\begin{aligned}
h_{1,\mu} = \frac{1}{\eta^{72}} & \left[ \frac{709709 E_4^7 E_6 - 3221146 E_4^4 E_6^3 - 1359283 E_4 E_6^5}{637009920} \right. \\
& \left. + \frac{1106929 E_4^8 + 5476894 E_4^5 E_6^2 + 604657 E_4^2 E_6^4}{26542080} D \right. \\
& \left. - \frac{58663 E_4^6 E_6 + 117682 E_4^3 E_6^3 + 7975 E_6^5}{73728} D^2 \right. \\
& \left. - \frac{62453 E_4^7 + 395798 E_4^4 E_6^2 + 94709 E_4 E_6^4}{46080} D^3 \right] \vartheta_{\mu}^{(6,1)},
\end{aligned}
\tag{C.8}
\end{equation}
$$

and has the following expansion:†

$$
\begin{align}
h_{1,0} &= q^{-\frac{9}{4}} \left( \underline{5_0 - 624_1 q + 35334_2 q^2 + 19017138 q^3 + 74785371360 q^4 + \dots} \right), \notag \\
h_{1,1} &= q^{-\frac{9}{4}+\frac{7}{12}} \left( \underline{0_0 + 5832_1 q - 544806 q^2 + 3919919670 q^3 + 2506521890376 q^4 + \dots} \right), \tag{C.9} \\
h_{1,2} &= q^{-\frac{9}{4}+\frac{1}{3}} \left( \underline{0_{-1} + 81_0 q - 455787 q^2 + 418792680 q^3 + 589406281317 q^4 + \dots} \right), \notag \\
h_{1,3} &= q^{-\frac{9}{4}+\frac{1}{4}} \left( \underline{0_{-2} + 0_{-1} q - 322658 q^2 + 154766856 q^3 + 356674009104 q^4 + \dots} \right). \notag
\end{align}
$$

X_{4,4}

The lowest DT invariants are as follows:

<table>
  <thead>
    <tr>
      <th>Q\n</th>
      <th>-4</th>
      <th>-3</th>
      <th>-2</th>
      <th>-1</th>
      <th>0</th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>1</td>
      <td>144</td>
      <td>10008</td>
      <td>446304</td>
    </tr>
    <tr>
      <th>1</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>3712</td>
      <td>527104</td>
      <td>36091776</td>
    </tr>
    <tr>
      <th>2</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>1408</td>
      <td>1185216</td>
      <td>160488768</td>
      <td>11145152320</td>
    </tr>
    <tr>
      <th>3</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>3712</td>
      <td>7495680</td>
      <td>1728263936</td>
      <td>172767389440</td>
      <td>10375330097920</td>
    </tr>
    <tr>
      <th>4</th>
      <td>6</td>
      <td>1296</td>
      <td>112296</td>
      <td>153732336</td>
      <td>48667802732</td>
      <td>6124054838960</td>
      <td>444235976561624</td>
      <td>21742669957124080</td>
    </tr>
  </tbody>
</table>

Although there is a modular constraint on polar terms, it turns out to be satisfied by our
Ansatz due to the following relation between the DT invariants

$$
DT(0,0) + \frac{3}{16} DT(0,1) - \frac{1}{32} DT(1,1) + \frac{1}{16} DT(2,0) = 0. \qquad (C.10)
$$

The resulting generating function is found to be

$$
\begin{equation}
\begin{split}
h_{1,\mu} = \frac{1}{\eta^{56}} & \left[ \frac{319 E_4^5 E_6 + 113 E_4^2 E_6^3}{11664} - \frac{146 E_4^6 + 1025 E_4^3 E_6^2 + 125 E_6^4}{972} D \right. \\
& \left. - \frac{566 E_4^4 E_6 + 298 E_4 E_6^3}{81} D^2 \right] \vartheta_{\mu}^{(4,1)},
\end{split}
\tag{C.11}
\end{equation}
$$

and has the following expansion:

$$
\begin{align*}
h_{1,0} &= q^{-\frac{44}{24}} \left( \underline{-4_0 + 432_1 q - 10032 q^2 + 148611456 q^3 + 53495321332 q^4 + \dots} \right), \\
h_{1,1} &= q^{-\frac{44}{24} + \frac{5}{8}} \left( \underline{0_0 - 7424_1 q + 7488256 q^2 + 7149513728 q^3 + 1104027086592 q^4 + \dots} \right), \quad \text{(C.12)} \\
h_{1,2} &= q^{-\frac{44}{24} + \frac{1}{2}} \left( \underline{0_{-1} - 2816_0 q + 2167680 q^2 + 3503031296 q^3 + 619015800576 q^4 + \dots} \right).
\end{align*}
$$
The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-4</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>0</td><td>1</td><td>256</td><td>32128</td><td>2633216</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>4992</td><td>1267968</td><td>157842048</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>-4</td><td>-1536</td><td>2129180</td><td>592221184</td><td>76687779936</td></tr><tr><th>3</th><td>0</td><td>0</td><td>0</td><td>14976</td><td>5071872</td><td>3527640064</td><td>784442776832</td><td>94963960029952</td></tr><tr><th>4</th><td>10</td><td>4096</td><td>810898</td><td>87634944</td><td>84783721868</td><td>25072077880832</td><td>3730330724940930</td><td>357859766301860864</td></tr></tbody></table>

The generating function is found to be†

$$h_{1,\mu} = \frac{1}{\eta^{68}} \left[ -\frac{994693E_4^8 + 4317814E_4^5E_6^2 + 2152453E_4^2E_6^4}{161243136} + \frac{1974661E_4^6E_6 + 5095030E_4^3E_6^3 + 395269E_6^5}{4478976} D + \frac{738373E_4^7 + 5203702E_4^4E_6^2 + 1522885E_4E_6^4}{559872} D^2 \right] \vartheta_{\mu}^{(4,1)}, \quad (C.13)$$

and has the following expansion:†

$$\begin{align*}
h_{1,0} &= q^{-\frac{56}{24}} (5_0 - 1024_1 q + 96384_2 q^2 - 1082400 q^3 + 87565497502 q^4 + \dots), \\
h_{1,1} &= q^{-\frac{56}{24} + \frac{5}{8}} (0_0 + 14976_1 q - 1135328 q^2 + 2168240416 q^3 + 3646461843520 q^4 + \dots), \quad (C.14) \\
h_{1,2} &= q^{-\frac{56}{24} + \frac{1}{2}} (16_{-1} - 4608_0 q - 5272444 q^2 + 903979584 q^3 + 2117148662336 q^4 + \dots).
\end{align*}$$

X<sub>6,4</sub>

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>156</td><td>11778</td><td>572416</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>8</td><td>16800</td><td>2489232</td><td>182945216</td></tr><tr><th>2</th><td>0</td><td>3</td><td>608</td><td>315828</td><td>71744924</td><td>7624177244</td><td>492335041044</td></tr><tr><th>3</th><td>-48</td><td>-72184</td><td>26107984</td><td>10989768672</td><td>1476019954080</td><td>112615254328992</td><td>5813857713864192</td></tr></tbody></table>

The generating function is found to be†

$$h_{1,\mu} = \frac{1}{\eta^{40}} \left[ -\frac{509E_4^3E_6 + 139E_6^3}{2592} - \frac{233E_4^4 + 415E_4E_6^2}{108} D \right] \vartheta_{\mu}^{(2,1)}, \quad (C.15)$$

and has the following expansion:†

$$\begin{align*}
h_{1,0} &= q^{-\frac{34}{24}} (3_0 - 312_1 q + 269343 q^2 + 133568456 q^3 + 12400947182 q^4 + \dots), \\
h_{1,1} &= q^{-\frac{34}{24} + \frac{3}{4}} (-16_0 + 31904 q + 36568960 q^2 + 4364805376 q^3 + 226013798816 q^4 + \dots). \tag{C.16}
\end{align*}$$

<footnote>†As indicated in the note on page 6, the ansatz (4.10) fails to give the correct polar terms for this model, so these results should not be trusted.</footnote>
X_{6,6}

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>120</td><td>6900</td><td>252400</td></tr><tr><th>1</th><td>0</td><td>0</td><td>1</td><td>482</td><td>117445</td><td>10668592</td><td>545062022</td></tr><tr><th>2</th><td colspan="8">-6 -1684 130808 67782432 7543637572 456342386980 18275307362778</td></tr></tbody></table>

The generating function is found to be

$$ 
\begin{aligned}
h_{1,0} &= - \frac{2E_4 E_6}{\eta^{23}} && (C.17) \\
&= q^{-\frac{23}{24}} (-2_{\underline{0}} + 482q + 282410q^2 + 16775192q^3 + 460175332q^4 + \dots).
\end{aligned}
$$

X_{3,3}

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>144</td><td>10008</td><td>446304</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>0</td><td>1053</td><td>149526</td><td>10238319</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>0</td><td>52812</td><td>8053182</td><td>591031890</td></tr><tr><th>3</th><td>0</td><td>0</td><td>0</td><td>3402</td><td>6914214</td><td>1001912544</td><td>71961634872</td></tr><tr><th>4</th><td>0</td><td>0</td><td>0</td><td>5520393</td><td>1937967282</td><td>225717793668</td><td>14749020131814</td></tr><tr><th>5</th><td>0</td><td>0</td><td>5520393</td><td>5626721862</td><td>1006811225253</td><td>88682916004956</td><td>4943255069504250</td></tr><tr><th>6</th><td colspan="8">10206 8383878 24521163804 6662846868372 768849614982540 52757172850669686 248470513656066336</td></tr></tbody></table>

Although there is a modular constraint on polar terms, it turns out to be satisfied by our
Ansatz due to the following relation between the DT invariants

$$ DT(0,1) - \frac{2}{15} DT(0,2) - \frac{92}{135} DT(1,1) + \frac{1}{90} DT(1,2) + \frac{1}{90} DT(2,1) - \frac{1}{10} DT(3,0) = 0. \quad (C.18) $$

The resulting generating function is found to be

$$ 
\begin{aligned}
h_{1,\mu} = & - \frac{1}{2\pi\eta^{90}} \left[ \frac{47723E_4^9 E_6 + 25095E_4^6 E_6^3 - 68943E_4^3 E_6^5 - 3875E_6^7}{107495424} \right. \\
& \left. + \frac{289326E_4^{10} + 415189E_4^7 E_6^2 - 3458324E_4^4 E_6^4 - 729839E_4 E_6^6}{334430208} D \right. \\
& \left. + \frac{2261629E_4^8 E_6 + 3219046E_4^5 E_6^3 - 6371E_4^2 E_6^5}{30965760} D^2 \right. \\
& \left. - \frac{94271E_4^9 + 1496733E_4^6 E_6^2 + 1342665E_4^3 E_6^4 + 52315E_6^6}{5160960} D^3 \right. \\
& \left. - \frac{162167E_4^7 E_6 + 300338E_4^4 E_6^3 + 35159E_4 E_6^5}{286720} D^4 \right] \partial_z \psi_{\mu}^{(9,1)},
\end{aligned}
\quad (C.19) $$

and has the following expansion (which agrees with the results in [17, §2.5], up to overall
sign):

$$ 
\begin{aligned}
h_{1,0} &= q^{-\frac{63}{24}} (-6_0 + 720_1 q - 40032_2 q^2 - 678474 q^3 + 30885198768 q^4 + \dots), \\
h_{1,1} &= q^{-\frac{63}{24} + \frac{5}{9}} (0_0 - 4212_1 q + 448578_2 q^2 + 374980104 q^3 + 2020724648442 q^4 + \dots), \\
h_{1,2} &= q^{-\frac{63}{24} + \frac{2}{9}} (0_{-1} + 0_0 q + 158436_1 q^2 - 12471246 q^3 + 174600085086 q^4 + \dots), \quad (C.20) \\
h_{1,3} &= q^{-\frac{63}{24}} (0_{-2} + 0_{-1} q + 10206_0 q^2 - 13828428 q^3 + 24425287884 q^4 + \dots), \\
h_{1,4} &= q^{-\frac{63}{24} + \frac{8}{9}} (0_{-2} + 0_{-1} q - 11040786 q^2 + 6769752552 q^3 + 17629606262268 q^4 + \dots).
\end{aligned}
$$
X$_{4,2}$

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>1</td><td>176</td><td>15048</td><td>831776</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>1280</td><td>222720</td><td>18814720</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>92288</td><td>16876672</td><td>1497331072</td></tr><tr><th>3</th><td>0</td><td>0</td><td>2560</td><td>16105728</td><td>2880650752</td><td>252911493632</td></tr><tr><th>4</th><td>-8</td><td>-2112</td><td>17161392</td><td>6933330304</td><td>961734375064</td><td>75838156759744</td></tr></tbody></table>

Our Ansatz (4.10) implies the following polar terms

$$
\begin{align*}
h_{1,0}^{(p)} &= q^{-\frac{8}{3}} (-6_0 + 880_1q - 60192_2q^2), \\
h_{1,1}^{(p)} &= q^{-\frac{8}{3}+\frac{9}{16}} (0_0 - 5120_1q + 668160_2q^2), \\
h_{1,2}^{(p)} &= q^{-\frac{8}{3}+\frac{1}{4}} (0_{-1} + 0_0q + 276864_1q^2), \tag{C.21} \\
h_{1,3}^{(p)} &= q^{-\frac{8}{3}+\frac{1}{16}} (0_{-2} + 0_{-1}q + 7680_0q^2), \\
h_{1,4}^{(p)} &= q^{-\frac{8}{3}} (0_{-3} + 32_{-2}q - 6336_{-1}q^2).
\end{align*}
$$

However, they fail to satisfy the constraint imposed by modularity, which would require that the DT invariants fulfill the relation

$$
\begin{equation}
\begin{split}
& DT(0,0) + \frac{5}{12} DT(0,1) - \frac{1}{6} DT(0,2) - \frac{29}{48} DT(1,1) + \frac{1}{64} DT(1,2) \\
& \qquad - \frac{9}{64} DT(3,0) - \frac{1}{8} DT(4,-1) + \frac{1}{3} DT(4,-2) = 0.
\end{split}
\tag{C.22}
\end{equation}
$$

Barring a possible error in the table of GV invariants in [33], we conclude that the Ansatz (4.10) does not produce the correct polar terms in this case. Given that it works in many other cases, one might try to modify it in a minimal fashion, by changing just one or two polar coefficients so as to restore modularity. For example, it turns out that if one replaces $h_{1,4}^{(p)}$ in (C.21) by

$$
h_{1,4}^{(p)} = q^{-\frac{8}{3}} (0_{-3} + (32 + k)_{-2}q - (2152 + 2k)_{-1}q^2), \quad k \in \mathbb{Z}, \quad (C.23)
$$

one does find a modular form with integer coefficients. Two choices of $k$ seem to be particularly interesting. If $k = 0$, only one polar coefficient is changed, while if $k = -20$, one ends up with the last polar coefficient given by $-2112 = DT(4, -1)$, which differs by the coefficient $1/3$ from the Ansatz (4.10). However, besides these numerical observations, we do not have any physical arguments in favor of one of these choices, and it may well be that more than one polar coefficient is incorrectly predicted by our Ansatz in this case.

X$_{3,2,2}$

The lowest DT invariants are as follows:

<table><thead><tr><th>Q\n</th><th>-3</th><th>-2</th><th>-1</th><th>0</th><th>1</th><th>2</th><th>3</th></tr></thead><tbody><tr><th>0</th><td>0</td><td>0</td><td>0</td><td>1</td><td>144</td><td>10008</td><td>446304</td></tr><tr><th>1</th><td>0</td><td>0</td><td>0</td><td>0</td><td>720</td><td>102240</td><td>7000560</td></tr><tr><th>2</th><td>0</td><td>0</td><td>0</td><td>0</td><td>22428</td><td>3443616</td><td>254303604</td></tr><tr><th>3</th><td>0</td><td>0</td><td>0</td><td>64</td><td>1620720</td><td>245622240</td><td>18019908288</td></tr><tr><th>4</th><td>0</td><td>0</td><td>0</td><td>265113</td><td>206421552</td><td>27955859922</td><td>1957624164576</td></tr><tr><th>5</th><td>0</td><td>0</td><td>10080</td><td>199558944</td><td>50497608240</td><td>5249855378592</td><td>323810241865488</td></tr><tr><th>6</th><td>-56</td><td>-12096</td><td>179713440</td><td>115538513824</td><td>18048558130992</td><td>1472617884239424</td><td>78052676370951268</td></tr></tbody></table>
Our Ansatz (4.10) implies the following polar terms

$$
\begin{align*}
h_{1,0}^{(p)} &= q^{-3} (7_0 - 864_1 q + 50040_2 q^2), \\
h_{1,1}^{(p)} &= q^{-3+\frac{13}{24}} (0_0 + 3600_1 q - 408960_2 q^2), \\
h_{1,2}^{(p)} &= q^{-3+\frac{1}{6}} (0_{-1} + 0_0 q - 89712_1 q^2), \\
h_{1,3}^{(p)} &= q^{-3+\frac{7}{8}} (0_{-1} - 256_0 q + 4862160_1 q^2), \tag{C.24} \\
h_{1,4}^{(p)} &= q^{-3+\frac{2}{3}} (0_{-2} + 0_{-1} q + 795339_0 q^2), \\
h_{1,5}^{(p)} &= q^{-3+\frac{13}{24}} (0_{-3} + 0_{-2} q + 30240_{-1} q^2), \\
h_{1,6}^{(p)} &= q^{-3+\frac{1}{2}} (0_{-4} + 224_{-3} q - 36288_{-2} q^2).
\end{align*}
$$

However, they fail to satisfy the constraint imposed by modularity, which would require that
the DT invariants fulfill the relation

$$
\begin{equation}
\begin{split}
& DT(0,0) - \frac{8}{21} DT(0,1) - \frac{5}{21} DT(0,2) + \frac{25}{126} DT(1,1) + \frac{1}{63} DT(1,2) - \frac{16}{63} DT(2,1) \\
& \qquad + \frac{1}{7} DT(3,0) + \frac{1}{84} DT(3,1) - \frac{1}{21} DT(4,0) + \frac{1}{21} DT(6,-2) - \frac{8}{84} DT(5,-1).
\end{split}
\tag{C.25}
\end{equation}
$$

As in the previous case, one might try to change just one or two polar coefficients so as to
restore modularity. For example, it turns out that if one replaces $h_{1,6}^{(p)}$ in (C.24) by

$$
h_{1,6}^{(p)} = q^{-3+\frac{1}{2}} (0_{-4} + (224+k)_{-3}q - 12096_{-2}q^2), \quad k \in \mathbb{Z}, \qquad (C.26)
$$

one does find a modular form with integer coefficients. Note that for such modification the
last polar coefficient is given by $-12096 = DT(6, -2)$, which, like in the case of $X_{4,2}$, differs
from the Ansatz (4.10) by a coefficient $1/3$. However, this could just be a coincidence.

$\mathbf{X}_{2,2,2,2}$

The lowest DT invariants are as follows:

<table>
  <thead>
    <tr>
      <th>Q\n</th>
      <th>-4</th>
      <th>-3</th>
      <th>-2</th>
      <th>-1</th>
      <th>0</th>
      <th>1</th>
      <th>2</th>
      <th>3</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th>0</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>1</td>
      <td>128</td>
      <td>7872</td>
      <td>308992</td>
    </tr>
    <tr>
      <th>1</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>512</td>
      <td>64512</td>
      <td>3900928</td>
    </tr>
    <tr>
      <th>2</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>9728</td>
      <td>1356544</td>
      <td>90337792</td>
    </tr>
    <tr>
      <th>3</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>416256</td>
      <td>57428992</td>
      <td>3811304448</td>
    </tr>
    <tr>
      <th>4</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>14752</td>
      <td>27592192</td>
      <td>3615258880</td>
      <td>233963061760</td>
    </tr>
    <tr>
      <th>5</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>8782848</td>
      <td>3089741312</td>
      <td>334005965824</td>
      <td>19901940605440</td>
    </tr>
    <tr>
      <th>6</th>
      <td>0</td>
      <td>0</td>
      <td>0</td>
      <td>1427968</td>
      <td>2857640448</td>
      <td>528800790528</td>
      <td>44911222707968</td>
      <td>2345453425978368</td>
    </tr>
    <tr>
      <th>7</th>
      <td>0</td>
      <td>0</td>
      <td>86016</td>
      <td>2451858432</td>
      <td>934638858240</td>
      <td>116559621707264</td>
      <td>8004013269150720</td>
      <td>363671494077060608</td>
    </tr>
    <tr>
      <th>8</th>
      <td>-672</td>
      <td>-129024</td>
      <td>2392944768</td>
      <td>1945381563648</td>
      <td>356833378589872</td>
      <td>32067803814853376</td>
      <td>1801967963699774848</td>
      <td>71093859294029974016</td>
    </tr>
  </tbody>
</table>
Our Ansatz (4.10) implies the following polar terms

$$
\begin{align*}
h_{1,0}^{(p)} &= q^{-\frac{10}{3}} (-8_0 + 896_1 q - 47232_2 q^2 + 1544960_3 q^3), \\
h_{1,1}^{(p)} &= q^{-\frac{10}{3}+\frac{17}{32}} (0_0 - 3072_1 q + 322560_2 q^2), \\
h_{1,2}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{8}} (0_{-1} + 0_0 q + 48640_1 q^2 - 5426176_2 q^3), \\
h_{1,3}^{(p)} &= q^{-\frac{10}{3}+\frac{25}{32}} (0_{-1} + 0_0 q - 1665024_1 q^2), \\
h_{1,4}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{2}} (0_{-2} + 0_{-1} q - 59008_0 q^2), \tag{C.27} \\
h_{1,5}^{(p)} &= q^{-\frac{10}{3}+\frac{9}{32}} (0_{-3} + 0_{-2} q + 0_{-1} q^2 + 26348544_0 q^3), \\
h_{1,6}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{8}} (0_{-4} + 0_{-3} q + 0_{-2} q^2 + 4283904_{-1} q^3), \\
h_{1,7}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{32}} (0_{-5} + 0_{-4} q + 0_{-3} q^2 + 258048_{-2} q^3), \\
h_{1,8}^{(p)} &= q^{-\frac{10}{3}} (0_{-6} + 0_{-5} q + 2688_{-4} q^2 - 387072_{-3} q^3).
\end{align*}
$$

However, they fail to satisfy three constraints imposed by modularity in this case. One can
again find a modular form with integer coefficients by appropriately modifying the polar
terms. In contrast to the cases of $X_{4,2}$ and $X_{3,2,2}$, it appears that we have to modify at least
4 coefficients appearing in $h_{1,\mu}^{(p)}$ with $\mu = 6, 7, 8$ for such a solution to exist. For example, if
one replaces these functions in (C.27) by

$$
\begin{align*}
h_{1,6}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{8}} (0_{-4} + 0_{-3}q + 0_{-2}q^2 + (2674832 + 440k)_{-1}q^3), \\
h_{1,7}^{(p)} &= q^{-\frac{10}{3}+\frac{1}{32}} (0_{-5} + 0_{-4}q + 0_{-3}q^2 - (469056 - 32k)_{-2}q^3), \tag{C.28} \\
h_{1,8}^{(p)} &= q^{-\frac{10}{3}} (0_{-6} + 0_{-5}q + (2690 + 23k)_{-4}q^2 - (366336 + 128k)_{-3}q^3), \quad k \in \mathbb{Z},
\end{align*}
$$

one does find a modular form with integer coefficients. Of course, modularity could also be
restored by an even more drastic modification of the polar coefficients.

D. Comparison with mathematical results

In [56], explicit formulae for rank 0 DT invariants are proven for any smooth polarized CY threefold $\mathcal{Y}$ satisfying a technical condition known as the Bogomolov-Gieseker inequality [78], which is known to hold for the quintic $X_5$ [79], $X_6$, $X_8$ [80] and for $X_{4,2}$ [81]. A somewhat less explicit formula was proven earlier for one-parameter CY threefolds in [53, Thm 3.18]. In this section, we translate Thm 1.1 of [56] in our notations, and compare to our Ansatz (5.20) for the polar terms. We refrain from discussing Thm 1.2 in loc. cit., as it is different in spirit from our Ansatz, but we anticipate that it may also give valuable information on D4-D2-D0 indices [84].

Let $v \in K(X)$ be a rank-zero dimension-two class with Chern character

$$
(\mathrm{ch}_0, \mathrm{ch}_1, \mathrm{ch}_2, \mathrm{ch}_3)(v) = (0, D, \beta, m) \equiv v \quad (\mathrm{D}.1)
$$

with $D \neq 0$. Let

$$
Q_H(v) = \frac{1}{2} \left( \frac{D \cdot H^2}{H^3} \right)^2 + 6 \left( \frac{\beta \cdot H}{D \cdot H^2} \right)^2 - \frac{12m}{D \cdot H^2}, \quad (\text{D.2})
$$
where $H = c_1(\mathcal{O}_{\mathfrak{g}}(1))$ is the polarization. According to [56, Thm 1.1], $H$-Gieseker semistable sheaves of class $v$ can only exist only if $Q_H(v) \ge 0$. Moreover, when $v$ satisfies

$$ (H^3)^2 Q_H(v) < D \cdot H^2 - \frac{5}{2} + \frac{2}{D \cdot H^2} - \frac{2}{(D \cdot H^2)^2} \quad (D.3) $$

then the DT invariant counting $H$-Gieseker semistable sheaves of class $v$ is given by the explicit formula<fnref n="18" />

$$ J(v) = (\#H^2(\mathfrak{g}, \mathbb{Z})_{\text{tors}})^2 \sum_{\substack{v_1+v_2=v \\ v_i \in M_i(v)}} (-1)^{\chi(v_1, v_2)-1} \chi(v_1, v_2) DT(\beta_1 \cdot \omega_a, n_1) PT(\beta_2 \cdot \omega_a, n_2), \quad (D.4) $$

where

$$ \begin{aligned} v_1 &= e^{D_1}(1, 0, -\beta_1, -n_1), \\ v_2 &= -e^{D_2}(1, 0, -\beta_2, n_2), \end{aligned} \quad (D.5) $$

$\chi(-, -)$ is the Euler form given by

$$ \begin{aligned} \chi(E, E') &= \int_{\mathfrak{g}} \mathrm{ch}(E^*) \mathrm{ch}(E') \mathrm{Td} \mathfrak{g} && (D.6) \\ &= \mathrm{ch}_0 \left( \mathrm{ch}'_3 + \frac{1}{12} c_2(T\mathfrak{g}) \mathrm{ch}'_1 \right) - \mathrm{ch}'_0 \left( \mathrm{ch}_3 + \frac{1}{12} c_2(T\mathfrak{g}) \mathrm{ch}_1 \right) - \mathrm{ch}_1 \mathrm{ch}'_2 + \mathrm{ch}_2 \mathrm{ch}'_1, \end{aligned} $$

while $PT(Q_a, n)$ are the Pandharipande-Thomas (PT) invariants, given by the same generating series as (2.9) without the Mac-Mahon factor,

$$ Z_{PT}(\xi^a, q) = \sum_{Q_a, n} PT(Q_a, n) e^{2\pi i Q_a \xi^a} q^n = [M(-q)]^{-\chi_{\mathfrak{g}}} Z_{DT}(\xi^a, q). \quad (D.7) $$

The sum in (D.4) runs over $(D_i, \beta_i, n_i)$, $i = 1, 2$ satisfying the inequalities

$$ \begin{aligned} & \frac{1}{2} \left( \frac{D_i \cdot H^2}{H^3} \right)^2 - \frac{D_i \cdot D_i \cdot H}{2H^3} + \frac{\beta_i \cdot H}{H^3} \le \frac{D \cdot H^2 - 2}{2(H^3)^2}, \\ & n_i \ge - \frac{D \cdot H^2 (D \cdot H^2 + H^3)}{6(H^3)^2}. \end{aligned} \quad (D.8) $$

By the Grothendieck-Lefschetz theorem (see e.g. [82, Ch. IV]), $H^2(\mathfrak{g}, \mathbb{Z})$ is torsion free for any complete intersection in a smooth projective variety, so the prefactor $(\#H^2(\mathfrak{g}, \mathbb{Z})_{\text{tors}})^2$ in (D.4) is trivial for the models $X_5, X_{3,3}, X_{4,2}, X_{3,2,2}, X_{2,2,2,2}$ considered in this paper. For the other models, the ambient weighted projective space is singular, and $H^2(\mathfrak{g}, \mathbb{Z})$ could have non-trivial torsion [83]. We leave the determination of this factor as an open problem.

In the notations of §4.1, one has

$$ \begin{aligned} D &= rH, & \beta \cdot H &= -\mu - \frac{\kappa r^2}{2}, & m &= \frac{\kappa r^3}{6} - n, \\ D_i &= (-1)^{i-1} r_i H, & \beta_i \cdot H &= m_i, \end{aligned} \quad (D.9) $$

<footnote n="18">¹⁸In transcribing [56, Thm 1.1], we exchanged $v_1$ and $v_2$, set (after the exchange) $n_i = (-1)^{i-1}m_i$, and denoted $DT(\beta \cdot \omega_a, n) = I_{n,\beta}$ and $PT(\beta \cdot \omega_a, n) = P_{n,\beta}$ where $\omega_a$ is a basis in $H^2(\mathfrak{g}, \mathbb{Z})$.</footnote>
with $H^3 = \kappa$, such that

$$Q_H(v) = \frac{12}{\kappa r} \left( \frac{\chi(r\mathcal{D})}{24} - \hat{q}_0 \right), \qquad (D.10)$$

$$\chi(v_1, v_2) = \mathcal{I}_r - r(m_1 + m_2) - n_1 - n_2 \equiv -\gamma_{12}. \qquad (D.11)$$

The bound $Q_H(v) \ge 0$ is then recognized as the Bogomolov bound (2.11), while the condition (D.3) for the validity of (D.4) becomes

$$\frac{12\kappa}{r} \left( \frac{\chi(r\mathcal{D})}{24} - \hat{q}_0 \right) < \kappa r - \frac{5}{2} + \frac{2}{\kappa r} - \frac{2}{(\kappa r)^2}. \qquad (D.12)$$

These two conditions may be written more compactly as

$$\frac{\kappa r^3}{24} A(\kappa r) < \hat{q}_0 - \frac{\chi(r\mathcal{D})}{24} \le 0, \qquad (D.13)$$

where $A(x) = (1 - \frac{1}{x} + \frac{2}{x^2})^2 - 1$. The function $A(x)$ is positive for $x < 2$ and negative for $x > 2$. It has a minimum $A = -\frac{15}{64}$ at $x = 4$ and asymptotes to $-2/x$ as $x$ becomes large. Thus, the range of validity of the formula (D.4) shrinks as $\kappa$ and $r$ increase, and is empty for $\kappa = r = 1$.

To rewrite the formula (D.4) in our notations, first let us write explicitly the condition $v = v_1 + v_2$. It leads to the following three equalities

$$\begin{aligned} r_1 + r_2 &= r, \\ m_1 - m_2 &= \mu + \kappa r r_1, \\ n_1 + n_2 &= n - r_1 m_1 - r_2 m_2 - \frac{\kappa}{2} r r_1 r_2. \end{aligned} \qquad (D.14)$$

The first two equations admit an integer solution for $r_1, r_2$ provided

$$m_1 - m_2 = \mu \quad \mod \kappa r \qquad (D.15)$$

After eliminating $r_1, r_2$, the last relation in (D.14) requires

$$n_1 + n_2 = n + \frac{1}{2\kappa r} \left( \mu^2 - (m_1 - m_2)^2 + \kappa r^2 (\mu - m_1 - m_2) \right). \qquad (D.16)$$

Finally, the inequalities (D.8) take the simple form

$$m_i \le \frac{r}{2} - \frac{1}{\kappa}, \quad n_i \ge -\frac{1}{6} r(r+1). \qquad (D.17)$$

As a result, the formula (D.4) takes the following form

$$\bar{\Omega}_{r,\mu}(\hat{q}_0) = \sum_{m_i, n_i} (-1)^{\gamma_{12}} \gamma_{12} DT(m_1, n_1) PT(m_2, n_2), \qquad (D.18)$$

where $\gamma_{12}$ is given in (D.11), and the sum is subject to the conditions (D.15), (D.16), (D.17) and $m_i \ge 0$. Since the condition (D.16) bounds $n_1, n_2$ from above, the sum is manifestly finite.

The formula (D.18) is reminiscent of our Ansatz (4.10) for $r = 1$, or (5.20) for higher $r$. Note however that for the models considered in this paper, the condition (D.13) is never satisfied except for the most polar term where $\hat{q}_0 = \frac{\chi(r\mathcal{D})}{24}$ (assuming $\kappa \ge 2$), in which case $\mu = m_i = n_i = 0$.
References

[1] J. M. Maldacena, A. Strominger, and E. Witten, “Black hole entropy in M-theory,” JHEP 12 (1997) 002, hep-th/9711053.

[2] R. Minasian, G. W. Moore, and D. Tsimpis, “Calabi-Yau black holes and (0,4) sigma models,” Commun. Math. Phys. 209 (2000) 325–352, hep-th/9904217.

[3] E. Witten, “Three-Dimensional Gravity Revisited,” 0706.3359.

[4] M. R. Gaberdiel, S. Gukov, C. A. Keller, G. W. Moore, and H. Ooguri, “Extremal N=(2,2) 2D Conformal Field Theories and Constraints of Modularity,” Commun. Num. Theor. Phys. 2 (2008) 743–801, 0805.4216.

[5] D. Gaiotto and X. Yin, “Genus two partition functions of extremal conformal field theories,” JHEP 08 (2007) 029, 0707.3437.

[6] S. Hellerman, “A Universal Inequality for CFT and Quantum Gravity,” JHEP 08 (2011) 130, 0902.2790.

[7] C. A. Keller and H. Ooguri, “Modular Constraints on Calabi-Yau Compactifications,” Commun. Math. Phys. 324 (2013) 107–127, 1209.4649.

[8] S. Collier, Y.-H. Lin, and X. Yin, “Modular Bootstrap Revisited,” JHEP 09 (2018) 061, 1608.06241.

[9] T. Hartman, D. Mazáč, and L. Rastelli, “Sphere Packing and Quantum Gravity,” JHEP 12 (2019) 048, 1905.01319.

[10] S. Mukhi, “Classification of RCFT from Holomorphic Modular Bootstrap: A Status Report,” in Pollica Summer Workshop 2019: Mathematical and Geometric Tools for Conformal Field Theories. 10, 2019. 1910.02973.

[11] D. Gaiotto, A. Strominger, and X. Yin, “The M5-brane elliptic genus: Modularity and BPS states,” JHEP 08 (2007) 070, hep-th/0607010.

[12] J. de Boer, M. C. N. Cheng, R. Dijkgraaf, J. Manschot, and E. Verlinde, “A farey tail for attractor black holes,” JHEP 11 (2006) 024, hep-th/0608059.

[13] P. Bantay and T. Gannon, “Vector-valued modular functions for the modular group and the hypergeometric equation,” Commun. Num. Theor. Phys. 1 (2007) 651–680, 0705.2467.

[14] J. Manschot and G. W. Moore, “A Modern Fareytail,” Commun. Num. Theor. Phys. 4 (2010) 103–159, 0712.0573.

[15] J. Manschot, “On the space of elliptic genera,” Commun. Num. Theor. Phys. 2 (2008) 803–833, 0805.4333.

[16] D. Gaiotto et al., “D4-D0 branes on the quintic,” JHEP 03 (2006) 019, hep-th/0509168.

[17] D. Gaiotto and X. Yin, “Examples of M5-Brane Elliptic Genera,” JHEP 11 (2007) 004, hep-th/0702012.
[18] F. Denef and G. W. Moore, “Split states, entropy enigmas, holes and halos,” JHEP 1111 (2011) 129, hep-th/0702146.

[19] D. Maulik, N. Nekrasov, A. Okounkov, and R. Pandharipande, “Gromov-Witten theory and Donaldson-Thomas theory. I,” Compos. Math. 142 (2006), no. 5, 1263–1285.

[20] A. Collinucci and T. Wyder, “The Elliptic genus from split flows and Donaldson-Thomas invariants,” JHEP 05 (2010) 081, 0810.4301.

[21] W. Van Herck and T. Wyder, “Black Hole Meiosis,” JHEP 04 (2010) 047, 0909.0508.

[22] F. Denef, B. R. Greene, and M. Raugas, “Split attractor flows and the spectrum of BPS D-branes on the quintic,” JHEP 05 (2001) 012, hep-th/0101135.

[23] J. Manschot, “Wall-crossing of D4-branes using flow trees,” Adv. Theor. Math. Phys. 15 (2011) 1–42, 1003.1570.

[24] S. Alexandrov and B. Pioline, “Attractor flow trees, BPS indices and quivers,” Adv. Theor. Math. Phys. 23 (2019), no. 3, 627–699, 1804.06928.

[25] F. Denef, “Quantum quivers and Hall/hole halos,” JHEP 10 (2002) 023, hep-th/0206072.

[26] I. Bena, C.-W. Wang, and N. P. Warner, “Mergers and Typical Black Hole Microstates,” JHEP 11 (2006) 042, hep-th/0608217.

[27] I. Bena, M. Berkooz, J. de Boer, S. El-Showk, and D. Van den Bleeken, “Scaling BPS Solutions and pure-Higgs States,” JHEP 1211 (2012) 171, 1205.5023.

[28] P. Descombes and B. Pioline, “On the existence of scaling multi-centered black holes”, to appear in Annales Henri Poincaré (2022)2110.06652.

[29] J. Manschot, B. Pioline, and A. Sen, “Wall Crossing from Boltzmann Black Hole Halos,” JHEP 1107 (2011) 059, 1011.1258.

[30] J. Manschot, B. Pioline, and A. Sen, “A Fixed point formula for the index of multi-centered N=2 black holes,” JHEP 1105 (2011) 057, 1103.1887.

[31] J. de Boer, S. El-Showk, I. Messamah, and D. Van den Bleeken, “Quantizing N=2 Multicenter Solutions,” JHEP 05 (2009) 002, 0807.4556.

[32] N. Gaddam, “Elliptic genera from multi-centers,” JHEP 05 (2016) 076, 1603.01724.

[33] M.-x. Huang, A. Klemm, and S. Quackenbush, Topological string theory on compact Calabi-Yau: Modularity and boundary conditions, pp. 1–58. Springer, 2008. hep-th/0612125.

[34] M.-x. Huang, A. Klemm, M. Marino, and A. Tavanfar, “Black holes and large order quantum geometry,” Phys. Rev. D 79 (2009) 066001, 0704.2440.

[35] A. Joshi and A. Klemm, “Swampland Distance Conjecture for One-Parameter Calabi-Yau Threefolds,” JHEP 08 (2019) 086, 1903.00596.

[36] C. F. Doran and J. W. Morgan, “Mirror symmetry and integral variations of Hodge structure underlying one parameter families of Calabi-Yau threefolds,” in Workshop on Calabi-Yau Varieties and Mirror Symmetry. 5, 2005. math/0505272.
[37] A. Clingher, C. F. Doran, J. Lewis, A. Y. Novoseltsev, and A. Thompson, “The 14th case vhs via K3 fibrations,” *Recent advances in Hodge theory: Period domains, algebraic cycles and arithmetic*, London Math. Soc. Lecture Note Ser 427 (2015) 165–227, 1312.6433.

[38] S. Hosono and Y. Konishi, “Higher genus Gromov-Witten invariants of the Grassmannian, and the Pfaffian Calabi-Yau threefolds,” *Adv. Theor. Math. Phys.* **13** (2009), no. 2, 463–495, 0704.2928.

[39] S. Hosono and H. Takagi, “Mirror symmetry and projective geometry of Reye congruences I,” *J. Alg. Geom.* **23** (2014), no. 2, 279–312, 1101.2746.

[40] S. Alexandrov, S. Banerjee, J. Manschot, and B. Pioline, “Multiple D3-instantons and mock modular forms I,” *Commun. Math. Phys.* **353** (2017), no. 1, 379–411, 1605.05945.

[41] S. Alexandrov, S. Banerjee, J. Manschot, and B. Pioline, “Multiple D3-instantons and mock modular forms II,” *Commun. Math. Phys.* **359** (2018), no. 1, 297–346, 1702.05497.

[42] S. Alexandrov and B. Pioline, “Black holes and higher depth mock modular forms,” *Commun. Math. Phys.* **374** (2019), no. 2, 549–625, 1808.08479.

[43] A. Chattopadhyaya, J. Manschot, and S. Mondal, “Scaling black holes and modularity,” *JHEP* **03** (2022) 001, 2110.05504.

[44] J. Manschot, “Stability and duality in $N=2$ supergravity,” *Commun. Math. Phys.* **299** (2010) 651–676, 0906.1767.

[45] M. Alim, B. Haghighat, M. Hecht, A. Klemm, M. Rauch, and T. Wotschke, “Wall-crossing holomorphic anomaly and mock modularity of multiple M5-branes,” *Commun. Math. Phys.* **339** (2015), no. 3, 773–814, 1012.1608.

[46] A. Dabholkar, S. Murthy, and D. Zagier, “Quantum Black Holes, Wall Crossing, and Mock Modular Forms,” 1208.4074.

[47] M. C. N. Cheng, J. F. R. Duncan, S. M. Harrison, J. A. Harvey, S. Kachru, and B. C. Rayhaun, “Attractive Strings and Five-Branes, Skew-Holomorphic Jacobi Forms and Moonshine,” *JHEP* **07** (2018) 130, 1708.07523.

[48] S. Alexandrov, J. Manschot, and B. Pioline, “S-duality and refined BPS indices,” *Commun. Math. Phys.* **380** (2020), no. 2, 755–810, 1910.03098.

[49] M. C. N. Cheng and J. F. R. Duncan, “Rademacher Sums and Rademacher Series,” *Contrib. Math. Comput. Sci.* **8** (2014) 143–182, 1210.3066.

[50] V. Bouchard, T. Creutzig, and A. Joshi, “Hecke Operators on Vector-Valued Modular Forms,” *SIGMA* **15** (2019) 041, 1807.07703.

[51] C. Vafa and E. Witten, “A Strong coupling test of S duality,” *Nucl. Phys. B431* (1994) 3–77, hep-th/9408074.

[52] H. Ooguri, A. Strominger, and C. Vafa, “Black hole attractors and the topological string,” *Phys. Rev. D70* (2004) 106007, hep-th/0405146.

[53] Y. Toda, “Bogomolov-Gieseker type inequality and counting invariants,” 1112.3411.
[54] S. Feyzbakhsh and R. P. Thomas, “Rank *r* DT theory from rank 0,” 2103.02915.

[55] S. Feyzbakhsh and R. P. Thomas, “Rank *r* DT theory from rank 1,” 2108.02828.

[56] S. Feyzbakhsh, “Explicit formulae for rank zero DT invariants and the OSV conjecture,” 2203.10617.

[57] S. Alexandrov, D. Persson, and B. Pioline, “Fivebrane instantons, topological wave functions and hypermultiplet moduli spaces,” JHEP 1103 (2011) 111, 1010.5792.

[58] R. Pandharipande and R. P. Thomas, “13/2 ways of counting curves,” Lond. Math. Soc. Lect. Note Ser. 411 (2014) 282–333, 1111.1552.

[59] D. Maulik, N. Nekrasov, A. Okounkov, and R. Pandharipande, “Gromov-Witten theory and Donaldson-Thomas theory. II,” Compos. Math. 142 (2006), no. 5, 1286–1304.

[60] A. Klemm, M. Kreuzer, E. Riegler, and E. Scheidegger, “Topological string amplitudes, complete intersection Calabi-Yau spaces and threshold corrections,” hep-th/0410018.

[61] J. de Boer, F. Denef, S. El-Showk, I. Messamah, and D. Van den Bleeken, “Black hole bound states in $AdS_3 \times S^2$,” JHEP 0811 (2008) 050, 0802.2257.

[62] S. Feyzbakhsh and R. P. Thomas, “Curve counting and S-duality,” Epijournal de Géométrie Algébrique 7 (2020), 2007.03037.

[63] S. Alexandrov, J. Manschot, and B. Pioline, “D3-instantons, Mock Theta Series and Twistors,” JHEP 1304 (2013) 002, 1207.1109.

[64] N.-P. Skoruppa, *Über den Zusammenhang zwischen Jacobiformen und Modulformen halbganzen Gewichts*. PhD thesis, Bonner Mathematische Schriften, 1985.

[65] M. Shmakova, “Calabi-Yau black holes,” Phys. Rev. D 56 (1997) 540–544, hep-th/9612076.

[66] S. H. Katz, A. Klemm, and C. Vafa, “M theory, topological strings and spinning black holes,” Adv. Theor. Math. Phys. 3 (1999) 1445–1537, hep-th/9910181.

[67] A. A. Klyachko, “Moduli of vector bundles and numbers of classes,” Funct. Anal. and Appl. 25 (1991) 67–68.

[68] K. Yoshioka, “The Betti numbers of the moduli space of stable sheaves of rank 2 on $\mathbb{P}^2$,” J. Reine Angew. Math 453 (1994) 193–220.

[69] D. Zagier, “Nombres de classes et formes modulaires de poids 3/2,” C. R. Acad. Sc. Paris 281 (1975) 883–886.

[70] F. Hirzebruch and D. Zagier, “Intersection numbers of curves on Hilbert modular surfaces and modular forms of nebentypus,” Inventiones mathematicae 36 (1976), no. 1, 57–113.

[71] V. Bouchard, T. Creutzig, D.-E. Diaconescu, C. Doran, C. Quigley, and A. Sheshmani, “Vertical D4-D2-D0 Bound States on K3 Fibrations and Modularity,” Commun. Math. Phys. 350 (2017), no. 3, 1069–1121, 1601.04030.

[72] J. Manschot, “The Betti numbers of the moduli space of stable sheaves of rank 3 on $\mathbb{P}^2$,” Lett. Math. Phys. 98 (2011) 65–78, 1009.1775.
[73] J. Manschot, “BPS invariants of semi-stable sheaves on rational surfaces,” *Lett. Math. Phys.* **103** (2013) 895–918, 1109–4861.

[74] J. Manschot, “Sheaves on $\mathbb{P}^2$ and generalized Appell functions,” *Adv. Theor. Math. Phys.* **21** (2017) 655–681, 1407–7785.

[75] S. Alexandrov, “Rank $N$ Vafa-Witten invariants, modularity and blow-up,” *Adv. Theor. Math. Phys.* **25** (2021), no. 2, 275–308, 2006.10074.

[76] T. M. Apostol, *Introduction to Analytic Number Theory*. Springer, New York, NY, 1976.

[77] S. Alexandrov, “Vafa-Witten invariants from modular anomaly,” *Commun. Num. Theor. Phys.* **15** (2021), no. 1, 149–219, 2005.03680.

[78] A. Bayer, E. Macrì, and Y. Toda, “Bridgeland stability conditions on threefolds I: Bogomolov-Gieseker type inequalities,” *Journal of Algebraic Geometry* **23** (2014) 117–163, 1103.5010.

[79] C. Li, “On stability conditions for the quintic threefold,” *Inventiones mathematicae* **218** (2019), no. 1, 301–340, 1810.03434.

[80] N. Koseki, “Stability conditions on Calabi-Yau double/triple solids”, in *Forum of Mathematics, Sigma*, vol. 10, p. e63, Cambridge University Press. 2007.00044.

[81] S. Liu, “Stability condition on Calabi-Yau threefold of complete intersection of quadratic and quartic hypersurfaces,” in *Forum of Mathematics, Sigma*, vol. 10, p. e106, Cambridge University Press, 2108.08934.

[82] R. Hartshorne, *Ample subvarieties of algebraic varieties*, vol. 156. Springer, 2006.

[83] G. V. Ravindra and V. Srinivas, “The Grothendieck-Lefschetz theorem for normal projective varieties,” math/0511134.

[84] S. Alexandrov, S. Feyzbakhsh, A. Klemm, B. Pioline, T. Schimannek, “Quantum geometry, stability and modularity”, to appear in *Comm. Num. Theo. Phys.*, 2301.08066.