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

Sergei Alexandrov1, Nava Gaddam2, Jan Manschot3, Boris Pioline4
1 Laboratoire Charles Coulomb (L2C), Université de Montpellier, CNRS,
F-34095, Montpellier, France
2 Institute for Theoretical Physics and Center for Extreme Matter and Emergent
Phenomena, Utrecht University, 3508 TD Utrecht, The Netherlands
3 School of Mathematics, Trinity College, Dublin 2, Ireland
4 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<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
###### 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,\mathds{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-$\overline{\rm
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^{\rm(an)}_{2}$ with
exactly the same modular anomaly as $h_{2}$, so that the difference
$h_{2}-h^{\rm(an)}_{2}$ 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.

††preprint: arXiv:2204.02207v4

##  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 bootstrap111The 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].  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 $\mbox{q}=e^{2\pi\mathrm{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,\mathds{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{\rm D6}$-branes [18], and exploit the
relation $Z_{D6}\sim Z_{\rm 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_{\rm 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{\rm D6}$ pair contributes, an assumption which
needs to be verified case-by-case through a detailed analysis of the possible
attractor flow trees [22, 18, 23, 24] or more general222Multi-centered scaling
solutions [25, 26, 27, 28] are not accessible by attractor flow tree
techniques, but are amenable to localization methods [29, 30]. 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].

$\begin{array}[]{|l|r|r|r|r|r|r|r|r|r|r|}\hline\cr\mbox{CICY}&\chi&\kappa&c_{2}&\chi(\mathcal{O}_{\mathcal{D}})&\chi(\mathcal{O}_{2\mathcal{D}})&n_{1}&n_{2}&C_{1}&C_{2}&{\rm
type}\\\ \hline\cr X_{5}(1^{5})&-200&5&50&5&15&7&36&0&1&F\\\
X_{6}(1^{4},2)&-204&3&42&4&11&4&19&0&1&F\\\
X_{8}(1^{4},4)&-296&2&44&4&10&4&14&0&1&F\\\
X_{10}(1^{3},2,5)&-288&1&34&3&7&2&7&0&0&F\\\
X_{4,3}(1^{5},2)&-156&6&48&5&16&9&42&0&0&F\\\
X_{4,4}(1^{4},2^{2})&-144&4&40&4&12&6&25&1&1&K\\\
X_{6,2}(1^{5},3)&-256&4&52&5&14&7&30&0&1&C\\\
X_{6,4}(1^{3},2^{2},3)&-156&2&32&3&8&3&11&0&1&F\\\
X_{6,6}(1^{2},2^{2},3^{2})&-120&1&22&2&5&1&5&0&0&K\\\
X_{3,3}(1^{6})&-144&9&54&6&21&14&78&1&3&K\\\
X_{4,2}(1^{6})&-176&8&56&6&20&15&69&1&3&C\\\
X_{3,2,2}(1^{7})&-144&12&60&7&26&21&117&1&0&C\\\
X_{2,2,2,2}(1^{8})&-128&16&64&8&32&33&185&3&4&M\\\ \hline\cr\end{array}$ Table
1: Relevant data for the 13 smooth CICY threefolds with
$b_{2}(\mathfrak{Y})=1$ (the first 4 columns are taken from [33], [34, Table
3.1]). A complete intersection of multidegree $(d_{1},\ldots,d_{k})$ in
weighted projective space $\mathbb{P}^{k+3}(w_{1},\ldots,w_{l})$ is denoted
$X_{d_{1},\ldots,d_{k}}(w_{1}^{m_{1}},\ldots,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{Y}$, intersection
product $\kappa=\mathcal{D}\cup\mathcal{D}\cup\mathcal{D}$ and second Chern
class $c_{2}=\int_{\mathcal{D}}c_{2}(T\mathfrak{Y})$. The columns
$\chi(\mathcal{O}_{\mathcal{D}})$ and $\chi(\mathcal{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].

In this work, our aim is twofold. First, we generalize the analysis of [11,
17, 20, 21] to the complete list [36]333We 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{Y})=1$, such as the $\mathds{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.  of 13 compact CY threefolds with $b_{2}(\mathfrak{Y})=1$
obtained as a complete 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[\mathcal{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
$\mathscr{M}_{r}(\mathfrak{Y})$ 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[\mathcal{D}]$ with $[\mathcal{D}]$ being the primitive generator of
$H_{4}(\mathfrak{Y},\mathds{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{Y}$ 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
$\mathscr{M}_{r}(\mathfrak{Y})$ 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{Y}$, which sums the contributions
from a single D6-$\overline{\rm D6}$ pair and reproduces the results of [17]
for $\mathfrak{Y}\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{\rm 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[\mathcal{D}]$, and make it
explicit in the case $r=2$. The main difficulty, which appears when
$\mathcal{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,\mathds{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 $\widehat{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
$\widehat{h}_{p,\mu}$, known as the shadow, is not anti-holomorphic) implies
that it is necessary to specify both the polar terms and the shadow444In
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]. 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^{\rm(an)}_{p,\mu}$ with the same modular
anomaly as $h_{p,\mu}$, such that
$h^{(0)}_{p,\mu}=h_{p,\mu}-h^{\rm(an)}_{p,\mu}$ becomes an ordinary VV
holomorphic modular form. Second, one reconstructs $h^{(0)}_{p,\mu}$ 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^{\rm(an)}_{2,\mu}$ 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).555Our 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$. 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 $\mathds{P}^{2}$ inside the
non-compact threefold $K_{\mathds{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 $\mathscr{M}_{r}(\mathfrak{Y})$ 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
$\mathscr{M}_{r}(\mathfrak{Y})$, and tabulate the results for low values of
$r$. In §B we construct a Hecke operator producing a solution
$h^{\rm(an)}_{2,\mu}$ of the modular anomaly equation 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 $\dagger$
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{Y}$, and of the the modular properties of their
generating series $h_{p,\mu}$, specializing the relevant formulae to the one-
modulus case $b_{2}(\mathfrak{Y})=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{Y}$ are described by semi-stable coherent sheaves $\mathcal{E}$ on
$\mathfrak{Y}$. Their electromagnetic charge $\gamma$ is identified with the
Mukai vector
$\operatorname{ch}\mathcal{E}\sqrt{\operatorname{Td}\mathfrak{Y}}$. Expanding
$\gamma$ on a basis of $H^{\rm even}(\mathfrak{Y},\mathds{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\mathds{Z},\qquad
q_{a}\in\mathds{Z}+\frac{1}{2}\,\kappa_{abc}p^{b}p^{c}-\frac{1}{24}p^{0}c_{2,a},\qquad
q_{0}\in\mathds{Z}-\frac{1}{24}\,c_{2,a}p^{a},$ (2.1)

where $\kappa_{abc}$ are triple intersection numbers of $\mathfrak{Y}$ 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{Y}}e^{-z^{a}\omega_{a}}\operatorname{ch}\mathcal{E}\sqrt{\operatorname{Td}\mathfrak{Y}},$
(2.2)

where $z^{a}=b^{a}+\mathrm{i}t^{a}$ are the Kähler moduli conjugate to the
basis $\omega_{a}$ in $H^{2}(\mathfrak{Y},\mathds{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{split}p^{0}\mapsto p^{0},\qquad&p^{a}\mapsto
p^{a}+\epsilon^{a}p^{0},\qquad q_{a}\mapsto
q_{a}-\kappa_{abc}p^{b}\epsilon^{c}-\frac{p^{0}}{2}\,\kappa_{abc}\epsilon^{b}\epsilon^{c},\\\
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}.\end{split}$
(2.3)

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}^{\prime}\subset\mathcal{E}$ have
$\arg Z_{\gamma^{\prime}}\leq\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})\,,$
(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 charges666The 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).

$Q_{a}=q_{a}+\frac{1}{2}\,\kappa_{abc}p^{b}p^{c}+\frac{c_{2a}}{24}\,,\qquad
n=-q_{0}-p_{a}q^{a}-\frac{1}{3}\,\kappa_{abc}p^{a}p^{b}p^{c}\,.$ (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}+\mathrm{i}t^{a})),$
(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}+\mathrm{i}t^{a})).$
(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\mathrm{i}Q_{a}\xi^{a}}q^{n},$
(2.8)

where the sum runs over effective curve classes $Q_{a}\geq 0$. Up to a factor
$M(-q)^{\chi_{\scriptstyle\mathfrak{Y}}}$, where
$M(q)=\prod_{k>0}(1-q^{k})^{-k}$ is the Mac-Mahon function, the series (2.8)
coincides with the 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]

$\begin{split}Z_{DT}(\xi^{a},q)=&\,[M(-q)]^{\chi_{\scriptstyle\mathfrak{Y}}}\prod_{Q>0}\prod_{k>0}\left(1-(-q)^{k}e^{2\pi\mathrm{i}Q_{a}\xi^{a}}\right)^{kN_{Q}^{(0)}}\\\
&\times\prod_{Q>0}\prod_{g>0}\prod_{\ell=0}^{2g-2}\left(1-(-q)^{g-\ell-1}e^{2\pi\mathrm{i}Q_{a}\xi^{a}}\right)^{(-1)^{g+\ell}{\scriptsize\begin{pmatrix}2g-2\\\
\ell\end{pmatrix}}N_{Q}^{(g)}}.\end{split}$ (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^{\mathrm{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 charges777Note that our definition of $\hat{q}_{0}$ differs from [1] by an
overall sign.

$\hat{q}_{0}\equiv q_{0}-\frac{1}{2}\,\kappa^{ab}q_{a}q_{b}.$ (2.10)

Here $\kappa^{ab}$ is the inverse of $\kappa_{ab}=\kappa_{abc}p^{c}$, a
quadratic form of signature $(1,b_{2}(\mathfrak{Y})-1)$ on
$\Lambda\otimes\mathds{R}\simeq\mathds{R}^{b_{2}(\mathfrak{Y})}$ where
$\Lambda=H_{4}(\mathfrak{Y},\mathds{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}\leq\hat{q}_{0}^{\rm max}=\frac{1}{24}\,\chi(\mathcal{D}_{p}),$
(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{Y},\mathds{Z})$), given by [1, Eq.(3.3)]

$\chi(\mathcal{D}_{p})=\kappa_{abc}p^{a}p^{b}p^{c}+c_{2,a}p^{a}.$ (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},$
(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 $|\,{\rm det}\,\kappa_{ab}|$)
is sometimes known as the residual D2-brane charge.

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^{\rm
MSW}(\gamma)=\Omega(\gamma;z^{a}_{\infty}(\gamma))$ as the DT invariants
evaluated at the large volume attractor point [61],

$z^{a}_{\infty}(\gamma)=\lim_{\lambda\to+\infty}\left(b^{a}(\gamma)+\mathrm{i}\lambda
t^{a}(\gamma)\right)=\lim_{\lambda\to+\infty}\left(-\kappa^{ab}q_{b}+\mathrm{i}\lambda
p^{a}\right).$ (2.14)

The MSW index $\Omega^{\rm MSW}(\gamma)$ should be distinguished from the
attractor index $\Omega_{\star}(\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^{\rm 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^{\rm 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{Y}$, 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
invariants888The definition in terms rational MSW invariants was proposed in
[44, 23], motivated by consistency with wall-crossing. Note that the modular
parameter $\mbox{q}=\exp(2\pi\mathrm{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$.

$h_{p,\mu}(\tau)=\sum_{\hat{q}_{0}\leq\hat{q}_{0}^{\rm
max}}\bar{\Omega}_{p,\mu}(\hat{q}_{0})\,\mbox{q}^{-\hat{q}_{0}}\ .$ (2.15)

As briefly explained in the Introduction, the generating functions $h_{p,\mu}$
possess remarkable modular properties under the standard $SL(2,\mathds{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 show999Even
in this simple case, modularity remains conjectural from a mathematical
viewpoint, see e.g. [62] for some recent discussion. [11, 12, 18, 63] that
$h_{p,\mu}$ is a weakly holomorphic VV modular form of weight
$-\frac{b_{2}(\mathfrak{Y})}{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{split}M_{\mu\nu}(T)=&\,e^{\pi\mathrm{i}\left(\mu+\frac{p}{2}\right)^{2}+\tfrac{\pi\mathrm{i}}{12}\,c_{2,a}p^{a}}\,\delta_{\mu\nu},\\\
M_{\mu\nu}(S)=&\,\frac{(-1)^{\chi(\mathcal{O}_{\mathcal{D}_{p}})}}{\sqrt{|\Lambda^{*}/\Lambda|}}\,e^{(b_{2}-2)\frac{\pi\mathrm{i}}{4}}\,e^{-2\pi\mathrm{i}\mu\cdot\nu}\,,\end{split}$
(2.16)

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}\,.$
(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 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
$\widehat{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{Y})=1$, many of the
equations above simplify. Firstly, the indices $a,b,c\dots$ 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
$\mathds{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{Y},\mathds{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{split}M_{\mu\nu}(T)=&\,e^{\frac{\pi\mathrm{i}}{\kappa
r}(\mu+\frac{\kappa}{2}r^{2})^{2}+\frac{\pi\mathrm{i}}{12}\,rc_{2}}\,\delta_{\mu\nu},\\\
M_{\mu\nu}(S)=&\,\frac{(-1)^{\mathcal{I}_{r}}}{\sqrt{\mathrm{i}\kappa
r}}\,e^{-\frac{2\pi\mathrm{i}}{\kappa r}\,\mu\nu},\end{split}$ (2.18)

where

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

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

$\widehat{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),$
(2.20)

where

$R_{\mu,\mu_{1}\mu_{2}}(\tau,\bar{\tau})=\delta^{(\kappa)}_{\mu_{1}+\mu_{2}-\mu}(-1)^{\mu^{\prime}}\Theta^{(\kappa)}_{\mu^{\prime}}(\tau,\bar{\tau}),$
(2.21)

with $\mu^{\prime}=\mu-2\mu_{1}+\kappa$. Here $\delta^{(n)}_{x}$ is the
mod-$n$ Kronecker delta defined by

$\delta^{(n)}_{x}=\left\\{\begin{array}[]{ll}1&\mbox{if }x=0\\!\\!\\!\mod
n,\\\ 0&\mbox{otherwise},\end{array}\right.$ (2.22)

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

$\Theta^{(\kappa)}_{\mu}(\tau,\bar{\tau})=\frac{1}{8\pi}\,\sum_{k\in
2\kappa\mathds{Z}+\mu}|k|\,\beta_{\frac{3}{2}}\\!\left(\frac{\tau_{2}}{\kappa}\,k^{2}\right)e^{-\frac{\pi\mathrm{i}\tau}{2\kappa}\,k^{2}},$
(2.23)

where $\beta_{\frac{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^{(\kappa)}_{\mu}=\frac{\sqrt{\kappa}}{16\pi\mathrm{i}\tau_{2}^{3/2}}\sum_{k\in
2\kappa\mathds{Z}+\mu}e^{-\frac{\pi\mathrm{i}\bar{\tau}}{2\kappa}\,k^{2}}.$
(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 $\mathscr{M}_{r}(\mathfrak{Y})$ 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 $\mathscr{M}_{1}(\mathfrak{Y})$, while for $r>1$
the modular anomaly of $h_{r,\mu}$ only specifies it up to an element in
$\mathscr{M}_{r}(\mathfrak{Y})$. 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)\,\mbox{q}^{n-\Delta_{\mu}}$ (3.1)

that becomes singular in the limit $\tau\to\mathrm{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^{h}_{\mu}=\frac{\chi(r\mathcal{D})}{24}-{\rm
Fr}\left[\frac{\mu^{2}}{2\kappa r}+\frac{r\mu}{2}\right].$ (3.2)

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

$\chi(r\mathcal{D})=\kappa r^{3}+c_{2}r.$ (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
$\mathscr{M}_{r}(\mathfrak{Y})$, 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^{(m,p)}_{\mu}(\tau,z)=\\!\\!\\!\\!\sum_{{k}\in\mathds{Z}+\frac{\mu}{m}+\frac{p}{2}}\\!\\!(-1)^{mpk}\,\mbox{q}^{\tfrac{m}{2}\,k^{2}}e^{2\pi\mathrm{i}mkz}.$
(3.4)

They satisfy

$\vartheta^{(m,p)}_{\mu}(\tau,z)=\vartheta^{(m,p)}_{\mu+m}(\tau,z)=\vartheta^{(m,p)}_{-\mu}(\tau,z)$
(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{split}M^{(m,p)}_{\mu\nu}(T)=&\,e^{\frac{\pi\mathrm{i}}{m}\left(\mu+\tfrac{mp}{2}\right)^{2}}\,\delta_{\mu\nu}\,,\\\
M^{(m,p)}_{\mu\nu}(S)=&\,\frac{e^{-\frac{\pi\mathrm{i}}{2}\,mp^{2}}}{\sqrt{\mathrm{i}m}}\,e^{-2\pi\mathrm{i}\,\frac{\mu\nu}{m}}.\end{split}$
(3.6)

Note that $\vartheta^{(1,1)}_{0}(\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^{(r,\kappa)}_{\mu}(\tau)}{\eta^{4\kappa
r^{3}+rc_{2}}(\tau)},\qquad\theta^{(r,\kappa)}_{\mu}(\tau)=\left\\{\begin{array}[]{ll}\vartheta^{(\kappa
r,r)}_{\mu}(\tau,0),&\quad\kappa r\mbox{ even},\\\ -\frac{1}{2\pi
r}\,\partial_{z}\vartheta^{(\kappa r,r)}_{\mu}(\tau,0),&\quad\kappa r\mbox{
odd},\end{array}\right.$ (3.7)

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

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

it is straightforward to check that the multiplier system of (3.7) coincides
with (2.18). Furthermore, given that $\eta(\tau)\sim\mbox{q}^{1/24}$ as
$\tau\to\mathrm{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({\rm
Fr^{\prime}}\left[\frac{\mu}{\kappa
r}+\frac{r}{2}\right]\right)^{2}=\Delta^{h}_{\mu}+n,$ (3.9)

where ${\rm Fr^{\prime}}(x)=|x-\lfloor x\rceil|$ is the difference with the
closest integer, $\Delta^{h}_{\mu}$ is defined in (3.2), and $n\in\mathds{Z}$.
Importantly, the integer $n$ is non-negative,

$n=\frac{\kappa r^{3}}{8}-\frac{\kappa r}{2}\left({\rm
Fr^{\prime}}\left[\frac{\mu}{\kappa r}+\frac{r}{2}\right]\right)^{2}+{\rm
Fr}\left[\frac{\mu^{2}}{2\kappa r}+\frac{r\mu}{2}\right]\geq\frac{\kappa
r}{8}\,(r^{2}-1)\geq 0,$ (3.10)

where we used that ${\rm Fr^{\prime}}(x)\leq{1\over 2}$ and ${\rm Fr}(x)\geq
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^{(r,\kappa)}_{\mu}[g_{\ell}](\tau)=g_{\ell}(\tau)\,\frac{D^{\ell}\theta^{(r,\kappa)}_{\mu}(\tau)}{\eta^{4\kappa
r^{3}+rc_{2}}(\tau)}\,,$ (3.11)

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

$w_{\ell}=2\kappa r^{3}+{1\over 2}\,rc_{2}-2-2\ell-\delta^{(2)}_{\kappa r-1}\
.$ (3.12)

Here, $D$ is the Serre derivative, acting on holomorphic modular forms of
weight $w$ through $D=\mbox{q}\partial_{\mbox{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 integer101010The reason
of taking the derivative w.r.t. $z$ for odd $\kappa$ in the definition (3.7)
was precisely to ensure this property., $g_{\ell}$ themselves can be
represented as polynomials in Eisenstein series $E_{4}$ and $E_{6}$. As a
result, any $f\in\mathscr{M}_{r}(\mathfrak{Y})$ 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-\epsilon_{\ell}-3k}\,E_{6}^{2k+\epsilon_{\ell}}\right)\frac{D^{\ell}\theta^{(r,\kappa)}_{\mu}(\tau)}{\eta^{4\kappa
r^{3}+rc_{2}}(\tau)}\,,$ (3.13)

where $k_{\ell}=\lfloor w_{\ell}/12\rfloor-\delta^{(12)}_{w_{\ell}-2}$,
$\epsilon_{\ell}=\delta^{(2)}_{w_{\ell}/2-1}$ 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.111111One 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. 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}^{\rm max}$, appear to receive contributions
from a single D6-$\overline{\rm 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

######  Assumption 1.

The polar coefficients in $h_{1,\mu}$ count the number of bound states of the
form

$\begin{array}[]{cl}\mbox{D6}\mbox{--}\mu\mbox{D2}\mbox{--}n\mbox{D0}\ +\
\overline{\mbox{D6}[-1]}&\mbox{for }0\leq\mu\leq\kappa/2\\\ \mbox{D6}[1]\ +\
\overline{\mbox{D6}\mbox{--}(-\mu)\mbox{D2}\mbox{--}(-n)\mbox{D0}}&\mbox{for
}0\leq-\mu\leq\kappa/2,\end{array}$ (4.1)

where ${\rm 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\mbox{D6}[r_{1}]\mbox{--}m_{1}\mbox{D2}\mbox{--}n_{1}\mbox{D0}+\overline{N\mbox{D6}[-r_{2}]\mbox{--}m_{2}\mbox{D2}\mbox{--}(-n_{2})\mbox{D0}}.$
(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}),$
(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 $N$D6-$m$D2-$n$D0 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).$ (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).$
(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-{1\over
2}\,(\bar{r}m+r\bar{m})+\frac{N}{24}\,\chi(r\mathcal{D})+\frac{N\kappa}{8}\,r\bar{r}^{2}\right),$
(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(r\mathcal{D})$ is given in
(3.3). The invariant charge (2.10) evaluates to

$\hat{q}_{0}=\frac{N}{24}\,\chi(r\mathcal{D})-\frac{m^{2}}{2\kappa
rN}-\frac{r\bar{m}}{2}-n,$ (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),$
(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

$\begin{split}\bar{\Omega}_{1,\mu}(\hat{q}_{0})=&\,(-1)^{n+|\mu|+\mathcal{I}_{1}+1}\left(\mathcal{I}_{1}-|\mu|-n\right)\Omega(\gamma_{1};z_{12})\Omega(\gamma_{2};z_{12}),\\\
\mbox{where}\qquad&\hat{q}_{0}=\frac{\chi(\mathcal{D})}{24}-\frac{\mu^{2}}{2\kappa}-\frac{|\mu|}{2}-n>0,\end{split}$
(4.9)

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^{a}_{\infty}(\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}$121212Note that the second
argument of $DT$ is given by $n$ for both cases in (4.1). The reason for this
is that $\mbox{sgn}(b)=-\mbox{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.

$h^{\rm(p)}_{1,\mu}=\mbox{q}^{-\frac{\chi(\mathcal{D})}{24}+\frac{\mu^{2}}{2\kappa}+\frac{|\mu|}{2}}\sum_{n\in\mathds{Z}\;:\;\hat{q}_{0}>0}(-1)^{n+|\mu|+\mathcal{I}_{1}+1}(\mathcal{I}_{1}-|\mu|-n)\,DT(|\mu|,n)\,\mbox{q}^{n}.$
(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\leq\mu\leq\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}$ (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$ (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.

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).131313Note 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. 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|\geq\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.

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 $\widehat{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^{\rm(an)}_{2,\mu}$ 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^{\rm(an)}_{2,\mu}$
and a VV modular form $h^{(0)}_{2,\mu}$,

$h_{2,\mu}=h^{\rm(an)}_{2,\mu}+h^{(0)}_{2,\mu}.$ (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^{\rm(an)}_{2,\mu}$
(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^{\rm(an)}_{2,\mu}$ with the anomaly determined by the shadow of
$h_{2,\mu}$, which in turn can be derived from the holomorphic anomaly of its
completion $\widehat{h}_{2,\mu}$. Since the anomalous term in (2.20) has a
factorized form, it is natural to look for $h^{\rm(an)}_{2,\mu}$ of the same
form, namely

$h^{\rm(an)}_{2,\mu}=\sum_{\mu_{1},\mu_{2}=0}^{\kappa-1}g_{2,\mu,\mu_{1},\mu_{2}}\,h_{1,\mu_{1}}\,h_{1,\mu_{2}},$
(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

$\widehat{g}_{2,\mu,\mu_{1},\mu_{2}}=g_{2,\mu,\mu_{1},\mu_{2}}+R_{\mu,\mu_{1}\mu_{2}},$
(5.3)

where $R_{\mu,\mu_{1}\mu_{2}}$ is the same function (2.21) that appears in the
expression for $\widehat{h}_{2,\mu}$, must transform as VV modular forms of
weight 3/2 and the following multiplier system

$\begin{split}M_{\mu,\mu_{1},\mu_{2};\nu,\nu_{1},\nu_{2}}(T)=&\,e^{\pi\mathrm{i}\left(\frac{1}{\kappa}({1\over
2}\,\mu^{2}-\mu_{1}^{2}-\mu_{2}^{2})-\mu_{1}-\mu_{2}-\frac{\kappa}{2}\right)}\,\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{\mathrm{i}}(-1)^{\kappa}}{\sqrt{2}\kappa^{3/2}}\,e^{\frac{2\pi\mathrm{i}}{\kappa}\left(\mu_{1}\nu_{1}+\mu_{2}\nu_{2}-{1\over
2}\,\mu\nu\right)}.\end{split}$ (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^{(\kappa)}_{\mu}$ ($\mu=0,\dots,2\kappa-1$) transforms with the
multiplier system

$\begin{split}M^{(\kappa)}_{\mu\nu}(T)=&\,e^{-\frac{\pi\mathrm{i}}{2\kappa}\,\mu^{2}}\,\delta_{\mu\nu},\\\
M^{(\kappa)}_{\mu\nu}(S)=&\,\frac{\sqrt{\mathrm{i}}}{\sqrt{2\kappa}}\,e^{\frac{\pi\mathrm{i}}{\kappa}\,\mu\nu},\end{split}$
(5.5)

then

$g_{2,\mu,\mu_{1},\mu_{2}}=\delta^{(\kappa)}_{\mu_{1}+\mu_{2}-\mu}(-1)^{\mu^{\prime}}G^{(\kappa)}_{\mu^{\prime}}$
(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\mathds{Z}$)

$\begin{split}&\,e^{\pi\mathrm{i}\left(\frac{1}{\kappa}({1\over
2}\,\mu^{2}-\mu_{1}^{2}-\mu_{2}^{2})-\mu_{1}-\mu_{2}-\frac{\kappa}{2}\right)}\stackrel{{\scriptstyle\mu_{1}+\mu_{2}=\mu+\lambda\kappa}}{{=}}e^{\pi\mathrm{i}\left(\frac{1}{\kappa}\left({1\over
2}\,\mu^{2}-\mu_{1}^{2}-(\mu-\mu_{1}+\lambda\kappa)^{2}\right)-\mu-\lambda\kappa-\frac{\kappa}{2}\right)}\\\
=&\,e^{-\pi\mathrm{i}\kappa(\lambda+\lambda^{2})}\,e^{-\frac{\pi\mathrm{i}}{2\kappa}\,(\mu-2\mu_{1}+\kappa)^{2}}=e^{-\frac{\pi\mathrm{i}}{2\kappa}\,\mu^{\prime
2}},\end{split}$ (5.7)

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

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

$\displaystyle\frac{\sqrt{\mathrm{i}}(-1)^{\kappa}}{\kappa\sqrt{2\kappa}}\sum_{\nu,\nu_{1},\nu_{2}}e^{\frac{\pi\mathrm{i}}{\kappa}\left(-\mu\nu+2\mu_{1}\nu_{1}+2\mu_{2}\nu_{2}\right)}\,\delta^{(\kappa)}_{\nu_{1}+\nu_{2}-\nu}\,(-1)^{\nu^{\prime}}\,G^{(\kappa)}_{\nu^{\prime}}$
(5.8) $\displaystyle=$
$\displaystyle\frac{\sqrt{\mathrm{i}}(-1)^{\kappa}}{\kappa\sqrt{2\kappa}}\,\sum_{\nu,\nu_{1}}e^{\frac{\pi\mathrm{i}}{\kappa}\left((2\mu_{2}-\mu)\nu+2(\mu_{1}-\mu_{2})\nu_{1}\right)}\,(-1)^{\nu^{\prime}}\,G^{(\kappa)}_{\nu^{\prime}}$
$\displaystyle=$
$\displaystyle\frac{\sqrt{\mathrm{i}}}{\kappa\sqrt{2\kappa}}\,\sum_{\nu^{\prime},\nu_{1}}e^{\frac{\pi\mathrm{i}}{\kappa}(2\mu_{2}-\mu)(\nu^{\prime}-\kappa)+\frac{2\pi\mathrm{i}}{\kappa}(\mu_{1}+\mu_{2}-\mu)\nu_{1}}\,(-1)^{\nu^{\prime}-\kappa}\,G^{(\kappa)}_{\nu^{\prime}}$
$\displaystyle=$
$\displaystyle\delta^{(\kappa)}_{\mu_{1}+\mu_{2}-\mu}\,(-1)^{\mu^{\prime}}\,\frac{\sqrt{\mathrm{i}}}{\sqrt{2\kappa}}\sum_{\nu^{\prime}}e^{\frac{\pi\mathrm{i}}{\kappa}\,\mu^{\prime}\nu^{\prime}}\,G^{(\kappa)}_{\nu^{\prime}}.$

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

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^{(\kappa)}_{\mu}$ such that its completion, transforming with weight
$3/2$ and multiplier system (5.5), is given by

$\widehat{G}^{(\kappa)}_{\mu}=G^{(\kappa)}_{\mu}+\Theta^{(\kappa)}_{\mu},$
(5.9)

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

$\begin{split}h_{2,\mu}=&\,h^{(0)}_{2,\mu}+\sum_{\mu_{1}=0}^{\kappa-1}(-1)^{\mu-2\mu_{1}+\kappa}G^{(\kappa)}_{\mu-2\mu_{1}+\kappa}\,h_{1,\mu_{1}}\,h_{1,\mu-\mu_{1}}\,.\end{split}$
(5.10)

The holomorphic ambiguity $h^{(0)}_{2,\mu}$ 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^{(\kappa)}_{\mu}$ with an anomaly specified by
$\Theta^{(\kappa)}_{\mu}$ (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
$\widehat{G}^{(\kappa)}_{\mu}$ 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 $\mathds{P}^{2}$ [51,
Eq.(4.32)]141414The connection between Hurwitz class numbers and moduli spaces
of rank 2 semi-stable sheaves on $\mathds{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].. Thus, for
$\kappa=1$ we can simply choose

$G^{(1)}_{\mu}=H_{\mu},$ (5.11)

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

$\begin{split}H_{0}(\tau)=&\,-\frac{1}{12}+\frac{\mbox{q}}{2}+\mbox{q}^{2}+\frac{4\mbox{q}^{3}}{3}+\frac{3\mbox{q}^{4}}{2}+2\mbox{q}^{5}+2\mbox{q}^{6}+2\mbox{q}^{7}+3\mbox{q}^{8}+\frac{5\mbox{q}^{9}}{2}+2\mbox{q}^{10}+\dots\,,\\\
H_{1}(\tau)=&\,\mbox{q}^{\frac{3}{4}}\left(\frac{1}{3}+\mbox{q}+\mbox{q}^{2}+2\mbox{q}^{3}+\mbox{q}^{4}+3\mbox{q}^{5}+\frac{4\mbox{q}^{6}}{3}+3\mbox{q}^{7}+2\mbox{q}^{8}+4\mbox{q}^{9}+\mbox{q}^{10}+\dots\right).\end{split}$
(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$ 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 number151515Out of the list of 13 CICY, this rules out
$X_{4,3}$ and $X_{3,2,2}$, for which the construction of
$\mathcal{T}^{\prime}_{\kappa}$ is left as an open problem., it is possible to
cure the problem and modify $\mathcal{T}_{\kappa}$ into an operator
$\mathcal{T}^{\prime}_{\kappa}$ such that

$G^{(\kappa)}_{\mu}=(\mathcal{T}^{\prime}_{\kappa}[H])_{\mu}.$ (5.13)

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

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

where the action of $\mathcal{T}^{\prime}_{\kappa}$ is defined by (B.4) and
(B.16). Thus, we only need to fix the holomorphic modular ambiguity
$h^{(0)}_{2,\mu}$, 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^{\rm(int)}_{2,\mu}=\sum_{\hat{q}_{0}\geq
0}\Omega_{2,\mu}(\hat{q}_{0})\,\mbox{q}^{-\hat{q}_{0}},$ (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^{\prime}$. 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^{\prime}=\Bigl{(}0,1,\kappa\epsilon+\mu^{\prime}+\frac{\kappa}{2}\,,q^{\prime}_{0}\Bigr{)},$
(5.16)

one must have

$\mu^{\prime}={1\over 2}\,(\mu+\kappa)\in\mathds{Z}\,,\qquad
q_{0}^{\prime}={1\over 2}\,q_{0}\in\mathds{Z}\,.$ (5.17)

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

$h_{2,\mu}(\tau)=h^{\rm(int)}_{2,\mu}(\tau)+\frac{1}{4}\,\delta^{(2)}_{\mu+\kappa}\,h_{1,\frac{\mu+\kappa}{2}}(2\tau).$
(5.18)

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

$\begin{split}h^{\rm(int)}_{2,\mu}(\tau)-\sum_{\mu_{1}=0}^{\kappa-1}(-1)^{\mu-2\mu_{1}+\kappa}(\mathcal{T}^{\prime}_{\kappa}[H])_{\mu-2\mu_{1}+\kappa}(\tau)\,h_{1,\mu_{1}}(\tau)\,h_{1,\mu-\mu_{1}}(\tau)+\frac{1}{4}\,\delta^{(2)}_{\mu+\kappa}\,h_{1,\frac{\mu+\kappa}{2}}(2\tau),\end{split}$
(5.19)

which is entirely determined by the polar part of $h^{\rm(int)}_{2,\mu}$
(which serves as input) and by $h_{1,\mu}$ (which by assumption has been
previously determined). Assuming that a VV modular form $h^{(0)}_{2,\mu}$ 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^{\rm(int)}_{2,\mu}$ of integer DT invariants via
(5.18). If no such VV modular form $h^{(0)}_{2,\mu}$ exists, or if the Fourier
coefficients of $h^{\rm(int)}_{2,\mu}$ 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}$.

###  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-$\overline{\rm 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^{\rm(p)}_{r,\mu}\stackrel{{\scriptstyle?}}{{=}}\mbox{q}^{-\frac{\chi(r\mathcal{D})}{24}+\frac{\mu^{2}}{2r\kappa}+\frac{r\mu}{2}}\sum_{n\in\mathds{Z}\;:\;\hat{q}_{0}>0}(-1)^{n+r\mu+\mathcal{I}_{r}+1}(\mathcal{I}_{r}-r\mu-n)\,DT(\mu,n)\,\mbox{q}^{n}.$
(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^{(0)}_{2,\mu}$ 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^{\rm(int)}_{2,\mu}$. 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{Y})=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 $\mathds{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 $\mathds{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-$\overline{\rm
D6}$ pairs with $1\leq N\leq 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{\rm
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{\rm
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{\rm 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{\rm 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-$\overline{\rm D6}$ pairs discussed above are also relevant for $r=1$. In
that case, a careful analysis of multi-centered configurations of D6 and
$\overline{\rm 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.

##  Appendix A Polar terms of vector valued modular forms

In this section, we determine the dimension of the space
$\mathscr{M}_{r}(\mathfrak{Y})$ of weakly holomorphic VV modular forms with
Fourier expansion of the form

$h^{(0)}_{r,\mu}=\sum_{n\geq 0}c_{\mu}(n)\,\mbox{q}^{n-\Delta_{\mu}}$ (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^{(0)}_{r,\mu}\in\mathscr{M}_{r}(\mathfrak{Y})$. For $r=1$,
$h^{(0)}_{1,\mu}$ 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^{(0)}_{r,\mu}$ is by assumption invariant under $\mu\mapsto\mu+m$ and
$\mu\mapsto-\mu$, it consists of $d=\lceil\frac{m+1}{2}\rceil$ independent
components. The number of polar terms is therefore given by

$n_{r}(\mathfrak{Y})=\sum_{\mu=0}^{d-1}\lceil\Delta_{\mu}\rceil.$ (A.2)

It will be useful to rewrite this formula as

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

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

$((x))=x-\frac{\lceil x\rceil+\lfloor
x\rfloor}{2}=\left\\{\begin{array}[]{ll}\xi-\frac{1}{2},&{\rm
if}\,\,x=\xi+\mathbb{Z},\,\,0<\xi<1,\\\ 0,&{\rm
if}\,\,x\in\mathbb{Z}.\end{array}\right.$ (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]

${\rm dim}\\!\left[\mathcal{S}_{2-w}(\bar{M})\right]-{\rm
dim}\\!\left[\mathcal{M}_{w}(M)\right]=A_{\rm s}+A_{\rm e}+A_{\rm p},$ (A.5)

where $A_{\rm s}$, $A_{\rm e}$ and $A_{\rm p}$ are the scalar, elliptic and
parabolic contributions which are given by

$\begin{split}A_{\rm s}=&\,\frac{1-w}{12}\,\chi_{M}(1),\\\ A_{\rm
e}=&\,-\frac{1}{4}\,{\rm
Re}\\!\left[e^{\frac{\pi\mathrm{i}w}{2}}\,\chi_{M}(S)\right]+\frac{2}{3\sqrt{3}}\,{\rm
Re}\\!\left[e^{\frac{\pi\mathrm{i}}{6}\,(2w-5)}\,\chi_{M}(ST)\right],\\\
A_{\rm
p}=&\,-\frac{1}{2}\,\mathcal{I}(M)-\sum_{\mu=0}^{d-1}((\Delta_{\mu})).\end{split}$
(A.6)

Here, $\chi_{M}(g)$ denotes the character $\mbox{Tr}M(g)$ of the action of
$g\in SL(2,\mathds{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_{\rm
e}$.

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

$G(n,m)=\sum_{\nu=1}^{m}e^{\frac{2\pi in\nu^{2}}{m}}.$ (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{\mathrm{i}m}}\begin{cases}1-e^{-\frac{\pi\mathrm{i}m}{2}}+\sum_{\nu=1}^{m/2}\left(e^{\frac{2\pi\mathrm{i}\nu^{2}}{m}}+e^{-\frac{2\pi\mathrm{i}\nu^{2}}{m}}\right),&m\
{\rm even},\\\
1+\sum_{\nu=1}^{(m-1)/2}\left(e^{\frac{2\pi\mathrm{i}\nu^{2}}{m}}+e^{-\frac{2\pi\mathrm{i}\nu^{2}}{m}}\right),&m\
{\rm odd},\end{cases}$ (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{\mathrm{i}m}}\,\Bigl{(}G(1,m)+G(1,m)^{*}\Bigr{)}.$
(A.9)

Using the well-known values for the Gauss sum $G(1,m)$ [76],

$\begin{split}G(1,m)=\left\\{\begin{array}[]{ll}(1+\mathrm{i})\sqrt{m},&m=0\\!\\!\mod
4,\\\ \sqrt{m},&m=1\\!\\!\mod 4,\\\ 0,&m=2\\!\\!\mod 4,\\\
\mathrm{i}\sqrt{m},&m=3\\!\\!\mod 4,\end{array}\right.\end{split}$ (A.10)

we arrive at

$\chi_{M}(S)=\left\\{\begin{array}[]{ll}(-1)^{\mathcal{I}_{r}}e^{-\frac{\pi\mathrm{i}}{4}},&m=0,1\\!\\!\mod
4,\\\ 0,&m=2,3\\!\\!\mod 4.\end{array}\right.$ (A.11)

Turning to $\chi_{M}(ST)$, we have

$\chi_{M}(ST)=\frac{(-1)^{\mathcal{I}_{r}}}{\sqrt{\mathrm{i}m}}\,e^{\frac{\pi\mathrm{i}}{4}\,mr^{2}+\frac{\pi\mathrm{i}}{12}\,rc_{2}}\begin{cases}1-(-1)^{\frac{mr}{2}}e^{-\frac{\pi\mathrm{i}m}{4}}+\sum_{\nu=1}^{m/2}(-1)^{r\nu}\left(e^{-\frac{\pi\mathrm{i}\nu^{2}}{m}}+e^{\frac{3\pi\mathrm{i}\nu^{2}}{m}}\right),&m\
{\rm even},\\\
1+\sum_{\nu=1}^{(m-1)/2}(-1)^{r\nu}\left(e^{-\frac{\pi\mathrm{i}\nu^{2}}{m}}+e^{\frac{3\pi\mathrm{i}\nu^{2}}{m}}\right),&m\
{\rm odd}.\end{cases}$ (A.12)

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

$\begin{split}\chi_{M}(ST)&=\frac{e^{\frac{\pi\mathrm{i}}{3}\,mr^{2}}}{2\sqrt{\mathrm{i}m}}\sum_{\nu=1}^{m}\left(e^{-\frac{\pi\mathrm{i}\nu^{2}}{m}}+e^{\frac{3\pi\mathrm{i}\nu^{2}}{m}}\right)=\frac{e^{\frac{\pi\mathrm{i}}{3}\,mr^{2}}}{4\sqrt{\mathrm{i}m}}\sum_{\nu=1}^{2m}\left(e^{-\frac{2\pi\mathrm{i}\nu^{2}}{2m}}+e^{\frac{6\pi\mathrm{i}\nu^{2}}{2m}}\right)\\\
&=\frac{e^{\frac{\pi\mathrm{i}}{3}\,mr^{2}}}{4\sqrt{\mathrm{i}m}}\,\Bigl{(}G(1,2m)^{*}+G(3,2m)\Bigr{)}.\end{split}$
(A.13)

Using the standard result for the Gauss sum

$G(3,m)=\left\\{\begin{array}[]{ll}\left\\{\begin{array}[]{ll}(-1)^{(m-4)/4}(1-\mathrm{i})\sqrt{m},&m=0\\!\\!\mod
4\\\ (-1)^{(m-1)/4}\sqrt{m},&m=1\\!\\!\mod 4,\\\ 0,&m=2\\!\\!\mod 4,\\\
(-1)^{(m-3)/4}\mathrm{i}\sqrt{m},&m=3\\!\\!\mod
4,\end{array}\right.\qquad\gcd(3,m)=1,\\\ 3\,G(1,m/3),\hskip
142.26378pt\begin{array}[]{c}\gcd(3,m)=3,\\\ m=0\\!\\!\mod
3,\end{array}\end{array}\right.$ (A.14)

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

$\begin{split}\chi_{M}(ST)&=\frac{e^{\frac{\pi\mathrm{i}}{3}\,mr^{2}}}{4\sqrt{\mathrm{i}m}}\left(\sqrt{2m}(1-\mathrm{i})+\left\\{\begin{array}[]{ll}\sqrt{6m}(1+\mathrm{i}),&\quad
m=0\\!\\!\mod 6\\\ \sqrt{2m}(1-\mathrm{i}),&\quad m=2\\!\\!\mod 6\\\
-\sqrt{2m}(1-\mathrm{i}),&\quad m=4\\!\\!\mod 6\end{array}\right.\right)\\\
&=e^{\frac{\pi\mathrm{i}}{3}\,mr^{2}}\left\\{\begin{array}[]{ll}e^{-\frac{\pi\mathrm{i}}{6}},&\quad
m=0\\!\\!\mod 6\\\ e^{-\frac{\pi\mathrm{i}}{2}},&\quad m=2\\!\\!\mod 6\\\
0,&\quad m=4\\!\\!\mod
6\end{array}\right.=\left\\{\begin{array}[]{ll}e^{-\frac{\pi\mathrm{i}}{6}},&\quad
m=0\\!\\!\mod 6,\\\ e^{\frac{\pi\mathrm{i}}{6}},&\quad m=2\\!\\!\mod 6,\\\
0,&\quad m=4\\!\\!\mod 6,\end{array}\right.\end{split}$ (A.15)

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

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

$\begin{split}\chi_{M}(ST)&=\frac{(-1)^{\mathcal{I}_{r}}}{\sqrt{\mathrm{i}m}}\,e^{\frac{\pi\mathrm{i}}{4}\,mr^{2}+\frac{\pi\mathrm{i}}{12}\,rc_{2}}\left(1+\sum_{\nu=1}^{(m-1)/2}(-1)^{r\nu}\left(e^{-\frac{\pi\mathrm{i}\nu^{2}}{m}}+e^{\frac{3\pi\mathrm{i}\nu^{2}}{m}}\right)\right).\end{split}$
(A.16)

Substitution of $\mathcal{I}_{r}$ (2.19) and evaluation for low values of $m$
suggests that this can be further simplified to

$\begin{split}\chi_{M}(ST)&=e^{\frac{\pi\mathrm{i}}{12}\,m(r^{2}-1)}\left\\{\begin{array}[]{ll}e^{-\frac{\pi\mathrm{i}}{6}},&\quad
m=1\\!\\!\mod 6,\\\ e^{\frac{\pi\mathrm{i}}{6}},&\quad m=3\\!\\!\mod 6,\\\
0,&\quad m=5\\!\\!\mod 6.\end{array}\right.\end{split}$ (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\mathds{Z}$ and we arrive at a result similar to (A.15)

$\chi_{M}(ST)=\left\\{\begin{array}[]{ll}e^{-\frac{\pi\mathrm{i}}{6}},&\quad
m=1\\!\\!\mod 6,\\\ e^{\frac{\pi\mathrm{i}}{6}},&\quad m=3\\!\\!\mod 6,\\\
0,&\quad m=5\\!\\!\mod 6.\end{array}\right.$ (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,

$\begin{split}&A_{\rm
e}=\left\\{\begin{array}[]{ll}\frac{1}{4}(-1)^{\mathcal{I}_{r}},&\quad
m=0,1\\!\\!\mod 4,\\\ 0,&\quad m=2,3\\!\\!\mod
4,\end{array}\right.\qquad+\left\\{\begin{array}[]{ll}-\frac{1}{3},&\quad
m=2,3\\!\\!\mod 6,\\\ 0,&\quad m=0,1,4,5\\!\\!\mod
6.\end{array}\right.\end{split}$ (A.19)

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

$C_{r}(\mathfrak{Y})=\frac{5d}{24}-\frac{1}{2}\,\mathcal{I}(M)-\sum_{\mu=0}^{d-1}((\Delta_{\mu}))+\frac{1}{4}\,(-1)^{\mathcal{I}_{r}}\left(\delta_{m}^{(4)}+\delta_{m-1}^{(4)}\right)-\frac{1}{3}\left(\delta_{m-2}^{(6)}+\delta_{m-3}^{(6)}\right),$
(A.20)

where we recall that $d=\lceil\frac{m+1}{2}\rceil$, $\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 $\mathscr{M}_{r}(\mathfrak{Y})$ is obtained
by subtracting the number of constraints (A.20) from the number of polar terms
(A.3):

$\dim\mathscr{M}_{r}(\mathfrak{Y})=\sum_{\mu=0}^{d-1}\Delta_{\mu}+\frac{7d}{24}-\frac{1}{4}(-1)^{\mathcal{I}_{r}}\left(\delta_{m}^{(4)}+\delta_{m-1}^{(4)}\right)+\frac{1}{3}\left(\delta_{m-2}^{(6)}+\delta_{m-3}^{(6)}\right).$
(A.21)

In particular, the dimension of $\mathscr{M}_{r}(\mathfrak{Y})$ 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{Y})$ and constraints
$C_{r}(\mathfrak{Y})$ for rank up to 10 (see Table 1 for $r=1,2$).

$\begin{array}[]{|l|rr|rr|rr|rr|rr|rr|rr|rr|}\hline\cr\mathfrak{Y}&n_{3}&C_{3}&n_{4}&C_{4}&n_{5}&C_{5}&n_{6}&C_{6}&n_{7}&C_{7}&n_{8}&C_{8}&n_{9}&C_{9}&n_{10}&C_{10}\\\
\hline\cr X_{5}&96&1&241&3&475&2&923&4&1549&4&2595&6&3928&6&5961&5\\\
X_{6}&44&1&105&0&197&2&378&3&608&3&1014&0&1497&3&2283&4\\\
X_{8}&32&1&65&1&117&1&203&0&333&2&519&3&774&3&1121&3\\\
X_{10}&11&0&26&1&37&0&71&1&98&1&165&1&217&1&336&1\\\
X_{4,2}&126&0&312&0&659&1&1254&1&2192&2&3600&1&5606&3&8370&2\\\
X_{4,4}&65&0&159&3&322&3&598&0&1033&4&1681&4&2591&1&3855&6\\\
X_{6,2}&77&1&177&3&349&2&637&0&1084&2&1749&4&2679&3&3960&6\\\
X_{6,4}&25&0&55&1&103&2&182&0&304&1&483&3&726&0&1066&3\\\
X_{6,6}&8&0&20&1&30&1&59&1&84&1&145&1&194&1&306&1\\\
X_{3,3}&237&3&627&1&1339&5&2650&7&4625&8&7770&2&12041&9&18292&12\\\
X_{4,2}&208&0&525&4&1125&6&2150&1&3793&6&6254&9&9768&2&14630&10\\\
X_{3,2,2}&399&3&1050&1&2325&6&4551&2&8127&9&13524&4&21285&11&32025&5\\\
X_{2,2,2,2}&650&1&1766&9&3970&10&7840&4&14106&14&23581&15&37230&7&56171&20\\\
\hline\cr\end{array}$ Table 2: The number of polar terms $n_{r}(\mathfrak{Y})$
and the number of constraints $C_{r}(\mathfrak{Y})$ for $3\leq r\leq 10$

##  Appendix 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\mathds{Z}$ with the discriminant group
$\Lambda^{*}/\Lambda=\mathds{Z}_{2\kappa}$. Thus, we simply need to find an
operator which maps modular forms from one Weil representation to 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{split}M_{\lambda\lambda^{\prime}}(T)=&\,e^{\pi\mathrm{i}\lambda^{2}}\,\delta_{\lambda\lambda^{\prime}},\\\
M_{\lambda\lambda^{\prime}}(S)=&\,\frac{1}{\sqrt{|A|}}\,e^{-\frac{\pi\mathrm{i}}{4}\,(b^{+}-b^{-})-2\pi\mathrm{i}(\lambda,\lambda^{\prime})}.\end{split}$
(B.1)

Then the vector

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

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

$\delta_{\kappa}(\mu,d)=\left\\{\begin{array}[]{ll}1&\mbox{if }\mu\in
A(d)\subseteq A(\kappa),\\\ 0&\mbox{otherwise,}\end{array}\right.$ (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_{a,d>0\atop
ad=\kappa}d^{-2}\sum_{b=0}^{d-1}\delta^{(1)}_{\mu/a}\,e^{\frac{\pi\mathrm{i}b}{2a\kappa}\,\mu^{2}}\phi_{\mu/a}\left(\frac{a\tau+b}{d}\right),$
(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}[\widehat{G}^{(1)}])_{\mu}=(\mathcal{T}_{\kappa}[G^{(1)}])_{\mu}+(\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu}.$
(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
$\widehat{G}^{(\kappa)}_{\mu}$. Provided the last term on the r.h.s. coincides
with $c_{\kappa}\Theta^{(\kappa)}_{\mu}$, the first term can then be
identified with $c_{\kappa}G^{(\kappa)}_{\mu}$ and the operator generating the
solution (5.13) can be taken to be
$\mathcal{T}^{\prime}_{\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{split}(\mathcal{T}_{\kappa}[\Theta^{(1)}])_{\mu}=&\,\frac{\kappa}{8\pi}\sum_{a,d>0\atop
ad=\kappa}\sum_{b=0}^{d-1}\delta^{(1)}_{\mu/a}\,e^{\frac{\pi\mathrm{i}b}{2a\kappa}\,\mu^{2}}\sum_{k\in
2\mathds{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\mathrm{i}}{2}\left(\frac{a\tau+b}{d}\right)k^{2}}\\\
=&\,\frac{1}{8\pi}\sum_{a|\kappa,\mu}\sum_{k\in
2\mathds{Z}+\frac{\mu}{a}}|ak|\,\beta_{\frac{3}{2}}\\!\left(\frac{\tau_{2}}{\kappa}\,(ak)^{2}\right)e^{-\frac{\pi\mathrm{i}\tau}{2\kappa}\,(ak)^{2}}\,\frac{a}{\kappa}\sum_{b=0}^{\frac{\kappa}{a}-1}e^{\frac{\pi\mathrm{i}b}{2a\kappa}\,(\mu^{2}-(ak)^{2})}.\end{split}$
(B.6)

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

$\frac{a}{\kappa}\sum_{b=0}^{\frac{\kappa}{a}-1}e^{\frac{\pi\mathrm{i}b}{2a\kappa}\,(\mu^{2}-(ak)^{2})}=\frac{a}{\kappa}\sum_{b=0}^{\frac{\kappa}{a}-1}e^{-2\pi\mathrm{i}b\,\frac{a}{\kappa}\,(\epsilon^{2}+\epsilon\mu/a)}=\delta^{(\kappa/a)}_{\epsilon(\epsilon+\mu/a)}.$
(B.7)

Thus, we arrive at the constraint

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

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

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

To proceed further, we need to find $\mathcal{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^{(\kappa)}_{0}$. On the other hand, for $1\leq\mu<\kappa$, $a=1$ and
the condition (B.8) has two solutions: $\epsilon=0$ and
$\epsilon=-\mu\mod\kappa$. Thus, (B.9) results in
$\Theta^{(\kappa)}_{\mu}+\Theta^{(\kappa)}_{-\mu}=2\Theta^{(\kappa)}_{\mu}$.
Hence, for all $\mu$ one obtains

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

Thus, one may simply take
$\mathcal{T}^{\prime}_{\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):

$\displaystyle(\mathcal{T}_{4}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
2\Theta^{(4)}_{\mu}+\delta^{(2)}_{\mu}(\Theta^{(4)}_{\mu}+\Theta^{(4)}_{\mu+4}),$
(B.11a) $\displaystyle(\mathcal{T}_{6}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
4\Theta^{(6)}_{\mu}-2\delta^{(2)}_{\mu+1}(\Theta^{(6)}_{\mu}-\Theta^{(6)}_{\mu+6}).$
(B.11b) $\displaystyle(\mathcal{T}_{8}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
2\Theta^{(8)}_{\mu}+2\delta^{(2)}_{\mu}(\Theta^{(8)}_{\mu}+\Theta^{(8)}_{\mu+8}),$
(B.11c) $\displaystyle(\mathcal{T}_{9}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
2\Theta^{(9)}_{\mu}+\delta^{(3)}_{\mu}(\Theta^{(9)}_{\mu}+\Theta^{(9)}_{\mu+6}+\Theta^{(9)}_{\mu+12}),$
(B.11d) $\displaystyle(\mathcal{T}_{12}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
4\Theta^{(12)}_{\mu}+2\delta^{(2)}_{\mu}(\Theta^{(12)}_{\mu}+\Theta^{(12)}_{\mu+12})$
$\displaystyle-2\left[\delta^{(4)}_{\mu+2}(\Theta^{(12)}_{\mu}-\Theta^{(12)}_{\mu+12})+\delta^{(6)}_{\mu+1}(\Theta^{(12)}_{\mu}-\Theta^{(12)}_{\mu+16})+\delta^{(6)}_{\mu+5}(\Theta^{(12)}_{\mu}-\Theta^{(12)}_{\mu+8})\right],$
$\displaystyle(\mathcal{T}_{16}[\Theta^{(1)}])_{\mu}$ $\displaystyle=$
$\displaystyle
2\Theta^{(16)}_{\mu}+2\delta^{(2)}_{\mu}(\Theta^{(16)}_{\mu}+\Theta^{(16)}_{\mu+16})+\delta^{(4)}_{\mu}(\Theta^{(16)}_{\mu}+\Theta^{(16)}_{\mu+8}+\Theta^{(16)}_{\mu+16}+\Theta^{(16)}_{\mu+24}).$
(B.11f)

Thus, unlike for prime $\kappa$, we cannot just take
$\mathcal{T}^{\prime}_{\kappa}$ to be proportional to $\mathcal{T}_{\kappa}$.
However, upon closer examination one can still find an operator
$\mathcal{T}^{\prime}_{\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\mathds{N}$ : $d^{2}$ divides
$\kappa$. Then the vector with components

$(\Sigma_{\kappa,d}[\theta])_{\mu}=\delta^{(d)}_{\mu}\sum_{n=0}^{d-1}\theta_{\mu+2n\kappa/d}$
(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\mathrm{i}}{2\kappa}\left(\mu+\frac{2n\kappa}{d}\right)^{2}}=e^{-\frac{\pi\mathrm{i}}{2\kappa}\mu^{2}-2\pi\mathrm{i}\left(\frac{n\mu}{d}+\frac{n^{2}\kappa}{d^{2}}\right)}=e^{-\frac{\pi\mathrm{i}}{2\kappa}\mu^{2}},$
(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

$\displaystyle\frac{\sqrt{\mathrm{i}}}{\sqrt{2\kappa}}\,\delta^{(d)}_{\mu}\sum_{n=0}^{d-1}\sum_{\nu=0}^{2\kappa-1}e^{\frac{\pi\mathrm{i}\nu}{\kappa}\left(\mu+\frac{2n\kappa}{d}\right)}\,\theta_{\nu}=\frac{\sqrt{\mathrm{i}}}{\sqrt{2\kappa}}\,\sum_{m=0}^{d-1}e^{2\pi\mathrm{i}\mu\frac{m}{d}}\sum_{\nu=0}^{2\kappa-1}e^{\frac{\pi\mathrm{i}\nu}{\kappa}\mu}\,\delta^{(d)}_{\nu}\,\theta_{\nu}$
(B.14) $\displaystyle=$
$\displaystyle\frac{\sqrt{\mathrm{i}}}{\sqrt{2\kappa}}\,\sum_{\nu=0}^{2\kappa-1}\delta^{(d)}_{\nu}\sum_{m=0}^{d-1}e^{\frac{\pi\mathrm{i}\nu}{\kappa}\mu}\,\theta_{\nu-2m\kappa/d}=\sum_{\nu=0}^{2\kappa-1}M^{(\kappa)}_{\mu\nu}(S)(\Sigma_{\kappa,d}[\theta])_{\nu},$

which confirms the correct transformation. ∎

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

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

where

$\displaystyle(\mathcal{T}^{\prime}_{\kappa}[\phi])_{\mu}$ $\displaystyle=$
$\displaystyle{1\over
2}\,(\mathcal{T}_{\kappa}[\phi])_{\mu},\qquad\kappa\mbox{ --- prime},$ (B.16a)
$\displaystyle(\mathcal{T}^{\prime}_{4}[\phi])_{\mu}$ $\displaystyle=$
$\displaystyle{1\over
2}\,(\mathcal{T}_{4}[\phi])_{\mu}-\frac{1}{8}\left(\Sigma_{4,2}[\mathcal{T}_{4}[\phi]]\right)_{\mu},$
(B.16b) $\displaystyle(\mathcal{T}^{\prime}_{8}[\phi])_{\mu}$ $\displaystyle=$
$\displaystyle{1\over
2}\,(\mathcal{T}_{8}[\phi])_{\mu}-\frac{1}{6}\left(\Sigma_{8,2}[\mathcal{T}_{8}[\phi]]\right)_{\mu},$
(B.16c) $\displaystyle(\mathcal{T}^{\prime}_{9}[\phi])_{\mu}$ $\displaystyle=$
$\displaystyle{1\over
2}\,(\mathcal{T}_{9}[\phi])_{\mu}-\frac{1}{10}\left(\Sigma_{9,3}[\mathcal{T}_{9}[\phi]]\right)_{\mu},$
(B.16d) $\displaystyle(\mathcal{T}^{\prime}_{16}[\phi])_{\mu}$
$\displaystyle=$ $\displaystyle{1\over
2}\,(\mathcal{T}_{16}[\phi])_{\mu}-\frac{1}{6}\left(\Sigma_{16,2}[\mathcal{T}_{16}[\phi]]\right)_{\mu}-\frac{1}{60}\left(\Sigma_{16,4}[\mathcal{T}_{16}[\phi]]\right)_{\mu}.$
(B.16e)

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

$(\mathcal{T}^{\prime}_{\kappa}[\phi])_{\mu}={1\over 2}\sum_{n=0}^{\lfloor
m/2\rfloor}c_{\kappa,n}\left(\Sigma_{\kappa,p^{n}}[\mathcal{T}_{\kappa}[\phi]]\right)_{\mu}$
(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}^{\prime}_{\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.11) do transform with the
proper multiplier system (5.5), it turns out that these equations cannot be
solved for $\Theta^{(\kappa)}_{\mu}$ because (B.11b) does not depend on
$\Theta^{(6)}_{1}-\Theta^{(6)}_{7}$, while (B.11) does not involve
$\Theta^{(12)}_{1}-\Theta^{(12)}_{7}$ and
$\Theta^{(12)}_{5}-\Theta^{(12)}_{11}$. 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.

##  Appendix 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.

### $\mathbf{X_{5}}$

The lowest DT invariants are as follows (extending the table in [20]):

${\scriptsize\begin{array}[]{|c|cccccccc}\hline\cr Q\backslash
n&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&1&200&19500&1234000\\\
1&0&0&0&2875&569250&54921125\\\ 2&0&0&0&609250&124762875&12448246500\\\
3&0&0&609250&439056375&76438831000&7158676736750\\\
4&8625&2294250&4004590375&1010473893000&123236265797125&9526578133835000\\\
\hline\cr\end{array}}$

The generating function is found to be161616Here and below it is understood
that the argument $z$ of the theta function $\vartheta^{(\kappa,1)}_{\mu}$
defined in (3.4) is set to zero after taking derivative. The Fourier expansion
is given only for the components with $0\leq\mu\leq\kappa/2$ as the other
components are fixed by the symmetry $h_{1,\mu}=h_{1,-\mu}$.

$\begin{split}h_{1,\mu}=&\,-\frac{1}{2\pi\eta^{70}}\left[-\frac{222887E_{4}^{8}+1093010E_{4}^{5}E_{6}^{2}+177095E_{4}^{2}E_{6}^{4}}{35831808}\right.\\\
&\,+\frac{25\left(458287E_{4}^{6}E_{6}+967810E_{4}^{3}E_{6}^{3}+66895E_{6}^{5}\right)}{53747712}\,D\\\
&\,\left.+\frac{25\left(155587E_{4}^{7}+1054810E_{4}^{4}E_{6}^{2}+282595E_{4}E_{6}^{4}\right)}{8957952}\,D^{2}\right]\partial_{z}\vartheta^{(5,1)}_{\mu},\end{split}$
(C.1)

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

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

### $\mathbf{X_{6}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|ccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&204&20298&1311584\\\
1&0&0&0&0&7884&1592568&156836412\\\
2&0&0&0&7884&7636788&1408851522&136479465324\\\
3&6&1836&266526&169502712&43151185260&5487789706776&440955379766460\\\
4&-47304&-24852636&6684091812&3616211898459&597179528504352&56820950585055180&3715523804755065780\\\
\hline\cr\end{array}}$

The generating function is found to be

$\begin{split}h_{1,\mu}=&\,-\frac{1}{2\pi\eta^{54}}\left[\frac{7E_{4}^{6}+58E_{4}^{3}E_{6}^{2}+7E_{6}^{4}}{216}+\frac{5E_{4}^{4}E_{6}+3E_{4}E_{6}^{3}}{2}\,D\right]\partial_{z}\vartheta^{(3,1)}_{\mu},\end{split}$
(C.3)

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

$\begin{split}h_{1,0}=&\,\mbox{q}^{-\frac{15}{8}}\left(\underline{-4_{0}+612_{1}\mbox{q}}-40392\mbox{q}^{2}+146464860q^{3}+66864926808\mbox{q}^{4}+\dots\right),\\\
h_{1,1}=&\,\mbox{q}^{-\frac{15}{8}+\frac{2}{3}}\left(\underline{0_{0}-15768_{1}\mbox{q}}+7621020\mbox{q}^{2}+10739279916\mbox{q}^{3}+1794352963536\mbox{q}^{4}+\dots\right).\end{split}$
(C.4)

### $\mathbf{X_{8}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccc}\hline\cr Q\backslash
n&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&1&296&43068&4104336\\\
1&0&0&0&29504&8674176&1253300416\\\
2&6&2664&564332&204456696&45540821914&6127608486208\\\
3&-177024&-69481920&8775447296&6313618655104&1225699503521536&141978726005461504\\\
\hline\cr\end{array}}$

The generating function is found to be

$\begin{split}h_{1,\mu}=&\,\frac{1}{\eta^{52}}\left[\frac{103E_{4}^{6}+1472E_{4}^{3}E_{6}^{2}+153E_{6}^{4}}{5184}+\frac{503E_{4}^{4}E_{6}+361E_{4}E_{6}^{3}}{108}\,D\right]\vartheta^{(2,1)}_{\mu},\end{split}$
(C.5)

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

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

### $\mathbf{X_{10}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|ccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&288&40752&3774912\\\
1&0&0&3&1150&435827&89103872&11141118264\\\
2&-12&-5181&-1529746&-64916198&40225290446&9325643249563&1112733511380100\\\
\hline\cr\end{array}}$

The generating function is found to be†

$\begin{split}h_{1,0}=&\,\frac{541E_{4}^{4}+1187E_{4}E_{6}^{2}}{576\,\eta^{35}}\\\
=&\,\mbox{q}^{-\frac{35}{24}}\Bigl{(}\underline{3_{0}-576_{1}q}+271704\mbox{q}^{2}+206401533\mbox{q}^{3}+21593767647\mbox{q}^{4}+\cdots\Bigr{)},\end{split}$
(C.7)

where we took into account that
$\partial_{z}\vartheta^{(1,1)}_{0}(\tau,0)=-2\pi\eta^{3}(\tau)$. This result
agrees with [17, Eq.(2.12)].171717It 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 1, it is in fact confirmed by the mathematical results of
[56], hence we have marked (C.7) with a $\dagger$. The correct expansion can
be found in [21, (5.10)].

### $\mathbf{X_{4,3}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccccccc}\hline\cr Q\backslash
n&-6&-5&-4&-3&-2&-1&0&1&2\\\ \hline\cr 0&0&0&0&0&0&0&1&156&11778\\\
1&0&0&0&0&0&0&0&1944&299376\\\ 2&0&0&0&0&0&0&27&227772&36634842\\\
3&0&0&0&0&0&0&161248&89961744&12314066208\\\
4&0&0&0&0&81&240408&418646475&90148651920&9065616005898\\\
5&0&0&0&5832&1100304&3996193968&7007431566096&1058781525672312&79955621660025792\\\
6&10&2496&275273&-21407812&69458828969&32461114565928&5111995215726463&460091731369849584&28020271480178497520\\\
\hline\cr\end{array}}$

The generating function is found to be†

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

and has the following expansion:†

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

### $\mathbf{X_{4,4}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccccc}\hline\cr Q\backslash
n&-4&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&0&1&144&10008&446304\\\
1&0&0&0&0&0&3712&527104&36091776\\\
2&0&0&0&0&1408&1185216&160488768&11145152320\\\
3&0&0&0&3712&7495680&1728263936&172767389440&10375330097920\\\
4&6&1296&112296&153732336&48667802732&6124054838960&444235976561624&21742669957124080\\\
\hline\cr\end{array}}$

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.$
(C.10)

The resulting generating function is found to be

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

and has the following expansion:

$\begin{split}h_{1,0}=&\,\mbox{q}^{-\frac{44}{24}}\left(\underline{-4_{0}+432_{1}\mbox{q}}-10032\mbox{q}^{2}+148611456\mbox{q}^{3}+53495321332\mbox{q}^{4}+\dots\right),\\\
h_{1,1}=&\,\mbox{q}^{-\frac{44}{24}+\frac{5}{8}}\left(\underline{0_{0}-7424_{1}\mbox{q}}+7488256\mbox{q}^{2}+7149513728\mbox{q}^{3}+1104027086592\mbox{q}^{4}+\dots\right),\\\
h_{1,2}=&\,\mbox{q}^{-\frac{44}{24}+\frac{1}{2}}\left(\underline{0_{-1}-2816_{0}\mbox{q}}+2167680\mbox{q}^{2}+3503031296\mbox{q}^{3}+619015800576\mbox{q}^{4}+\dots\right).\end{split}$
(C.12)

### $\mathbf{X_{6,2}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccccc}\hline\cr Q\backslash
n&-4&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&0&1&256&32128&2633216\\\
1&0&0&0&0&0&4992&1267968&157842048\\\
2&0&0&0&-4&-1536&2129180&592221184&76687779936\\\
3&0&0&0&14976&5071872&3527640064&784442776832&94963960029952\\\
4&10&4096&810898&87634944&84783721868&25072077880832&3730330724940930&357859766301860864\\\
\hline\cr\end{array}}$

The generating function is found to be†

$\begin{split}h_{1,\mu}=&\,\frac{1}{\eta^{68}}\left[-\frac{994693E_{4}^{8}+4317814E_{4}^{5}E_{6}^{2}+2152453E_{4}^{2}E_{6}^{4}}{161243136}\right.\\\
&\,+\frac{1974661E_{4}^{6}E_{6}+5095030E_{4}^{3}E_{6}^{3}+395269E_{6}^{5}}{4478976}\,D\\\
&\,\left.+\frac{738373E_{4}^{7}+5203702E_{4}^{4}E_{6}^{2}+1522885E_{4}E_{6}^{4}}{559872}\,D^{2}\right]\vartheta^{(4,1)}_{\mu},\end{split}$
(C.13)

and has the following expansion:†††As indicated in the note on page 1, the
ansatz (4.10) fails to give the correct polar terms for this model, so these
results should not be trusted.

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

### $\mathbf{X_{6,4}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|ccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&156&11778&572416\\\
1&0&0&0&8&16800&2489232&182945216\\\
2&0&3&608&315828&71744924&7624177244&492335041044\\\
3&-48&-72184&26107984&10989768672&1476019954080&112615254328992&5813857713864192\\\
\hline\cr\end{array}}$

The generating function is found to be†

$\begin{split}h_{1,\mu}=&\,\frac{1}{\eta^{40}}\left[-\frac{509E_{4}^{3}E_{6}+139E_{6}^{3}}{2592}-\frac{233E_{4}^{4}+415E_{4}E_{6}^{2}}{108}\,D\right]\vartheta^{(2,1)}_{\mu},\end{split}$
(C.15)

and has the following expansion:†

$\begin{split}h_{1,0}=&\,\mbox{q}^{-\frac{34}{24}}\left(\underline{3_{0}-312_{1}\mbox{q}}+269343\mbox{q}^{2}+133568456\mbox{q}^{3}+12400947182\mbox{q}^{4}+\dots\right),\\\
h_{1,1}=&\,\mbox{q}^{-\frac{34}{24}+\frac{3}{4}}\left(\underline{-16_{0}}+31904\mbox{q}+36568960\mbox{q}^{2}+4364805376\mbox{q}^{3}+226013798816\mbox{q}^{4}+\dots\right).\end{split}$
(C.16)

### $\mathbf{X_{6,6}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|ccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&120&6900&252400\\\
1&0&0&1&482&117445&10668592&545062022\\\
2&-6&-1684&130808&67782432&7543637572&456342386980&18275307362778\\\
\hline\cr\end{array}}$

The generating function is found to be

$\begin{split}h_{1,0}=&\,-\frac{2E_{4}E_{6}}{\eta^{23}}\\\
=&\,\mbox{q}^{-\frac{23}{24}}\left(-\underline{2_{0}}+482\mbox{q}+282410\mbox{q}^{2}+16775192\mbox{q}^{3}+460175332\mbox{q}^{4}+\dots\right).\end{split}$
(C.17)

### $\mathbf{X_{3,3}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|ccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&144&10008&446304\\\
1&0&0&0&0&1053&149526&10238319\\\ 2&0&0&0&0&52812&8053182&591031890\\\
3&0&0&0&3402&6914214&1001912544&71961634872\\\
4&0&0&0&5520393&1937967282&225717793668&14749020131814\\\
5&0&0&5520393&5626721862&1006811225253&88682916004956&4943255069504250\\\
6&10206&8383878&24521163804&6662846868372&768849614982540&52757172850669686&2484705136566066336\\\
\hline\cr\end{array}}$

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.$
(C.18)

The resulting generating function is found to be

$\begin{split}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.\\\
&\,+\frac{289326E_{4}^{10}+415189E_{4}^{7}E_{6}^{2}-3458324E_{4}^{4}E_{6}^{4}-729839E_{4}E_{6}^{6}}{334430208}\,D\\\
&\,+\frac{2261629E_{4}^{8}E_{6}+3219046E_{4}^{5}E_{6}^{3}-6371E_{4}^{2}E_{6}^{5}}{30965760}\,D^{2}\\\
&\,-\frac{94271E_{4}^{9}+1496733E_{4}^{6}E_{6}^{2}+1342665E_{4}^{3}E_{6}^{4}+52315E_{6}^{6}}{5160960}\,D^{3}\\\
&\,\left.-\frac{162167E_{4}^{7}E_{6}+300338E_{4}^{4}E_{6}^{3}+35159E_{4}E_{6}^{5}}{286720}\,D^{4}\right]\partial_{z}\vartheta^{(9,1)}_{\mu},\end{split}$
(C.19)

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

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

### $\mathbf{X_{4,2}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccc}\hline\cr Q\backslash
n&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&1&176&15048&831776\\\
1&0&0&0&1280&222720&18814720\\\ 2&0&0&0&92288&16876672&1497331072\\\
3&0&0&2560&16105728&2880650752&252911493632\\\
4&-8&-2112&17161392&6933330304&961734375064&75838156759744\\\
\hline\cr\end{array}}$

Our Ansatz (4.10) implies the following polar terms

$\begin{split}h^{\rm(p)}_{1,0}=&\,\mbox{q}^{-\frac{8}{3}}\left({-6_{0}+880_{1}\mbox{q}-60192_{2}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,1}=&\,\mbox{q}^{-\frac{8}{3}+\frac{9}{16}}\left({0_{0}-5120_{1}\mbox{q}+668160_{2}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,2}=&\,\mbox{q}^{-\frac{8}{3}+\frac{1}{4}}\left({0_{-1}+0_{0}\mbox{q}+276864_{1}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,3}=&\,\mbox{q}^{-\frac{8}{3}+\frac{1}{16}}\left({0_{-2}+0_{-1}\mbox{q}+7680_{0}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,4}=&\,\mbox{q}^{-\frac{8}{3}}\left({0_{-3}+32_{-2}\mbox{q}-6336_{-1}\mbox{q}^{2}}\right).\end{split}$
(C.21)

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

$\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)\\\
&-\frac{9}{64}\,DT(3,0)-\frac{1}{8}\,DT(4,-1)+\frac{1}{3}\,DT(4,-2)=0.\end{split}$
(C.22)

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^{\rm(p)}_{1,4}$ in (C.21) by

$h^{\rm(p)}_{1,4}=\mbox{q}^{-\frac{8}{3}}\left({0_{-3}+(32+k)_{-2}\mbox{q}-(2152+2k)_{-1}\mbox{q}^{2}}\right),\qquad
k\in\mathds{Z},$ (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.

### $\mathbf{X_{3,2,2}}$

The lowest DT invariants are as follows:

${\scriptsize\begin{array}[]{|c|cccccccccc}\hline\cr Q\backslash
n&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&1&144&10008&446304\\\
1&0&0&0&0&720&102240&7000560\\\ 2&0&0&0&0&22428&3443616&254303604\\\
3&0&0&0&64&1620720&245622240&18019908288\\\
4&0&0&0&265113&206421552&27955859922&1957624164576\\\
5&0&0&10080&199558944&50497608240&5249855378592&323810241865488\\\
6&-56&-12096&179713440&115538513824&18048558130992&1472617884239424&78052676370951268\\\
\hline\cr\end{array}}$

Our Ansatz (4.10) implies the following polar terms

$\begin{split}h^{\rm(p)}_{1,0}=&\,\mbox{q}^{-3}\left({7_{0}-864_{1}\mbox{q}+50040_{2}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,1}=&\,\mbox{q}^{-3+\frac{13}{24}}\left({0_{0}+3600_{1}\mbox{q}-408960_{2}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,2}=&\,\mbox{q}^{-3+\frac{1}{6}}\left({0_{-1}+0_{0}\mbox{q}-89712_{1}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,3}=&\,\mbox{q}^{-3+\frac{7}{8}}\left({0_{-1}-256_{0}\mbox{q}+4862160_{1}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,4}=&\,\mbox{q}^{-3+\frac{2}{3}}\left({0_{-2}+0_{-1}\mbox{q}+795339_{0}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,5}=&\,\mbox{q}^{-3+\frac{13}{24}}\left({0_{-3}+0_{-2}\mbox{q}+30240_{-1}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,6}=&\,\mbox{q}^{-3+\frac{1}{2}}\left({0_{-4}+224_{-3}\mbox{q}-36288_{-2}\mbox{q}^{2}}\right).\end{split}$
(C.24)

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

$\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)\\\
&+\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}$
(C.25)

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^{\rm(p)}_{1,6}$ in (C.24) by

$h^{\rm(p)}_{1,6}=\mbox{q}^{-3+\frac{1}{2}}\left({0_{-4}+(224+k)_{-3}\mbox{q}-12096_{-2}\mbox{q}^{2}}\right),\qquad
k\in\mathds{Z},$ (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:

${\scriptsize\begin{array}[]{|c|cccccccc}\hline\cr Q\backslash
n&-4&-3&-2&-1&0&1&2&3\\\ \hline\cr 0&0&0&0&0&1&128&7872&308992\\\
1&0&0&0&0&0&512&64512&3900928\\\ 2&0&0&0&0&0&9728&1356544&90337792\\\
3&0&0&0&0&0&416256&57428992&3811304448\\\
4&0&0&0&0&14752&27592192&3615258880&233963061760\\\
5&0&0&0&0&8782848&3089741312&334005965824&19901940605440\\\
6&0&0&0&1427968&2857640448&528800790528&44911222707968&2345453425978368\\\
7&0&0&86016&2451858432&934638858240&116559621707264&8004013269150720&363671494077060608\\\
8&-672&-129024&2392944768&1945381563648&356833378589872&32067803814853376&1801967963699774848&71093859294029974016\\\
\hline\cr\end{array}}$

Our Ansatz (4.10) implies the following polar terms

$\begin{split}h^{\rm(p)}_{1,0}=&\,\mbox{q}^{-\frac{10}{3}}\left({-8_{0}+896_{1}\mbox{q}-47232_{2}\mbox{q}^{2}+1544960_{3}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,1}=&\,\mbox{q}^{-\frac{10}{3}+\frac{17}{32}}\left({0_{0}-3072_{1}\mbox{q}+322560_{2}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,2}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{8}}\left({0_{-1}+0_{0}\mbox{q}+48640_{1}\mbox{q}^{2}-5426176_{2}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,3}=&\,\mbox{q}^{-\frac{10}{3}+\frac{25}{32}}\left({0_{-1}+0_{0}\mbox{q}-1665024_{1}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,4}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{2}}\left({0_{-2}+0_{-1}\mbox{q}-59008_{0}\mbox{q}^{2}}\right),\\\
h^{\rm(p)}_{1,5}=&\,\mbox{q}^{-\frac{10}{3}+\frac{9}{32}}\left({0_{-3}+0_{-2}\mbox{q}+0_{-1}\mbox{q}^{2}+26348544_{0}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,6}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{8}}\left({0_{-4}+0_{-3}\mbox{q}+0_{-2}\mbox{q}^{2}+4283904_{-1}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,7}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{32}}\left({0_{-5}+0_{-4}\mbox{q}+0_{-3}\mbox{q}^{2}+258048_{-2}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,8}=&\,\mbox{q}^{-\frac{10}{3}}\left({0_{-6}+0_{-5}\mbox{q}+2688_{-4}\mbox{q}^{2}-387072_{-3}\mbox{q}^{3}}\right).\end{split}$
(C.27)

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^{\rm(p)}_{1,\mu}$ with $\mu=6,7,8$ for such a solution to
exist. For example, if one replaces these functions in (C.27) by

$\begin{split}h^{\rm(p)}_{1,6}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{8}}\left({0_{-4}+0_{-3}\mbox{q}+0_{-2}\mbox{q}^{2}+(2674832+440k)_{-1}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,7}=&\,\mbox{q}^{-\frac{10}{3}+\frac{1}{32}}\left({0_{-5}+0_{-4}\mbox{q}+0_{-3}\mbox{q}^{2}-(469056-32k)_{-2}\mbox{q}^{3}}\right),\\\
h^{\rm(p)}_{1,8}=&\,\mbox{q}^{-\frac{10}{3}}\left({0_{-6}+0_{-5}\mbox{q}+(2690+23k)_{-4}\mbox{q}^{2}-(366336+128k)_{-3}\mbox{q}^{3}}\right),\qquad
k\in\mathds{Z},\end{split}$ (C.28)

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.

##  Appendix D Comparison with mathematical results

In [56], explicit formulae for rank 0 DT invariants are proven for any smooth
polarized CY threefold $\mathfrak{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 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

$(\operatorname{ch}_{0},\operatorname{ch}_{1},\operatorname{ch}_{2},\operatorname{ch}_{3})(v)=(0,D,\beta,m)\equiv
v$ (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}}\,,$ (D.2)

where $H=c_{1}(\mathcal{O}_{\mathfrak{Y}}(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)\geq 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}}$ (D.3)

then the DT invariant counting $H$-Gieseker semistable sheaves of class $v$ is
given by the explicit formula181818In 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)={\mathrm{I}}_{n,\beta}$ and
$PT(\beta\cdot\omega_{a},n)={\mathrm{P}}_{n,\beta}$ where $\omega_{a}$ is a
basis in $H^{2}(\mathfrak{Y},\mathds{Z})$.

$J(v)=\left(\sharp H^{2}(\mathfrak{Y},\mathds{Z})_{\rm
tors}\right)^{2}\sum_{v_{1}+v_{2}=v\atop 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}),$
(D.4)

where

$\begin{split}v_{1}=&\,e^{D_{1}}(1,0,-\beta_{1},-n_{1}),\\\
v_{2}=&\,-e^{D_{2}}(1,0,-\beta_{2},n_{2}),\end{split}$ (D.5)

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

$\displaystyle\chi(E,E^{\prime})$ $\displaystyle=$
$\displaystyle\int_{\mathfrak{Y}}\operatorname{ch}(E^{*})\operatorname{ch}(E^{\prime})\,\operatorname{Td}\mathfrak{Y}$
$\displaystyle=$
$\displaystyle\operatorname{ch}_{0}\left(\operatorname{ch}^{\prime}_{3}+\frac{1}{12}\,c_{2}(T\mathfrak{Y})\operatorname{ch}^{\prime}_{1}\right)-\operatorname{ch}^{\prime}_{0}\left(\operatorname{ch}_{3}+\frac{1}{12}\,c_{2}(T\mathfrak{Y})\operatorname{ch}_{1}\right)-\operatorname{ch}_{1}\operatorname{ch}^{\prime}_{2}+\operatorname{ch}_{2}\operatorname{ch}^{\prime}_{1},$

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\mathrm{i}Q_{a}\xi^{a}}q^{n}=[M(-q)]^{-\chi_{\scriptstyle\mathfrak{Y}}}Z_{DT}(\xi^{a},q).$
(D.7)

The sum in (D.4) runs over $(D_{i},\beta_{i},n_{i})$, $i=1,2$ satisfying the
inequalities

$\begin{split}&\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}}\leq\frac{D\cdot
H^{2}-2}{2(H^{3})^{2}}\,,\\\ &\qquad\qquad n_{i}\geq-\frac{D\cdot H^{2}(D\cdot
H^{2}+H^{3})}{6(H^{3})^{2}}\,.\end{split}$ (D.8)

By the Grothendieck-Lefschetz theorem (see e.g. [82, Ch. IV]),
$H^{2}(\mathfrak{Y},\mathds{Z})$ is torsion free for any complete intersection
in a smooth projective variety, so the prefactor $\left(\sharp
H^{2}(\mathfrak{Y},\mathds{Z})_{\rm tors}\right)^{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{Y},\mathds{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{split}D=&\,rH,\qquad\qquad\qquad\beta\cdot H=-\mu-\frac{\kappa
r^{2}}{2}\,,\qquad m=\frac{\kappa r^{3}}{6}-n,\\\
D_{i}=&\,(-1)^{i-1}r_{i}H,\qquad\ \beta_{i}\cdot H=m_{i},\end{split}$ (D.9)

with $H^{3}=\kappa$, such that

$Q_{H}(v)=\frac{12}{\kappa
r}\left(\frac{\chi(r\mathcal{D})}{24}-\hat{q}_{0}\right),$ (D.10)
$\chi(v_{1},v_{2})=\mathcal{I}_{r}-r(m_{1}+m_{2})-n_{1}-n_{2}\equiv-\gamma_{12}.$
(D.11)

The bound $Q_{H}(v)\geq 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}}\,.$ (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}\leq 0\,,$ (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{split}r_{1}+r_{2}=&\,r,\\\ m_{1}-m_{2}=&\,\mu+\kappa rr_{1},\\\
n_{1}+n_{2}=&\,n-r_{1}m_{1}-r_{2}m_{2}-\frac{\kappa}{2}\,rr_{1}r_{2}.\end{split}$
(D.14)

The first two equations admit an integer solution for $r_{1},r_{2}$ provided

$m_{1}-m_{2}=\mu\mod\kappa r$ (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}\,\Bigl{(}\mu^{2}-(m_{1}-m_{2})^{2}+\kappa
r^{2}(\mu-m_{1}-m_{2})\Bigr{)}.$ (D.16)

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

$m_{i}\leq\frac{r}{2}-\frac{1}{\kappa}\,,\qquad
n_{i}\geq-\frac{1}{6}\,r(r+1)\,.$ (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}),$
(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}\geq 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