aainstitutetext: Department of Particle Physics and Astrophysics, Weizmann
Institute of Science,
Rehovot 7610001, Israelbbinstitutetext: School of Natural Sciences, Institute
for Advanced Study, Princeton, NJ 08540, USAccinstitutetext: Department of
Physics and Astronomy, University of Kentucky,
506 Library Drive, Lexington, KY, USA 40506

# Holographic description of Narain CFTs and their code-based ensembles

Ofer Aharony c Anatoly Dymarsky c and Alfred D. Shapere
<EMAIL_ADDRESS><EMAIL_ADDRESS><EMAIL_ADDRESS>
###### Abstract

We provide a precise relation between an ensemble of Narain conformal field
theories (CFTs) with central charge $c=n$, and a sum of $(U(1)\times
U(1))^{n}$ Chern-Simons theories on different handlebody topologies. We begin
by reviewing the general relation of additive codes to Narain CFTs. Then we
describe a holographic duality between any given Narain theory and a pure
Chern-Simons theory on a handlebody manifold. We proceed to consider an
ensemble of Narain theories, defined in terms of an ensemble of codes of
length $n$ over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ for prime $k$. We show
that averaging over this ensemble is holographically dual to a level-$k$
$(U(1)\times U(1))^{n}$ Chern-Simons theory, summed over a finite number of
inequivalent classes of handlebody topologies. In the limit of large $k$ the
ensemble approaches the ensemble of all Narain theories, and its bulk dual
becomes equivalent to “U(1)-gravity” – the sum of the pertubative part of the
Chern-Simons wavefunction over all possible handlebodies – providing a bulk
microscopic definition for this theory. Finally, we reformulate the sum over
handlebodies in terms of Hecke operators, paving the way for generalizations.

##  1 Introduction

In recent years, it has become evident that certain gravitational theories in
anti-de Sitter (AdS) space are dual to ensemble averages, rather than to
individual quantum field theories. A general argument for requiring an
ensemble to describe gravitational bulk theories is based on the presence of
bulk geometries with several disconnected boundaries Maldacena:2004rf , known
as “wormholes”. If the gravitational action of such configurations is non-
trivial, then the dual field theory will not factorize on disconnected
manifolds, necessitating an ensemble interpretation. The first explicit
example of such a duality arose in 2d JT gravity, which was found to be dual
to an average over an ensemble of quantum-mechanical systems Saad:2019lba . In
one dimension higher, an intriguing example that motivated our study is
provided by a theory called “U(1) gravity”, which is formulated as a sum over
handlebody geometries in the bulk, and is dual to an average over the moduli
space of Narain CFTs Afkhami-Jeddi:2020ezh ; Maloney:2020nni  (see also
perez2020gravitational ; Dymarsky:2020pzc ; Datta:2021ftn ; Benjamin:2021wzr ;
Benjamin:2021ygh ; Meruliya:2021lul ; Dong:2021wot ; Ashwinkumar:2021kav ;
Collier:2021rsn ; Chakraborty:2021gzh ; Raeymaekers:2021ypf ; Benini:2022hzx ;
kamesking2023lion  for further developments). Yet the original example of a
holographic correspondence, between the ${\mathcal{N}}=4$ supersymmetric Yang-
Mills theory and type IIB string theory on $AdS_{5}\times S^{5}$
Maldacena:1997re , has so far evaded an ensemble interpretation. This raises
the question: when does an ensemble of field theories admit a holographic
interpretation? In particular, can a finite ensemble have a gravitational
dual, and which bulk geometries need to be summed over in this case?

In this paper, we address the latter question by studying finite ensembles of
Narain theories composed of “code CFTs”, which were introduced in
Dymarsky:2020qom ; Yahagi:2022idq ; Angelinos:2022umf . We find that they are
dual to a $(U(1)\times U(1))^{n}$ Chern-Simons theory of finite level, summed
over a finite number of inequivalent handlebody topologies.

The relation between error-correcting codes and CFTs goes back all the way to
the Golay code, which is associated with the Leech lattice, and which led to
the discovery of the Monster CFT frenkel1989vertex , followed by other
developments connecting codes and chiral CFTs dolan1996conformal ;
miyamoto1996binary ; dong1998framed ; LAM2000268 ; gaiotto_johnson-freyd_2022
; Moriwaki:2021ebe . Motivated by these developments, as well as by the
emergence of quantum error correction in the context of bulk reconstruction
Almheiri:2014lwa , two of us proposed a connection between quantum codes and
non-chiral CFTs in Dymarsky:2020qom . Our work led to further activity
connecting codes and CFTs, with applications to the modular bootstrap program
and beyond Dymarsky:2020bps ; Dymarsky:2020pzc ; Dymarsky:2021xfc ;
Buican:2021uyp ; Angelinos:2022umf ; Yahagi:2022idq ; Henriksson:2021qkt ;
Henriksson:2022dml ; Henriksson:2022dnu ; Dymarsky:2022kwb ; Kawabata:2022jxt
; furuta2023rationality ; alam2023narain ; kawabata2023supersymmetric ;
Kawabata:2023nlt ; kawabata2023elliptic ; Kawabata:2023iss . Ensembles of code
CFTs were found in Dymarsky:2020pzc ; Angelinos:2022umf  to be self-averaging
and to exhibit a large spectral gap, suggesting a possible holographic
interpretation and motivating the current study.

We first consider the holographic description of an individual Narain CFT with
$c=n$ on a Riemann surface $\Sigma$. By explicitly evaluating the partition
functions on both sides of the duality for $\Sigma$ of genus one, we show that
it is dual to a pure level-1 $(U(1)\times U(1))^{n}$ “$AB$” Chern-Simons (CS)
theory on a 3-manifold $\mathcal{M}$ with boundary
$\partial{\mathcal{M}}=\Sigma$ (any such 3-manifold can be chosen and gives
the same results, there is no sum over 3-manifolds), and we establish the
precise holographic dictionary. We note that the two $U(1)^{n}$ gauge fields
are coupled at the level of large gauge transformations, and their boundary
conditions determine the moduli of the Narain theory. The level $k=1$ Chern-
Simons theory avoids the factorization puzzle because it is trivial in the
bulk – it has a unique wavefunction on any $\Sigma$, and in particular the
partition function on a “wormhole” geometry connecting two disjoint boundaries
is the same as that on the disconnected product of manifolds with the same
boundaries.

For a $(U(1)\times U(1))^{n}$ CS theory of level $k>1$, the field theory dual
is no longer an individual Narain CFT. Rather, we find it to be dual to an
ensemble average over a finite set of $c=n$ Narain CFTs based on the set of
all even self-dual codes of length $n$ over the “alphabet”
$\mathbb{Z}_{k}\times\mathbb{Z}_{k}$. In this case the CS wavefunction depends
on the topology of the bulk manifold $\mathcal{M}$, and we find that the
averaged CFT partition function is precisely reproduced by the corresponding
Chern-Simons wavefunction, summed over a finite number of equivalence classes
of handlebody topologies. The boundary conditions of the CS theory map to
parameters of the Narain theories in the ensemble. Our main identity (4.3),
valid for any fixed $n$ and prime $k=p$, gives an explicit relation between
the average over the code-based ensemble and the “Poincaré series”
representing a (finite) sum over bulk geometries. The $k=1$ duality of the
previous paragraph may be viewed as a special case of this, where the ensemble
contains just a single CFT.

As $p\to\infty$, for $n>2$ we will argue that the ensemble of code theories
densely covers the whole of Narain moduli space with the canonical measure. We
show explicitly how a similar limit works in the case of $n=2$, by expressing
the average in terms of Hecke operators, and applying a theorem
clozel2001hecke  on the equidistribution of Hecke points. In the bulk, for
$n>2$ in the $p\to\infty$ limit we recover the full Poincaré sum over all
handlebody topologies, reproducing the “U(1)-gravity” of Afkhami-Jeddi:2020ezh
; Maloney:2020nni . Thus, our construction provides a microscopic bulk
definition for the latter, as a limit of CS theories.

Arguments of typicality suggest that for large ensembles of CFTs that are
self-averaging and possess a holographic description as a sum over geometries,
random individual theories should also admit an approximate holographic
description as a sum over geometries. Motivated by this, we propose a sum-
over-geometries description for any individual Narain theory with $n>2$, that
in general is non-local in the bulk, but that becomes approximately local for
typical (random) theories as $n\to\infty$ (which is the limit in which the
ensemble becomes self-averaging).

The plan of the paper is as follows. In Section 2, we briefly review the
relation between additive codes, lattices, and Narain CFTs. In the course of
this discussion, we generalize previous constructions by introducing arbitrary
additive codes in Section 2.2. Section 3 reviews $(U(1)\times U(1))^{n}$
Chern-Simons theories on handlebody geometries, and constructs their
wavefunctions for general boundary conditions. In Section 4 we discuss the
holographic interpretation of Narain theories and their ensembles. First, in
section 4.1 we show that the wavefunction of level-1 $(U(1)\times U(1))^{n}$
Chern-Simons theory, evaluated with given boundary conditions, is equal to the
partition function of a Narain CFT. The point in the Narain moduli space is
specified by the boundary conditions of the CS theory, establishing an
explicit holographic dictionary. We briefly discuss the idea of averaging over
these boundary conditions in section 4.2, and proceed to discuss level $k>1$
CS theories summed over geometries in section 4.3. This section establishes
our main technical result, equation (4.3). We discuss the $k\to\infty$ limit
and the emergence of “U(1)-gravity” in section 4.4. Section 4.5 is devoted to
a detailed analysis of the $n=1$ and $n=2$ cases. It also establishes
connections with Hecke operators, which we further discuss, together with
related mathematical observations, in section 4.6. Section 5 explores the
holographic description of an individual Narain theory as a sum over
geometries. We conclude with a discussion in Section 6. Several appendices
contain technical details.

##  2 Additive codes and Narain CFTs

###  2.1 Codes over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$

A classical additive code over an Abelian group $F$ is a collection of
$F$-valued strings (codewords) of length $n$ closed under addition within $F$.
Additive codes are naturally related to lattices conway2013sphere , and thus
to lattice-based chiral CFTs dolan1996conformal . Recently, codes of more
general type have been shown to be related to Narain CFTs, their orbifolds,
and Abelian fermionic theories Dymarsky:2020qom ; Dymarsky:2020bps ;
Dymarsky:2021xfc ; Angelinos:2022umf ; Yahagi:2022idq ; Henriksson:2022dnu ;
Kawabata:2022jxt ; furuta2023rationality ; alam2023narain ;
kawabata2023supersymmetric ; Kawabata:2023nlt ; kawabata2023elliptic ;
Kawabata:2023iss .

As an illustrative example, we briefly review the relation between additive
even self-dual codes over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ and Narain
theories Yahagi:2022idq ; Angelinos:2022umf . A code ${\mathcal{C}}$ over
$\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ can be thought of as a linear space
within $\mathbb{Z}_{k}^{2n}$ where all algebra is defined mod $k$. The space
is equipped with the indefinite scalar product

$\displaystyle\eta=\left(\begin{array}[]{cc}0&\mathbb{I}_{n\times n}\\\
\mathbb{I}_{n\times n}&0\end{array}\right)$ (3)

with respect to which all code vectors are “even”, $c^{T}\eta\,c=0\,({\rm
mod}\ 2k)$ for all $c\in\mathcal{C}$. Furthermore, self-duality implies that
any vector $c^{\prime}\in\mathbb{Z}^{2n}$ orthogonal to $\mathcal{C}$, in the
sense that $c^{T}\eta\,c^{\prime}=0\,({\rm mod}\ k)$ for any
$c\in\mathcal{C}$, also belongs to $\mathcal{C}$. There are

$\displaystyle{\mathcal{N}}=\prod_{i=0}^{n-1}(p^{i}+1)$ (4)

distinct codes of this type when $k=p$ is prime (the expression for composite
$k$ is more involved). Starting from an even self-dual code $\mathcal{C}$, we
can define an even self-dual lattice
$\Lambda_{\mathcal{C}}\subset\mathbb{R}^{n,n}$ as follows:

$\displaystyle\Lambda_{\mathcal{C}}\equiv\left\\{v/\sqrt{k}\,|\,v\in\mathbb{Z}^{2n},\,v\,{\rm
mod}\,k\in\mathcal{C}\subset\mathbb{Z}^{2n}_{k}\right\\}.$ (5)

A lattice $\Lambda_{\mathcal{C}}$ defines a Narain CFT. When $k=p$ is prime,
the CFT can be described, via a $T$-duality transformation111T-duality is
commonly understood as the action of $O(n,n,\mathbb{Z})$ on $\gamma$ and $B$.
From the lattice generator matrix point of view, it is the action of
$O(n,n,\mathbb{Z})$ from the right, amended by the action of
$O(n,\mathbb{R})\times O(n,\mathbb{R})$ from the left to preserve the “left
bottom block equal zero” structure as in (8). From the Narain lattice point of
view action of $O(n,n,\mathbb{Z})$ from the right is trivial. Hence, in the
context of Narain lattices, by T-duality we mean the action of
$O(n,\mathbb{R})\times O(n,\mathbb{R})$., as a compactification on an
$n$-dimensional torus with metric $\gamma=I/\sqrt{p}$ and with $B$-field given
by an antisymmetric integer-valued matrix ${\rm B}_{ij}\in\mathbb{Z}$, such
that $G=(I,{\rm B}^{T})$ with ${\rm B}=B\,{\rm mod}\,p$ is the generator
matrix of the code $\mathcal{C}$ brought into canonical form,222The generator
matrix $G$ is a $n\times 2n$ matrix such that all codewords are given by
$c=G^{T}q\,{\rm mod}\,k$, $q\in\mathbb{Z}_{k}^{n}$. The form of $G=(I,{\rm
B}^{T})$ with some antisymmetric ${\rm B}_{ij}\in\mathbb{Z}_{k}$ is called
canonical. When $k$ is prime, one can always bring the generator matrix to the
canonical form using so-called code equivalence transformations
Angelinos:2022umf .

$\displaystyle\Lambda_{\mathcal{C}}=O_{T}\left(\begin{array}[]{cc}\gamma^{*}&\gamma^{*}B\\\
0&\gamma\end{array}\right),\qquad\gamma^{*}\equiv(\gamma^{\mathsf{T}})^{-1},\qquad
O_{T}\in O(n,\mathbb{R})\times O(n,\mathbb{R}).$ (8)

Here we use $\Lambda_{\mathcal{C}}$ to denote both the lattice and the
lattice-generating matrix.

An important object characterizing a code is the complete enumerator
polynomial $W_{\mathcal{C}}$. It counts the number of codewords of a code,
that include a given “letter” with the specified multiplicity. In the present
case, with the “alphabet” $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$, we regard a
codeword $c=(a_{1},\dots,a_{n},b_{1},\dots,b_{n})$ as being composed of
letters $(a_{i},b_{i})\in\mathbb{Z}_{k}\times\mathbb{Z}_{k}$. Introducing
$k^{2}$ formal variables $X_{ab}$ with $0\leq a,b<k$ to represent the letters,
one defines the complete enumerator polynomial

$\displaystyle
W_{\mathcal{C}}(X)=\sum_{(\vec{a},\vec{b})\in\mathcal{C}}\prod_{i=1}^{n}X_{a_{i}b_{i}}.$
(9)

For self-dual $\mathcal{C}$, $W_{\mathcal{C}}$ satisfies the so-called Mac-
Williams identity

$\displaystyle W_{\mathcal{C}}(X)=W_{\mathcal{C}}(X^{\prime}),\quad{\rm where\
\ }X^{\prime}_{ab}\equiv{1\over
k}\sum_{a^{\prime},b^{\prime}}X_{a^{\prime}b^{\prime}}e^{-2\pi
i(a^{\prime}b+a\,b^{\prime})/k}.$ (10)

To better illustrate the notation, we consider a simple example – length $n=1$
even self-dual codes over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$. When $k=1$
there is a unique code consisting of only one codeword $(0,0)\in\mathcal{C}$.
When $k=p$ is prime, there are two codes, one with codewords of the form
$(a,0)\in\mathcal{C}_{1}$ and the other with $(0,b)\in\mathcal{C}_{2}$, with
arbitrary $0\leq a,b<p$. Their enumerator polynomials are

$\displaystyle W_{\mathcal{C}_{1}}(X)=\sum_{a=0}^{p-1}X_{a0},\qquad
W_{\mathcal{C}_{2}}(X)=\sum_{b=0}^{p-1}X_{0b}.$ (11)

When $k>1$ is not prime, there are more codes. All length $n=2$ codes for
prime $k=p$ are listed in Appendix C.1.

A defining feature of the code construction of Narain theories is that for a
Narain theory defined with the help of a code-based lattice (5), its torus
partition function can be concisely written in terms of $W_{\mathcal{C}}$.
Indeed, the torus partition function of a Narain theory is defined in terms of
a Siegel theta series that sums over all lattice points. For
$\Lambda_{\mathcal{C}}$ as in (8), we can readily see that the lattice points
organize into sets, each associated with a given codeword
$(\vec{a},\vec{b})\in\mathcal{C}$:

$\displaystyle
S_{\vec{a},\vec{b}}=\\{v/\sqrt{k}\in\Lambda_{\mathcal{C}}\,|\,v=(\vec{a},\vec{b})\,\,{\rm
mod}\,\,k\\}.$ (12)

We can sum over these sets individually, yielding

$\displaystyle Z(\tau)$ $\displaystyle=$ $\displaystyle
W_{\mathcal{C}}(\Psi),\quad\Psi_{ab}={\Theta_{ab}\over|\eta(\tau)|^{2}},$
$\displaystyle\Theta_{ab}$ $\displaystyle\equiv$
$\displaystyle\sum\limits_{n,m}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}},\quad p_{L,R}=\sqrt{k\over
2}((n+a/k)\pm(m+b/k)),\quad n,m\in\mathbb{Z}.$ (13)

It can be readily seen that by virtue of $\mathcal{C}$ being even, each
combination $\prod_{i=1}^{n}\Psi_{a_{i}b_{i}}$ in $W_{\mathcal{C}}$ associated
with an individual codeword $(\vec{a},\vec{b})\in\mathcal{C}$ will be
invariant under $\tau\rightarrow\tau+1$, although individual factors

$\displaystyle\Psi_{ab}(\tau+1)=\Psi_{ab}(\tau)\,e^{2\pi iab/k}$ (14)

are not. Furthermore, $Z$ will be invariant under $\tau\rightarrow-1/\tau$ due
to the Mac-Williams identity (10) and the fact that
$\Psi_{ab}(-1/\tau)=\Psi^{\prime}_{ab}(\tau)$, where $\Psi^{\prime}$ are
defined as $X^{\prime}$ in (10). The relation between the code’s enumerator
polynomial and the associated CFT partition function can be extended to higher
genus Henriksson:2021qkt ; Henriksson:2022dnu .

The relation between codes and CFTs at the level of the partition function has
proved to be a useful tool, which among other things provides an efficient way
to solve modular bootstrap constraints, construct inequivalent isospectral
CFTs Dymarsky:2020bps  and modular invariant $Z(\tau)$ which are “fake” (i.e.,
not associated with any bona fide CFT) Dymarsky:2022kwb , construct “optimal”
CFTs maximizing the value of the spectral gap Dymarsky:2021xfc ;
Angelinos:2022umf , etc. One recent application was the calculation of the
spectral gap of $U(1)^{n}\times U(1)^{n}$ primaries for a typical code theory
when $k\rightarrow\infty$ while $n$ is kept fixed Angelinos:2022umf . The
resulting gap, $\Delta=n/(2\pi e)$, matches the value of the spectral gap in
“$U(1)$-gravity” Dymarsky:2020pzc ; Afkhami-Jeddi:2020ezh , a result we return
to in section 5.

The results mentioned above mostly rely on a “rigid embedding” (5) or its
analogues, in which a code, understood as a subset of $\mathbb{Z}_{k}^{2n}$,
is mapped to a lattice $\Lambda_{\mathcal{C}}$, which is a sublattice of a
cubic lattice of spacing $1/\sqrt{k}$,
$(\sqrt{k}\,\mathbb{Z})^{2n}\subset\Lambda_{\mathcal{C}}\subset(\mathbb{Z}/\sqrt{k})^{2n}\subset\mathbb{R}^{n,n}$.
This rigidity, which allows only very special Narain lattices to be obtained
from codes, suggests a picture in which codes are related to a set of very
special Narain theories, dubbed code CFTs. In this picture, there is a close
relation between the underlying code and the algebraic properties of the CFT
Buican:2021uyp . However, as we will see momentarily, these maps from codes to
CFTs are a particular instance of a much more general relation.

###  2.2 General case

Reference Angelinos:2022umf  provides a general construction of codes over an
Abelian group ${\sf G}$ defined as the quotient group of a self-orthogonal
even “glue lattice” ${\sf\Lambda}$,

$\displaystyle{\sf
G}={\sf\Lambda}^{*}/{\sf\Lambda},\qquad{\sf\Lambda}^{*}\equiv\eta({\sf\Lambda}^{\mathsf{T}})^{-1}.$
(15)

In Angelinos:2022umf  the focus was on ${\sf\Lambda}\subset\mathbb{R}^{1,1}$
and all such lattices were classified there. They are defined by

$\displaystyle{\sf\Lambda}^{T}\eta{\sf\Lambda}=g_{\sf\Lambda}=\left(\begin{array}[]{cc}2\,{\sf
n}&{\sf k}\\\ {\sf k}&2\,{\sf m}\end{array}\right),\quad{\sf n},{\sf m},{\sf
k}\in\mathbb{Z},\quad{\sf k}^{2}-4{\sf nm}>0,$ (18)

with an arbitrary $O_{+}(1,1)$ transformation acting on ${\sf\Lambda}$. In
particular, the case of $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ codes discussed
above corresponds to the glue matrix

$\displaystyle{\sf\Lambda}=\left(\begin{array}[]{cc}1/r&0\\\
0&r\end{array}\right)\sqrt{k}$ (21)

with $r=1$. A nontrivial “embedding” $r$ in (21) changes $p_{L,R}$ in (13) to

$\displaystyle p_{L,R}=\sqrt{k\over 2}((n+a/k)/r\pm(m+b/k)r),$ (22)

while changing neither the relation between $Z(\tau)$ and $W_{\mathcal{C}}$,
nor the way in which $\Psi_{ab}(\tau)$ changes under modular transformations
of $\tau$. The group $\sf G$ is an “alphabet”, while codes are collections of
$\sf G$-valued strings of length $n$ closed under addition and equipped with
the scalar product inherited from $\eta$. Then, even self-dual codes
$\mathcal{C}$ over $\sf G$ define even self-dual (Narain) lattices
$\Lambda_{\mathcal{C}}$ in $\mathbb{R}^{n,n}$ via a straightforward
generalization of (5),

$\displaystyle{\Lambda}\subset\,\Lambda_{\mathcal{C}}\,\subset{\Lambda}^{*}\subset\mathbb{R}^{n,n},\qquad{\Lambda}={\sf\Lambda}\oplus\dots\oplus{\sf\Lambda}.$
(23)

If all $n$ glue lattices ${\sf\Lambda}$ in (23) are the same, then the
permutation of letters within the codeword – a code equivalence – is also a
symmetry (an element of the T-duality group) at the level of the code CFT. But
one can also choose $n$ different parameters $r_{i}$, in which case to
preserve the relation between $Z$ and $W_{\mathcal{C}}$, the enumerator
polynomial should depend on $n\,k^{2}$ distinct auxiliary variables
$X_{ab}^{i}$,
$W_{\mathcal{C}}=\sum_{(\vec{a},\vec{b})\in\mathcal{C}}\prod_{i}X^{i}_{a_{i}b_{i}}$.
More generally, one can consider $O(n,n,\mathbb{R})$ transformations acting
and mixing several or all ${\sf\Lambda}$’s within $\Lambda$, or combinations
of completely different even self-orthogonal matrices ${\sf\Lambda}$ of
different dimensions (leading to codes where different letters belong to
different alphabets).

Thus, most generally one can consider a lattice
${\Lambda}\subset\mathbb{R}^{n,n}$, even and self-orthogonal with respect to
the $2n$-dimensional scalar product (3) within $\mathbb{R}^{n,n}$, with the
“codewords” being elements of the Abelian quotient group
$c\in\mathcal{C}\subset{\Lambda}^{*}/{\Lambda}={\sf G}_{\Lambda}$. This group
defines a “dictionary,” a set of all possible “words”. The “dictionary group”
inherits the scalar product from (3). An even self-dual code would
additionally satisfy

$\displaystyle c^{T}\,\eta\,c\in 2\mathbb{Z}\,\,\,{\rm
for\,\,any}\,\,c\in\mathcal{C},$ (24) $\displaystyle
c^{T}\,\eta\,c^{\prime}\in\mathbb{Z}\,\,\,{\rm
for\,\,all}\,\,c,c^{\prime}\in\mathcal{C},$ (25)

while if $c^{\prime}\notin\mathcal{C}$ then $c^{T}\,\eta\,c^{\prime}$ is not
an integer for some $c\in\mathcal{C}$.

Any even self-dual code then defines a Narain lattice, generalizing (5),

$\displaystyle\Lambda_{\mathcal{C}}=\left\\{v\,|\,v\in{\Lambda}^{*},\,(v\ {\rm
mod}\,{\Lambda})\in\mathcal{C}\right\\},\quad{\Lambda}\subset\Lambda_{\mathcal{C}}\subset{\Lambda}^{*}\subset\mathbb{R}^{n,n}.$
(26)

Here we denote by $(v\ {\rm mod}\,{\Lambda})$ the equivalence class of $v$
within ${\Lambda}^{*}/{\Lambda}$. In general, the relation between the
associated CFT partition function and the code enumerator polynomial remains
essentially the same. The complete enumerator polynomial

$\displaystyle W_{\mathcal{C}}(X)=\sum_{c\in\mathcal{C}}X_{c},$ (27)

is defined in term of formal auxiliary variables $X_{c}$ for $c\in{\sf
G}_{\Lambda}$, which are then promoted to “(code)word blocks” $\Psi_{c}$ with
modular parameter $\tau$ and arbitrary fugacities
$\xi,{\bar{\xi}}\in\mathbb{R}^{n}$

$\displaystyle\Psi_{c}(\tau,\xi,\bar{\xi})={{\Theta}_{c}\over|\eta(\tau)|^{2n}},\quad\Theta_{c}=\sum\limits_{\ell}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}+2\pi i(p_{L}\cdot\xi-
p_{R}\cdot\bar{\xi})+{\pi\over 2\tau_{2}}(\xi^{2}+{\bar{\xi}}^{2})},$
$\displaystyle\left(\begin{array}[]{c}p_{L}+p_{R}\\\ p_{L}-p_{R}\\\
\end{array}\right)=\sqrt{2}({{\Lambda}\,\vec{\ell}+\vec{c}}),\quad\vec{\ell}\in\mathbb{Z}^{2n},\quad{\vec{c}}\in\mathcal{C}\subset{\sf
G}_{\Lambda}\equiv{\Lambda}^{*}/{\Lambda}.$ (30)

We emphasize that $\Psi_{c}$ are defined for all $c\in{\sf G}_{\Lambda}$, and
not all of them are even. The path integral of the CFT is then given by

$\displaystyle Z_{BPI}=W_{\mathcal{C}}(\Psi),$ (31)

where “BPI” stands for bulk path integral. This name is justified in Section
3. $Z_{BPI}$ is equal to the CFT partition function up to a theory-independent
factor, as explained in Appendix A; see also Kraus_2007 .

The functions $\Psi_{c}$ change covariantly under modular transformations

$\displaystyle\Psi_{c}(\tau+1,\xi,\bar{\xi})$ $\displaystyle=$
$\displaystyle\Psi_{c}(\tau,\xi,\bar{\xi})e^{\pi ic^{T}\eta c},$
$\displaystyle\Psi_{c}(-1/\tau,\xi/\tau,\bar{\xi}/\bar{\tau})$
$\displaystyle=$ $\displaystyle{1\over|{\sf
G}_{\Lambda}|^{1/2}}\sum\limits_{c^{\prime}\in{\sf
G}_{\Lambda}}\Psi_{c^{\prime}}(\tau,\xi,\bar{\xi})e^{-2\pi ic^{T}\eta
c^{\prime}}.$ (32)

Modular invariance of $Z_{\it PI}$ follows from (32) and the algebraic
properties of $W_{\mathcal{C}}$ due to the evenness and self-duality (Mac-
Williams identity) of the underlying code. The transformations (32) are
defined solely in terms of the code and therefore can be defined already at
the level of the formal variables $X_{c}$.

The same functions $\Psi_{c}$, with $\xi=\bar{\xi}=0$, have been discussed in
Ashwinkumar:2021kav , where they appeared in a different context – as the
partition functions of non-modular-invariant CFTs. There, an ensemble of such
CFTs generated by the action of $O(n,n,\mathbb{R})$ on a given $\Lambda$ was
discussed, together with its holographic interpretation. The focus in this
paper is different: we sum over $\Psi_{c}$ for all $c$ belonging to a suitable
even self-dual code such that the resulting partition function corresponds to
a modular-invariant Narain CFT.

We would like to emphasize that the action of $O(n,n,\mathbb{R})$ on $\Lambda$
does not affect the code, its enumerator polynomial, nor the transformation
laws (32). It changes the “embedding” that maps the codes associated with a
given $\Lambda$ into the space of Narain CFTs. Explicitly, this means we
define $\Psi_{c}$ exactly as in (2.2), but can introduce an arbitrary
${\mathcal{O}}\in O(n,n,\mathbb{R})$,

$\displaystyle\left(\begin{array}[]{c}p_{L}+p_{R}\\\ p_{L}-p_{R}\\\
\end{array}\right)={\mathcal{O}}\sqrt{2}({{\Lambda}\,\vec{\ell}+\vec{c}}),\quad\vec{\ell}\in\mathbb{Z}^{2n},\quad{\vec{c}}\in\mathcal{C}\subset{\sf
G}_{\Lambda}\equiv{\Lambda}^{*}/{\Lambda}$ (35)

where the change of notation can be absorbed into the definition of $\Lambda$.
Choosing different “embeddings” $\mathcal{O}$ will change code theories, but
the relation (31) between $Z$ and $W_{\mathcal{C}}$ will remain the same.
Thus, starting from any ${\sf\Lambda}$, e.g. as given by (23) and (21) with
$r=1$, and applying an appropriate $\mathcal{O}$, we can represent any Narain
lattice as a code lattice $\Lambda_{\mathcal{C}}$ associated with any
$\mathcal{C}$ over any alphabet. This, first of all, makes the notion that
only certain Narain CFTs are associated with codes obsolete – any Narain
theory can be thought of as a code CFT associated with any even self-dual code
of any type, i.e. with any $\sf G$, $\mathcal{C}\subset{\sf G}^{n}$, or more
generally with any ${\sf G}_{\Lambda}\supset\mathcal{C}$. One can even
associate several arbitrary Narain CFTs with several codes simultaneously, by
making use of the $n(2n-1)$ parameters of $O(n,n,\mathbb{R})$. Yet the notion
of a code CFT ensemble is still relevant, since as $n$ increases there are
generally many more codes of a given type, see e.g. (4), than the number of
adjustable parameters.

In the case of $n=1$ codes with prime $k=p$ discussed above, the construction
based on (21) gives two possible codes; the corresponding CFTs are compact
scalar theories with radii $R=r\sqrt{2p}$ and $R=r\sqrt{2/p}$, respectively.
Obviously, by taking different values of $r$, each code covers the full space
of $c=1$ Narain CFTs.

Another way to think about the relation of codes to CFTs is that codes provide
a simple tool to represent the modular invariant partition function $Z(\tau)$
of any given Narain theory as a sum of “codeword blocks” $\Psi_{c}$
transforming in a particular representation of the modular group specified by
$\sf G$ (or more generally ${\sf G}_{\Lambda}$) equipped with the scalar
product. At a more technical level, the code – a collection of individual
codewords – provides a division of a code-based Narain lattice into subsets
$S_{c}$. The sum over such a subset is $\Psi_{c}$, which exhibits modular
properties (32). Since all Narain lattices are related by the orthogonal group
$O(n,n,\mathbb{R})$, any code can be used to decompose any Narain lattice into
subsets, such that the partial sums over the subsets will form a code-
specified representation of the modular group.

##  3 $(U(1)\times U(1))^{n}$ Chern-Simons theories on a solid torus

###  3.1 A review of Abelian Chern-Simons theories on handlebodies

In this paper we discuss Abelian Chern-Simons theories on handlebodies,
starting from a single Abelian factor, and then generalizing to many.
Handlebodies are smooth 3-manifolds ${\mathcal{M}}$ whose boundary
${\partial{\mathcal{M}}}$ is a genus-$g$ Riemann surface $\Sigma$.
Topologically, they are characterized by the set of one-cycles of $\Sigma$
that are contractible in ${\mathcal{M}}$, which form a Lagrangian sublattice
of $H^{1}({\mathcal{M}},\mathbb{Z})$ with respect to the intersection form. We
will focus on the $g=1$ case, for which two important examples of handlebodies
are thermal global anti-de Sitter space and (related to it by a modular
transformation of the torus) the BTZ black hole. Since Chern-Simons theories
are topological, the bulk metric of ${\mathcal{M}}$ will not play any role,
but its topology and the metric on the boundary ${\partial{\mathcal{M}}}$ are
important.

We begin with a $U(1)_{k}$ theory, whose Euclidean action is

$\displaystyle S={ik\over 4\pi}\int_{\mathcal{M}}A\wedge dA$ (36)

for integer $k$. A natural way to study this theory on a handlebody is using
radial quantization, where we view the handlebody ${\mathcal{M}}$ as a
fibration of the Riemann surface $\Sigma$ over a “radial” direction (which can
be viewed as Euclidean time) running from the interior (where the Riemann
surface shrinks to zero volume) to the boundary. In the above examples of
asymptotically $AdS_{3}$ spaces, the radial direction coincides with the usual
radial coordinate of $AdS_{3}$. From this point of view, the quantum theory
has a Hilbert space which is that of Chern-Simons theory on the Riemann
surface, and the path integral over the handlebody evaluates Euclidean time
evolution starting from some initial state $|\Psi_{\rm interior}\rangle$
determined by boundary conditions in the interior, to some final state
$|\Psi_{\rm boundary}\rangle$ corresponding to the boundary conditions on
${\partial{\mathcal{M}}}$. This Hilbert space contains $|k|^{g}$ states of
zero energy, and any given state is a linear combination of these. The
Euclidean time evolution is trivial, and the path integral on ${\mathcal{M}}$
is simply the overlap between the initial and final states inside this finite-
dimensional Hilbert space, $\langle\Psi_{\rm boundary}|\Psi_{\rm
interior}\rangle$. Note that for $|k|=1$ the Hilbert space is one-dimensional,
so all handlebodies give rise to the same interior wavefunction.

In this radial quantization picture the two “spatial” components of $A$ along
the Riemann surface are canonically conjugate variables, so they cannot both
be diagonalized at the same time. One can choose to write the wavefunctions as
functions of one or the other of these variables. More precisely, we will
express the wavefunctions in terms of holonomies of the gauge fields along $g$
nonintersecting one-cycles of the Riemann surface $\oint_{\gamma}A$;
$W_{\gamma}=\exp(i\oint_{\gamma}A)$ is gauge-invariant, so the holonomies can
be viewed as gauge-invariant coordinates up to shifts by $2\pi$ (which arise
from large gauge transformations that preserve the wavefunction). The
holonomies for a basis of dual cycles of $\Sigma$ form a set of canonically
conjugate variables. For any cycle $\gamma$ that shrinks in the interior of
the handlebody, the interior wavefunction must obey $W_{\gamma}|\Psi_{\rm
interior}\rangle=|\Psi_{\rm interior}\rangle$ (while the Wilson lines on the
conjugate cycles are completely smeared).

In the presence of a boundary, having a consistent variational principle for
the action (36) requires that

$\displaystyle\int_{\partial\mathcal{M}}A\wedge\delta A=0$ (37)

(involving both components of the gauge field along the boundary, and their
variations). Equation (37) can be satisfied by setting one of the components
of the gauge field to zero at the boundary, or by setting to zero a complex
combination of the two components, $A_{z}$ or $A_{\bar{z}}$, defined using an
appropriate complex structure on $\partial\mathcal{M}$. Setting a field to
zero at the boundary automatically sets its variation to be zero.

In order to obtain more interesting possibilities for boundary conditions, one
can add extra terms on the boundary. With an appropriate choice of a boundary
term quadratic in $A$, one can cancel the terms in (37) that involve a given
component of $\delta A$ (either a spatial component or a complex combination),
and then boundary conditions that set the other component of $A$ to any fixed
value are also allowed. In particular, if (with an appropriate choice of
boundary terms) $A_{\bar{z}}$ is frozen to a specific value at the boundary
while $A_{z}$ on the boundary is allowed to fluctuate, then the Chern-Simons
theory behaves as a chiral block of a 2d $U(1)_{k}$ CFT, with $A_{\bar{z}}$
interpreted as a source for a chiral $U(1)$ current $J(z)$ at level $k$
Witten:1988hf .

###  3.2 The wavefunction of $U(1)_{k}$ theory on a torus

As a warm-up example we construct the wavefunctions of level-$k$ $U(1)$ Chern-
Simons theory on a torus, following the classic work of Bos and Nair
Bos:1989wa . Additional technical details can be found in Appendix B. We
consider the CS theory (36) on a three-dimensional manifold $\mathcal{M}$ with
boundary $\partial\mathcal{M}$, which in our case will be a torus with modular
parameter $\tau$. We parametrize the boundary torus by the coordinate $z$,
with identifications $z\sim z+1,z+\tau$. We choose a gauge where the radial
component of the gauge field vanishes, and its equation of motion imposes
$F_{z{\bar{z}}}=0$. We can then further choose a gauge where the spatial
components of the gauge fields, $A_{z}$ and $A_{\bar{z}}$, are constant on the
torus.

Following Bos:1989wa ; Elitzur:1989nr  we will consider a holomorphic
representation of the wavefunction on the torus. This representation arises
naturally if we deform the action (36) by adding the boundary term

$\displaystyle S^{\prime}=S-{k\over 2\pi}\int_{\partial
M}d^{2}z|A|^{2},\qquad|A|^{2}\equiv A_{z}A_{\bar{z}},\qquad k>0,$ (38)

so that the equation of motion $\delta S^{\prime}/\delta A_{z}=0$ is trivially
satisfied at the boundary. Then the path integral can be evaluated with
boundary conditions of fixed $A_{\bar{z}}$ and arbitrary $A_{z}$.333Adding the
term (38) with the opposite sign, which is natural for $k<0$, allows one to
fix $A_{z}$ instead. The full path integral on the handlebody, including the
boundary term, with a fixed value of $A_{\bar{z}}$ at the boundary (which is
equivalent to the overlap with a wavefunction that is a delta function
imposing the boundary value of $A_{\bar{z}}$) is then

$\displaystyle\Psi_{\rm
interior}(A_{\bar{z}})=\int\limits_{A_{\bar{z}}|_{\partial{\mathcal{M}}}\,\rm
fixed}{\mathcal{D}}A\,\,e^{-S^{\prime}}.$ (39)

This is a holomorphic function of $A_{\bar{z}}$.

Because of the extra factor in the path integral, the overlap between two
wavefunctions in the holomorphic representation is given by

$\displaystyle\langle{\Psi_{1}}|{\Psi_{2}}\rangle=\int
d^{2}A_{\bar{z}}\,(\Psi_{1}(A_{\bar{z}}))^{*}\Psi_{2}(A_{\bar{z}})e^{-{k\over\pi}\int
d^{2}z|A_{\bar{z}}|^{2}}.$ (40)

This expression is schematic, since as we will discuss below one needs to
remove degeneracies due to large gauge transformations; see Appendix B for
details. The extra exponential factor in the overlap (40) can also be
understood in the following way. Understood as quantum operators in radial
quantization, the gauge field components on the torus with action (36) obey
the commutation relation $[A_{z},A_{\bar{z}}]=\frac{\pi}{k\tau_{2}}$,444Note
that this is not the same commutation relation that one obtains by starting at
high energies in a Maxwell-Chern-Simons theory Gukov:2004id , for which the
phase space is labelled by $A_{z}$, $A_{\bar{z}}$ and their (independent)
conjugate momenta. Here we describe wavefunctions on a different phase space,
which is labeled only by $A_{z}$ and its canonical conjugate $A_{\bar{z}}$.
See also Faddeev:1988qp ; Jackiw:1993in . so if we choose the wavefunctions to
be functions of only $A_{\bar{z}}$, $A_{z}$ acts on them by
$\frac{\pi}{k\tau_{2}}\frac{\partial}{\partial A_{\bar{z}}}$. If we insert
$A_{\bar{z}}$ into the overlap (40), then on one hand it can act on
$\Psi_{2}(A_{\bar{z}})$ by just multiplying it by $A_{\bar{z}}$, but on the
other hand by integration by parts it can act on
$(\Psi_{1}(A_{\bar{z}}))^{*}$, which is a function of $A_{z}$, as
$\frac{\pi}{k\tau_{2}}\frac{\partial}{\partial A_{z}}$, as expected from the
canonical commutation relations.

We will parameterize the value of $A_{\bar{z}}$ at the boundary by

$\displaystyle A_{\bar{z}}={i\pi\over\tau_{2}}\xi,$ (41)

where $\xi$ is a complex number. As described above, we can write the
wavefunctions on the torus, in particular $\Psi_{\rm interior}$, as
holomorphic functions of $\xi$. The normalization in (41) has been chosen so
that large gauge transformations in the bulk $A\rightarrow A+\omega$, which
are characterized by integer winding numbers $n,m$ around the two basis cycles
of the torus and preserve the gauge of $A$ being constant on the torus, shift
$\xi$ by

$\displaystyle\xi\rightarrow\xi+n+m\tau.$ (42)

Any holomorphic wavefunction of $A_{\bar{z}}$ gives a ground state of the
Hamiltonian, so the only constraint on the wavefunctions comes from their
required covariance under large gauge transformations. Under these
transformations, the interior wavefunction $\Psi_{\rm interior}$ should change
as follows

$\displaystyle\Psi_{\rm interior}\rightarrow\Psi_{\rm interior}\,e^{{ik\over
4\pi}\int\limits_{\partial\mathcal{M}}\omega\wedge A}e^{{k\tau_{2}\over
2\pi}(A_{z}\omega_{\bar{z}}+A_{\bar{z}}\omega_{z}+|\omega_{z}|^{2})}e^{i\varphi(\omega)},$
(43)

where we have introduced an additional cocycle $\varphi$ to assure
associativity of large gauge transformations $\Psi_{\rm
interior}(A+(\omega+\omega^{\prime}))=\Psi_{\rm
interior}((A+\omega)+\omega^{\prime})$. This condition requires

$\displaystyle\varphi(\omega+\omega^{\prime})=\varphi(\omega)+\varphi(\omega^{\prime})-{k\over
4\pi}\int\limits_{\partial\mathcal{M}}\omega\wedge\omega^{\prime},$ (44)

understood mod $2\pi$. Note that the $A_{z}$-dependent terms in (43) cancel,
consistent with $\Psi$ being holomorphic in $A_{\bar{z}}$.

Written explicitly in terms of $\xi$, see Appendix B for details,

$\displaystyle\Psi(\xi+n+m\tau)=\Psi(\xi)\,e^{{k\pi\over\tau_{2}}(n+m\bar{\tau})\xi+{k\pi\over
2\tau_{2}}|n+m\tau|^{2}+i\varphi},\quad\varphi=\pi knm+n\phi_{1}+m\phi_{2},$
(45)

which is consistent with the combination $|\Psi_{\rm
interior}|^{2}e^{-{k\pi\over\tau_{2}}|\xi|^{2}}$ being invariant under large
gauge transformations (43), as is expected from (40). For even $k$ the CS
theory does not require a spin structure, and we have $\phi_{1}=\phi_{2}=0$.
For odd $k$ the definition of the theory requires a spin structure, and on the
torus there are four possible spin structures, which give rise to the options
$\phi_{1,2}=0,\pi$. This statement can be justified by considering
transformations of $\Psi$ under modular transformations of $\tau$.

For any choice of spin structure there are $k$ distinct solutions for
$\Psi_{r}(\xi)$ (labeled by $r=0,\cdots,k-1$) since the space of level-$k$
$U(1)$ Chern-Simons wavefunctions on a torus is $k$-dimensional. They can be
written explicitly as

$\displaystyle\Psi_{r}(\xi)$ $\displaystyle=$
$\displaystyle\frac{1}{\eta(\tau)}\sum\limits_{n}e^{i\pi\tau p^{2}+2\pi
ipu+{\pi u^{2}\over 2\tau_{2}}+{\xi(\phi_{2}-\bar{\tau}\phi_{1})\over
2\tau_{2}}-{|\phi_{2}-\tau\phi_{1}|^{2}\over 8\pi k\tau_{2}}},$ (46)
$\displaystyle p$ $\displaystyle=$ $\displaystyle\sqrt{k}\left(n+{r\over
k}\right),\qquad u=\sqrt{k}\left(\xi+{\tau\phi_{1}-\phi_{2}\over 2\pi
k}\right).$

Here the appearance of $\eta(\tau)$ in the denominator is due to small
(topologically trivial) fluctuations of the gauge field in the bulk
Porrati:2021sdc . It can be checked straightforwardly that $\Psi_{r}$
satisfies (45) and is canonically normalized, see Appendix B.

In the holomorphic representation, the Wilson loop operator $W(p,q)={\rm
exp}\,({i\oint_{p,q}A})$ defined along the cycle $p+q\tau$ acts on
$\Psi_{r}(\xi)$ as follows

$\displaystyle\oint_{p,q}{A}$ $\displaystyle=$ $\displaystyle(p+q\tau){-i\over
k}{\partial\over\partial\xi}+(p+q\bar{\tau}){i\pi\over\tau_{2}}\xi,$ (47)
$\displaystyle W(p,q)\,\Psi_{r}(\xi)$ $\displaystyle=$ $\displaystyle
e^{i(p\phi_{1}+q\phi_{2})/k+2\pi ipr/k+i\pi pq/k}\Psi_{r+q}(\xi).$ (48)

Note that the spin structure with $\phi_{1}=\phi_{2}=\pi$ is one where the
spinors are periodic along both basic cycles of the torus; this odd spin
structure is modular invariant by itself, but it does not allow any of the
cycles to shrink in the interior (so it does not appear for handlebodies).
This is consistent with the fact that for $k=1$ with this choice, the unique
wavefunction $\Psi_{0}(\xi)$ has eigenvalues $W(1,0)=W(0,1)=-1$.

###  3.3 Wavefunction of the $(U(1)\times U(1))_{k}$ theory

Our next step is to study the “AB” theory with the action

$\displaystyle S={ik\over 4\pi}\int(A\wedge dB+B\wedge dA),$ (49)

with invariance under all gauge transformations of $A$ and $B$, that include
the large gauge transformations

$\displaystyle A\rightarrow A+\omega_{A},\quad B\rightarrow B+\omega_{B}.$
(50)

This defines the theory in the bulk, which we will denote by $(U(1)\times
U(1))_{k}$ to emphasize that this is not a direct product of two $U(1)_{k}$
Chern-Simons theories. As above, to describe the theory on a handlebody we
also need to choose boundary terms and boundary conditions. Unlike the case of
a single $U(1)$ field, the $U(1)\times U(1)$ theory has a continuous family of
choices of which variables can be kept fixed at the boundary. For any $r$ we
can define gauge fields $A_{\pm}=(A/r\pm B\,r)\sqrt{k/2}$ such that the action
becomes

$\displaystyle S={i\over 4\pi}\int(A_{+}\wedge dA_{+}-A_{-}\wedge dA_{-}).$
(51)

This now becomes the action of two decoupled $U(1)$ theories at levels $1$ and
$(-1)$, but the dynamical fields are connected at the level of the large gauge
transformations (50), so the theory is not equivalent to a product of two
decoupled theories. In any case, since $A_{+}$ has positive level and $A_{-}$
has negative level, we can now choose boundary terms and boundary conditions
as in the previous subsection such that we fix $(A_{+})_{\bar{z}}$ and
$(A_{-})_{z}$ at the boundary to arbitrary values. Analogously to (41), we
introduce two independent holomorphic coordinates

$\displaystyle\xi={\tau_{2}\over
i\pi}(A_{+})_{\bar{z}},\quad\bar{\xi}=-{\tau_{2}\over i\pi}(A_{-})_{z},$ (52)

and deform the action by the boundary term

$\displaystyle S^{\prime}=S-{1\over 2\pi}\int_{\partial
M}d^{2}z\left(|A_{+}|^{2}+|A_{-}|^{2}\right),$ (53)

such that the equations of motion $\delta S/\delta(A_{+})_{z}=\delta
S/\delta(A_{-})_{\bar{z}}=0$ are trivially satisfied at the boundary. The
wavefunction $\Psi(\xi,\bar{\xi})$ associated with this action is holomorphic
in $\xi$, and separately in ${\bar{\xi}}$.

Next, we demand that under large gauge transformations with parameters $(n,m)$
for $A$, and $(p,q)$ for $B$, which take

$\displaystyle\xi$ $\displaystyle\rightarrow$
$\displaystyle\xi+\delta\xi,\quad\delta\xi=\sqrt{k\over
2}\left((n+m\tau)r^{-1}+(p+q\tau)r\right),$ (54) $\displaystyle\bar{\xi}$
$\displaystyle\rightarrow$
$\displaystyle\bar{\xi}+\delta\bar{\xi},\quad\delta\bar{\xi}=\sqrt{k\over
2}\left((n+m\bar{\tau})r^{-1}-(p+q\bar{\tau})r\right),$

$\Psi$ should change by

$\displaystyle\Psi$ $\displaystyle\rightarrow$
$\displaystyle\Psi\,e^{{\pi\over
2\tau_{2}}(2\xi\delta\xi^{*}+|\delta\xi|^{2}+2\bar{\xi}\delta\bar{\xi}^{*}+|\delta\bar{\xi}|^{2})+i\pi
k(mp-nq)}.$ (55)

In this case the cocycle factor is simply $\varphi=\pi k(mp-nq)$, so there is
no need to introduce nontrivial phases $\phi_{i}$. There are $k^{2}$
wavefunctions given explicitly by

$\displaystyle\Psi_{a,b}(\xi,\bar{\xi},\tau)$ $\displaystyle=$
$\displaystyle{1\over|\eta(\tau)|^{2}}\sum_{n,m}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}+2\pi i(p_{L}\xi-p_{R}\bar{\xi})+{\pi\over
2\tau_{2}}(\xi^{2}+\bar{\xi}^{2})},\quad 0\leq a,b<k,$ (56) $\displaystyle
p_{L,R}$ $\displaystyle=$ $\displaystyle\sqrt{k\over
2}\left((n+a/k)r^{-1}\pm(m+b/k)r\right),\quad n,m\in\mathbb{Z}.$

We would like to emphasize that (56) for different $r$ are different
representations of the same $k^{2}$ bulk wavefunctions, expressed as functions
of different variables (corresponding to the specific choice of boundary
conditions we made). The result (56) resembles the partition function of a
free scalar CFT, and we will discuss the precise relation in the next section.

Wilson loops of $A$ along the $n+m\tau$ cycle, $W_{A}(n,m)={\rm
exp}\,(i\oint_{n,m}A)$, with a similar definition for Wilson loops of $B$, act
on (56) as follows

$\displaystyle W_{A}(n,m)\Psi_{a,b}=\Psi_{a,b+m}\,e^{2\pi ian/k},$ (57)
$\displaystyle W_{B}(n,m)\Psi_{a,b}=\Psi_{a+m,b}\,e^{2\pi ibn/k}.$ (58)

In particular, Wilson lines of both $A$ and $B$ along the $1$ cycle act on
$\Psi_{0,0}$ trivially, so $\Psi_{0,0}$ is a consistent wavefunction on
thermal AdS – the handlebody where this cycle shrinks in the interior.

###  3.4 General case

Before we proceed with the general $(U(1)\times U(1))^{n}$ theory we would
like to revisit the $U(1)\times U(1)$ case, but instead of starting with the
“AB” theory (49), we can start with (51) and (52) and just impose large gauge
transformations generalizing (54)

$\displaystyle\delta\left(\begin{array}[]{c}\xi+\bar{\xi}^{*}\\\
\xi-\bar{\xi}^{*}\end{array}\right)=\sqrt{2}\Lambda(\vec{n}+\vec{m}\tau),\quad\vec{n},\vec{m}\in\mathbb{Z}^{2}.$
(61)

Here $\Lambda$ defines an even self-orthogonal lattice in $\mathbb{R}^{1,1}$
as in (18). The holomorphic functions of $\xi$ and $\bar{\xi}$

$\displaystyle\Psi_{\vec{c}}(\xi,\bar{\xi},\tau)=\frac{1}{|\eta(\tau)|^{2}}\sum_{\vec{\ell}}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}+2\pi i(p_{L}\xi-p_{R}\bar{\xi})+{\pi\over
2\tau_{2}}(\xi^{2}+\bar{\xi}^{2})},$ (62)
$\displaystyle\left(\begin{array}[]{c}p_{L}+p_{R}\\\ p_{L}-p_{R}\\\
\end{array}\right)=\sqrt{2}\Lambda(\vec{\ell}+g_{\Lambda}^{-1}\vec{c}),\quad\vec{\ell}\in\mathbb{Z}^{2}$
(65)

are parametrized by elements of the Abelian group
$\vec{c}\in\mathbb{Z}^{2}/g_{\Lambda}=\Lambda^{*}/\Lambda={\sf G}$, and under
large gauge transformations (61) they change as follows :

$\displaystyle\Psi_{\vec{c}}(\xi+\delta\xi,\bar{\xi}+\delta\bar{\xi})=\Psi_{\vec{c}}(\xi,\bar{\xi})\,e^{{\pi\over
2\tau_{2}}(2\xi\delta\xi^{*}+|\delta\xi|^{2}+2\bar{\xi}\delta\bar{\xi}^{*}+|\delta\bar{\xi}|^{2})}\,e^{i\pi
n^{T}g_{\Lambda}m}.$ (66)

The generalization to the case of $(U(1)\times U(1))^{n}$ is now
straightforward. The main ingredient is the even self-orthogonal lattice
${\Lambda}\in\mathbb{R}^{n,n}$, which defines large gauge transformations of
$U(1)^{n}$-valued gauge fields $A_{\pm}$ as follows,

$\displaystyle\left(\begin{array}[]{c}\xi+\bar{\xi}^{*}\\\
\xi-\bar{\xi}^{*}\end{array}\right)\rightarrow\left(\begin{array}[]{c}\xi+\bar{\xi}^{*}\\\
\xi-\bar{\xi}^{*}\end{array}\right)+{\sqrt{2}{\Lambda}(\vec{n}+\vec{m}\tau)},\quad\vec{n},\vec{m}\in\mathbb{Z}^{2n},$
(71)

while the relation between $\xi,\bar{\xi}$ and $A_{\pm}$ is as in (52),
generalized to vector-valued quantities. The resulting wavefunction is
parametrized by an element of the Abelian group $c\in{\sf
G}_{\Lambda}={\Lambda}^{*}/{\Lambda}$,

$\displaystyle\Psi_{c}={\Theta_{c}\over|\eta(\tau)|^{2n}},$
$\displaystyle\Theta_{c}(\xi,\bar{\xi},\tau)=\sum_{\vec{\ell}}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}+2\pi i(p_{L}\cdot\xi-
p_{R}\cdot\bar{\xi})+{\pi\over 2\tau_{2}}(\xi^{2}+\bar{\xi}^{2})},$ (72)
$\displaystyle\left(\begin{array}[]{c}p_{L}+p_{R}\\\
p_{L}-p_{R}\end{array}\right)={\sqrt{2}{\Lambda}(\vec{\ell}+g_{\Lambda}^{-1}\vec{c})},\quad\vec{\ell}\in\mathbb{Z}^{2n},\quad
g_{\Lambda}={\Lambda}^{T}\eta{\Lambda}.$ (75)

The wavefunction $\Psi_{c}$ coincides exactly with the “codeword blocks”
(2.2). We will explore the holographic interpretation of this result in
section 4.

##  4 Holographic description of the ensemble of code CFTs

###  4.1 Level $k=1$ CS theories and conventional holographic correspondence

As discussed above, for $k=1$ the $U(1)\times U(1)$ CS theory has a unique
wavefunction, which can be written as $\Psi_{00}(\tau,\xi,\bar{\xi})$. It is
given by the CS path integral on any handlebody $\mathcal{M}$ with the
appropriate boundary conditions on $\partial M=\Sigma$ of genus one. Our
starting point is the observation that this unique wavefunction (56) with
$k=1$ is the same as the path integral of the two-dimensional CFT, the compact
scalar of radius $R=\sqrt{2}r$, coupled to an external complex gauge field
$\mathcal{A}$ parametrized by $\xi,\bar{\xi}$

$\displaystyle Z_{BPI}(\tau,\xi,\bar{\xi})=\Psi_{00}(\tau,\xi,\bar{\xi}).$
(76)

We discuss the compact scalar in detail in Appendix A. From the bulk point of
view $\xi,\bar{\xi}$ parametrize certain components of the fields
$A_{+},A_{-}$ on the boundary of $\mathcal{M}$, and the holographic dictionary
relates them to sources in the CFT by

$\displaystyle{i\pi\over\tau_{2}}\xi={\mathcal{A}}_{\bar{z}}=(A_{+})_{\bar{z}},\qquad-{i\pi\over\tau_{2}}\bar{\xi}={\mathcal{A}}_{z}=(A_{-})_{z},$
(77)

such that $Z_{BPI}$ is the CFT path integral with these sources (as discussed
in Appendix A). In the CFT the complex field $\mathcal{A}$ is a combination of
two real fields $A$ and $B$ coupled to the two conserved $U(1)$ currents, see
(174), and we have chosen notation such that the CFT source fields $A,B$ are
exactly the boundary values of the bulk gauge fields $A,B$ introduced in
subsection 3.3. At the same time we emphasize that the Chern-Simons theory is
quantized with the boundary condition that fixes the fields
$(A_{+})_{\bar{z}},(A_{-})_{z}$ at the boundary, while
$(A_{+})_{z},(A_{-})_{\bar{z}}$ vary freely. This condition looks cumbersome
when expressed in terms of $A$ and $B$.

While preserving the same boundary conditions, we can add an additional
boundary term ${\pi\xi\bar{\xi}\over\tau_{2}}$ to the bulk action (53) and
obtain, after an integration by parts,

$\displaystyle S_{1}={i\over 2\pi}\int_{\mathcal{M}}B\wedge
dA-{r^{2}\over\pi}\int_{\partial\mathcal{M}}d^{2}z\,|B|^{2}.$ (78)

The new action still satisfies $\delta S_{1}/\delta(A_{+})_{z}=\delta
S_{1}/\delta(A_{-})_{\bar{z}}=0$ at the boundary, because the added boundary
term does not include fluctuating fields. It leads to a holomorphic bulk
wavefunction which equals the first path integral introduced in Appendix A

$\displaystyle Z_{\rm
PI}(\tau,\xi,\bar{\xi})=\int{\mathcal{D}}A\,{\mathcal{D}}B\,e^{-S_{1}}.$ (79)

Note that unlike the bulk path integral discussed in the previous section
(related to it by
$Z_{PI}(\tau,\xi,\bar{\xi})=Z_{BPI}(\tau,\xi,\bar{\xi})e^{-{\pi\over\tau_{2}}\xi\bar{\xi}}$),
$Z_{\rm PI}$ is manifestly invariant under large gauge transformations of $A$.
Similarly, subtracting ${\pi\xi\bar{\xi}\over\tau_{2}}$ from the bulk action
leads to

$\displaystyle S_{2}={i\over 2\pi}\int_{\mathcal{M}}A\wedge
dB-{r^{-2}\over\pi}\int_{\partial\mathcal{M}}d^{2}z\,|A|^{2},$ (80)

and

$\displaystyle Z^{\prime}_{\rm
PI}(\tau,\xi,\bar{\xi})=\int{\mathcal{D}}A\,{\mathcal{D}}B\,e^{-S_{2}},$ (81)

which is manifestly invariant under large gauge transformations of $B$. To be
precise, these bulk theories are actually complexifications of the path
integrals considered in Appendix A, as $\xi,\bar{\xi}$ are treated here as two
independent complex variables. To reduce precisely to the CFTs described by
the actions (162) and (169), one would need to impose additional restrictions
on the boundary conditions in (79) and (81), that respectively set $B=0$ and
$A=0$ at the boundary, by choosing $\xi^{*}=\pm\bar{\xi}$.

It is important to point out that the parameter $r$ from the bulk point of
view is a parameter changing the representation of the Chern-Simons
wavefunction $|\Psi\rangle$. It defines the boundary conditions, but it does
not affect the action in the bulk. Hence, for all $r$ the quantum state
$|\Psi\rangle$ remains the same, which is already clear from the fact that the
Hilbert space of level-1 Chern-Simons theory is 1-dimensional. From the
boundary point of view, the parameter $r$ – the radius of the compact circle –
changes the CFT. This situation is not conceptually different from more
conventional instances of the holographic correspondence, such as
gauge/gravity duality, in which the path integral of the same bulk action with
different boundary conditions describes different field theories. For example,
exactly marginal deformations of a CFT correspond to changing the boundary
conditions for massless scalars in anti-de Sitter space. Another even more
direct analogy is with the dS/CFT correspondence Strominger:2001pn , where the
same quantum Hartle-Hawking wavefunction in the bulk is dual to different
field theories, depending on the overlap of the unique bulk wavefunction with
the wavefunction at the boundary.

The generalization of the above considerations to $(U(1)\times U(1))^{n}$ is
straightforward. The general level $k=1$ theory is $(U(1)\times U(1))^{n}$
Chern-Simons theory, quantized with large gauge transformations corresponding
to points in an even self-dual lattice $\Lambda$ (71). In this case ${\sf
G}_{\Lambda}={\Lambda}^{*}/{\Lambda}$ consists of a single element, and the
unique wavefunction (3.4) is identified with the path integral of the Narain
theory associated with $\Lambda$

$\displaystyle
Z_{BPI}(\tau,\xi,\bar{\xi},{\Lambda})=\Psi_{\vec{0}}(\tau,\xi,\bar{\xi}).$
(82)

Similarly to the $n=1$ case, there are many possible definitions of path
integrals, generalizing (79) and (81); here we use the $T$-duality invariant
definition of (3.4).

One can rewrite the $(U(1)\times U(1))^{n}$ fields $A_{\pm}$ in terms of the
gauge fields $A,\,B$ and the lattice $\Lambda$, which we parametrize by
$\gamma$ and $B$ as in (8) with trivial $O_{T}$,

$\displaystyle A_{\pm}={(\gamma\pm\gamma^{*}B)A\pm\gamma^{*}B\over\sqrt{2}}.$
(83)

In terms of these fields, the action of large gauge transformations are
canonical, $A\rightarrow A+\omega_{A}$, $B\rightarrow B+\omega_{B}$, but the
boundary conditions in the path integral become $\Lambda$-dependent. This
description provides the holographic dictionary for a general Narain CFT: the
path integral of a Narain theory is equivalent to the path integral of level-1
$(U(1)\times U(1))^{n}$ Chern-Simons theory with boundary conditions
(wavefunction representation) specified by $\Lambda$.

The construction above is an explicit realization of the $\rm AdS_{3}/CFT_{2}$
correspondence for Narain theories in terms of pure Chern-Simons theory in the
bulk. The original treatment in Gukov:2004id , recently revisited in
Ashwinkumar:2021kav , was in terms of Maxwell-Chern-Simons theory in the limit
of infinite Maxwell coupling. We have shown here that inclusion of the Maxwell
term is not necessary, provided a more explicit treatment by evaluating the
path integral on both sides of the duality, and established a holographic
dictionary. Our approach is also related to the recent work Benini:2022hzx ,
which constructs a bulk description for a Narain theory with decomposable
${\Lambda}={\Lambda}_{L}\oplus{\Lambda}_{R}$ in terms of level $k=1$ CS
theory, obtained from $k>1$ Chern-Simons theory by gauging all discrete
symmetries.

It is important to note that the holographic description above does not
include a sum over bulk geometries or topologies. Rather, all handlebodies
yield the same wavefunction, obeying (82). This is analogous to the case of
$\rm AdS_{3}$ with $k=1$ units of NS-NS flux (the “tensionless string”)
Eberhardt:2020bgq ; Eberhardt:2021jvj , where fluctuations in the bulk on a
fixed background geometry are believed to account for the full partition
function.

Codes, and code ensembles, play a rather trivial role in the holographic
description of Narain CFTs in terms of level $k=1$ Chern-Simons theory.
Indeed, the $k=1$ $U(1)\times U(1)$ theory is associated with the unique
length $n=1$ code over the alphabet $\mathbb{Z}_{1}\times\mathbb{Z}_{1}$,
consisting of the unique codeword $c=(0,0)$. The parameter $r$, the radius of
the compact scalar on the CFT side, does not affect the code, but controls the
embedding of the code into the space of $n=1$ Narain CFTs. Similarly, whenever
the lattice $\Lambda$ is self-dual, the group ${\sf G}_{\Lambda}$ is trivial,
consisting of a single element, and there is a unique code consisting of a
single codeword $c=\vec{0}$. As we saw above, this trivial code can be mapped
to an arbitrary Narain theory by choosing an appropriate embedding. To
summarize, we see that the conventional holographic correspondence emerges
when the code ensemble consist of only one element, a unique code associated
with a given Narain CFT.

###  4.2 Averaging over Narain CFTs

The holographic duality described above maps Narain theories to three
dimensional bulk theories which are non-gravitational Chern-Simons theories
living on a fixed space-time, with no sum over geometries. This is consistent
with the fact that in these CFTs the energy-momentum tensor is a product of
$U(1)$ currents, so we do not expect an independent graviton field in the bulk

Motivated by Afkhami-Jeddi:2020ezh ; Maloney:2020nni  will now consider an
average over a finite ensemble of Narain theories, or over the whole moduli
space of Narain theories with some $c=n$. A priori, it is not clear if such an
ensemble average would have a simple description in the bulk. The duality
between Narain theories and level-1 CS theories on a fixed handlebody provides
one way to evaluate it – by averaging over all possible boundary terms and
boundary conditions, corresponding to all Narain CFTs. For $n=1$ this is just
an average over the values of $r$. One way to implement this is to write down
the boundary terms as a function of $\gamma$ and $B$ using (83), and then to
make these variables dynamical and to integrate over them with an
$O(n,n,\mathbb{R})$-invariant measure. These variables live just on the
boundary, but since they are constant on $\partial{\mathcal{M}}$, integrating
over them gives a non-local theory. This non-local theory (on a given
handlebody) is, by construction, equivalent to the ensemble average over
Narain theories, but this is not very satisfactory, and certainly more
complicated than the dual description suggested in Afkhami-Jeddi:2020ezh ;
Maloney:2020nni . In the rest of this section we explore an alternative way to
obtain the ensemble average over Narain theories, which will lead to bulk sums
over geometries similar to those of Afkhami-Jeddi:2020ezh ; Maloney:2020nni ,
but described by a fully consistent Chern-Simons theory with compact gauge
group. “U(1)-gravity” theory will then emerge as a limit.

###  4.3 Level $k>1$ CS theory and ensemble averaging

Our next step is to consider codes over alphabets with more than one element.
As we have seen in full generality in section 3.4, the “codeword blocks”
$\Psi_{c}$ (2.2) appearing in the context of codes have a simple bulk
interpretation. They are precisely the same as the wavefunctions of the
$(U(1)\times U(1))^{n}$ Chern-Simons theory on a spatial torus. Indeed, the
theory quantized with large gauge transformations specified by a lattice
$\Lambda$ has exactly $G_{\Lambda}={\Lambda}^{*}/{\Lambda}$ independent
wavefunctions, in one to one correspondence with the codewords. As was
emphasized in section 2, any given code $\mathcal{C}$ of length $n$ can be
associated with any Narain CFT of central charge $n$, by choosing an
appropriate embedding. As a result we have the following expression for the
CFT path integral

$\displaystyle
Z_{\mathcal{C}}=W_{\mathcal{C}}(\Psi)=\sum_{c\in\mathcal{C}}\Psi_{c}.$ (84)

This expression, though suggestive, has no apparent holographic
interpretation. Indeed, the sum of wavefunctions on the right-hand side of
(84) does not allow for a simple interpretation as the bulk path integral
evaluated on a simple 3d geometry, or as a sum of such path integrals. This is
because in general, path integrals on simple geometries such as solid tori
with different shrinking cycles would lead to a subclass of $\Psi_{c}$ not
nearly exhausting all possibilities. This is easiest to see in the case of
codes over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ and $(U(1)\times
U(1))_{k}^{n}$ Chern-Simons theory. The path integral over the solid torus
with a shrinkable $n+m\tau$ cycle will lead to the unique combination of
$\Psi_{a_{1},b_{1}}\dots\Psi_{a_{n}b_{n}}$ invariant under (57),(58) for those
values of $n$ and $m$. For $k>1$, combinations of these with integer
coefficients can not in general lead to (84).

Although associating individual CFTs with codes does not lead to a simple
holographic interpretation, we note that codes – and hence also the associated
CFTs – naturally appear in the context of ensembles. There is always an
ensemble of all codes (CFTs) of a particular type (e.g. over a particular
alphabet) and of given length (corresponding to CFT central charge $n$). It
was initially suggested in Dymarsky:2020qom  that such an ensemble of code
CFTs should admit a holographic interpretation. A crucial observation building
towards such an interpretation was made recently in Henriksson:2022dml . There
the authors considered an ensemble consisting of all length-$n$
$\mathbb{Z}_{2}\times\mathbb{Z}_{2}$ codes with the glue matrix

$\displaystyle{\sf\Lambda}=\left(\begin{array}[]{cc}1&1\\\
1&-1\end{array}\right)$ (87)

in the notation of section 2 (the original paper used a different but
equivalent description). It was conjectured, and then verified explicitly for
small $n$, that the enumerator polynomial, averaged over the ensemble of all
such codes, is proportional to the “Poincaré series” of all possible modular
transformations acting on the auxiliary variable associated with the trivial
codeword,

$\displaystyle\overline{W}(\\{X\\})\equiv{1\over{\mathcal{N}}}\sum\limits_{\mathcal{C}}W_{\mathcal{C}}(\\{X\\})\,\propto\sum_{g\in\Gamma^{*}\backslash
SL(2,\mathbb{Z})}{g}(X_{00}^{n}).$ (88)

We emphasize that the action of the modular group on the variables $X_{ab}$,
generated by (32), along with the equality (88), are defined and satisfied at
the level of codes, before the map to CFTs and Chern-Simons theory. The
variables $X_{ab}$ provide (for $k=2$) a four-dimensional representation of
the modular group $SL(2,\mathbb{Z})$; hence the sum on the right-hand side of
(88) over $\Gamma^{*}\backslash SL(2,\mathbb{Z})$, where $\Gamma^{*}$ is the
stabilizer of $X_{00}$, includes a finite number of terms. Alternatively, one
can sum over the whole modular group, with the infinite size of $\Gamma^{*}$
absorbed into the overall proportionality coefficient.

While we leave a systematic justification of (88) and its generalizations to
future work future , we point out that the equality between the weighted
average over codes and the Poincaré sum over the modular group will apply to
other code constructions as well, and will extend to higher genus boundaries.
To be explicit, in what follows we focus our attention on
$\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ codes with the glue matrix (21) and prime
$k=p$, for which we establish the analogue of (88) for arbitrary $n$. We
consider codes of length $n$, which define an ensemble of size (4). For prime
$p$ all codes should be averaged with equal weight. In this case, the average
is straightforward – see footnote on page 31.

Next we consider the sum over the modular group in (88). We introduce $p^{2}$
variables $X_{ab}$ forming a representation of the modular group generated by
(14) and by obtaining $X^{\prime}$ of (10) when taking $\tau\to-1/\tau$. The
full set of $(p^{2})^{n}$ variables $X_{\vec{a},\vec{b}}$ associated with
codes of length $n$ transform in the tensor product of $n$ such
representations. The explicit action of the $T$ and $S$ generators of
$SL(2,\mathbb{Z})$ is, using (32),

$\displaystyle T(X_{\vec{a},\vec{b}})=X_{\vec{a},\vec{b}}\,e^{2\pi
i{\vec{a}\cdot\vec{b}\over p}},$ (89) $\displaystyle
S(X_{\vec{a},\vec{b}})={1\over
p^{n}}\sum_{\vec{a}^{\prime},\vec{b}^{\prime}}X_{\vec{a}^{\prime},\vec{b}^{\prime}}\,e^{-2\pi
i{\vec{a}\cdot\vec{b}^{\prime}+\vec{a}^{\prime}\cdot\vec{b}\over p}}.$

Our goal is to sum over $\Gamma^{*}\backslash SL(2,\mathbb{Z})$, where
$\Gamma^{*}$ is the stabilizer group of $X_{\vec{0},\vec{0}}$. The sum can be
performed in two steps: we first define a subgroup $\Gamma\subset
SL(2,\mathbb{Z})$ which leaves all $X_{\vec{a},\vec{b}}$ invariant, and then
additionally factorize over the stabilizer of $X_{\vec{0},\vec{0}}$ within
$\Gamma\backslash SL(2,\mathbb{Z})$. The group $\Gamma$ in the general case is
known to be a congruence subgroup of $SL(2,\mathbb{Z})$ Ashwinkumar:2021kav ;
schoeneberg2012elliptic ; for prime $p$ it is the principal congruence
subgroup $\Gamma=\Gamma(p)$. The stabilizer of $X_{\vec{0},\vec{0}}$ in
$\Gamma\backslash SL(2,\mathbb{Z})$ is the cyclic group
$\mathbb{Z}_{2}\times\mathbb{Z}_{p}$ generated by $S^{2}$ (which takes
$X_{a,b}$ to $X_{-a,-b}$) and by powers of $T$, so

$\displaystyle\Gamma^{*}\backslash
SL(2,\mathbb{Z})=(\mathbb{Z}_{2}\times\mathbb{Z}_{p})\backslash
SL(2,\mathbb{Z})/\Gamma(p).$ (90)

This quotient consists of $(p^{2}-1)/2$ elements, which can be parametrized by
integer pairs $(c,d)\sim(-c,-d)$, corresponding to the modular transformation

$\displaystyle g=\left(\begin{array}[]{cc}a&b\\\ c&d\end{array}\right)\in
SL(2,\mathbb{Z}_{p})\cong\Gamma_{1}(p)\backslash PSL(2,\mathbb{Z}),$ (93)

which has the following action on $X_{\vec{0},\vec{0}}$:

$\displaystyle g(X_{\vec{0},\vec{0}})={1\over
p^{n}}\sum_{\vec{a},\vec{b}}X_{\vec{a},\vec{b}}\,e^{-2\pi
i{\vec{a}\cdot\vec{b}\over p}r},\qquad r=d/c\,\,{\rm mod}\,\,p.$ (94)

The equation above applies when $c\neq 0$; otherwise
$g(X_{\vec{0},\vec{0}})=X_{\vec{0},\vec{0}}$. One can readily see that the
$(p^{2}-1)/2$ terms in the Poincaré sum split into $p+1$ terms labeled by
elements of $\Gamma_{0}(p)\backslash SL(2,\mathbb{Z})=\\{1,ST^{l}\\}$ with
$0\leq l<p$, each appearing $(p-1)/2$ times. Combining everything, we find the
averaged enumerator polynomial for codes over
$\mathbb{Z}_{p}\times\mathbb{Z}_{p}$,

$\displaystyle\overline{W}(X_{\vec{a},\vec{b}})={1\over{\mathcal{N}}}\sum\limits_{\mathcal{C}}W_{\mathcal{C}}(X_{\vec{a},\vec{b}})={\sum_{g\in\Gamma_{0}(p)\backslash
SL(2,\mathbb{Z})}g(X_{\vec{0},\vec{0}})\over
1+p^{1-n}}={X_{\vec{0},\vec{0}}+{1\over
p^{n}}\sum\limits_{r=0}^{p-1}\sum\limits_{\vec{a},\vec{b}}X_{\vec{a},\vec{b}}\,e^{-2\pi
i{\vec{a}\cdot\vec{b}\over p}r}\over 1+p^{1-n}}.$ (95)

Here $\mathcal{N}$ is given by (4), and the coefficient $1+p^{1-n}$ in the
denominator of the right-hand side is chosen such that the coefficient in
front of $X_{\vec{0},\vec{0}}$ associated with the trivial codeword is equal
to one.

The identity (95) for code CFTs acquires a straightforward holographic
interpretation which has been envisioned in Henriksson:2022dml . We consider
$((U(1)\times U(1))_{k}^{n}$ Chern-Simons theory, placed on an arbitrary
handlebody geometry, and identify $\Psi_{\vec{0},\vec{0}}(\tau,\xi,\bar{\xi})$
to be the wavefunction of this theory on thermal AdS, the solid torus with
shrinkable $a$-cycle. Indeed, Wilson loops of both $A$ and $B$ fields over
this shrinkable cycle should act on the boundary wavefunction trivially, which
singles out $\Psi_{\vec{0},\vec{0}}$, as follows from (57), (58). Hence, the
sum in (95) can be interpreted as a sum over all possible handlebody
topologies, or more accurately, as a sum over equivalence classes of
topologies yielding the same boundary wavefunction,

$\displaystyle\overline{Z}_{BPI}(\tau,\xi,\bar{\xi})$ $\displaystyle=$
$\displaystyle{1\over 1+p^{1-n}}\sum_{g\in\Gamma_{1}(p)\backslash
SL(2,\mathbb{Z})}\Psi_{\vec{0},\vec{0}}(g\,\tau,g\,\xi,g\,\bar{\xi})=$
$\displaystyle{1\over
1+p^{1-n}}\left(\Psi_{\vec{0},\vec{0}}(\tau,\xi,\bar{\xi})+p^{-n}\sum\limits_{r=0}^{p-1}\sum\limits_{\vec{a},\vec{b}\in\mathbb{Z}^{n}_{p}}\Psi_{\vec{a},\vec{b}}(\tau,\xi,\bar{\xi})\,e^{-2\pi
i{\vec{a}\cdot\vec{b}\over p}r}\right).$

This equality between ensemble averaging over code CFTs on the field theory
side, and summing over topologies on the bulk side, is preserved under the
action of $O(n,n,\mathbb{R})$, which changes the embedding of the codes in the
space of Narain CFTs and the representation of the wavefunction of the dual
Chern-Simons theory.

We expect an equality analogous to (4.3) to apply more broadly, to codes
defined as even self-dual linear subspaces of the group ${\sf G}_{\Lambda}$
defined by an even self-orthogonal lattice ${\Lambda}$ and corresponding code
CFTs/ Chern-Simons theories, although the averaging weights and the details of
the “Poincaré sum” will be different. The equality will also extend to higher
genus boundary geometries.

To summarize, we have obtained an infinite series of explicit examples of
“holographic duality,” in which an ensemble of CFTs is dual to a Chern-Simons
theory coupled to topological gravity, and the bulk partition function is
given by a sum over topologies. This sum is akin to a sum over saddle point
configurations in conventional gravity, implementing the ideas of
Dijkgraaf:2000fq ; Maloney:2007ud ; Keller:2014xba . In spirit, our examples
are similar to the original work Castro:2011zq  representing the Ising model
partition function as a sum “over geometries,” but crucially we explicitly
outline the dual theory in the bulk.

Our code-based construction allows for many generalizations, to additive codes
of other types, and potentially going beyond additive codes and Abelian CFTs.
We expect that this approach may lead to many more explicit examples,
potentially reformulating the results of Meruliya:2021lul ; Dong:2021wot ;
Raeymaekers:2021ypf  in terms of codes.

Although in this paper we only consider the CFTs living on a torus, we expect
that the holographic duality will generalize to higher genera future . The
ensembles we consider contain a finite number of CFTs, hence the ensemble is
parameterized by a finite number of moments. This will imply that the dual
Chern-Simons theory on $\mathcal{M}$, with $\partial\mathcal{M}$ being a
Riemann surface of sufficiently high genus, would be completely determined in
terms of path integrals over lower genus boundary surfaces. This will require
various factorization rules in the bulk, which deserves a better
understanding.

###  4.4 Holographic correspondence in the $k\rightarrow\infty$ limit

In the previous section we saw that the size of the ensemble is related to the
number of classes of topologies appearing in the bulk sum. Bigger ensembles
correspond to “more gravitational” theories in the bulk, distinguishing more
topological features and thus leading to a sum over more classes of
topologies. It is thus natural to ask, what would happen with the duality as
the size of the code CFT ensemble becomes infinitely large. In what follows we
take $k=p$ to be prime for simplicity. To evaluate the right-hand side of (95)
in the $p\to\infty$ limit we go back to definition of $\Psi_{\vec{0},\vec{0}}$
(3.4),

$\displaystyle\Psi_{\vec{0},\vec{0}}(\tau^{\prime},\xi^{\prime},\bar{\xi}^{\prime})={\Theta_{\vec{0},\vec{0}}(\tau^{\prime},\xi^{\prime},\bar{\xi}^{\prime})\over|c\tau+d|^{n}|\eta(\tau)|^{2n}},\qquad
g=\left(\begin{array}[]{cc}a&b\\\ c&d\end{array}\right)\in SL(2,\mathbb{Z}),$
(99) $\displaystyle\tau^{\prime}={a\tau+b\over
c\tau+d},\qquad\xi^{\prime}={\xi\over
c\tau+d},\qquad\bar{\xi}^{\prime}={\bar{\xi}\over c\bar{\tau}+d}.$

From (94) we know that we do not need to consider all possible co-prime pairs
$c,d$, but only $c=0,d=1$, and $p$ additional pairs yielding all possible
values for $dc^{-1}$ mod $p$. A crucial observation is that one can always
pick a set of such pairs with positive $c$ satisfying $c,|d|\leq\sqrt{p}$.
While we could not prove this in full generality, we have numerically checked
it for the first hundred primes.

We first consider the case when $c,|d|\ll\sqrt{p}$ with $p\gg 1$. In this
regime all vectors $\vec{p}_{L},\vec{p}_{R}$ summed over in
$\Theta_{\vec{0},\vec{0}}$, except for $\vec{p}_{L},\vec{p}_{R}=0$, are of
order $|\vec{p}_{L}|,|\vec{p}_{R}|\sim O(p^{1/2})$. This is in fact a general
result for any embedding, in the limit where the embedding is fixed while
$p\rightarrow\infty$. So for $c,|d|\ll\sqrt{p}$, the factor

$\displaystyle e^{-\pi\tau^{\prime}_{2}(|\vec{p}_{L}|^{2}+|\vec{p}_{R}|^{2})}$
(100)

in (3.4) suppresses all other terms, and hence the only contribution is from
$\vec{p}_{L},\vec{p}_{R}=0$,

$\displaystyle\Theta_{\vec{0},\vec{0}}(\tau^{\prime},\xi^{\prime},\bar{\xi}^{\prime})=e^{{\pi\over
2\tau^{\prime}_{2}}(\xi^{\prime 2}+\bar{\xi}^{\prime 2})}+e^{-O(p)}.$ (101)

Outside of the $c,|d|\ll\sqrt{p}$ regime, but provided $c,|d|\leq\sqrt{p}$ is
still satisfied, we notice that the combination
$\tau_{2}^{\prime}(|\vec{p}_{L}|^{2}+|\vec{p}_{R}|^{2})$ is at least of order
one, and $|p_{L}\cdot\xi|$, $|p_{R}\cdot\bar{\xi}|$ are at most of order one,
$O(p^{0})$. This means that
$\Theta_{\vec{0},\vec{0}}(\tau^{\prime},\xi^{\prime},\bar{\xi}^{\prime})\lesssim
O(p^{0})$ for $p\gg 1$. Now, going back to the sum over $p+1$ pairs $c,d$, we
split the sum into two groups, for $c,|d|$ satisfying $c,|d|\leq p^{\alpha}$
for any $1/3<\alpha<1/2$, and the rest. The first group will yield

$\displaystyle\overline{Z}_{BPI}\approx{1\over
1+p^{1-n}}\sum_{\begin{subarray}{c}(c,d)=1,\\\ c,|d|\leq
p^{\alpha}\end{subarray}}{e^{{\pi\xi^{2}\over 2\tau_{2}}{c\bar{\tau}+d\over
c\tau+d}+{\pi\bar{\xi}^{2}\over 2\tau_{2}}{c\tau+d\over
c\bar{\tau}+d}}\over|c\tau+d|^{n}|\eta(\tau)|^{2n}},\qquad p\gg 1,$ (102)

while the second group, which has at most $p$ terms, will give a contribution
bounded by

$\displaystyle\sum_{|c|+|d|\geq
p^{\alpha}}{\Theta_{\vec{0},\vec{0}}\over|c\tau+d|^{n}|\eta(\tau)|^{2n}}\lesssim
O(p^{1-n\alpha}).$ (103)

For $n\,\alpha>1$ this second term is negligible in the limit
$p\rightarrow\infty$. To conclude, for $n\geq 3$, in the $p\rightarrow\infty$
limit we recover the following expression for the averaged partition function

$\displaystyle\overline{Z}(\tau,\xi,\bar{\xi})={1\over|\eta(\tau)|^{2n}}\sum_{(c,d)=1}{e^{-i\pi{c\xi^{2}\over
c\tau+d}+i\pi{c\bar{\xi}^{2}\over c\bar{\tau}+d}}\over|c\tau+d|^{n}},$ (104)

matching the result of Datta:2021ftn , which reduces to the partition function
of Maloney:2020nni ; Afkhami-Jeddi:2020ezh  for $\xi=\bar{\xi}=0$. The special
cases of $n=1,2$ are considered below.

Our final expression (104) is manifestly independent of the embedding. From
Afkhami-Jeddi:2020ezh ; Maloney:2020nni ; Datta:2021ftn  we know this
expression is equal to the Narain CFT path integral averaged with the Haar
measure over the whole Narain moduli space. It is thus natural to speculate
that for $n>2$ in the $p\rightarrow\infty$ limit, independently of the
embedding, the ensemble of code CFTs densely covers the whole moduli space
with the canonical measure. We will first discuss how this works in the $n=2$
case in next section, and then provide additional arguments and formulate an
underlying hypothesis in section 5.

The original works Afkhami-Jeddi:2020ezh ; Maloney:2020nni  identified the sum
in the right-hand-side of (104) as a sum over handlebody topologies of the
“perturbative sector of Chern-Simons,” an Abelian Chern-Simons theory with
only small (topologically trivial) fluctuations of gauge fields contributing
to the path integral. This theory was dubbed “U(1)-gravity” Afkhami-
Jeddi:2020ezh , but apparently it has no well-defined microscopic description.
As was pointed out in Maloney:2020nni , genuine Chern-Simons theories with
either non-compact or compact gauge groups would lead to different results. We
are now ready to clarify this point. U(1)-gravity does not have a proper
microscopic description in the bulk because it emerges as a limit of well-
defined theories, namely the $k\rightarrow\infty$ limit of level-$k$
$(U(1)\times U(1))^{n}$ Chern-Simons theory, coupled to topological gravity
(to give the sum over handlebodies).

###  4.5 Ensembles of $n=1$ and $n=2$ theories in the large $p$ limit

The cases $n=1$ and $n=2$ are special. As discussed above, for $n=1$ and $k>1$
the ensemble consists of just two codes, one with the codewords of the form
$(a,0)\in\mathcal{C}_{1}$ and the other with $(0,b)\in\mathcal{C}_{2}$, with
arbitrary $0\leq a,b<p$. When translated to CFTs, each of them maps to a
single compact scalar, with radii $R_{\pm}=\sqrt{2}\,r\,p^{\pm 1/2}$,
respectively. The relation between the ensemble-averaged enumerator polynomial
and the Poincaré series (95) is valid for all $n$; hence this ensemble can be
represented “holographically" as follows

$\displaystyle
Z_{BPI}(\tau,\xi,\bar{\xi},R_{+})+Z_{BPI}(\tau,\xi,\bar{\xi},R_{-})=\sum_{g\in\Gamma_{0}(p)\backslash
SL(2,\mathbb{Z})}\Psi_{00}(g\,\tau,g\,\xi,g\,\bar{\xi},r),$ (105)

where the sum is over $p+1$ classes of three-dimensional topologies and
$\Psi_{00}$ is given by (56). We have explicitly specified the embedding
parameter $r$, which is arbitrary and can scale with $p$. This relation holds
for any prime $p$, but in the limit $p\rightarrow\infty$ it diverges. The sum
in the right-hand side of (105) becomes the divergent real Eisenstein series
of weight $1$. The left-hand side of (105) also diverges, as at least one of
the scalars decompactifies. Using the representation (165) of the partition
function and T-duality, we find the limit for fixed $r$ to be (for simplicity
we consider vanishing fugacities $\xi=\bar{\xi}=0$)

$\displaystyle
Z_{R_{+}}+Z_{R_{-}}={p\left(r+r^{-1}\right)\over\sqrt{\tau_{2}}|\eta(\tau)|^{2}}+e^{-O(p)},\qquad
p\rightarrow\infty.$ (106)

One can also consider the $p\to\infty$ limit when $R_{-}=R$ remains fixed,
while $R_{+}$ scales with $p$, in which case

$\displaystyle
Z_{R}+Z_{Rp}={(p+1)R\over\sqrt{2\tau_{2}}|\eta(\tau)|^{2}}+\sum_{(c,d)=1}R{\theta_{3}\left({iR^{2}\over
2\tau_{2}^{\prime}}\right)-1\over\sqrt{2\tau_{2}}|\eta(\tau)|^{2}}+e^{-O(p)},\quad\tau_{2}^{\prime}={\tau_{2}\over|c\tau+d|^{2}}.$
(107)

This is essentially the “modular sum” representation for the given compact
scalar partition function $Z_{R}$, except for the constant term
$R/\sqrt{2\tau_{2}}|\eta(\tau)|^{2}$. In this way it is similar to the
representation (3.14) of Benjamin:2021ygh . In any case, the interpretation of
the divergent equations that arise in these cases is not clear.

The case of $n=2$ codes is similar but much richer. Narain lattices in
$\mathbb{R}^{2,2}$ are conventionally parametrized by two modular parameters
$t=t_{1}+it_{2}$ and $b=b_{1}+ib_{2}$, related to $\gamma$ and the $B$-field
by

$\displaystyle\gamma=\sqrt{{b_{2}\over
t_{2}}}\left(\begin{array}[]{cc}1&t_{1}\\\ 0&t_{2}\end{array}\right),\qquad
B={b_{1}}\left(\begin{array}[]{cc}0&1\\\ -1&0\end{array}\right).$ (112)

T-duality acts on $(t,b)$ as $SL(2,\mathbb{Z})\times SL(2,\mathbb{Z})$ with an
additional $\mathbb{Z}_{2}$ exchanging $t\leftrightarrow b$. We denote the
partition function of a $c=2$ Narain theory by $Z_{c=2}(\tau,t,b)$. It is
modular invariant with respect to all three variables. One can also introduce
the partition function of primaries,
$\hat{Z}(\tau,t,b)=\tau_{2}|\eta(\tau)|^{4}Z_{c=2}(\tau,t,b)$, where here and
in what follows we assume the fugacities vanish $\xi=\bar{\xi}=0$. The
partition function of primaries remains modular invariant under $\tau$, and
exhibits triality – full symmetry under permutation of its three arguments
dijkgraaf1988moduli ; Benjamin:2021ygh .

There are $2(p+1)$ $n=2$ codes, see Appendix C.1 for a detailed discussion. If
we choose an embedding, an orthogonal matrix from $O(2,2,\mathbb{R})$
introduced in the end of section 2, in the form

$\displaystyle\left(\begin{array}[]{cc}\gamma^{*}&\gamma^{*}B\\\
0&\gamma\end{array}\right)\in O(2,2,\mathbb{R}),$ (115)

parametrized by two modular parameters $t=-1/t_{0},b=b_{0}$, then the $2(p+1)$
self-dual lattices of the code theories (after appropriate T-dualities) are
explicitly given by

$\displaystyle\\{t={k+t_{0}\over p}\quad{\rm or}\quad t=p\,t_{0}\\}\quad{\rm
with}\quad b=b_{0},$ (116)

and

$\displaystyle\\{b={k+b_{0}\over p}\quad{\rm or}\quad b=p\,b_{0}\\}\quad{\rm
with}\quad t=t_{0},$ (117)

where $0\leq k<p$. It is convenient to represent the average over code
theories in terms of Hecke operators $T_{p}$, defined as follows
koblitz2012introduction . For a modular form $f(\tau)$ of weight $k$ and prime
$p$

$\displaystyle T_{p}f(\tau)\equiv p^{k-1}f(p\tau)+{1\over
p}\sum_{r=0}^{p-1}f\left(\frac{\tau+r}{p}\right).$ (118)

Then, the average over codes is simply

$\displaystyle{p\over
2(p+1)}\left(T_{p}^{t}\,Z_{c=2}(\tau,t,b)+T_{p}^{b}\,Z_{c=2}(\tau,t,b)\right),$
(119)

where we introduced an upper index to indicate the variable that each Hecke
operator is acting on.

The “sum over topologies” in the right-hand side of (95)

$\displaystyle{\Psi_{\vec{0},\vec{0}}(\tau)+p^{-n}\sum_{r=0}^{p-1}\sum_{a,b}\Psi_{\vec{a},\vec{b}}(\tau)\,e^{2\pi
ir{\vec{a}\cdot\vec{b}\over p}}\over 1+p^{1-n}}$ (120)

can also be simplified for general $n$. Starting from an $O(n,n,\mathbb{R})$
matrix ${\mathcal{O}}$ specifying a Narain lattice, the partition function of
the corresponding Narain theory can be written as (2.2)

$\displaystyle
Z_{\mathcal{O}}={\Theta(\tau)\over|\eta(\tau)|^{2n}},\quad\Theta(\tau)=\sum_{\vec{\ell}}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}},$ (121)
$\displaystyle\left(\begin{array}[]{c}p_{L}+p_{R}\\\ p_{L}-p_{R}\\\
\end{array}\right)={\mathcal{O}}\sqrt{2}\,\vec{\ell},\quad\vec{\ell}\in\mathbb{Z}^{2n}.$
(124)

Now, going back to (120), we notice that it can be rewritten as

$\displaystyle{\Theta(p\tau)+p^{-n}\sum_{r=0}^{p-1}\Theta((\tau+r)/p)\over(1+p^{1-n})|\eta(\tau)|^{2n}}={T_{p}\,\Theta\over(p^{n-1}+1)|\eta(\tau)|^{2n}},$
(125)

where $\Theta$ is defined with the same $\mathcal{O}$ as the embedding matrix
of codes, introduced at the end of section 2. The last step in (125) is
justified because $\Theta(\tau)$ is a modular form of weight $n$. Using the
definition (118) we can express $T_{p}$ acting on a modular form $f$ of weight
$n$ in terms of its action on the modular invariant $\tau_{2}^{n/2}f$,

$\displaystyle{\tau_{2}^{n/2}\,T_{p}\,f}=p^{n/2}\,T_{p}(\tau_{2}^{n/2}f).$
(126)

Going back to the $n=2$ case and noting that
$\tau_{2}\,\Theta=\hat{Z}(\tau,t,b)$ is exactly the partition function of
primaries, we can now rewrite the identity (4.3) as follows:

$\displaystyle{p\,(T_{p}^{t}\,\hat{Z}+T_{p}^{b}\,\hat{Z})\over
2(p+1)\tau_{2}|\eta(\tau)|^{4}}={p\,T_{p}^{\tau}\,\hat{Z}\over(p+1)\tau_{2}|\eta(\tau)|^{4}}.$
(127)

In fact a stronger identity holds for any prime $p$, see Appendix C,

$\displaystyle T_{p}^{\tau}\,\hat{Z}=T_{p}^{t}\,\hat{Z}=T_{p}^{b}\,\hat{Z},$
(128)

which extends the triality – permutation symmetry of $\hat{Z}$ with respect to
its arguments.

In the limit $p\rightarrow\infty$, the points $t={k+t_{0}\over p}$ form a
dense line close to $t_{2}=0$, that crosses infinitely many copies of the
fundamental domain. Once these $p$ points are mapped back to the standard
keyhole domain of $SL(2,\mathbb{Z})$, they will cover it densely with the
standard covariant measure $d^{2}t/t_{2}^{2}$. The contribution of the point
$t=p\,t_{0}$ in the full average will be $1/p$ suppressed, and can be
neglected. Thus, the average over code theories when $p\rightarrow\infty$, at
least at leading order, would plausibly approach the average over the
fundamental domain of $t$ with the $SL(2,\mathbb{Z})$ covariant measure, plus
the same average over $b$ (note that this is not the same as averaging over
all Narain theories). Similarly, thanks to (125), the “bulk” sum in the
$p\rightarrow\infty$ limit will be proportional to the average of $\hat{Z}$
over the fundamental domain of $\tau$ with the measure
$d^{2}\tau/\tau_{2}^{2}$. The same conclusion is supported by the general
result of clozel2001hecke ; GoldsteinMayer , that in the limit $p\to\infty$,
for any square-integrable modular function $f$, $T_{p}(f)$ approaches the
integral of $f$ over the fundamental domain $\mathcal{F}$ with the canonical
measure

$\displaystyle\left|\left|T_{p}(f)-\int_{\cal
F}f\,d\mu\right|\right|<||f||\,O(p^{-9/28+\epsilon})\to 0,$ (129)

for large $p$, where $\epsilon$ is any real number $>0$, and $||f||$ is the
Weil-Petersson norm of $f$ GoldsteinMayer . The caveat here is that in our
case $\hat{Z}$ is not square-integrable, and the integral over the fundamental
domain diverges. We therefore conjecture that in the $p\rightarrow\infty$
limit, $T^{x}_{p}(\hat{Z})$ for $x=\tau$, $t$ or $b$ would be given by the
regularized average over the fundamental domain of $x$, plus an $x$-dependent
term, which will not be dependent on other variables. The regularized average
of $\hat{Z}$ over $\tau$ has been carried out in Dixon:1990pc . We discuss
averaging over $t$, related to it by triality, in Appendix C. Using this
result we conjecture

$\displaystyle
T^{\tau}_{p}(\hat{Z}(\tau))={3\over\pi}\ln(p/p_{0})-{3\over\pi}\ln(t_{2}|\eta(t)|^{4})-{3\over\pi}\ln(b_{2}|\eta(b)|^{4})+f(\tau)+O(1/p)$
(130)

for some unknown $f(\tau)$. Since both (127) and (128) hold for any finite
prime $p$, to preserve triality we must conclude
$f(\tau)=-{3\over\pi}\ln(\tau_{2}|\eta(\tau)|^{4})$ and

$\displaystyle\overline{Z}={3\over\pi}\left.{\ln(p/p_{0})-\ln(\tau_{2}|\eta(\tau)|^{4})-\ln(t_{2}|\eta(t)|^{4})-\ln(b_{2}|\eta(b)|^{4})\over\tau_{2}|\eta(\tau)|^{4}}\right|_{t=t_{0},\,b=b_{0}}+O(1/p),$

where $p_{0}$ is some constant.

###  4.6 Extensions and generalizations

The equality between averaging over length-$n$
$\mathbb{Z}_{p}\times\mathbb{Z}_{p}$ codes (with $n\geq 3$) and “Poincaré
series,” which can be understood as sums over handlebody topologies, begs a
deeper understanding. First, we expect it to hold for arbitrary genus ${\sf
g}$,

$\displaystyle{1\over\mathcal{N}}\sum_{\mathcal{C}}W_{\mathcal{C}}(\Psi_{(c_{1},\dots,c_{\sf
g})}(\Omega))\propto\sum_{{g}\in Sp(2{\sf
g},\mathbb{Z})}\Psi_{(0,\dots,0)}({g}\,\Omega),$ (131) $\displaystyle
W_{\mathcal{C}}(\\{X_{(c_{1},\dots,c_{\sf g})}\\})=\sum_{c_{1},\dots,c_{\sf
g}\in\mathcal{C}}X_{(c_{1},\dots,c_{\sf g})},$ (132)

where $X_{c_{1},\dots,c_{\sf g}}$ are formal variables associated with the
${\sf g}$-tuples of codewords RUNGE1996175 ; Henriksson:2021qkt ;
Henriksson:2022dnu . We promote them to wavefunctions
$\Psi_{c_{1},\dots,c_{\sf g}}$ of Chern-Simons theory on a genus-${\sf g}$
Riemann surface, hence their dependence on the period matrix $\Omega$.
$\Psi_{(0,\dots,0)}$, associated with the zero codeword taken ${\sf g}$ times,
is the wavefunction of the Chern-Simons theory computed on a 3d manifold
$\mathcal{M}$ with all $a$-cycles of $\partial\mathcal{M}$ contractible in the
interior, which is an analog of thermal AdS.

As in section 4.3, the Poincaré sum in (131) can be reformulated as a sum over
a coset $\Gamma^{*}\backslash Sp(2{\sf g},\mathbb{Z})$, where $\Gamma^{*}$ is
a congruence subgroup of the modular group $Sp(2{\sf g},\mathbb{Z})$ leaving
$\Psi_{(0,\dots,0)}(\Omega)$ invariant. Extending the result of the ${\sf
g}=1$ case, we conjecture this subgroup to be $\Gamma^{Sp(2{\sf
g})}_{0}(p)\subset Sp(2{\sf g},\mathbb{Z})$, which we define to be the group
of matrices

$\displaystyle\left(\begin{array}[]{cc}A&B\\\ C&D\end{array}\right)\in
Sp(2{\sf g},\mathbb{Z}),\qquad C=0\,\,{\rm mod}\,p.$ (135)

For prime $p$ the coset $\Gamma^{Sp(2{\sf g})}_{0}(p)\backslash Sp(2{\sf
g},\mathbb{Z})$ consists of

$\displaystyle{\mathcal{N}}_{sp}({\sf g},p)=\prod_{j=1}^{\sf g}(p^{j}+1)$
(136)

elements (we obtained this expression by generalizing Runge ; cosnier2018bps
), which matches the result ${\mathcal{N}}_{Sp}(2,2)=15$ found in
Henriksson:2022dml .

In a somewhat similar fashion, the sum over codes on the left-hand-side of
(131) can also be represented as a coset. We recall that all even self-dual
codes over $\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ of the kind we are considering
can be understood as a set of even self-dual lattices $\Lambda_{\mathcal{C}}$
satisfying, see (23),

$\displaystyle(\sqrt{k}\mathbb{Z})^{2n}\subset\Lambda_{\mathcal{C}}\subset(\mathbb{Z}/\sqrt{k})^{2n}.$
(137)

This defines the action of $O(n,n,\mathbb{Z})\subset O(n,n,\mathbb{R})$ on
codes. For prime $k=p$ this action is transitive.555The action of
$O(n,n,\mathbb{Z})$ is also transitive on all even non-zero codewords. This is
sufficient to obtain the averaged enumerator polynomial $\overline{W}$ for
arbitrary $n,p$ for genus 1, thus completing the mathematical proof of (95).
Indeed, one can bring any code to canonical form with a generator matrix of
the form $(I,{\rm B})$,where $\rm B$ is antisymmetric mod $p$
Angelinos:2022umf , and then use $O(n,n,\mathbb{Z})$ to make $\rm B$ vanish.
In other words, for prime $p$ the set of all codes can be described as a coset

$\displaystyle{O(n,n,\mathbb{Z})\over\Gamma_{0}^{O(n,n)}(p)},$ (138)

where $\Gamma_{0}^{O(n,n)}(p)$, the subgroup of $O(n,n,\mathbb{Z})$ which
leaves the code with ${\rm B}=0$ invariant, is defined to be the group of
matrices

$\displaystyle\left(\begin{array}[]{cc}A&B\\\ C&D\end{array}\right)\in
O(n,n,\mathbb{Z}),\qquad C=0\,\,{\rm mod}\,p.$ (141)

The coset description (138) is a generalization to arbitrary prime $p$ of the
coset construction for $p=2$ outlined in Dymarsky:2020qom . The size of the
coset is given by (4).

To summarize, the equality (131) between the average over codes and the
Poincaré series over topologies can be rewritten as a sum over similar cosets

$\displaystyle\sum_{\mathcal{C}\in\Gamma_{0}^{O(n,n)}(p)\backslash
O(n,n,\mathbb{Z})}W_{\mathcal{C}}(\\{\Psi_{(c_{1},\dots,c_{\sf
g})}\\})\propto\sum_{{g}\in\Gamma_{0}^{Sp(2{\sf g})}(p)\backslash Sp(2{\sf
g},\mathbb{Z})}{g}(\Psi_{(0,\dots,0)}).$ (142)

The number of terms on both sides, ${\mathcal{N}}(n,p)$ (4) and
${\mathcal{N}}_{Sp}({\bf g},p)$ (136), and the overall similarity of the
cosets, can be seen as an extension of the worldsheet/target space duality of
the $c=2$ case dijkgraaf1988moduli .

We have seen in the previous section that the Poincaré sum for genus one can
be represented in terms of a Hecke operator. In general the Hecke operator
$T_{k}$ is defined to act on functions $f(\Lambda)$ on lattices $\Lambda$.
Then $(T_{k}\,f)(\Lambda)$ is a sum $f(\Lambda^{\prime})$ over all sublattices
$\Lambda^{\prime}\subset\Lambda$ of index $k$. A modular form $f(\tau)$ can be
understood as a function on two-dimensional lattices generated by $1$ and
$\tau$. Then $T_{k}$ can be written as a sum over equivalence classes of
$2\times 2$ integer matrices of determinant $k$,

$\displaystyle\left(\begin{array}[]{cc}a&b\\\ c&d\end{array}\right)\in
M_{k},\quad a,b,c,d\in\mathbb{Z},\quad ad-bc=k,$ (145)

modulo right multiplication by any element of $SL(2,\mathbb{Z})$. For prime
$k=p$ this sum includes $p+1$ terms and $T_{p}$ is given by (118). The
equivalence of $\Gamma_{0}(p)\backslash SL(2,\mathbb{Z})$ and
$M_{p}/SL(2,\mathbb{Z})$, together with the relation between the Poincaré
series and the Hecke operator representation koblitz2012introduction , leads
to equality (125), which we rewrite as

$\displaystyle{1\over(1+p^{1-n})\tau_{2}^{n/2}|\eta(\tau)|^{2n}}\sum_{g\in\Gamma_{0}(p)\backslash
SL(2,\mathbb{Z})}\hat{Z}_{\vec{0},\vec{0}}(g\,\tau)={p^{-n/2}\over(1+p^{1-n})\tau_{2}^{n/2}|\eta(\tau)|^{2n}}\sum_{g\in
M_{p}/SL(2,\mathbb{Z})}\hat{Z}(g\,\tau).$ (146)

Here we introduced the modular invariant partition function of primaries
$\hat{Z}(\tau)=\tau_{2}^{n/2}\Theta(\tau)$, which is related to
$\hat{Z}_{\vec{0},\vec{0}}(\tau)=\tau_{2}^{n/2}\Theta_{\vec{0},\vec{0}}(\tau)$
as follows

$\displaystyle\hat{Z}_{\vec{0},\vec{0}}(\tau)=p^{-n/2}\hat{Z}(p\,\tau).$ (147)

It is tempting to speculate that an analogous representation is also possible
for higher-genus Poincaré series, in which the Hecke operator would be defined
to act on modular forms $f(\Omega)$ of $Sp(2{\sf g},\mathbb{Z})$.

The left-hand-side of (142), the sum over codes, is also very reminiscent of
Hecke operators. While the standard Hecke operator includes the sum over all
sublattices of index $p$, the sum over even self-dual codes can be readily
rewritten as a sum over all even sublattices of $(\mathbb{Z}/\sqrt{p})^{2n}$
of index $p^{n}$. The Hecke form of code averaging, through a suitable
generalization of (129), could potentially lead to a more straightforward and
general proof that in the limit that the size of the code ensemble becomes
infinite, the code average computes the average over the whole Narain moduli
space with the Haar measure. We should note that formally the same logic can
be applied to the Poincaré series, which would naively suggest that when
$p\rightarrow\infty$, the right-hand-side of (146) and hence (4.3) would be
given by an integral over the fundamental domain of $\tau$. This is not so
because the corresponding modular form $\hat{Z}$ is not square-integrable on
the fundamental domain. As a result, in order to apply (129) the integral has
to be covariantly regularized, eventually leading to the conclusion of section
4.4: in the $p\rightarrow\infty$ limit the Poincaré series in (4.3) approaches
the real Eisenstein series of weight $n$.

##  5 Ensemble averaging, typicality and holography

In section 4.4 we saw that averaging partition functions over the ensemble of
code CFTs in the $k\rightarrow\infty$ limit leads (for $n>2$) to
“$U(1)$-gravity,” the sum over CS theories on all handlebody topologies. In
particular, the answer does not depend on the embedding of the codes, and is
equal to the average of the whole Narain moduli space with the Haar measure,
as was outlined in Afkhami-Jeddi:2020ezh ; Maloney:2020nni . This suggests
that code CFTs in the $k\rightarrow\infty$ limit, when the ensemble becomes
infinitely large, densely cover the entire Narain moduli space with the
canonical measure. This is in agreement with an earlier observation that the
averaged code theory, in the $k\rightarrow\infty$ limit, has the same spectral
gap as the averaged Narain theory Dymarsky:2020pzc . If we additionally take
the large central charge limit, $c\gg 1$, then averaging over the whole moduli
space would be well approximated by a random Narain theory, because the
ensemble of all Narain theories, as well as the ensemble of code CFTs in the
$c\rightarrow\infty$ limit, are self-averaging at large $c$, namely the
variance is exponentially small $e^{-O(c)}$ Dymarsky:2020pzc ; Collier:2021rsn
; Henriksson:2022dml .

To support the conclusion that the $k\rightarrow\infty$ ensemble densely
covers the entire moduli space, we first note that there are two code
ensembles, but for large $k$ they are similar. The first ensemble, which we
used in our discussions above, is the ensemble of all
${\mathcal{N}}=\prod_{i=0}^{n-1}(p^{i}+1)$ codes of length $n$ (here we assume
$k=p$ is prime). The second ensemble is the ensemble of all
${\mathcal{N}}^{\prime}=p^{n(n-1)/2}$ codes in the canonical form, also called
the $\rm B$-form Dymarsky:2020qom . Each code in the canonical form is
parametrized by an antisymmetric matrix $\rm B$ defined mod $p$, which can be
interpreted as an adjacency matrix of a graph with edges carrying an element
of $\mathbb{Z}_{p}$. Every code from the first ensemble has an equivalent code
in the canonical form, in the sense of code equivalences. It is a non-trivial
question to determine the number of codes equivalent to the canonical one with
a given $\rm B$ (noting that certain canonical form codes are equivalent to
each other). At the level of CFTs, code equivalence is the same as T-duality
only for the most symmetric “rigid” embedding, when the code with the matrix
$\rm B$ is associated with the Narain lattice specified by $\gamma=I/\sqrt{p}$
and $B={\rm B}/p$. When $p\rightarrow\infty$ we expect averaging over both
ensembles with each code entering with equal weight to be physically
equivalent, which is reflected by
${\mathcal{N}}^{\prime}/{\mathcal{N}}\rightarrow 1$ and by the equivalence of
the resulting Gilbert-Varshamov bounds (averaged spectral gap).

The ensemble of all codes in the canonical form, independently of the
embedding, leads to the ensemble of CFTs with $\gamma\rightarrow 0$ and with
the $B$-field homogeneously covering the “T-duality cube” $B_{ij}\sim
B_{ij}+1$. We conjecture that the region in the moduli space

$\displaystyle\gamma\rightarrow 0,\qquad 0\leq B_{ij}<1,$ (148)

with the conventional flat measure for $dB_{ij}$ on the cube, covers (via
T-duality) the whole Narain moduli space, with the canonical
$O(n,n,\mathbb{R})$-invariant measure. By $\gamma\rightarrow 0$ we mean that
all singular values of $\gamma$ approach zero. This is analogous to the
observation in section 4.5 that the $t_{2}\rightarrow 0$, $0\leq t_{1}<1$
region is T-dual to the entire fundamental domain of $t$ with the canonical
measure. Similarly here, it is straightforward to see that starting from an
arbitrary pair $(\gamma,B)$, via T-duality one can move it into the region
(148). A non-trivial point, which we leave for the future, is whether the Haar
measure on the Narain moduli space indeed results in the homogeneous measure
for $B_{ij}$. With this assumption, we would find that the ensemble of all
canonical codes densely covers the entire Narain moduli space with the Haar
measure. In particular, this would explain why the averaged spectral gap
matches the one of the whole Narain ensemble Dymarsky:2020pzc .

The representation of the Narain moduli space via (148) provides a new easy
way to obtain the original result of Afkhami-Jeddi:2020ezh ; Maloney:2020nni
and Datta:2021ftn . Starting from the conventional representation of the CFT
path integral (3.4) with self-dual $\Lambda$ parametrized by $\gamma,B$, and
by performing Poisson resummation over half of the variables, we obtain

$\displaystyle Z^{\gamma,B}_{BPI}(\tau,\xi,\bar{\xi})$ $\displaystyle=$
$\displaystyle{{\rm
det}\,(\gamma)\over\tau_{2}^{n/2}|\eta(\tau)|^{2n}}\sum_{\vec{n},\vec{m}\in\mathbb{Z}^{n}}e^{-{\pi\over\tau_{2}}|\vec{v}|^{2}-2\pi
i\,m^{T}Bn-{2\pi\over\sqrt{2}\tau_{2}}(\xi\cdot v^{*}-\bar{\xi}\cdot
v)+{\pi\over\tau_{2}}\xi\bar{\xi}},$ (149) $\displaystyle\vec{v}$
$\displaystyle=$ $\displaystyle\gamma(\vec{n}\tau+\vec{m}).$

Now we are ready to average $Z_{\gamma,B}$ over the region (148). Integration
over $B_{ij}$ forces the vectors $\vec{n},\vec{m}$ to be collinear. We thus
can parametrize $\vec{n}=c\,\vec{\ell},\,\vec{m}=d\,\vec{\ell}$ with
$\vec{\ell}\in\mathbb{Z}^{n}$ and with a co-prime pair $(c,d)=1$. Using the
explicit modular invariance of (149),

$\displaystyle\tau\rightarrow\tau^{\prime}={a\tau+b\over
c\tau+d},\quad\xi\rightarrow\xi^{\prime}={\xi\over
c\tau+d},\quad\bar{\xi}\rightarrow\bar{\xi}^{\prime}={\bar{\xi}\over
c\bar{\tau}+d},$ (150)
$\displaystyle(\vec{n}\,\,\vec{m})\rightarrow(\vec{n}\,\,\vec{m})\left(\begin{array}[]{cc}a&b\\\
c&d\end{array}\right),$ (153)

we find

$\displaystyle\overline{Z}_{BPI}=\sum_{(c,d)=1}{{\rm
det}\,(\gamma)\over\tau_{2}^{n/2}|\eta(\tau)|^{2n}}\sum_{\vec{\ell}\in\mathbb{Z}^{n}}e^{-{\pi\over\tau^{\prime}_{2}}|\vec{v}|^{2}-{2\pi\over\sqrt{2}\tau_{2}^{\prime}}(\xi^{\prime}-\bar{\xi}^{\prime})\cdot\vec{v}+{\pi\over\tau_{2}}\xi\bar{\xi}},\qquad\vec{v}=\gamma\vec{\ell}.$
(154)

In the limit $\gamma\rightarrow 0$, the summation over $\ell$ can be replaced
by an integration, giving

$\displaystyle\overline{Z}_{BPI}=\sum_{(c,d)=1}{1\over|\eta(\tau^{\prime})|^{2n}}e^{{\pi\over
2\tau^{\prime}_{2}}(\xi^{\prime 2}+\bar{\xi}^{\prime 2})},$ (155)

matching (104).

The calculation above hints towards a possible “holographic dual” for an
individual Narain theory, understood as a “Poincaré sum” over all co-prime
pairs $(c,d)=1$, enumerating all handlebodies. The representation (149), valid
for any $\gamma,B$, geometrizes the action of the modular group
$SL(2,\mathbb{Z})$ as an action on a lattice of vectors
$(\vec{n},\vec{m})\in\mathbb{Z}^{2n}$. There is a trivial orbit of
$SL(2,\mathbb{Z})$, consisting of the origin $\vec{n}=\vec{m}=0$, with a non-
trivial action on all other elements (trivial stabilizer). Thus, only the
contribution of the origin does not admit the Poincaré sum form, but we can
make it as small as we want by using chains of T-dualities to render ${\rm
det}(\gamma)$ arbitrarily small. The remaining contributions of
$\mathbb{Z}^{2n}\backslash\vec{0}$ may be conveniently split into “one-vector
orbits”, with collinear $\vec{n}=c\,\vec{\ell},\,\vec{m}=d\,\vec{\ell}$, and
“two-vector orbits”, when $\vec{n},\vec{m}$ are not collinear. The
contribution of the one-vector orbits leads naturally to a sum over co-prime
pairs $(c,d)$, as in (154). We can choose a representative in each orbit with
$\vec{n}=0,\,\vec{m}=\vec{\ell}$, leading to a concise expression for
$\vec{v}=\gamma\vec{\ell}$. Averaging over $\gamma$, even without assuming
$\gamma\rightarrow 0$, would lead to “$U(1)$-gravity” – the real Eisenstein
series.666As was shown in Afkhami-Jeddi:2020ezh , averaging over $\gamma$ with
${\rm det}\,(\gamma)$ fixed is equivalent to replacing the sum over
$\vec{\ell}\in\mathbb{Z}^{n}$ by an integral over $\mathbb{R}^{n}$.

The contribution of the two-vector orbits can also be represented as a sum
over co-prime $(c,d)=1$, but here the choice of “gauge” – the choice of a
representative in the orbit of $SL(2,\mathbb{Z})$ – is less clear. There is no
obvious choice admitting an apparent bulk interpretation. For a typical Narain
theory with large central charge, when $B$ can be considered random, the
contribution of two-vector orbits will be exponentially small: for small
$\gamma$ the term $-\pi|v|^{2}/\tau_{2}$ in the exponent can be neglected,
while many different pairs $(n,m)$ will lead to random phases $e^{-2\pi
im^{T}Bn}$ canceling each other.

To summarize, we outlined a possible holographic “Poincaré sum” representation
for an individual Narain theory, which fits the picture proposed in
Dymarsky:2020pzc . A typical theory (when $c\gg 1$) will be described by
$U(1)$-gravity with exponentially small corrections. There is a natural
ambiguity of assigning these corrections to individual handlebodies, rooted in
the ambiguity of choosing representatives among the two-vector orbits. This,
together with the need to consider a limit of T-duality transformations
yielding ${\rm det}(\gamma)\rightarrow 0$, precludes a simple microscopic
local bulk interpretation.

The resulting picture is qualitatively similar to the one in JT gravity
Blommaert:2021fob ; Blommaert:2022ucs . An attempt to extend a holographic
duality based on a sum over topologies to describe an individual Narain theory
leads to potentially non-local interactions in the bulk, responsible for
“half-wormholes.” After averaging over all theories these interactions vanish.
The crucial difference with the JT gravity case is that in our case there is
also a bona fide holographic description for an individual theory, described
in section 4.1 above, though it does not involve a sum over topologies. It
would be very interesting to make an explicit link between the two holographic
descriptions for a given theory, by starting from CS theory on a given
handlebody and deforming it into a sum over topologies with some non-local
action.

##  6 Discussion

In this paper we considered Narain CFTs on $\Sigma$, and found that they are
described by pure level-1 $(U(1)\times U(1))^{n}$ Chern-Simons theory on a 3d
manifold $\mathcal{M}$ with $\partial{\mathcal{M}}=\Sigma$. The details of
$\mathcal{M}$ do not matter; all manifolds with $\partial{\mathcal{M}}=\Sigma$
lead to the same partition function because the Hilbert space of $k=1$ CS
theory is one-dimensional. The two $U(1)^{n}$ gauge fields are linked at the
level of large gauge transformations. The choice of large gauge
transformations, or, equivalently, the choice of boundary conditions changing
the representation of the unique CS wavefunction, specifies the dual Narain
theory. This provides a holographic duality, with the holographic dictionary
as outlined in section 4.1. Our considerations were limited to genus one
$\Sigma$, but it should be straightforward to extend the duality to arbitrary
genus.

We then proceeded to consider an ensemble of Narain CFTs defined in terms of
an ensemble of codes. We considered an ensemble of all even self-dual codes of
length $n$ over $\mathbb{Z}_{p}\times\mathbb{Z}_{p}$ for prime $p$, and then
embedded (mapped) these codes into the $c=n$ Narain moduli space. The
embedding is specified by an arbitrary ${\mathcal{O}}\in O(n,n,\mathbb{R})$,
thus any given code can be mapped to any given Narain theory. As $n$ or $p$
grows, the size of the ensemble given by (4) grows much faster than the
dimension of $O(n,n,\mathbb{R})$. Hypothetically, in the $p\rightarrow\infty$
limit, the ensemble of code theories densely covers the whole Narain moduli
space with the canonical measure. For fixed $n$ and $p$ we find that the CFT
partition function averaged over this ensemble is given by the level-$p$
$(U(1)\times U(1))^{n}$ Chern-Simons theory summed over all classes of
handlebody topologies that are distinguished by that theory. The main identity
(4.3), valid for any fixed $n,p$ and fixed embedding, establishes an explicit
relation between averaging over the code-based ensemble and the “Poincaré
series” representing the sum over topologies. Again, our explicit
consideration was focused on genus one.

One of the questions our construction answers is why the “U(1)-gravity” of
Afkhami-Jeddi:2020ezh ; Maloney:2020nni , though suggestive, has no well-
defined microscopic bulk description. In section 4.4 we found that
U(1)-gravity emerges as the $p\rightarrow\infty$ limit of our construction,
hence it is an infinite limit of a family of level-$p$ pure Chern-Simons
theories, which are all well-defined in the bulk. In our formalism the sum
over bulk manifolds originates from a sum over $SL(2,\mathbb{Z})$
transformations of a specific solid torus, and it is thus natural that we get
a sum over just handlebodies and not other manifolds. Taking a leap to the
holographic CFTs of Hartman:2014oaa , presumably dual to 3d quantum gravity
with additional light matter, and the failure to find a dual to pure gravity
due to intrinsic inconsistencies Maloney:2007ud ; Witten:2007kt ;
Keller:2014xba ; Benjamin:2019stq ; Alday:2019vdr ; Benjamin:2020mfz , we can
speculate that pure 3d quantum gravity might not be well defined by itself,
but could emerge as an infinite limit of a family of well-defined theories.

From the mathematical point of view, our main technical result, equation (95),
deserves a better understanding. It would be interesting to extend it to
higher genus future  and to disconnected manifolds. More generally, rewriting
this equation in terms of sums over cosets or in terms of Hecke operators as
was done in section 4.6 hints at a deeper mathematical structure. Beyond the
$\mathbb{Z}_{k}\times\mathbb{Z}_{k}$ codes considered in this paper, the
general code construction of Angelinos:2022umf  described in section 2.2 opens
up possibilities for considering other types of code ensembles. Consideration
of a variety of ensemble types could help answer a crucial question: when is
an ensemble holographic, in the sense of admitting a bulk description in terms
of a sum over geometries.

When the central charge is large $c\gg 1$, ensembles of code CFTs or the
ensemble of all Narain theories are self-averaging: a random theory faithfully
captures the ensemble average up to exponentially small (in $c$) corrections.
This suggests that individual theories, at least the sufficiently typical
ones, should admit a bulk description in terms of a sum over topologies. We
outline such a description in section 5, but notice that it suffers from
ambiguities and possibly non-local interactions in the bulk. It would be very
interesting to explicitly relate this bulk description, which includes the sum
over topologies, to the conventional holographic description in terms of
level-1 CS theory on a fixed topology, discussed in section 4.1.

Our work clarifies the role codes play in relation to CFTs and their
holographic duals. We saw that all possible “words” label all possible
wavefunctions in the bulk. We also saw that an ensemble of codes plays a
crucial role in holography, although the reason why remains obscure. We
emphasize that this is only one aspect of a more comprehensive story. We
recall that the theory dual to the $c=1$ compact scalar, the “AB” Chern-Simons
theory, also emerges as a low energy limit of a 2+1 dimensional system
describing Kitaev’s toric code nayak2008non . Is there a relation between the
codes of this paper and the quantum codes underlying the “AB” theory? A first
step connecting these two pictures was taken in Buican:2021uyp  for the
$\mathbb{Z}_{2}\times\mathbb{Z}_{2}$ case, where classical additive codes can
be understood as quantum codes. More progress followed recently, relating
quantum codes (connected to $\mathbb{Z}_{p}\times\mathbb{Z}_{p}$ classical
codes in our nomenclature) to CFTs and Chern-Simons theories Kawabata:2022jxt
; alam2023narain ; Kawabata:2023iss , but a complete picture is yet to emerge.

The codes considered in this work are of additive type; consequently the
corresponding CFTs are Abelian. There is a natural generalization of our story
to non-Abelian codes, WZW theories and dual non-Abelian Chern-Simons theory
nonabelian . Going in the direction of gradually generalizing the type of CFTs
under consideration, one hopes to eventually arrive at codes associated with
the conventional “Virasoro” CFTs, dual to quantum gravity. We can only
speculate that at this point a direct link may emerge between the code
structure on the CFT side and the holographic codes responsible for the
locality in the bulk Almheiri:2014lwa ; Pastawski:2015qua .

###### Acknowledgements.

We thank Ahmed Barbar, Nathan Benjamin, Debarghya Chakraborty, Mathew
Dodelson, Daniel Jafferis, Johan Henriksson, Brian McPeak, Adam Schwimmer and
Edward Witten for discussions. The work of OA was supported in part by an
Israel Science Foundation (ISF) center for excellence grant (grant number
2289/18), by ISF grant no. 2159/22, by Simons Foundation grant 994296 (Simons
Collaboration on Confinement and QCD Strings), by grant no. 2018068 from the
United States-Israel Binational Science Foundation (BSF), by the Minerva
foundation with funding from the Federal German Ministry for Education and
Research, by the German Research Foundation through a German-Israeli Project
Cooperation (DIP) grant “Holography and the Swampland”, and by a research
grant from Martin Eisenstein. OA is the Samuel Sebba Professorial Chair of
Pure and Applied Physics. A.D. is grateful to Weizmann Institute of Science
for hospitality and acknowledges sabbatical support of the Schwartz/Reisman
Institute for Theoretical Physics, and support by the NSF under grants
PHY-2013812 and 2310426. This work was performed in part at Aspen Center for
Physics, which is supported by National Science Foundation grant PHY-2210452.
A.S. thanks the Institute for Advanced Study for hospitality and sabbatical
support, and the Simons Center for Geometry and Physics for hospitality during
the 2023 Simons Summer Workshop.

##  Appendix A The compact scalar CFT

The compact scalar CFT of radius $R$ is a two-dimensional theory of a real
scalar field $X$, subject to the identification $X\sim X+2\pi R$, coupled to
external gauge fields. The free scalar theory has a $U(1)_{L}\times U(1)_{R}$
global symmetry, and we call the corresponding charges $Q$ and $\bar{Q}$. We
consider the Euclidean theory placed on a spacetime torus with modular
parameter $\tau$. The CFT partition function with fugacities (background gauge
fields) $\xi$ and $\bar{\xi}$ is defined as a sum over the Hilbert space of
the theory on a circle

$\displaystyle Z={\rm
Tr}\,\left[q^{L_{0}-1/24}{\bar{q}}^{\bar{L}_{0}-1/24}e^{2\pi i(\xi
Q-\bar{\xi}\bar{Q})}\right],\qquad q=e^{2\pi i\tau}.$ (156)

It can be readily evaluated francesco2012conformal

$\displaystyle Z(\tau,\xi,\bar{\xi},R)={\sum_{n,m}e^{i\pi\tau
p_{L}^{2}-i\pi\bar{\tau}p_{R}^{2}+2\pi i(p_{L}\xi-
p_{R}\bar{\xi})}\over|\eta(\tau)|^{2}},\quad p_{L,R}={n\over R}\pm{mR\over
2}.$ (157)

The simultaneous reflection $p_{R}\rightarrow-p_{R}$,
$\bar{\xi}\rightarrow-\bar{\xi}$ is a symmetry of $Z$, which is the T-duality
exchanging $R$ and $2/R$,

$\displaystyle Z(\tau,\xi,\bar{\xi},R)=Z(\tau,\xi,-\bar{\xi},2/R).$ (158)

We would like to obtain the partition function (157) from the path integral
formulation. We parametrize the spacetime torus by a complex coordinate $z$,

$\displaystyle z\sim z+1,\qquad z\sim z+\tau,\qquad\tau=\tau_{1}+i\tau_{2},$
(159)

with the notation

$\displaystyle\int d^{2}z=\tau_{2},\qquad\int dz\wedge d\bar{z}=-2i\tau,$
(160)

where the integrals are over the torus. The scalar field $X(z,\bar{z})$ is
periodic up to identifications,

$\displaystyle X(z+1)=X(z)-2\pi Rn_{2},\quad X(z+\tau)=X(z)+2\pi Rn_{1}.$
(161)

The sign of $n_{2}$ is chosen for convenience.

One way of coupling the theory to a background gauge field is by the action

$\displaystyle S[X,A]={1\over 2\pi}\int d^{2}z\,\,|\partial_{z}X|^{2}-{i\over
2\pi R}\int dX\wedge A,$ (162)

where $A$ is an external $U(1)$ gauge field coupling to a specific combination
of the global symmetries and satisfying $dA=0$. Using the background field
gauge freedom we can choose

$\displaystyle\xi={\tau_{2}\over i\pi
R}A_{\bar{z}},\qquad\bar{\xi}=-{\tau_{2}\over i\pi R}A_{z}$ (163)

to be constant on the torus. For a real background field $A$, $\xi$ and
$\bar{\xi}$ are complex conjugate to each other, $\xi^{*}=\bar{\xi}$. The
theory is free (quadratic), so the partition function can be computed
straightforwardly. We should sum over on-shell configurations satisfying
(161),

$\displaystyle X=2\pi R{(n_{1}+n_{2}\bar{\tau})z-(n_{1}+n_{2}\tau)\bar{z}\over
2i\tau_{2}},$ (164)

and the small fluctuations around the classical solutions contribute a
multiplicative factor, that includes the Dedekind eta-function
francesco2012conformal . The full expression for the path integral is then

$\displaystyle Z_{\rm
PI}(\tau,R,\xi,\bar{\xi})=\int{\mathcal{D}}X\,e^{-S[X,A]}=$
$\displaystyle\qquad\qquad{R\over\sqrt{2\tau_{2}}|\eta(\tau)|^{2}}\sum_{n_{1},n_{2}}e^{-{\pi
R^{2}\over 2\tau_{2}}|n_{1}+n_{2}\tau|^{2}-{\pi
R\over\tau_{2}}\left(\xi(n_{1}+n_{2}\bar{\tau})-\bar{\xi}(n_{1}+n_{2}\tau)\right)}.$
(165)

Under large background gauge transformations $A\rightarrow A+d\phi_{A}$, where
$\phi_{A}=\pi{(n+m\bar{\tau})z-(n+m\tau)\bar{z}\over i\tau_{2}}$, we have from
(163)

$\displaystyle\xi\rightarrow\xi+{n+m\tau\over
R},\qquad\bar{\xi}\rightarrow\xi+{n+m\bar{\tau}\over R},$ (166)

and the action (162) is shifted by an integer multiplied by $2\pi i$. Hence,
the Euclidean path integral is invariant under (166), which can be verified
explicitly from (165). Similarly, $Z_{\rm PI}$ is invariant under modular
transformations generated by the two transformations

$\displaystyle\tau\rightarrow\tau+1,\quad$
$\displaystyle\xi\rightarrow\xi,\qquad\bar{\xi}\rightarrow\bar{\xi},$
$\displaystyle\tau\rightarrow-1/\tau,\quad$
$\displaystyle\xi\rightarrow\xi/\tau,\quad\bar{\xi}\rightarrow\bar{\xi}/\bar{\tau},$

which is just the relabeling of spacetime coordinates, amended by a dilatation
(which acts trivially since the theory is conformal).

To find the relation between the path integral (165) and the partition
function (156), we perform a Poisson resummation in (157) over $n$, which
readily yields

$\displaystyle Z=Z_{\rm PI}e^{-{\pi\over 2\tau_{2}}(\xi-\bar{\xi})^{2}}.$
(168)

Alternatively we can couple a background gauge field $B$ to a different
combination of the $U(1)$ global symmetries by

$\displaystyle S^{\prime}[X,B]={1\over 2\pi}\int
d^{2}z\,|(\partial_{z}+R\,B_{z})X|^{2}.$ (169)

We assume $dB=0$ and use the background gauge symmetry to parametrize the
background gauge field by

$\displaystyle\xi={\tau_{2}\over i\pi}{R\over
2}B_{\bar{z}},\qquad\bar{\xi}={\tau_{2}\over i\pi}{R\over 2}B_{z}.$ (170)

In this case for real $B$ we have $\xi^{*}=-\bar{\xi}$, and large gauge
transformations take $B\rightarrow B+d\phi_{B}$, where
$\phi_{B}=\pi{(p+q\bar{\tau})z-(p+q\tau)\bar{z}\over i\tau_{2}}$, and act as

$\displaystyle\xi\rightarrow\xi+{(p+q\tau)R\over
2},\qquad\bar{\xi}\rightarrow\bar{\xi}-{(p+q\bar{\tau})R\over 2}.$ (171)

Clearly, the path integral

$\displaystyle Z^{\prime}_{\rm
PI}(\tau,R,\xi,\bar{\xi})=\int{\mathcal{D}}X\,e^{-S^{\prime}[X,B]}=$
$\displaystyle\qquad\qquad{R\over\sqrt{2\tau_{2}}|\eta(\tau)|^{2}}\sum_{n_{1},n_{2}}e^{-{\pi
R^{2}\over 2\tau_{2}}|n_{1}+n_{2}\tau|^{2}-{\pi
R\over\tau_{2}}\left(\xi(n_{1}+n_{2}\bar{\tau})-\bar{\xi}(n_{1}+n_{2}\tau)\right)+{2\pi\xi\bar{\xi}\over\tau_{2}}}$
(172)

is invariant under large gauge transformations (171), and is also modular
invariant. A comparison with $Z_{\rm PI}$ yields $Z_{\rm PI}=Z_{\rm
PI^{\prime}}\,e^{{2\pi\over\tau_{2}}\xi\bar{\xi}}$, and

$\displaystyle Z=Z_{\rm PI^{\prime}}e^{-{\pi\over
2\tau_{2}}(\xi+\bar{\xi})^{2}},$ (173)

in agreement with Appendix A of Kraus_2007 .

The two path integrals above are particular sections $\xi^{*}=\pm\bar{\xi}$ of
a more general theory coupled to two gauge fields, $A$ and $B$, combined into
one complex combination

$\displaystyle S={1\over 2\pi}\int d^{2}z{|\partial X|^{2}}-{i\over 2\pi}\int
dX\wedge{\mathcal{A}}+{\kappa\over\pi}\int d^{2}z\,{\mathcal{A}^{2}},$ (174)
$\displaystyle{\mathcal{A}}={A\over R}+i*B{R\over
2},\qquad{\mathcal{A}^{2}}\equiv{\mathcal{A}}_{z}{\mathcal{A}}_{\bar{z}}.$

Taking $\kappa=0$ or $2$ gives complexifications of the two path integrals
with the actions (162) and (169) above. As follows from (158) and (168),(173)
these two values are T-dual to each other

$\displaystyle Z_{\rm PI}(\tau,\xi,\bar{\xi},R)=Z^{\prime}_{\rm
PI}(\tau,\xi,-\bar{\xi},2/R),$ (175)

and each is invariant under one group of large gauge transformations, (166) or
(171). The “symmetric” choice $\kappa=1$ corresponds to the bulk path integral
discussed in the bulk of the paper

$\displaystyle Z_{BPI}(\tau,\xi,\bar{\xi})=Z(\tau,\xi,\bar{\xi})\,e^{{\pi\over
2\tau_{2}}(\xi^{2}+\bar{\xi}^{2})}.$ (176)

It is both modular-invariant and T-duality-invariant, and it changes
covariantly (but is not invariant) under large gauge transformations of the
form

$\displaystyle\xi={\tau_{2}\over i\pi}\left({A_{\bar{z}}\over
R}+{B_{\bar{z}}R\over 2}\right),\qquad\qquad\quad\,\,\bar{\xi}=-{\tau_{2}\over
i\pi}\left({A_{z}\over R}-{B_{z}R\over 2}\right),$ (177)
$\displaystyle\xi\rightarrow\xi+{n+m\tau\over R}+{(p+q\tau)R\over
2},\qquad\bar{\xi}\rightarrow\xi+{n+m\bar{\tau}\over R}-{(p+q\bar{\tau})R\over
2}.$ (178)

##  Appendix B Chern-Simons theory: technical details

In this section we provide additional details accompanying section 3. Our
starting point is the $U(1)$ gauge field $A$ living on a three-manifold
$\mathcal{M}$ as in subsection 3.2. We focus on the case when
$\partial\mathcal{M}$ is a two-dimensional torus, with the same notation as in
Appendix A above. The bulk theory is invariant under large gauge
transformations $A\rightarrow A+\omega$ in (43) when $\omega$ is a canonically
normalized cohomology on $\partial\mathcal{M}$, namely $\omega=d\phi$ where
$\phi$ is a multi-valued function winding along the cycles of
$\partial\mathcal{M}$. When $\partial\mathcal{M}$ is a two-dimensional torus
as above, we have explicitly $\phi=2\pi{(n+m\bar{\tau})z-(n+m\tau)\bar{z}\over
2i\tau_{2}}$, from where (42) follows. Taking $A_{\bar{z}}=0$ at the boundary
for simplicity, two consecutive large gauge transformations $\omega$ and
$\omega^{\prime}$ change the Chern-Simons action (36) by

$\displaystyle-{ik\over
4\pi}\int\limits_{\partial\mathcal{M}}\omega\wedge\omega^{\prime}=-i\pi
k(nm^{\prime}-n^{\prime}m).$ (179)

Thus the bulk theory is gauge-invariant for even $k$, while pure sign phase
factors appear for odd $k$, related to the need to choose a spin structure.

In the $U(1)\times U(1)$ case of subsection 3.3, there are two gauge fields
$A,B$ subject to large gauge transformations $A\rightarrow A+\omega_{A}$,
$B\rightarrow B+\omega_{B}$, where $\omega_{A,B}=d\phi_{A,B}$ are defined in
Appendix A above.

One can imagine splitting $\mathcal{M}$ into two parts by a hypersurface.
Imposing boundary conditions on the surface, and then integrating over them,
should remove the split. This leads to the scalar product
$\langle\Psi|\Psi^{\prime}\rangle$ discussed in the main text Elitzur:1989nr ,
and the wave functions (46) discussed there form an orthogonal basis,

$\displaystyle\langle\Psi_{r}|\Psi_{r^{\prime}}\rangle=\int{d^{2}\xi\over\tau_{2}}\,(\Psi_{r}(\xi))^{*}e^{-{k\pi\over\tau_{2}}|\xi|^{2}}\Psi_{r^{\prime}}(\xi)=\sqrt{1\over
2k\tau_{2}}\,{\delta_{r,r^{\prime}}\over|\eta(\tau)|^{2}}.$ (180)

The integral here is over the torus of possible boundary conditions, defined
by the large gauge transformations (42), $\xi\sim\xi+n+m\tau$. In the case of
$(U(1)\times U(1))^{n}$ discussed in section 3.4 above, the wavefunctions
(3.4) also satisfy an orthogonality condition

$\displaystyle\int{d^{2n}\xi\,d^{2n}\bar{\xi}\over\tau_{2}^{2n}}(\Psi_{c}(\xi,\bar{\xi}))^{*}e^{-{\pi\over\tau_{2}}(|\xi|^{2}+|\bar{\xi}|^{2})}\Psi_{c^{\prime}}(\xi,\bar{\xi})=\delta_{c,c^{\prime}}{1\over\left(2|{\sf
G}_{\Lambda}|^{1/2}\right)^{n}}{1\over\tau_{2}^{n}|\eta(\tau)|^{4n}},$ (181)

where the integral is over the torus in the space of $\xi,\bar{\xi}$ variables
defined by (71).

To obtain the explicit form of the Wilson loop operators acting on the
wavefunction in the holomorphic representation (47), we take into account that
$A_{\bar{z}}$ (understood as a quantum operator) acts on ket vectors by
multiplication, $A_{\bar{z}}|\Psi\rangle={i\pi\xi\over\tau_{2}}\Psi(\xi)$, and
hence $A_{z}$ acts on bra vectors analogously
$\langle\Psi|A_{z}=(\Psi(\xi){i\pi\over\tau_{2}}\xi)^{*}$. From here and by
integrating by parts in (180) we find

$\displaystyle A_{z}|\Psi\rangle={-i\over
k}{\partial\over\partial\xi}\Psi(\xi),$ (182)

which is used in (47). As we explained in the main text, this is in agreement
with $A_{z}$ being canonically conjugate to $A_{\bar{z}}$, as follows from the
Chern-Simons equations of motion Bos:1989wa .

##  Appendix C Narain $c=2$ theories

The partition function $Z_{c=2}(\tau,t,b)$ of a central charge $c=2$ Narain
theory depends on three modular parameters, $\tau$ and $t,b$ introduced in
(112). It can be written explicitly using the representation (149):

$\displaystyle
Z_{c=2}(\tau,t,b)={b_{2}\over\tau_{2}|\eta(\tau)|^{4}}\sum_{\vec{n},\vec{m}\in\mathbb{Z}^{2}}e^{-{\pi\over\tau_{2}}|\gamma(\vec{n}\tau+\vec{m})|^{2}-2\pi
i\,b_{1}\vec{n}\wedge\vec{m}}.$ (183)

The moduli space of $c=2$ Narain theories is a product of two fundamental
domains of $t$ and $b$, with the canonical $SL(2,\mathbb{Z})$-invariant
measure, modulo $\mathbb{Z}_{2}$ exchange symmetry. It is convenient to
introduce

$\displaystyle\Theta_{c=2}(\tau,t,b)=|\eta(\tau)|^{4}Z_{c=2}(\tau,t,b),$ (184)

which is modular invariant under $t,b$ and is a weight 2 modular form with
respect to $\tau$. The modular invariant combination
$\hat{Z}=\tau_{2}\Theta_{c=2}$ is the partition function of primaries; it
exhibits triality – full permutation symmetry under its arguments $\tau,t,b$
Benjamin:2021ygh  – which is not manifest in the representation (183).

###  C.1 All even self-dual $n=2$ codes over
$\mathbb{Z}_{p}\times\mathbb{Z}_{p}$

There are $2(p+1)$ even self-dual codes over
$\mathbb{Z}_{p}\times\mathbb{Z}_{p}$ with prime $p$, which can be split into 2
families. The first $p$ codes are generated through

$\displaystyle\mathcal{C}\ni c=(\vec{a},\vec{b})=G^{T}q,\quad
q\in\mathbb{Z}_{p}^{2},$ (185)

by the following matrix

$\displaystyle G=(I,{\rm B}^{T}),\qquad{\rm
B}=r\left(\begin{array}[]{cc}0&1\\\ -1&0\end{array}\right)\,{\rm
mod}\,p,\qquad 0\leq r<p.$ (188)

One more code is generated by the matrix $G=(0,I)$. Another $p+1$ codes are
obtained from the previous ones by exchanging $a_{2}$ and $b_{2}$.

###  C.2 Hecke operators and triality

The $2(p+1)$ codes described above, once promoted to code CFTs, can be
described as two families of $p+1$ theories, specified by modular parameters
$t={r+t_{0}\over p}$ and $t=p\,t_{0}$ with fixed $b=b_{0}$, and
$b={r+b_{0}\over p}$ and $b=p\,b_{0}$ with fixed $t=t_{0}$, where $0\leq r<p$.
The sum over the latter (fixed $t=t_{0}$) series is easy to reformulate using
the representation of the partition function (183). We start with

$\displaystyle{1\over
p}\sum_{k=0}^{p-1}\Theta_{c=2}\left(\tau,t_{0},{b_{0}+k\over p}\right)$ (189)

and immediately conclude from (183) that the role of the sum over $k$ is to
impose $n\wedge m=0\,{\rm mod}\,p$. This constraint means that the vectors
$n\,{\rm mod}\,p$ and $m\,{\rm mod}\,p$, understood as vectors in
$\mathbb{Z}_{p}^{2}$, are collinear. Thus, when $p$ is prime, we can write

$\displaystyle m=r\,n+p\tilde{m},\quad\tilde{m}\in\mathbb{Z}^{2},$ (190)

for some integer $0\leq r<p$, unless $n=0\,{\rm mod}\,p$, in which case
$n=p\,\tilde{n}$ for arbitrary $\tilde{n},m\in\mathbb{Z}^{2}$. First we
consider the latter case, and find

$\displaystyle{b_{2}\over
p\,\tau_{2}}\sum_{\tilde{n},{m}\in\mathbb{Z}^{2}}e^{-{\pi\over\tau_{2}}|p^{-1/2}\gamma(p\tilde{n}\tau+m)|^{2}-2\pi
i\,{b_{1}\over p}p\,\tilde{n}\wedge m}=\Theta_{c=2}(p\,\tau,t,b).$ (191)

Next, we consider the case (190),

$\displaystyle\sum_{r=0}^{p-1}{b_{2}\over
p\,\tau_{2}}\left(\sum_{n,\tilde{m}\in\mathbb{Z}^{2}}e^{-{\pi\over\tau_{2}}|p^{-1/2}\gamma(n\tau+rn+p\tilde{m})|^{2}-2\pi
i\,{b_{1}\over
p}p\,n\wedge\tilde{m}}-\sum_{\tilde{n},\tilde{m}\in\mathbb{Z}^{2}}e^{-{\pi\over\tau_{2}}|p^{1/2}\gamma(\tilde{n}\tau+rn)|^{2}-2\pi
i\,{b_{1}\over p}p^{2}\,\tilde{n}\wedge\tilde{m}}\right),$

where we explicitly subtracted the terms when both $n,m=0\,{\rm mod}\,p$,
which were already covered in (191). We can easily recognize these terms to be

$\displaystyle\sum_{r=0}^{p-1}{1\over p^{2}}\Theta_{c=2}\left({\tau+r\over
p},t,b\right)-{1\over p}\Theta_{c=2}(\tau,t,p\,b).$ (192)

Combining (189),(191),(192) we find, in terms of the Hecke operator (118),

$\displaystyle{1\over p}T_{p}^{\tau}\,\Theta_{c=2}=T_{p}^{b}\,\Theta_{c=2}.$
(193)

We label each Hecke operator by the variable it acts on; since $\Theta_{c=2}$
is a modular form of weight $2$ with respect to $\tau$ and weight $0$ with
respect to $b$, $T_{p}^{\tau}$ and $T_{p}^{b}$ act differently. The left-hand-
side of (193) is manifestly invariant under the exchange of $t$ and $b$, thus
$T_{p}^{\tau}\,\Theta_{c=2}=p\,T_{p}^{t}\,\Theta_{c=2}=p\,T_{p}^{b}\,\Theta_{c=2}$.
This relation implies that the Hecke operators for $\tau$, $b$, and $t$ act on