Narain CFTs and error-correcting codes on finite fields

We construct Narain CFTs from self-dual codes on the finite field Fp through even self-dual lattices for any prime p > 2. Using this correspondence, we can relate the spectral gap and the partition function of the CFT to the error correction capability and the extended enumerator polynomial of the code. In particular, we calculate specific spectral gaps of CFTs constructed from codes and compare them with the largest spectral gap among all Narain CFTs.


Introduction
In high energy physics, conformal field theories (CFTs) are widely used such as for describing string theory.On the other hand, in information theory, error-correcting codes enable us to transmit information correctly in spite of possible errors.Although their theoretical motivations are very different, their properties have many mathematical similarities.
In fact, the relation between classical error-correcting codes on F 2 = {0, 1} and chiral CFTs through Euclidean lattices has long been known.The symmetries and quantities of CFTs have been analyzed through codes [1], and vertex operator algebras have been studied such as the correspondence among the Golay code, the CFT related to the Leech lattice and the Monster group [2,3].Recently, the higher genus partition functions of CFTs constructed from codes were calculated to understand modular invariance at higher genus [4].
There is also a rich connection between quantum error-correcting codes and CFTs.The term "quantum" means transmitting a quantum state that can involve quantum entanglement among qubits.For example, the symmetries of quantum codes can be translated into the superconformal symmetries of corresponding CFTs [5].In addition, the properties of holography such as the AdS/CFT correspondence can be interpreted in the language of quantum codes and tensor networks [6,7].As discussed later, we focus on the spectrum in this paper.The spectrum of twodimensional CFTs has been studied numerically and analytically using the modular invariance of CFTs and linear functional methods, which is related to the sphere packing problem [8][9][10][11].In particular, the maximum value of the spectral gaps that Narain CFTs can have was evaluated numerically using the modular bootstrap, and analytical methods to get the lower bound are proposed [12].The spectrum itself is an essential quantity for the CFT, and it is also related to states in the corresponding theory of gravity through holography [13].
Recently, the relation between classical error-correcting codes on F 2 or F 4 = {0, 1, ω, ω 2 } and Narain CFTs through lattices on R n,n have been studied and quantities in CFTs such as spectral gaps and partition functions were described in the language of codes [14,15].In this paper, we extend the relation to codes on F p for any prime p > 2 and more general Narain CFTs.The relation between CFTs, lattices and codes is roughly summarized in Table 1.In addition, we calculate spectral gaps of corresponding Narain CFTs for small p and compare them with known optimal values in [12].Though it is generally difficult to solve the problem of finding the spectral gap for a given CFT, we can calculate it rigorously using the construction from codes.
The outline of the paper is as follows.In section 2, we review the background knowledge about Narain CFTs, lattices and codes.We clarify the properties "even" and "self-dual", which play important roles in establishing the relation.Section 3 contains the main result of this paper.In subsection 3.1, we construct Narain CFTs from self-dual codes on F 2n p through even self-dual lattices on R n,n for any prime p > 2. The corresponding CFTs have n scalars, radii 2/p, the flat metric and antisymmetric tensor backgrounds with integer values (hereinafter called integer backgrounds).In subsection 3.2, we relate the spectral gap and the partition function in the CFT to the error correction capability and the enumerator polynomial in the corresponding code.Using this relation, we calculate specific spectral gaps of Narain CFTs constructed from codes for small p, n.In subsection 3.3, we introduce a more general construction that covers Narain CFTs with curved metrics and non-integer backgrounds.Since the relation between quantities is not concise in this case, we give a few important examples.

Preliminaries
This section deals with the background knowledge about Narain CFTs, lattices and codes needed for later discussions to understand the relation in Table 1.

Narain CFTs
A Narain CFT is described by n scalars X i , i = 1, . . ., n on a torus T n with radii R [16,17].We follow the notations of [18].A world-sheet action S is where G ij is a metric (symmetric) and B ij is an antisymmetric tensor background, both of which are constants.From the equation of motion, the mode expansion of X i is From the compactification, they should satisfy where w = (w 1 , . . ., w n ) T , m = (m 1 , . . ., m n ) T ∈ Z n and S = dtL.By substituting (2.2),(2.3),(2.4)for (2.5),(2.6), the eigenvalues k L , k R of p L , p R are ) We introduce a tetrad e µ i which satisfy G ij = e µ i e ν j δ µν , its inverse e i µ and dimensionless momenta on orthogonal basis where r = R 2/α is a dimensionless radius.In the following, we use the momentum to refer to this dimensionless one.
The spectral gap and the partition function are important quantities in the Narain CFT.The spectral gap ∆ of primary states, which is the energy difference between the ground state and the first nontrivial primary state, is when we set α = 2.The partition function Z(τ ), which is a trace of states weighted by the Hamiltonian and the momentum, is (2.12) where η(τ ) is the Dedekind eta function: (1 − q m ), q = e 2πiτ , q = e −2πiτ . (2.13)

Lattices
A lattice Λ ⊂ R n is a subgroup of R n which can be written as Λ = { n i=1 a i v i | a i ∈ Z} where v are basis of R n .Much of the discussion in this and the next subsection depends on [19].Since the properties "even" and "self-dual" are the core of our discussion, we clarify definitions.
• "even": A lattice Λ ⊂ R n is even with a metric g if ∀x ∈ Λ, x • x ∈ 2Z. (2.14) • "self-dual": For a lattice Λ ⊂ R n , a dual lattice with a metric g is Here, the dot "•" means an inner product : (2.16) In addition, G, G ∈ GL(n, R) are generator matrices of the same lattice if and only if there exists an n × n unimodular matrix U s.t.G = GU .The momenta of the Narain CFT form a lattice and we can easily prove that this lattice is even self-dual with a metric where I is an n × n identity matrix.We can define another lattice by where This lattice is even self-dual with a metric since the inner product with g of vectors in Λ N (r, G, B) is equal to the inner product with g of the corresponding vectors in Λ(r, G, B).From (2.9) and (2.10), α and β can be written as and thus one generator matrix of where (γ) iµ = e µ i .We will associate a code with this lattice in the next section.In the language of the lattice, the spectral gap ∆ is and the partition function Z(τ ) is The partition function of the Narain CFT is modular-invariant, i.e.Z(τ ) = Z(τ + 1) and Z(τ ) = Z(−1/τ ) which respectively correspond to evenness and self-duality of the lattice (Λ(r, G, B) with the metric g or Λ N (r, G, B) with the metric g).

Codes
For a prime p, we will consider an error-correcting code on F p = Z/pZ, which is a finite field with p elements.In this paper, elements on F p are often denoted by bars, for instance, F 3 = { 0, 1, 2}, in order to distinguish them from elements on R. Furthermore, R : The code is used to transmit information.During the transmission, it may be possible to pick errors.Now, we assume that an error e ∈ F n p : a → a + e occurs with a probability inversely proportional to d(e).In this case, the coding procedure through C with a specified n × k generator matrix G on F p is as follows: 1. Alice wants to transmit a ∈ F k p to Bob. (2.29)

Alice sends
The distance does not depend on the choice of the generator matrix and represents the error correction capability of the code.If C is additive, As for lattices, we define the property "self-dual" for codes.
• "self-dual": For a code C ⊂ F n p , a dual code with a metric ḡ on F n p is Here, the circle "•" means an inner product :

Narain CFTs and codes
This section is the main part of this paper.We will define the correspondence between codes on F 2n p and Narain CFTs with n scalars and see the relation between quantities in both theories.
In this section, we set where I, Ī are n × n identity matrices on R, F p .Furthermore, "•" and "•" mean inner products respectively on R 2n with the metric g and on F 2n p with the metric ḡ.

Construction of Narain CFTs from codes
We define a lattice corresponding to an additive code C ⊂ F 2n p by It is obvious from the definition that Λ p (C) = Λ p (C ) if and only if C = C .In this construction, we can translate the properties "even" and "self-dual" into words in codes as follows.
Proposition 3.1.For a prime p = 2, Λ p (C) is even with the metric g if and only if c•c = 0 for all c ∈ C.
Proof.We rewrite the evenness of the lattice.From the definition, Λ p (C) is even with g when x • x ∈ 2Z for all x ∈ Λ p (C).From the construction (3.2), it can be rewritten that is even for all c ∈ C and m ∈ Z 2n .Since the second and third terms are always even, it is satisfied if and only if n i=1 R(c i )R(c i+n ) ∈ pZ.The calculation on F p can be regarded as that on R with mod p, thus it can be expressed as does not hold for p = 2. Thus, for p = 2, we can conclude that Λ p (C) is even with g if and only if c • c = 0 for all c ∈ C. Proposition 3.2.For a prime p (including p = 2), Λ p (C) is self-dual with the metric g if and only if C is self-dual with the metric ḡ.
Proof.First, we show that the dual lattice of the code is the lattice of the dual code, i.e. (Λ p (C)) * = Λ p (C * ).We prove (Λ p (C)) * ⊂ Λ p (C * ) explicitly.From the definition of the dual lattice, x ∈ (Λ p (C)) * when x • x ∈ Z for all x ∈ Λ p (C).From the construction (3.2), it can be rewritten that 1 Since we have to handle the case p = 2 differently as shown in the proof, we will only consider a prime p = 2.
We have seen that we can generate even self-dual lattices from self-dual codes.Conversely, if a lattice Λ ⊂ R 2n is even self-dual with the metric g and satisfies √ pZ 2n ⊂ Λ, there exists a code C ⊂ F 2n p that satisfies Λ = Λ p (C).This is because Λ ⊂ 1 √ p Z 2n from the self-duality and Λ can be written as } from linearity of the lattice.Thus, by combining with Proposition 3.3, we can conclude that even self-dual lattices Λ ⊂ R 2n with the metric g that satisfy √ pZ 2n ⊂ Λ and self-dual codes C ⊂ F 2n p with the metric ḡ have a one-to-one correspondence.
Next, we want to find a generator matrix G of a self-dual code C ⊂ F 2n p .From linearity, when C is k dimensional, i.e. |C| = p k , C * is 2n − k dimensional.Thus, C = C * requires C to be n dimensional and G to be a 2n × n matrix.By the method using row reduction in Appendix A, we can find G that can be written as where B is an n × n matrix on F p and S is a 2n × 2n matrix that has one 1 and 2n − 1 0's in each row and satisfies ST ḡ S = ḡ.S can be regarded as the operation to swap rows while keeping the inner product.We want to find a condition for B. From the definition of the dual code, C is selfdual only if c • c = 0 for all c, c ∈ C. By the generator matrix, it can be rewritten as a T G T ḡGa = 0 for all a, a ∈ F 2n p .This is equivalent to G T ḡG = Ō where Ō is a zero matrix, thus i.e.B is antisymmetric in the sense of F p .Using these results, we can relate Narain CFTs and self-dual codes through even selfdual lattices as follows.This is one of the main purposes of this paper.Proposition 3.4.A self-dual code C ⊂ F 2n p with the metric ḡ has a generator matrix where B is an n × n matrix s.t.B + BT = Ō and S is a 2n × 2n matrix that has one 1 and 2n − 1 0's in each row and satisfies ST ḡ S = ḡ.Then, where S = R( S) and B is an antisymmetric matrix s.t.
Proof.One generator matrix of SΛ N is from (2.23) and this is also the generator matrix of Λ p (C) since where 's mean appropriate vectors and we can generate any vector in Λ p (C) by combining these.
Note that S in (3.7) does not affect even self-duality of the lattice since S T gS = g.By this proposition, several Narain CFTs can be constructed from a self-dual code depending on the choice of the generator matrix of the code.Since they generate the same lattice up to S and have the same quantities as we will see, we simply call them the corresponding CFTs.
From (3.7), the corresponding CFTs have dimensionless radii r = 2/p, the flat metric and integer backgrounds.Conversely, any Narain CFT with such properties can be constructed from a self-dual code up to B ij ∼ B ij + p in the background, which corresponds to T-duality.

The spectral gap and the partition function
Through Proposition 3.4, we can describe the important quantities in the corresponding Narain CFTs in the language of the code.From (2.24), the spectral gap ∆ is (3.11) Thus, under the condition D(C) ≤ p, the spectral gap ∆ represents the error correction capability of the code.Through this relation, for fixed p, n, searching for the code with the highest correction capability among self-dual codes on F 2n p is equivalent to searching for the theory with the largest spectral gap among Narain CFTs with n scalars, dimensionless radii r = 2/p, the flat metric and integer backgrounds.
Figure 1 shows the largest spectral gap of Narain CFTs constructed from self-dual codes on F 2n p .We computed all the values by a full search using (3.11) for codes with generator matrices (3.6).In (a), we varied n at p = 3, 5, 7, 11 and calculated values evaluate 'optimal' values from below, which are the largest spectral gaps among all Narain CFTs with n scalars cited from Table 1 in [12].In (b),(c), we varied p at n = 2, 3.The values at n = 2 suggest that their upper limit is 1/ √ 3, which can be checked analytically by reducing to the sphere packing in two dimensions as follows.
For n = 2, a generator matrix of a self-dual code C ⊂ F 2n p is We can reduce it to a code C ⊂ F 2 p generated by (ā, 1) T and ∆ = min   Thus, the largest radius r of circles centered at points in Λ p (C ) that do not intersect each other satisfies πr 2 ≤ π/(2 √ 3) and For a general integer n, we do not know the analytical upper bound.Next, we consider the partition function.From (2.26), From the second line to the third line, we used the equation: Thus, the partition function Z(τ ) is where and w x,y (c) = |{i ∈ {1, . . ., n} | (c i , c i+n ) = (x, y)}|.It has the form like the enumerator polynomial in coding theory.We can check modular invariance, i.e.Z(τ ) = Z(τ + 1) and Z(τ ) = Z(−1/τ ), directly from this form.

General construction
In section 3.1, we constructed Narain CFTs with dimensionless radii r = 2/p, the flat metric and integer backgrounds from self-dual codes.By varying the correspondence between codes and lattices in (3.2), we can construct more general Narain CFTs.
We define a lattice corresponding to an additive code C ⊂ F 2n p and a 2n × 2n matrix As in section 3.1, we want to relate even self-duality in lattices and self-duality in codes.In fact, the following proposition holds.Proposition 3.5."For a primes p = 2, Λ p (C; V ) is even self-dual with the metric g if and only if C is self-dual with the metric ḡ" holds if conditions: Proof.(A proof for the more general case is in Appendix B.) Using this proposition, we can construct Narain CFTs from self-dual codes as follows.
Proposition 3.6.A self-dual code C ⊂ F 2n p with the metric ḡ has a generator matrix where X is an n × n matrix s.t.X + XT = Ō and S is a 2n × 2n matrix that has one 1 and 2n − 1 0's in each row and satisfies ST ḡ S = ḡ.In addition, if an n × n matrix γ and an n × n antisymmetric matrix B satisfy where S = R( S) and X is an antisymmetric matrix s.t.
Proof.As in Proposition 3.4, both sides of (3.21) are generator matrices of lattices in (3.22).
Note again that S in (3.22) does not affect even self-duality of the lattice since S T gS = g.This is a generalization of Proposition 3.4, which is the case V = I 2n / √ p.Since the form of the corresponding Narain CFT depends strongly on V and it is difficult to handle collectively, we will see some specific examples that may be significant.For simplicity, we only consider codes with S = Ī, i.e. S = I in (3.21), (3.22).The results can be easily extended to other cases.First, we set which satisfy pV T a gV a = g = R(ḡ).A self-dual code C with a generator matrix G = ( XT , Ī) T satisfies Λ p (C; V a ) = Λ N ( 2/p/a, I, a 2 X ). (3.24) The spectral gap of the corresponding Narain CFT can be written as where By introducing the factor a in V , we multiply radii and background by 1/a and a 2 in the CFT.The calculation for the spectral gap is almost same as (3.11).D a (C) can be regarded as the error correction capability of the code when the probability of error is proportional to a in the former half (i = 1, . . ., n) and 1/a in the latter half (i = n + 1, . . ., 2n).
Next, we set where α is an n × n matrix and β is an n × n antisymmetric matrix, which satisfy pV (α, β) T gV (α, β) = g = R(ḡ).A self-dual code C with a generator matrix G = ( XT , Ī) T satisfies We can relate the code to any metric and background by varying α and β.However, the quantities in CFT such as the spectral gap cannot be expressed in a simple form in the language of the code and it is difficult to interpret in the context of coding theory.Thus, we should restrict our consideration to simple forms such as I 2n / √ p and V a in order to see "good" relation between error-correcting codes and Narain CFTs.

Conclusion
We defined the correspondence between Narain CFTs with n scalars and self-dual errorcorrecting codes on F 2n p through even self-dual lattices on R n,n , and derived the relation between quantities in both theories.We found that the spectral gap of the CFT and the error correction capability of the code are almost proportional and the partition function of the CFT can be expressed by the extended enumerator polynomial of the code.Using this relation, we calculated the specific spectral gaps to get the maximum value among the Narain CFTs with radii 2/p, the flat metric and integer backgrounds and compared them with the known values among all Narain CFTs.
In general, a number of elements in a finite field is a prime number or a prime power.In this paper, we dealt with prime numbers and only showed the construction in Appendix B for prime powers.We will aim to derive meaningful results for CFTs from codes on finite fields with prime power elements.
In the future, we expect to analytically impose stronger bounds on quantities in both theories such as the spectral gap than those are currently known by considering the limit p → ∞.In addition, we will clearly relate symmetries in Narain CFTs to counterparts in codes and see how they appear when we vary V in Proposition 3.6.
where B is an n × n matrix and S is a 2n × 2n matrix that has one 1 and 2n − 1 0's in each row and satisfies ST ḡ S = ḡ.
Let G be any generator matrix of C. Note that the matrix corresponds to the same code even if we multiply any column by any value without 0, add one column to another column and swap columns.In addition, S corresponds to swapping rows as i-th ↔ (i+n)-th or i, (i + n)-th ↔ j, (j + n)-th for generator matrices.We can basically get G from G by the following method.
All calculations are understood as on F p .When the step i-2 is done, the top i rows must be ( Īi×i Ōi×(n−i) ).A problem is that it doesn't work when G ii = 0.If there exists a nonzero G jk or G j+n,k for i ≤ j, k ≤ n, then we can bring it to G ii by swapping rows by S and/or columns and restart the method.If not, i.e.G has the form (for simplicity, i − 1 → i) where 's mean arbitrary matrices, we can't complete the method.However, it can't happen when the code C is self-dual.If G has this form, ( 0, . . ., is orthogonal with the metric ḡ to all columns of G but can't written as G a by a ∈ F n p .It means C * ⊂ C, which contradicts C = C * .Thus, we can always complete the method and get the desired generator matrix G.

B A proof of Proposition 3.5
As mentioned in section 3.3, we will prove the more general case.
As preparation, we introduce a finite field with prime power elements.For a prime p and an integer l ∈ N, F p l = F p [x]/(f p,l (x)) = { l−1 t=0 a t x t | a t ∈ F p } is a finite field with p l elements where f p,l (x) is the Conway polynomial and (f (x)) is the ideal generated by f (x).Furthermore, for r ∈ Z s.t.0 ≤ r < l, we define a map P r : F p l → F p by P r ( l−1 t=0 a t x t ) = a r .We define a lattice corresponding to an additive code C ⊂ F n p l and an nl × nl matrix V = (v 1,0 , v 1,1 , . . ., v n,l−1 ) ∈ GL(nl, R) by where c i = l−1 t=0 c i,t x t , c i,t ∈ F p .A generalization of Proposition 3.5 is as follows.
Proposition B.1.We define inner products on R nl and F n p l by R nl ×R nl → R, x•y = x T gy where g : nl × nl symmetric matrix and F n p l × F n p l → F p , a • b = l−1 r=0 e r P r (a T ḡb) where e r ∈ F p and ḡ : n × n symmetric matrix on F p .Then, Λ p l (C; V ) is self-dual with the metric g ⇔ C is self-dual with the inner product • (B.2) holds if conditions: • W := pV T gV is unimodular • w i,t,j,s := pv i,t • v j,s (= W l(i−1)+t+1,l(j−1)+s+1 ) ≡ R(ḡ ij )R( e r P r (x t+s )) mod p are satisfied.Furthermore, for p = 2, Λ p l (C; V ) is even with the metric g ⇔ ∀c ∈ C, c • c = 0 (B.3) holds if above two conditions and an additional condition: • ∀i, t, w i,t,i,t ∈ 2Z are satisfied.For p = 2, without additional conditions, Λ p l (C; V ) is even with the metric g ⇔ ∀c ∈ C, i,t,j,s R(c i,t )R(c j,s )w i,t,j,s ∈ 4Z.(B.4) Proof.(self-dual) First, we show that the dual lattice of the code is the lattice of the dual code with the same V , i.e. (Λ p l (C; V )) * = Λ p l (C * ; V ).We prove (Λ p l (C; V )) * ⊂ Λ p l (C * ; V ) explicitly.From the definition of the dual lattice, x ∈ (Λ p l (C; V )) * when x • x ∈ Z for all x ∈ Λ p l (C; V ).Since v i,t are basis of R nl , we can write x = j,s x j,s v j,s by x j,s ∈ R.Then, from the construction (B.1), x • x ∈ Z can be rewritten that i,t,j,s (R(c i,t ) + pm i,t )v i,t • x j,s v j,s = i,t,j,s 1 p (R(c i,t ) + pm i,t )x j,s w i,t,j,s (B.5) is an integer for all c ∈ C and m ∈ Z nl .By considering the case c = 0, x should satisfy i,t,j,s m i,t x j,s w i,t,j,s ∈ Z for all m ∈ Z nl , which is equivalent to j,s x j,s w i,t,j,s ∈ Z for 27) and write d(a, 0) = d(a).It can be interpreted as an analog of the Euclidean distance on a torus T n with length p.A code on F p can be expressed by a subspace C ⊂ F n p where n is called length.In particular, a code C is additive if a + b ∈ C for all a, b ∈ C. For an additive code C ⊂ F n p , there exists an integer k s.t.C has p k elements, and an

3 .
Bob receives b = Ga + e ∈ F n p .(If no error occurred, b = Ga.)4. Bob decodes b by arg min c∈C d(b, c).Bob can get the correct message a if d(b, Ga) < d(b, c) for all c = Ga ∈ C. Thus, we can always correct the error e if d(e) < D(C)/2 where D(C) is a distance of the code defined by D(C) = min a,b∈C,a =b d(a, b).

1 √
for all c ∈ C and m ∈ Z 2n .By considering the case c = 0, only one element of m is 1 and the others are 0, all elements of x should be multiples of 1/ √ p.Since any integers can be expressed as R(c ) + pm , we can write x = p (R(c )+pm ) by c ∈ F 2n p and m ∈ Z 2n , and( ) becomes 1 p (R(c)+pm)•(R(c )+pm ) ∈ Z.This is satisfied if and only if R(c) • R(c ) ∈ pZ, which is equivalent to c • c = 0.From the definition of the dual code, it means c ∈ C * and thus x ∈ Λ p (C * ).Since the discussion can be easily traced back to prove(Λ p (C)) * ⊃ Λ p (C * ), we can conclude that (Λ p (C)) * = Λ p (C * ).Therefore, Λ p (C) is self-dual if and only if Λ p (C) = Λ p (C * ), i.e.C is self-dual.Proposition 3.3.For a prime p = 2, Λ p (C) is even self-dual with the metric g if and only if C is self-dual with the metric ḡ.Proof.It is obvious from Propositions 3.1, 3.2 and the fact that C = C * leads c • c = 0 for all c ∈ C.

13 )
From the construction (3.2),Λ p (C ) ⊂ R 2 has p points per √ p× √ p.On the other hand, it is widely known that the highest density of the sphere packing in two dimensions is π/(2 √ 3).

Figure 1 :
Figure 1: The largest spectral gap of Narain CFTs constructed from self-dual codes on F 2n p .

Table 1 :
The relation between CFTs, lattices and codes