Comments on the holographic description of Narain theories

We discuss the holographic description of Narain $U(1)^c\times U(1)^c$ conformal field theories, and their potential similarity to conventional weakly coupled gravity in the bulk, in the sense that the effective IR bulk description includes"$U(1)$ gravity"amended with additional light degrees of freedom. Starting from this picture, we formulate the hypothesis that in the large central charge limit the density of states of any Narain theory is bounded by below by the density of states of $U(1)$ gravity. This immediately implies that the maximal value of the spectral gap for primary fields is $\Delta_1=c/(2\pi e)$. To test the self-consistency of this proposal, we study its implications using chiral lattice CFTs and CFTs based on quantum stabilizer codes. First we notice that the conjecture yields a new bound on quantum stabilizer codes, which is compatible with previously known bounds in the literature. We proceed to discuss the variance of the density of states, which for consistency must be vanishingly small in the large-$c$ limit. We consider ensembles of code and chiral theories and show that in both cases the density variance is exponentially small in the central charge.


Introduction
The conventional picture of the holographic correspondence equates quantum gravity in AdS 3 with a 2d CFT at the boundary. In this correspondence, an individual conformal theory is dual to a particular theory of gravity, while many theories of gravity are expected to be similar in the IR. A particularly interesting question would be to find the holographic dual to pure gravity in AdS 3 , a hypothetical UV completion of the quasi-classical Einstein theory. An attempt to evaluate the partition function of this theory yields negative level degeneracies and a continuous spectrum [1,2], suggesting that it is not dual to any specific CFT. More recently these problems have been at least partially addressed by adding additional states to the bulk description [3][4][5][6]. This is consistent with the conventional expectation that certain large central charge c 1 theories would be described by a combination of quasi-classical gravity and additional matter fields. Using modular invariance of the CFT partition function, Hartman, Keller and Stoica [7] have shown that as long as these additional states contribute at subleading order in 1/c to the entropy at large temperatures β < 2π, the spectrum of CFT light states must be sparse ρ(∆) ≤ e 2π∆ , 0 < ∆ ≤ c/12. which matches the density of states of the BTZ black hole, suggesting that the gravity dual is a theory of quasiclassical gravity plus o(c) additional matter fields. To reiterate, the conventional picture is that sparse 2d CFTs with large central charge are expected to be dual to quasiclassical gravity with some additional fields. This simple picture immediately implies a bound on the maximal value of the spectral gap in large-c CFTs, ∆ 1 ≤ c/12. Indeed, for ∆ 1 ≥ c/12, the theory is automatically sparse. Once we assume it is dual to quasiclassical gravity, no additional matter can prevent black hole formation at energies exceeding the BTZ threshold E = ∆ − c/12 > 0. Thus for ∆ > c/12 there must be CFT states dual to black hole microstates and one obtains ρ(∆) ≥ ρ Cardy > 0 for ∆ > c/12 in sparse large-c theories. We emphasize that this picture is an unproven but widely expected hypothesis.
An indirect validation of this conventional picture could come from an independent proof that ∆ 1 ≤ c/12 in large c theories. This problem has been attacked using the modular conformal bootstrap approach, starting with the bound set by Hellerman ∆ 1 ≤ c/6 + O(1) [8][9][10][11]. So far the best asymptotic bound ∆ 1 c/9.1 [12] falls short of the desired value, which could indicate either a flaw in the general picture or the relevance of other CFT consistency conditions beyond modular invariance to ensure a tight bound on the spectral gap.
Recently a few novel examples of the holographic correspondence in the context of JT gravity [13] and Narain CFTs [14,15] suggest that gravity in the bulk is dual not to a particular boundary theory, but to an average over an ensemble of such theories. In retrospect this may explain the continuous spectrum of pure gravity in AdS 3 , which could arise from such an average. At the same time there are other examples of holographic correspondences, starting from the original N = 4 SYM in the 4d dual to IIB SUGRA on AdS 5 × S 5 , which seem to leave no room for an ensemble interpretation.
In our opinion these two scenarios for holographic correspondences are not inconsistent. Rather we will advocate a scenario in which each individual CFT is dual to some theory of quantum gravity in the bulk, and moreover, averaging over particular ensembles of boundary theories may also have a local description in the bulk. The goal of this paper is to discuss the consistency of this picture for Narain theories namely, that individual Narian CFTs can be described as "pure" U (1) gravity plus additional matter fields, where by pure U (1) gravity (in the notation of [14]) we mean the perturbative sector of U (1) c × U (1) c Chern-Simons theory in the bulk, which is dual to the average over all Narain theories. We repeat the analysis of Hartman, Keller and Stoica for Narain theories and find the sparseness condition to be where by (∆) we understand the density of U (1) c × U (1) c primary states. Provided this condition is satisfied, at leading order in 1/c the density of states is then given by the analog of the Cardy formula [16] N for all ∆ ≥ c/(2π). As in the case of conventional gravity in AdS 3 , in the case of U (1) gravity the Cardy formula (1.4) is valid for ∆ 1. For consistency of simplest picture, where in the large-c limit any individual Narain CFT is described in the IR by U (1) gravity plus additional matter, we require that the density of states of the Narain CFT should satisfy (This inequality should be understood strictly in the c → ∞ limit.) In particular, from this condition follows a bound on the spectral gap for Narain theories, ∆ 1 ≤ c/(2πe). To probe the consistency of this scenario and the hypothesis (1.5), we consider the code CFTs of [17,18] associated with quantum stabilizer codes as well as chiral theories associated with even self-dual lattices. We show that (1.5) leads to a novel bound on quantum codes, which is consistent with previously known results. Further, consistency of (1.5) requires the mean value to be greater than or equal to all values in the ensemble, which is only possible if the variance (and higher moments) vanish in the large-c limit. We calculate the variance of ln N for the ensembles of code and chiral theories and find it to be exponentially small e −O(c) . This paper is organized as follows. In the following section we remind the reader about the basics of the Narain theories and the duality between the average over Narain theories and U (1) gravity in the bulk. We also introduce code CFTs and calculate their density of states in terms of the underlying quantum code. Section 3 repeats the analysis of Hartman, Keller and Stoica for the Narain theories. We also formulate conjecture (1.5) there. We use code and chiral theories to probe the consistency of the conjecture in section 4. Section 5 concludes the paper with a discussion of implications for quantum gravity and the sphere packing problem.

Preliminaries
2.1 Averaged Narain theories and U (1) gravity A Narain CFT describes c ∈ N free scalar fields compactified on a c-dimensional torus. Mathematically such a theory is parametrized by an even self-dual lattice Λ in R c,c . The CFT torus partition function is given by where the Siegel-Narain theta function is Narain theories exhibit a U (1) c × U (1) c symmetry. By density of states (∆) we will understand density of U (1) c × U (1) c primaries, i.e. points of the Narain lattice. Instead of the density (∆) it is often convenient to study the cumulative number of states with dimensions bounded by some ∆, which is the same as the number of points of Λ inside a sphere of radius R, where R 2 /2 = ∆: Since Λ is unimodular, each lattice cell has unit volume and therefore for sufficiently large ∆ the cumulative number of states is equal to the volume of a 2c-dimensional sphere of radius R, This is the analog of the Cardy formula for Narain theories, as can be deduced directly from modular invariance [16]. It applies universally for ∆ c but as we will see below, in certain cases its validity extends to much smaller values of ∆. In what follows we will work in large c limit and introduce where the limit is taken with respect to a family of theories defined for arbitrarily large c. In this notation the Cardy formula is simply We advocate the point of view that each Narain theory, characterized by a lattice Λ, is dual to some gauge theory in the bulk. We leave the details of the bulk microscopic description to future work, and here only discuss provisional properties of such theories in the IR, namely the possible behavior of λ(α).
It has been argued recently that averaging over the ensemble of all Narain theories is dual to "U (1) gravity" -the pertubative sector of U (1) c ×U (1) c Chern-Simons theory in the bulk. Because of averaging, density of states is a continuous function [14] U For ∆ 1 the summation over can be replaced by an integration, yielding (2.4) in the c 1 limit. Hence, for this U (1) gravity theory, the Cardy formula (2.6) is valid for all values of ∆ > c/(2πe), i.e. when the number of states is exponential. This mirrors the behavior of sparse holographic theories with Virasoro symmetry [7], see below.
To conclude this section we introduce chiral theories associated with even self-dual lattices in R c . In this case c is divisible by 8 and it is convenient to introduce k = c/2. For a given lattice Λ ∈ R c the partition function is where lattice theta-series is As in the Narain case the Cardy formula is given by the volume of a c-dimensional sphere which applies to any theory for ∆ k. Averaging over the ensemble of all even selfdual lattices (with the weight specified by the size of the lattice automorphism group) yields [19] Θ = E k (τ ), (2.11) where E k is the Eisenstein series. By definition it has a representation as a sum over Γ ∞ \SL(2, Z), which can be interpreted as a sum over different handlebodies on the gravity side. This led to a suggestion in [17] that the ensemble of chiral theories also has a holographic description, similar to the one of the Narain case. The Taylor expansion of the Eisenstein series is leading to the density of states (dropping exponentially small corrections) In the chiral case ∆ assumes only integer values, i.e. the density of states is a sum of delta-functions. When ∆ 1 we can approximate it by a continuous distribution by treating ∆ in (2.15) as a continuous variable.

Density of states of code CFTs
Code CFTs comprise a family of Narain CFTs associated with quantum stabilizer codes, which was introduced in [17,18]. Quantum codes are c-dimensional linear spaces in Z 2c over Z 2 , self-orthogonal with respect to the metric A code C is non-uniquely characterized by its refined enumerator where 1 is a vector of ones of length 2c. The sum in (2.18) goes over all 2 c codewords of the code C. Torus partition function of a code CFT is given by For pure imaginary τ = −τ = iβ/2π corresponding Narain lattice theta function reduces to The Narain lattice of a code CFT is a union of 2 c cubic "lattices" associated with the codewords, each being a conventional cubic lattice of the size √ 2 with the origin shifted to be at c/ √ 2 for some c ∈ C. For each such cubic "lattice" the number of points inside a sphere of radius R 2 = 2αc in the c → ∞ limit was calculated by Mazo and Odlyzko [20] (see Appendix A for a simple derivation), where q * is chosen to minimize the value of Depending on the value of 0 ≤ p ≤ 2, λ(α, p) approaches ln(πeα) from above or below for large α. Strictly speaking λ(α, p) always differs from ln(πeα), but convergence is very fast as can be see in Fig. 1. Summing over individual codewords and leaving leading exponent would give λ for a code CFT.
As an example we consider averaging over the ensemble of all code CFTs, characterized by the averaged enumerator polynomial (see Appendix B) For small α the first term (zero codeword) dominates, λ 1 = λ(α, 0). For large α the second term is dominant, yielding for the theta-function From here we find (see Appendix A) where q is chosen to minimize λ 2 . The third and fourth terms are not dominant for any value of α. The resulting density of states λ = max(λ 1 , λ 2 ) is shown in Fig. 2.

HKS analysis for Narain theories
Using modular invariance, Hartman, Keller, and Stoica have shown that as long as the full density of states of a 2d CFT is sparse (1.1), the Cardy formula (1.2) applies for any ∆ > c/6 in the large-c limit. Equivalently, the free energy of a sparse large-c theory for β < 2π is given at leading in 1/c order by Before proceeding to establish an analogous result for Narain theories, we note that no Narain theory is sparse in the sense of (1.1). Indeed, for large β 2π the theta function can be approximated as This differs from (3.1) by an amount that is exponentially small in β, but not by a 1/c-suppressed factor. 1 The exponentially small discrepancy between (3.1) and (3.2) at large β implies that for ∆ c the density of states would be described by the Cardy formula (1.2) to exponential precision. For concreteness we focus on the averaged Narain theory (U (1) gravity) for which, at leading order, This expression is manifestly covariant under β → (2π) 2 /β. For β > 2π the free energy of U (1) gravity is dominated by (descendants of) the vacuum state. This is the contribution of thermal AdS 3 in the bulk. For β < 2π second term dominates -this is the contribution of BTZ black hole geometry in the U (1) gravity theory. At β = 2π both contributions are equal, marking the Hawking-Page transition. We plot the entropy in Fig. 3, versus the Cardy formula (1.2) and the HKS sparseness condition (1.1). For given E the largest of S 1 , S 2 is the leading contribution to the entropy. They have the same value for E = 0. It is clear that the full density of states S = S 2 (E) is numerically very close to the Cardy formula for ∆ c, but in fact never actually matches it. This is consistent with S 1 ≈ ∆ ln(∆/2c) for small ∆ = (E + c/12) > 0, violating the sparseness condition S ≤ 2π∆ (1.1). As a final comment, we note that S 2 becomes non-negative at ∆ = c/(2πe), which is exactly the threshold for new primary states, c.f. (2.6). From now on we will focus on the density of primary states for a given Narain theory. Following HKS we split the theta series into two terms where sum is over primaries. Then for β > 2π Using modular covariance (3.6), positive-definiteness of Θ L and (3.8) we find Using (3.8) one more time and assuming f (β) < 1 we find Finally we have .
To make sure f (β) < 1 for all β > 2π, ε/c must be larger than for all β > 2π. The minimum of (3.12) is achieved at β = 2π and is equal to 1/(4π). Hence where is some positive constant, which should be chosen such that /c → 0. With this choice of ε for any β ≥ 2π, and we arrive at the analog of the HKS result for Narain theories With the conventional procedure of taking to zero, we recognize the logarithmic term in (3.15) to be of subleading order o(c). 2 Now we can introduce the notion of a sparse Narain theory, a theory for which is of order O(1) in the 1/c expansion. In such a theory Θ Λ is given at leading order by for all values of β, as follows from modular covariance. In terms of the density of primaries the sparseness condition is (compare with (1.1)) Sparseness is necessary and sufficient for and for the validity of the Cardy formula (2.6) 3 To summarize, the emergent picture is completely analogous to the analysis of [7]: sparse theories are those for which the free energy matches the free energy of pure gravity (U (1) gravity in our case) for all β at leading order in 1/c. For such theories the Cardy formula applies already for ∆/c of order one.
While the averaged Narain theory is sparse, we do not know of any explicit example of a sparse large-c Narain theory. This echoes the situation described in the introduction, that no explicit example of an HKS-sparse holographic theory is known. In particular, none of the code CFTs introduced in section 2.2 are sparse. Indeed, any code includes the trivial codeword c = 0 and hence the density of primary states at small ∆ is given by ln = c λ(α, 0), (3.21) which violates the sparseness condition, as shown in the inset of Fig. 1.
The HKS analysis also applies to chiral theories. Since the averaged chiral theory is obviously sparse, we can construct an example of a sparse Narain CFT, by embedding the ensemble of chiral CFTs as follows: every even self-dual lattice Λ ⊂ R c gives rise to a Narain lattice Λ = Λ L ⊕ Λ R ⊂ R c,c . Its partition function is simply Then the spectral density can be obtained by the convolution of (2.15) with itself (because the variance is vanishingly small, as will be shown below) In terms of λ there are two contributions, coming from the second term and λ C = ln(2πeα) coming from the last term. It is clear that λ ch satisfies the sparseness condition as is shown in Fig. 4. As a side comment we notice that the averaged chiral CFT has spectral gap of ∆ 1 = c/(4πe), i.e. a Narain CFT based on a random Euclidean even self-dual lattice would have this value spectral gap. This agrees with the analogous result of [14].

Main hypothesis and its consistency
In thinking about the bulk description of conventional (Virasoro) large c holographic theories, we usually take pure quasiclassical gravity to be the minimal "core" theory which can be combined with other states (potentially described by matter fields) in the bulk. We would like to probe the consistency of this picture for Narain theories, with U (1) gravity playing the role of the minimal "core." We emphasize that our discussion refers not to a hypothetical microscopic bulk description, but to effective IR behavior. Provided this picture is correct, we arrive at the following main hypothesis: the density Since, by assumption, this inequality applies to all Narain theories and λ C is obtained by averaging over all Narain theories, the inequality (4.1) applies only in the strict c → ∞ limit. The LHS of (4.1) should be understood as a limit taken with respect to any family of Narain theories defined for arbitrarily large c, provided the limit converges. This hypothesis immediately implies an asymptotic value of the maximal spectral gap of primary states Here we define ∆ 1 as the minimal value for which the density of states is exponentially large. The conventional spectral gap, i.e. the dimension of the lightest non-trivial primary, is less than or equal to ∆ 1 and therefore satisfies ∆ 1 ≤ c/2πe. As we will argue below, the distribution of the density around the mean value e λ C is vanishingly narrow in the large-c limit, hence for nearly all large-c theories ∆ 1 = c/2πe. An immediate question is to assess the consistency of our hypothesis (4.2) with the behavior of ∆ 1 for small and intermediate c theories, coming from the numerical modular bootstrap. The results of the spinning modular bootstrap for c ≤ 15 [14] suggest the behavior ∆ 1 ≈ c/8 + 1/2 4 , seemingly in stark disagreement with (4.2). It should be immediately noted this behavior is an artifact of small c. Indeed, ∆ 1 is bounded from above by the spinless modular bootstrap of [16], which uses numerical results for c ≤ 2000 to estimate a stronger asymptotic bound of c/9.869. For smaller values of c, the bounds on ∆ 1 following from the spinless bootstrap are conservative; hence one can safely conclude that any asymptotic behavior satisfying ∆ 1 ≤ c/9.869 is consistent with the available numerics.
Next, we would like to study the implications of our hypothesis for code theories. The inequality (1.5) implies an upper bound on the binary distance d b of any real self-dual stabilizer code. The density of states of a code theory is dominated by the contribution of the zero codeword for small α, but contributions of other codewords appear for α ≥ d b /(4c). To make sure that λ(α) of a given code theory does not dip below λ C (α), new primary states must appear at or below the value of α * ≈ 0.08993 where the contribution of the zero codeword is equal to the Cardy formula (intersection of the blue and brown lines in Fig. 2) λ(α * , 0) = λ C (α * ). Since the conventional Hamming distance is bounded by the binary one, d ≤ d b , we find d/c ≤ 0.3597 which is consistent with, close to, but weaker than the linear programming bound d/c ≤ 1/3 [21]. On the other hand, real self-dual stabilizer codes, via the Gray map discussed in [18], can be understood as binary isodual [2n, n, d b ] codes. Therefore d b /c is bounded from above by the linear programming bound for formally self-dual binary codes, d b /c ≤ (1 − 3 −1/2 ) ≈ 0.4226 [22]. Again, this is consistent with (4.4). Finally, isodual codes include even self-dual codes as a particular subclass, for which the bound is stronger d b /c ≤ (1 − 5 −1/4 ) ≈ 0.3313 [22]. In other words the new bound (4.4) is consistent with other bounds found in the literature, which serves as an indirect consistency check of the main conjecture. Finally, in order for the main conjecture to hold, a necessary condition is for the variance of around its mean value to be vanishingly small in the large c limit, and the bar stands for averaging over the ensemble of Narain theories. In lieu of this calculation we make use of the similarity between the problems of maximizing the CFT spectral gap for both Narain and chiral theories, finding sphere packings of maximal density, and finding optimal classical and quantum codes (all three problems can be understood as finding a lattice from a given class with the largest possible shortest vector), and first perform an average over the space of code CFTs. The underlying assumption here is that in all these cases the qualitative behavior is the same. The average spectral density of code theories was found in section 2.2, (∆) = e cλ(α) = e cλ 1 (α) + e cλ 2 (α) , α = ∆/c, (4.6) in the large-c limit. In Appendix B we calculate the variance of the averaged refined enumerator polynomial, see eq. (B.20), which gives To calculate the connected two-point correlation function we need to perform an inverse Laplace transformation where β i is fixed by For equal ∆ 1 = ∆ 2 we plot µ(α) where δ 2 (αc) = e 2cµ(α) (4.10) in Fig. 5, superimposed with λ 1,2 . It is clear that for code theories the variance is exponentially suppressed for all ∆ confirming the overall picture. Next we perform a similar calculation for the ensemble of chiral theories. Our starting point is the two-point correlator Here the integers n, m should be interpreted as dimensions and An explicit expression for c nm was obtained in [23,24] (4.14) After certain manipulations we arrive at the following representation for the functions H, convenient for taking the large-k limit, Here (N |k) is Kronecker symbol. We have checked this representation by reproducing the numerical values of H(k − 1, N ) given in the appendix of [25].
In the limit r = k − 1 1 Hurwitz zeta function ζ(r, k/N ) drastically simplifies (4.16) From here it follows that the l = 1 term in the sum contributes at leading order, while the contributions with l ≥ 2 are exponentially suppressed, e −O(r) , where we have approximated ζ(3 − 2k) ≈ 1 with exponential precision. Our next step is to sum over r in (4.14), which can be substituted by integration with exponential precision in the regime of interest, k → ∞ for fixed n/k, m/k, as follows from the Euler-Maclaurin formula (see Appendix C), Finally we notice that in both (4.14) and (4.15) only d = 1 contributes at leading order, while the contributions of other terms are exponentially suppressed, as 1/d k . Thus we find Comparing with (2.15) confirms that the connected two point function is exponentially suppressed Certainly, a vanishing variance, provided that an analogous result holds for the ensemble of all Narain theories, does not guarantee the validity of (4.1). For that, a much stronger property is required: that the distribution of around the mean has no fat tails, which would allow substantial deviations from the mean even as c → ∞. Studying the higher moments of δ could provide additional consistency checks, but not a proof, unless one gains theoretical control over arbitrarily high moments, similarly to [26].

Discussion
In this paper we have discussed a scenario in which the holographic dual of a given Narian CFT in the infinite c limit is effectively described as "U (1) gravity" of [14,15] together with some additional states (fields). This simple picture, if correct, would imply that pure U (1) gravity has the lowest possible density of states, leading to our main conjecture (4.1). We have tested this hypothesis by noting that it is consistent with available numerics; it leads to new bounds on quantum codes which are consistent with previously known ones; and we have argued the variance of the density (∆) is vanishingly small, as is required by (4.1), by considering two related ensembles. Our analysis amounts to a series of indirect consistency checks and thus can not directly establish the validity of (4.1).
More direct evidence could come from the numerical conformal bootstrap in the form of a bound on the maximal spectral gap (4.2). One would need to extend the numerical analysis of [14] to higher values of c until the asymptotic slope emerges. While the result could turn out to be overly conservative (as is currently believed to be the case with the bound on the spectral gap of Virasoro theories), the problem of finding the maximal spectral gap can be formulated as a quadratic optimization problem, which makes it plausible that this question could be studied numerically.
Another potential way to confirm the scenario in question could come from the bulk microscopic description, e.g. in terms of Chern-Simons gauge fields with additional matter, dual to a given Narain theory. The microscopic description by itself will likely be insufficient: it will presumably depend on the metric G and B-field parameterizing Narain moduli space, but evaluating, for example, the spectral gap ∆ 1 (G, B) for given G and B would likely be as complicated on the bulk side as it is in the boundary theory. A crucial new ingredient on the bulk side is an analog of the Bekenstein-Hawking entropy formula for gauge fields [27,28], obtained potentially via embedding gauge theory into bona fide gravity in AdS 3 [29]. Presumably, if this formula were applied to the "BTZ" configuration discussed in section 3 it would yield the Cardy formula (1.4), mirroring the conventional analysis for Virasoro theories and establishing the validity of (4.1).
The underlying assumption we relied on in section 4 is that the spaces of Narain theories, of chiral CFTs defined by even self-dual Euclidean lattices, of Narain theories associated with quantum codes, and of lattice sphere packings (arbitrary lattices with the unit cell volume) are not only closely related (as discussed in [11,17]), but in fact share crucial features. Thus, we expect that the vanishing variance of the level densities of code and chiral theories will extend to the ensemble of all Narain theories. By extending this reasoning to lattice sphere packings we arrive at the well-known lore that a random sphere packing is as effective as the averaged one [30]. Furthermore, in asymptotically large dimensions a random sphere packing is conceivably the densest one [30], mirroring our conjecture for the maximal spectral gap (4.2). Should our scenario get confirmed, possibly as outlined above, that would in turn solidify the expectation for the sphere packing problem, providing non-trivial feedback from quantum gravity to discrete geometry.
Confirming the scenario of our paper would also support the expectation that pure gravity in AdS 3 is dual not to a particular theory but to an appropriately defined en-semble. An important difference between the original analysis of Hartman, Keller and Stoica and the analysis of section 3 is that in the Virasoro case the upper limit of the range of the sparseness condition c/12 (1.1) coincides with the lowest value of ∆ for which Cardy formula yields positive level density. In other words, Virasoro theories with maximal spectral gap are automatically sparse. This is not the case for Narain theories, as the upper limit of the sparseness condition c/(2π) exceeds the hypothetical maximal spectral gap c/(2πeα). In other words, there are likely non-sparse Narain theories with maximal spectral gap. We interpret this as an indication that there are different classes of Narain theories, not only those satisfying the sparseness condition, which can be described holographically using quasi-classical fields in the bulk. On the contrary, in the Virasoro case there seems to be only one class of sparse theories with a weakly-coupled bulk description. we easily calculate the contribution of a given codeword c ∈ C to the lattice thetafunction provided C is understood as a binary [2c, c, d b ] code, This is of course the same as (2.19) after the substitution τ = −τ = iβ/(2π). For convenience we introduce p = w(c)/c and represent Z(c) as Using the saddle point approximation we immediately find Upon redefinition q 2 → q and ∆/c = α this becomes (2.24). The density of states follows from here which gives (2.23).

B Averaging over code theories
In this section we denote c by n, which means we are considering self-dual [[n, 0, d]] quantum codes.

B.1 Averaged enumerator polynomial
We consider the ensemble of all B-form codes introduced in [18]. The codes are parametrized by binary symmetric n × n matrices B with zeroes on the diagonal. The space of all such matrices will be denoted as M n . For a given B the 2 n codewords are given by c(B, x) := (x 1 , . . . , x n , B x) where x is an arbitrary binary vector of length n. Hence, for pure imaginary τ the averaged refined enumerator polynomial is given by where (B x) 2 is the binary vector congruent to (B x) mod 2 . Without loss of generality we can assume that x is ordered, x = (1, . . . , 1 a , 0, . . . , 0) and 1 · x = a, for 0 ≤ a ≤ n.
We would like to calculate unless a = 0 in which case P 0 (t) = 1. We can calculateP a iteratively by adding one more row and column to matrix B. Assuming a particular configuration of B would yield a term t k , adding an additional row and column to B would turn it into (Here of course we need to sum over all possible i with the weight C i a /2 a .) In other words We therefore arrive at the following iterative relation From here andP 0 (t) = 1 we find Now we are ready to calculate W (1, t 2 , t) = 1 + n a=1 C a n t a Q a (t) = (B.8) matching the general result of [18].

B.2 Averaged square of enumerator polynomial
Now we would like to find W (1, t 2 1 , t 1 )W (1, t 2 2 , t 2 ) = x,y∈Z n We can find P m,k,l iteratively by increasing l by one (adding one additional row and column to B). Any monomial t a 1tã 1tâ 1 t b 2tb 2tb 2 will turn into From here we find The following expression is a solution P m,k,l (t 1 ,t 1 ,t 1 , t 2 ,t 2 ,t 2 ) = (B.12) from where follows P m,k,l (t 1 , t 1 , t 1 , t 2 , t 2 , t 2 ) = (B.13) This expression is correct only if k + l > 0. Otherwise as follows from (B.7). Now, if n < m + k + l the expression for where x, y are characterized by m, k, l is given by and m = k = 0, l > 0 with the substitution t 1 ↔ t 2 . Finally we need to sum over x and y, which is equivalent to summing over m, k, l with the weight n≥m+k+l≥0 This is a naive expression because we included the full range of m, k, l. Instead we should subtract n! m!(n − m)! t m 1 (1 + t 1 ) n−m t m 2 (1 + t 2 ) n−m P m,k,l (t 1 , t 2 )δ k+l=0 + n! k!(n − k)! t k 1 (1 + t 1 ) n−k (1 + t 2 ) n−k P m,k,l (t 1 , t 2 )δ m+l=0 + n! l!(n − l)!
(1 + t 1 ) n−l t l 2 (1 + t 2 ) n−l P m,k,l (t 1 , t 2 )δ m+k=0 and add terms (B.16), (B.17) and similarly for m = k = 0, Here we need to be careful: the first term in (B.18) stands for the sum over m while k = l = 0, the second term for the sum over k with m = l = 0, and the third for the sum over l while m = k = 0. We have therefore calculated the contribution of m = k = l = 0 three times instead of once. When m = k = l = 0 this means that x = y = 0 and hence the contribution is simply 1. We therefore must subtract −2.

C Approximating sums by an integrals
We consider the sum over r from the equation (4.14), which in the appropriate limit k 1 becomes where p is the largest integer number such that p 2 ≤ N . We are interested in the relative error, which would arise if we substitute summation for integration. It is convenient to divide the integral by a power of N , redefine k → k + 3/2, and change the lower bound of r by one (this introduces an error of order p −k ∼ e −O(k) ) Furthermore we assume that N scales as k 2 , i.e. p is of order k. The difference between the sum (C.2) and the integral (changing the limits of integration from N 1/2 to p also introduces an error of order e −O(k) )J is given by the Euler-Maclaurin formulã Our goal is to show that all terms on the RHS of (C.4) are exponentially suppressed.
We start with f (p) = (1 − p 2 /N ) k . Since p is the largest integer such that p 2 < N , we can estimate f (p) to be of order p −k . Next, f (p) is of order 2kp/N (1/p) k−1 ∝ 2k/p k . Differentiating iteratively we find at leading order f (l) (p) ∝ (2k) l /p k , with each term contributing more to the sum. The contribution of the last (largest) term is of order k 2a /p k (all numerical coefficients are neglected). Finally, the term R 2a can be bounded by To estimate it, we calculate maximum value of f (2a) (x) , which occurs at x = 0, After dropping all numerical coefficients we find at leading order (ak/p 2 ) a . We will choose a to make the discrepancy betweenĨ andJ sufficiently small. Taking into account that p scales as k, such that α = p/k is fixed we can take a to be a = εk where ε is chosen such that ε/α 2 would be (much) smaller than one. Then in the limit k → ∞ the first term in (C.7) would scale as e −k(1−2ε) ln(k) and the second term would scale as e −k 2ε ln(α 2 /ε) . In other words the discrepancy would be exponentially smaller thanJ ∼ p/k 1/2 . This estimate is likely to be non-optimal and can be improved.