Exploring the landscape of heterotic strings on T^d

Compactifications of the heterotic string on T^d are the simplest, yet rich enough playgrounds to uncover swampland ideas: the U(1)^{d+16} left-moving gauge symmetry gets enhanced at special points in moduli space only to certain groups. We state criteria, based on lattice embedding techniques, to establish whether a gauge group is realized or not. For generic d, we further show how to obtain the moduli that lead to a given gauge group by modifying the method of deleting nodes in the extended Dynkin diagram of the Narain lattice II_{1,17}. More general algorithms to explore the moduli space are also developed. For d=1 and 2 we list all the maximally enhanced gauge groups, moduli, and other relevant information about the embedding in II_{d,d+16}. In agreement with the duality between heterotic on T^2 and F-theory on K3, all possible gauge groups on T^2 match all possible ADE types of singular fibers of elliptic K3 surfaces. We also present a simple method to transform the moduli under the duality group, and we build the map that relates the charge lattices and moduli of the compactification of the E_8 x E_8 and Spin(32)/Z_2 heterotic theories.


Introduction
The compactification of perturbative heterotic strings on d-dimensional tori has a long history, starting with the seminal works by Narain [1], and Narain, Sarmadi and Witten [2]. Renewed interest in this subject arose as a consequence of the many dualities of toroidal compactifications. The conjectured dualities between the heterotic on T 4 and type IIA on K3 [3], the heterotic on T 3 and M-theory on K3 [4,5] (for reviews, see [6,7]), and the heterotic on T 2 and F-theory compactified on an elliptic K3 manifold [8], provide ideal frameworks for exploring non-perturbative aspects of string theory. Another recent application is the holographic duality between the average over toroidal compactifications of Narain's family of two-dimensional CFT's and three-dimensional gravity [9,10]. Additional motivations to further investigate this theory include the construction of phenomenologically viable models of string compactifications, since heterotic and F-theory vacua are two of the most promising scenarios to build realistic examples [11,12], as well as the test of swampland criteria (see [13] for reviews and [14,15] for recent related work).
As it is well known, modular invariance of the heterotic string on T d requires that the momenta of the worldsheet fields take values on the even self-dual lattice II d,d+16 [1]. This lattice is unique up to SO(d, d + 16, R) transformations, and the precise way in which it is related to the moduli of the theory was determined in [2]. In particular, the presence of suitable Wilson lines may result in the enlargement of the gauge group of the theory, while further adjusting the metric and Kalb-Ramond background fields, one could continuously interpolate between toroidally compactified versions of the E 8 × E 8 and Spin(32)/Z 2 heterotic theories. This interpolation was made explicit for the circle in [16,17].
Our aim is to examine the structure of the moduli space and the pattern of associated gauge symmetries. Various interesting related issues that deserve further analysis can be identified. One is to find the moduli (up to dualities) that produce a particular group. For example, as already noticed in [1], the group of maximal dimension allowed is SO(32 + 2d) and values of the moduli for which this group arises were found in [2] for d = 1 and in [16] for other d. More generally, we might ask for all possible groups and their corresponding background.
The allowed groups are such that their even positive definite root lattice can be embedded in the Narain lattice II d,d+16 [1]. Thus, they can in principle be found using lattice embedding techniques, in particular the machinery developed by Nikulin [18], as advocated in [19]. For instance, Theorem 1.12.4 in [18] implies that any ADE group of rank less or equal than (d + 8) can be embedded in II d,d+16 , and is thus realized in compactifications of the heterotic theory on T d .
For d = 2 all allowed gauge groups are known from the work of Shimada and Zhang who classified all possible ADE types of singular fibers in elliptic K3 surfaces [20,21]. As we will explain, the classification provides all possible heterotic gauge groups because the lattice embedding conditions are identical in the K3 and heterotic frameworks. This is consistent with duality between heterotic on T 2 and F-theory on K3.
Another problem is to obtain the resulting gauge group for specific moduli. It can be solved by organizing the left-moving components of the momenta into roots of an ADE group (see [22,23] for examples). However, since this method is cumbersome, it is desirable to develop a more powerful approach which could also be applied to the question of finding all possible groups. When d = 1 both problems can be solved using the extended Dynkin diagram (EDD) associated to the Narain lattice II 1,17 . For instance, the 44 allowed groups with maximal rank 17 and the corresponding moduli were determined in [23] starting from the EDD.
The generalization of the powerful EDD algorithm to higher dimensional compactifications clashes with the fact that, unlike O(1, 17; Z), the T-duality group O(d, d + 16; Z) is no longer generated by simple reflections. In the absence of a Dynkin diagram to describe II d,d+16 , what we can do to explore the landscape of heterotic strings on T d , for generic dimension d > 1, is to develop alternative methods.
To begin we will revisit Nikulin's criteria, and apply them to compactifications of the heterotic string on T d . The study of embeddings in II d,d+16 will enable us to characterize the allowed gauge groups in terms of lattice data consisting of the pair (L, T ), where L is the root lattice of the group, and T is the dual lattice of the right-moving momenta. Conversely, (L, T ) can be determined from the moduli that originate the group.
We also present three other methods to examine the toroidal landscape. We focus mainly on maximal enhancing in T 2 compactifications of the E 8 × E 8 theory, but the algorithms work in higher dimensions. In particular, we will obtain all semisimple groups with maximal rank d + 16, occurring in d = 1, 2. Moreover, the moduli in the Spin(32)/Z 2 theory can be deduced from those of the E 8 × E 8 theory by making use of an O(d, d + 16) transformation that generalizes the map constructed in [17] for d = 1.
One of the methods developed mimics the EDD approach by employing the shift vector algorithm, based on original work by Kac [24]. The algorithm gives in particular pairs of Wilson lines that break E 8 × E 8 to a subgroup of rank 16. By choosing special values of the torus metric and the Kalb-Ramond field one can construct extended diagrams containing d + 18 nodes, where the d nodes coming from the torus connect the two 9-node diagrams of two extended E 8 groups. Deleting two nodes leads to a semisimple group of rank 16 + d that is realized in the heterotic string, and the construction gives the point in moduli space where it is realized. This method gives all groups of maximal enhancement in circle compactifications, but already for d = 2 fails to give some groups that are known to appear from the results of [20]. To search for additional groups we elaborate an algorithm that determines maximal enhancements for other values of the moduli, but still starting from Wilson lines that leave unbroken a subgroup of rank 16. More groups can then be found, but still for d = 2 there are 2 of the 325 groups of the list in [20] that do not appear. We argue that these groups cannot be obtained from enhancing a rank 16 subgroup of E 8 × E 8 , which is the departing point of this method.
To recover all allowed groups we use a more general technique. The idea is to start from a point of maximal enhancement, i.e. a rank d + 16 group with no U(1) factors, move along lines in moduli space where there is a breaking to a group with one U(1) factor, and then find all maximal enhancings that can be reached from the neighborhood of the initial point. We have fully exploited this technique in d = 2, finding all enhancements reported in [20]. We have also done a quick exploration in d = 3.
The paper is organized as follows. In section 2, we briefly review the basics of heterotic compactification on T d and present a simple method to find the transformation of the background fields under the action of O(d, d + 16). We also review the map relating the charge vectors and moduli of the E 8 × E 8 and Spin(32)/Z 2 theories on the circle, and formulate it for generic d. In section 3 we state criteria, based on lattice embedding techniques, that can be used to detect whether a group is allowed or not. We additionally explain how to translate between heterotic moduli and lattice data. The notation and essential concepts about lattices that supplement this section are contained in appendices A and B. The method of the EDD and the results that were obtained in the circle are recalled in section 4, where we also show how they perfectly fit within the formalism of lattice embeddings. Compactifications on T 2 are the subject of section 5. In section 5.1, we introduce the complex moduli and their duality transformations, and review the action of O(2, 3; Z) on a particular slice of the moduli space.
In section 5.2 we describe a method based on extended diagrams and apply it to analyze maximal enhancings. In section 5.3, we present two computational algorithms to obtain the moduli underlying semisimple groups of maximal rank; one generalizes the method of extended diagrams while the other explores the neighborhood of points of maximal enhancement.

Toroidal compactification of the heterotic string
In this section we briefly review the basics of heterotic compactification on T d and outline our notation. The torus is defined by identifications in a latticeΛ d generated by vectors e i , i = 1, . . . , d. The constant torus metric is g ij = e a i δ ab e b j , a = 1, . . . , d. The vectorsê * i = g ij e i , g ij = g −1 ij , span the dual latticeΛ * d . The background is further specified by the constant antisymmetric two-form field b ij and d independent Wilson lines A I i , I = 1, ..., 16. The latter are constant components of the 10-dimensional gauge field in the Cartan sub-algebra of E 8 ×E 8 or SO (32). It is convenient to introduce the tensor E ij given by where A i · A j = A I i A I j . We use conventions α = 1. The momenta of the worldsheet fields of perturbative heterotic string theory compactified on a d-dimensional torus T d must take values on an even self-dual lattice II d,d+16 [1]. As shown in [2], the left and right components of the canonical center of mass momenta can be expressed in terms of the compactification moduli, g ij , b ij and A I i , as 2b) Here n i and w i are the integer momenta and winding numbers on the torus. The π I are the components of a vector belonging to the gauge lattice denoted Υ 16 , given by where Γ 8q is the even self-dual lattice consisting of vectors (m 1 , ..., m 8q ) and (m 1 + 1 2 , ..., m 8q + 1 2 ), with m k ∈ Z and 8q k=1 m k = even. Then π I π I = even. The π I can also be written as π I = π A α I A , with A = 1, . . . , 16, where α I A is a basis of Υ 16 such that α I A α I B = κ AB is the lattice metric.
The space of inequivalent lattices and inequivalent backgrounds is described by  (2.5) where O(d, d + 16; Z) is the T-duality group that leaves invariant the spectrum of the theory.
We refer to [23] for a complete discussion of the O(d, d+16; Z) generators, see also [25]. Typical elements are a change of basis of the torus latticeΛ d , shifts of the B-field by an antisymmetric integer matrix, and transformations of the Wilson lines by translations or automorphisms in Υ 16 . There are also factorized dualities that correspond to exchanging winding and momenta in one internal direction. In section 2.1 we will discuss duality transformations in more detail.
The spectrum of states depends on the background fields. It can be obtained from the mass formula and level-matching condition given by The condition p R = 0 requires that the the momentum numbers n i satisfy (see (2.2)) n i = E ij w j + π · A i ∈ Z . (2.9) Moreover, from (2.4) it follows that p L 2 = 2w i n i + π · π . (2.10) For generic values of the moduli the only solution is w i = 0, n i = 0, π I = 0, implying p L = 0, and N L = 1 in (2.8). It gives rise to the gravity multiplet plus gauge multiplets of U(1) d+16 .
On the other hand, for special values of the moduli there can exist solutions with N L = 0, and p L 2 = 2. The set of p L then gives the roots of a Lie group G r of rank r ≤ d + 16. In this case there will be gauge multiplets of a group G r × U(1) d+16−r . The non-Abelian piece G r is in turn a product of ADE factors of total rank r. Our main task for the next sections is to study which groups can occur and to determine the underlying moduli.
We will mostly work with the HE theory. The results for the HO can be deduced from the the map discussed in section 2.2.

Duality transformations of the moduli
In this section we present a simple way of finding the action of O(d, d + 16) transformations on the background fields (g ij , b ij , A I i ). We first start by the transformation of the 2d + 16 charge vectors, defined as |Z = |w i , n i ; π I . (2.11) The inner product between charge vectors is computed using the O(d, d + 16) invariant metric . (2.12) and is given by Z |Z = w i n i + n i w i + π I π I . (2.13) Given the generators O ∈ O(d, d+16; Z) presented in [23], the transformation of |Z ≡ η|Z is simply 1 14) The transformation of the moduli can be obtained from the transformation of the generalized metric, discussed for example in [23]. It is generically simpler though to find the transformation These vectors also form a negative definite orthonormal set: with rows labeled A i . These differ from the vectors |Ẽ a in that the factor (1/ √ 2)ê * i a is missing (cf. eq. (2.17)). We may however interpret this as takingê * i a = √ 2δ i a , so that the rows A i can also be transformed as O(d, d + 16) vectors, A i → A i = OA i . From the new matrix A one then extracts the moduli with the formula in agreement with the heterotic Buscher rules found originally in [26] and discussed also in [27].

The HE ↔ HO map
Due to the uniqueness of the Narain lattices, the HO and HE theories compactified on T d share the same moduli space. For the circle, an explicit map relating the charge lattices of both theories was given in [16] and the precise relation between the moduli was worked out in [17].
The O(1, 17) transformation relating a basis of vectors of the Γ 8 × Γ 8 embedding into II 1,17 to another one of the Γ 16 embedding is given by [16]

30)
O D 1 is a T-duality in the circle direction, O P 1 an inversion and O Ω a rescaling. Their action on the charge vectors and moduli is given by O Ω : |w, n; π → |2w, 1 2 n; π , (2.31) Hence the total transformation (2.29) gives where ⊗ is an outer product.
Labeling E E = R 2 E + 1 2 A 2 E and the Wilson line A E in the HE theory, the transformation (2.32) gives the HO moduli as [17] ( , The map from HO to HE is simply obtained by exchanging ( To extend (2.33) from the circle to T d , it is sufficient to consider a decomposition of the Narain lattice of the form It follows that the desired extension is which holds provided the ordering |Z = |w 2 , n 2 , ..., w d , n d , w 1 , n 1 ; π is used. In practice one may wish to keep the order in (2.11) and rearrange the entries of Θ Let us first take a detailed look at the map Θ E→O for d = 2. The generalization to arbitrary d is straightforward. Preserving the usual ordering of the components of |Z , namely |w 1 , w 2 , n 1 , n 2 ; π , we write The transformation rules for the quantum numbers are exactly the same as in the d = 1 case for w 1 ,n 1 and π, while w 2 and n 2 are invariant, as expected.
To work out the map, we proceed by applying the transformations in the r.h.s. of (2.29) in succession. The Wilson line shift in direction 1 acts as The map for generic d can be worked out in a similar fashion. The final result reads In the forthcoming sections we will apply the HE-HO map in compactifications to d = 1 and 2 and give some examples for other values of d.

Embedding in Narain lattices
In this section we discuss how to determine which gauge groups G r × U(1) d+16−r occur in the compactification of perturbative heterotic strings on T d . We are mostly interested in heterotic compactification on T 2 , which is dual to F-theory compactifications on elliptic K3 surfaces [8].
Not surprisingly, for d = 2 the problem of finding all allowed G r happens to be related to the classification of possible singular fibers of ADE type in elliptic K3 surfaces. The explicit solution has been obtained in the K3 framework in [20,21], using Nikulin's formalism. The results are expected to hold in the heterotic context too. The reason is that in the K3 context, the condition on the allowed G r is that its even positive definite root lattice can be embedded in II 2,18 which is precisely the Narain lattice.
According to Theorem 1.12.4 in [18], any G r of type ADE with r ≤ 10 is allowed for d = 2, as indeed found in [21]. For larger r more complicated conditions have to be verified as we will explain shortly. This program has been carried out in [21]. It turns out that for r = 11, 12, also all ADE G r can be embedded in II 2,18 . For r = 13, only 13A 1 and 11A 1 + A 2 are precluded. Henceforth G r will be denoted by the chain of ADE factors of its algebra. For r = 14, except 8A 1 +E 6 , all other forbidden groups, e.g. 14A 1 , were predicted to be prohibited because singular fibers with such G r could not fit in a K3 where the vanishing degree of the discriminant must be 24. For r ≥ 15 there are many more forbidden groups. In particular, there are 1599 ADE groups of rank 18 [21] but according to the analysis of [20,21], only 325 are expected to be realized in compactifications of the heterotic string on T 2 . A natural question is why some groups are forbidden. To answer it, we will present some tools that can be applied to decide when a group is allowed or not. Our purpose is to illustrate the main ideas, not to do a systematic search as in [20,21] for d = 2.
We will mostly focus on the case of maximal enhancing, i.e. G r with r = d + 16. In 3.1, we will first discuss three criteria that can be applied for generic d. We then specialize to d = 1, 2, and in less detail to d = 8. The criteria for groups with r < 16 + d are presented in appendix B.1. The connection of the criteria to heterotic compactifications is addressed in section 3.2. We refer to [28][29][30] for short expositions of the main results of Nikulin's [18] relevant for our analysis, see also [31][32][33][34]. Before jumping into matters the reader is advised to consult appendix A where the notation and some basic concepts are introduced.

Embeddings of groups with maximal rank r = d + 16
The problem is to embed a lattice L of signature (0, d + 16) in the even unimodular Narain lattice II d,d+16 . In the heterotic context L is the root lattice of a group of maximal rank arising upon compactification on T d . Nikulin [18] provides powerful results that serve to determine whether or not such embedding exists. In particular, adapting respectively Corollary 1.12.3 and Theorem 1.12.4(c) of [18] to the case at hand leads to the criteria

Criterion 1
If (A L ) < d then L has a primitive embedding in II d,d+16 .

Criterion 2
L has a primitive embedding in II d,d+16 if and only if there exists a lattice T of Here A L and q L are respectively the discriminant group and the quadratic discriminant form of L, whereas (A L ) is the minimal number of generators of A L , and analogously for T (see appendix A for details). Since (A T ) ≤ d, groups with (A L ) = d could pass criterion 2 which actually requires d(L) = d(T ). We will shortly explain how the lattice T can be determined when d = 1, 2. There could exist more than one T , as found for some groups in [20]. Notice that in our conventions (0, d) means positive signature. with (A L ) = 3, would be forbidden by criterion 2 but must admit an embedding in II 1,17 because it certainly arises in the heterotic string on S 1 . Actually, for d = 1 the 44 groups with maximal rank found in [23] have (A L ) ≤ 3. Only the groups with (A L ) = 1, e.g. L = 2E 8 + A 1 , could possibly be allowed by criterion 2. The problem is that criteria 1 and 2 refer to primitive embeddings and this need not be the case. From the arguments in [20,21] it transpires that this condition can be relaxed by demanding that L has an overlattice M which can be embedded primitively in the Narain lattice. For instance, we know that D 16 has an overlattice given by the even unimodular HO lattice Γ 16 with trivial discriminant group.
Therefore, L = D 16 + A 1 has an overlattice M = Γ 16 + A 1 with A M = Z 2 and (A M ) = 1. The overlattice M could then pass criterion 2 with an even 1 dimensional lattice T equal to the A 1 lattice.
The above arguments lead to a third criterion obtained adapting Theorem 7.1 [21]. It reads Criterion 3 L has an embedding in II d,d+16 if and only if L has an overlattice M with the following properties: Since L is an overlattice of itself, criterion 2 is a subcase of criterion 3. As explained in appendix A, for an overlattice M to exist, there must be an isotropic subgroup H L of A L such that M/L ∼ = H L and |H L | 2 = d(L)/d(M ). When criterion 3 is satisfied, d(M ) = d(T ). We then obtain the useful relation We will refer to T as the complementary lattice in the following.
In the K3 framework, in which d = 2, H L corresponds to the torsion part of the Mordell-Weil group, called M W in [20]. It can be checked that all pairs (L, T ) in Table 2 of [20], reproduced in our Table 12, satisfy the relation (3.1). We remark that there could exist more than one M , as found for some groups in [20].
In the work of Shimada and Zhang [20], the focus is on the classification of all possible ADE types of singular fibers of extremal elliptic K3 surfaces. Such a surface, called X, is characterized by having Picard number, ρ(X), equal to 20, and finite Mordell-Weil group [28].
In this case the Néron-Severi lattice, N S X , and the transcendental lattice, T X , have signatures (1,19) and (2, 0) respectively 2 . The lattice W X has signature (0, 18) and contains the sublattice L(Σ) of rank 18, where Σ is the formal sum of the ADE types of singular fibers (determined by the Kodaira classification). It follows that L(Σ) must admit an embedding in II 2,18 . Now, in the heterotic compactification on T 2 , the semisimple ADE groups of maximal rank 18 that can occur are such that their root lattice can be embedded in the Narain lattice II 2,18 . Thus, the results of [20] for all possible L(Σ) translate into all possible maximal enhancings in the heterotic compactification on T 2 . Notice that the complementary lattice of criteria 2 and 3 above is related to the transcendental lattice by a change of sign of the Gram metric, i.e. T = T X −1 . In section 3.2 we will discuss to greater extent the connection to heterotic compactifications.
We illustrate below the application of criteria 1,2,3 to the cases d = 1, 2. We will also comment briefly on d = 8. In practice we first try criterion 1. If L passes it, then it is allowed.
If not, we continue with criterion 2. If L satisfies it, we are done, otherwise we apply criterion 3. If L also fails criterion 3 we conclude that L is not allowed. A consistency check is that if L passes criterion 1 it must also fulfill criterion 3. Let us mention that the steps taken 2 By definition, N S X = H 1,1 (X, R)∩H 2 (X, Z) and has signature (1, ρ(X)−1). The transcendental lattice is the orthogonal complement of N S X in H 2 (X, Z) and has signature (2, 20−ρ(X)). With the intersection form of X, the second cohomology group H 2 (X, Z) is isometric to II 3,19 . The Néron-Severi lattice can be decomposed as N S X = II 1,1 ⊕ W X , where II 1,1 is generated by the zero section and the generic fiber. The lattice W X is the orthogonal complement of II 1,1 in N S X and has signature (0, ρ(X) − 2). Thus, II 1,1 ⊕ W X ⊕ T X ⊂ II 3,19 . by Shimada and Zhang to compile their list, cf. section 3 in [20], indicate that they run a computer program based on the more general criterion 3.

d = 1
As a warm up we will study the d = 1 case which is simple yet instructive. Moreover, all allowed groups of maximal enhancing appearing in heterotic compactification on S 1 are already known [23]. Thus, there are many examples to illustrate the application of the lattice embedding techniques.
When d = 1 the easy criterion 1 gives no information. When (A L ) = 1 we then apply criterion 2. In Table 1 we give some examples of allowed groups. It is easy to propose the corresponding T because it must be d(T ) = d(L) and the (0,1) even lattices are of type A 1 m , defined to be the A 1 lattice rescaled so that its basis vector has norm u 2 1 = 2m. One still has to check that the discriminant forms do match, more precisely that there is an isomorphism (A L , q L ) ∼ = (A T , q T ). For example, for L = D 17 , A L is generated by the spinor class with s 2 = 17 4 = 1 4 mod 2, so q L takes values j 2 4 mod 2, j = 0, . . . 3. This matches the q T of A 1 2 which takes the same values because (u * 1 ) 2 = 1 4 . It is more challenging to check L = E 7 + A 10 . For the proposed T , A T is generated by u * 1 with (u * 1 ) 2 = 1 22 , whereas A L is generated by w 56 × w 1 with w 2 56 = 3 2 and w 2 1 = 10 11 . To see that q L and q T match it suffices to verify that ( 3 2 + 10j 2 11 = 1 22 + 2k) is satisfied by integers j and k, e.g. j = 4, k = 8. Table 1: Examples of allowed L with (A L ) = 1, when d = 1.
The allowed groups [23] with maximal enhancing of the form L = E 8 + E 9−p + A p , p = 1, . . . , 9, p = 7, all have (A L ) = 1. Only for p = 8 there is an isotropic subgroup (actually for the A 8 component) but the M root of the associated M is larger than L. Hence, all these groups should be allowed by criterion 2. We find that the corresponding T is A 1 , p = 1, . . . , 6, and A 1 (10−p)(p+1) 2 , p = 8, 9.
It is straightforward but cumbersome to check exhaustively which of the known groups with maximal enhancing and (A L ) = 1 satisfy criterion 2, and if not apply criterion 3. In many cases, e.g. L = E 7 + E 6 + A 4 , A L = Z 30 , one can quickly see that an overlattice cannot exist because there is no isotropic subgroup. Since this L is known to appear, criterion 2 should allow it, and indeed T = A 1 15 fulfills the conditions.
A neat example with (A L ) = 1 is L = A 17 , A L = Z 18 . The candidate T would be A 1 9 but the discriminant forms do not match because there are no integers j and k such that We then look for weights orthogonal to the generator w 6 , i.e. weights such that w i · w 6 = 0 mod 1. Besides w 6 and w 12 which belong to H L , w 3 , w 9 and w 15 are orthogonal. Now, w 2 i = 1 2 mod 2, for i = 3, 9, 15. This confirms that A M = Z 2 , with the discriminant form q M taking values 0 and 1 2 . These are the same values taken by q T . Finally, the root sublattice of M is equal to L because w 2 6 = 4. We can also study known allowed groups with (A L ) ≥ 2 where criterion 3 must be applied.
An example is the group with L = E 6 + A 11 , A L = Z 3 × Z 12 . There exists an overlattice with H L = Z 3 and it can be shown that criterion 3 is satisfied with T = A 1 2 . For a second has an overlatticeM with d(M ) = 5 so necessarily AM = Z 5 . Thus, L has an overlattice M = A 1 +M , A M = Z 2 × Z 5 ∼ = Z 10 and a candidate T is A 1 5 . With (A L ) = 3 we already discussed how L = D 16 + A 1 passes the test. In Table 11 we give full results.
So far we have discussed groups with maximal enhancing which are known to occur. It is reassuring that they are allowed by the lattice embedding criteria but our main motivation was to understand why some groups are forbidden. Let us then finally offer a couple of examples of forbidden groups. Take L = A 6 + D 11 , A L = Z 28 . A candidate T is A 1 14 , but q T q L . An overlattice cannot exist because there is no isotropic subgroup of A L . Thus, this L fails criteria 2 and 3. A less trivial example is L = 2D 8 + A 1 , A L = Z 5 2 . In appendix A we explained that D 8 admits E 8 as an overlattice. For L this leads to a full overlattice given by M = 2E 8 + A 1 . Now A M = Z 2 and an adequate T would be A 1 . However, condition (ii) in criterion 3 is not satisfied. As remarked in appendix A, the root sublattice of 2E 8 is not equal to 2D 8 . Actually, L admits also an overlattice M = E 8 + D 8 + A 1 with A M = Z 3 2 and (A M ) = 3 so there can be no associated T . It would be interesting to study more examples of forbidden groups.

d = 2
When d = 2, criterion 1 implies that lattices with (A L ) = 1 give allowed groups. In Table 2 we present a few examples of this type.
Before considering examples with (A L ) = 2 let us describe how to find the lattice T . To begin, d(T ) is known because it must be equal to d(L) or d(M ). Next, the even 2 dimensional lattices of determinant less than 50 are listed in Table 15.1 of [35], and for larger d(T ) they can be found using the SageMath module on binary quadratic forms [36]. Given T , the pair (A T , q T ) can be deduced as explained in appendix A. We then check if (A T , q T ) ∼ = (A L , q L ).
Criterion 2 must also hold when (A L ) = 1 since in this case the existence of a primitive embedding is guaranteed by criterion 1. In Table 2 we have shown the corresponding matrices T . For example, with d(T ) = 19 there is only the lattice with Gram matrix Q given in Table   2. It can be checked that A T ∼ = Z 19 and that the values of q T are such that indeed (A T , q T ) is isomorphic to (A L , q L ) for L = A 18 . For L = A 4 + E 6 + E 8 we need a T with d(T ) = 15. In this case there are two possible lattices, [2,1,8] and [4,1,4], both with A T = Z 15 . It can be checked that only the discriminant form of the first does match q L .
The allowed L's are given in Table 2 in [20]. It is a simple task to find A L and (A L ). In Table 3 we show a few. To find T we proceed as explained before, looking first for even lattices of determinant d(T ) = d(L) and A T = A L . There might be more than one, the correct ones must have (A T , q T ) ∼ = (A L , q L ). In Table 3 we have displayed in red candidates for T that are discarded because q T is incongruent with q L . The incorrect T 's are more or less obvious. Checking the isomorphism for the correct ones is more laborious. For instance, for L = E 6 + D 12 , the distinct values that can appear in q L are in the set {0, 1 3 , 1, 4 3 }. Both T 's have A T = Z 2 × Z 6 , but the values of q L can only be matched to the values in the T with   [20] for this L.
When (A L ) ≥ 3 we can check that the allowed groups pass criterion 3 with the data given in Table 2 of [20]. One example is L = 3A 6 , A L = Z 3 7 . There is an isotropic subgroup H L = Z 7 generated by µ = w 1 (1) × w 2 (2) × w 4 (3), where w i (a) denotes weights of the a th A 6 factor.
Notice that µ 2 = 4 = 0 mod 2. From (3.1), d(M ) = 7 so necessarily A M = Z 7 . Following the procedure to determine q M shows that it matches the q T of T = [2,1,4] which is the unique even 2-dimensional lattice with d(T ) = 7.
Finally we come to forbidden groups. Let us discuss the examples in Table 4. In all three there are no suitable lattices T . The possible candidates, shown in red, are discarded because their q T does not match q L . We conclude that these groups do not satisfy criterion 2 and continue to check criterion 3. In example 1 we know that D 8 has an overlattice E 8 so the full L has an overlattice M = 2E 8 + A 2 , M/L ∼ = Z 2 so d(M ) = 3, consistent with A M = Z 3 . Now q M matches the q T of T = [2, 1, 2] but still criterion 3 fails because M root = L. In example 2, there is an isotropic subgroup H L = Z 2 generated by µ = v × w 2 , where v is the vector weight of D 15 and w 2 is the weight of the 10 of A 3 . Since v 2 = 1 and w 2 2 = 1, µ 2 = 2. From (3.1), d(M ) = 16 2 2 = 4. The only possible T with d(T ) = 4 is [2, 0, 2] and it could be that q T matches q M . However, M has elements y + nµ, y ∈ L, n = 0, 1 and since µ 2 = 2, M root = L.
Hence, example 2 does not pass criterion 3. Concerning example 3, it flops criterion 3 because there is no isotropic subgroup of A L . To see this, first observe that (3.1) implies that only |H L |= 7 would be consistent with d(M ) being an integer. Thus, H L would have to be Z 7 and its generator would have to be a product of weights of the A 6 's, say µ = w i (1) × w j (2).
However it is not possible to obtain µ 2 = 0 mod 2. [14,7,14]  In summary, we have provided several examples where it was relatively simple to apply by hand the criteria that serve to determine whether a group of maximal rank is allowed or not.
Clearly, to make a full search, or even to check more complicated examples, would require computer aid.
In Table 12 we give the subgroups H L and the lattice T for all the allowed L's found in the K3 framework [20]. They correspond to all maximal enhancements arising in heterotic compactifications on T 2 . This indicates that in the heterotic on T 8 it is possible to obtain the group 3E 8 . Indeed, it can be found in the HE by setting all the Wilson lines to zero and taking the internal torus with metric g ij = 1 2g ij , whereg ij is the Cartan matrix of E 8 . The antisymmetric field must be chosen as .
This is an example of the general type discussed in [16,37] in which p L − p R belongs to the root lattice of an ADE group of rank d.
A second interesting example is L = 24A 1 , A L = Z 24 2 . Since (A L ) = 24, L fails criterion 1 and criterion 2 as well because (T ) ≤ 8. To apply criterion 3 we recall that this L admits an even unimodular overlattice given by one of the Niemeier lattices, say N ψ , with N ψ /L ∼ = Z 12 2 (see chapter 16 in [35]). It is also known that the root lattice of N ψ and L coincide. Thus, L fulfills criterion 3 with M = N ψ and T = E 8 . By the same token L = 12A 2 is also allowed by criterion 3. Niemeier lattices in heterotic compactifications on T 8 have appeared in [39].

Connection to heterotic compactifications
We have seen that the groups of maximal rank that can be embedded in II d,d+16 are charac- For an embedding to exist, it must be that In the heterotic framework L is the root lattice of some gauge group with maximal enhancing. We now want to identify T , which we call the complementary lattice.
There is a natural candidate for an even lattice of rank d, namely the sublattice of II d,d+16 , denoted K, obtained by setting p L = 0. This is Let us next examine the consequences of setting p L = 0. First, from (2.2c) we find that p I = 0 implies Second, imposing p L = 0 leads to after substituting (3.4) in (2.2b). From p L = 0 it further follows that If A i = 0, its order is 1. In section 4.1.3 we will review an algorithm to find such Wilson lines.
All A i must be quantized so that (3.4) does not force some windings w i to be identically zero.
The quantization condition in (3.5) is also very restrictive. It clearly demands the E ij to be rational numbers. Taking into account quantization of the Wilson lines then requires the T d metric components g ij = e i ·e j to be rational numbers, which is consistent with p 2 R being even. From now on we assume that K has rank d.
The constraints on the A i and E ij are compatible with having a gauge group of maximal enhancing, which is the case under study. In fact, recall that to this end there must exist solutions to p R = 0 and p L 2 = 2. The former implies the conditions (2.9), which can be achieved with quantized A i and rational E ij .
The name M is appropriate because it is indeed the overlattice of criteria 3 with M root = L.
The reason is that M root is the sublattice of M generated by vectors with p L 2 = 2 and it has rank (d + 16) by the assumption of maximal enhancing.
So far we have argued that M of signature (0, d + 16) is the orthogonal complement in II d,d+16 of K of signature (d, 0), and that K as well as M are primitively embedded in II d,d+16 .
In fact, II d,d+16 is an overlattice of M ⊕ K. We can then apply Lemma 2.4 in [20] to conclude Finally, by Nikulin's Proposition 1.12.1 [18] there exists T of signature (0, d) It is obtained by changing the sign of the Gram matrix of K, i.e.
Summarizing, the two rationality conditions N i A i ∈ Υ 16 and E ij ∈ Q, guarantee the existence of the even (0, d) lattice T , which in turn implies the existence of the even (0, d + 16) lattice . Thus, the rationality conditions are necessary to have maximal enhancing to a group of rank d + 16. However, these conditions are not sufficient to ensure that the sub-lattice M root has rank d + 16. The additional constraint in criterion 3 is precisely that the gauge lattice L of rank d + 16 coincides with M root .

Lattice data from moduli
Once we know the data (L, T ) of the allowed groups G r we still have to determine specific moduli A i and E ij that give rise to them. Conversely, given A i and E ij , in principle L is obtained from the solutions of p R = 0, p L 2 = 2, which correspond to the roots of G r . On the other hand, T can be derived directly from the moduli as explained below.
The elements of T are of the form (3.6). Besides, the moduli must comply with the conditions (3.4) and (3.5). To make more concrete statements, consider first the case in which the E ij are integers so that (3.6) is satisfied by any w i . Then, a class of allowed values for the w i are multiples of the Wilson lines orders, namely w i = i N i (no sum over i), with i ∈ Z. If we assume that this class exhausts all possibilities, T will be generated by a basis where we dropped an irrelevant sign. The Gram matrix of T will then be given by Since this is valid for E ij integers and N i A i ∈ Υ 16 , we see that the Q ij are integers and the diagonal components are even, as required for an even lattice.
In some cases there might be more admissible values of the winding numbers w i . In general, the allowed values are sets of integers (M 1 , M 2 , . . . , M d ) that satisfy In this situation a way to proceed is to obtain d solutions (M generate a lattice with the least volume. For instance, the vectors in (3.10) are recovered when E ij ∈ Z and the only solutions of (3.12a) are M (k) = N δ k (no sum over ). In the general case we have to impose the condition of least volume. To be more precise, define the matrix the rows of C are the solutions of (3.12). The Gram matrix of T then reads where we used g ij = e i ·e j . Therefore, det Q = 2 d (det C) 2 det g. Since the determinant of the torus metric is fixed by the choice of moduli A i and E ij , to obtain the least lattice volume it suffices to choose C with least determinant. Hadamard's inequality then instructs us to (3.12) with the least norm. To check that Q k are integers and the diagonal elements are even, we write g ij = 1 2 (E ij + E ji − A i · A j ), and take into account that the M (k) i verify (3.12). Finally, Q is unique up to the action of GL(d, Z). For d = 2 we can use the procedure described in section 3, Chapter 15, of [35] to bring Q to the standard reduced form used in [20].
In the next sections we will discuss systematic methods to determine moduli associated to groups of maximal enhancing when d = 1 and d = 2. We will then exemplify further how T computed from the moduli matches the T from the lattice embedding data. Meanwhile it is instructive to illustrate the main points in cases with generic d.

For a simple example, consider moduli
2g ij , whereg ij is the Cartan matrix of an ADE groupG d of rank d, and b ij is given in (3.2). The E ij moduli are found to be Therefore, the E ij are either 1, −1 or 0. In this setup the gauge group of the heterotic string on T d is 2E 8 +G d in the HE or D 16 +G d in the HO. This example is of the general type in which all Wilson lines are set to zero and p L − p R ∈ Γ d , where Γ d is the root lattice of G d [16,37]. From the lattice formalism we find that T = Γ d . From the moduli we obtain the same result for T because the basis is given in (3.10) with e i = 1 √ 2ẽ i and N i = 1. A second example in the HO on T d has moduli [16,37] It can be shown that the resulting group is D d+16 . All Wilson lines have order N i = 2. Besides, can be chosen so that the u i are the roots of D d . Thus, T = D d .
Another important question in the heterotic context is the meaning of the quadratic discriminant form q T . The answer is that the values that p 2 R can take are precisely given by q T mod 2. This follows because p R generically lies in the dual lattice T * . When T has basis (3.10), it is easy to see from (2.2a) that p R indeed takes values in a lattice generated by with Gram matrix the inverse of Q in (3.11). When there are additional solutions to (3.12), so that the basis for T is given by (3.13), p R lies in a lattice spanned by (3.14). The fact that q T gives the values of p 2 R is useful to determine the spectrum of massive states. In particular, it could be relevant in the double field theory analysis of gauge enhancements [38].

Compactifications on S 1
In this section we consider in more detail compactifications of the heterotic string on the circle, where the moduli are the radius R and the 16-dimensional Wilson line A I . The problems of finding all possible gauge groups G r × U(1) 17−r and the corresponding moduli (R, A I ), were solved in [23] by means of the extended Dynkin diagram (EDD) associated to II 1,17 , depicted in Figure 1. We will first review the procedure and the results. We will also explain how they can be put in a form that can be generalized to compactification on T d . Afterwards we will discuss the connection with the lattice embedding formalism. In Table 11 we collect the relevant lattice and moduli data for all the 44 groups of maximal rank that appear in heterotic string compactifications on S 1 .
where E = R 2 + 1 2 A 2 is just the E-tensor of (2.1) for d = 1. Recall that n and w are the quantized momenta and winding numbers, while π I belongs to the lattice Γ 8 × Γ 8 in the HE or Γ 16 in the HO.
As in [16], p = (p R ; p L , p I ) can be expanded as Here u I is a Cartesian 16-dimensional basis vector. The inner product is taken with the For many purposes it is simpler to work with the charge vector |Z = |w, n; π I . The change of basis to p is easily read from (4.2). Besides, Z |Z = w n + n w + π · π.

Moduli and gauge group from the EDD diagram
We refer to [37] for an introduction to root systems and associated EDDs of Lorentzian II 1,8m+1 lattices. The special case of II 1,17 is discussed in detail in [16] and [40], precisely in connection to circle compactifications of the heterotic string. It was originally considered by Vinberg [41]. The reflective part of its group of automorphisms, which is actually the duality group O(1, 17, Z) [40], can be encoded in the EDD as we review shortly. We begin by describing the embedding of the HE lattice Γ 8 × Γ 8 in II 1,17 . The EDD is shown in Figure 1. It is composed by the extended Dynkin diagrams of E 8 and E 8 joined by a central node. The nodes can be specified in terms of the charge vectors where α i and α i are the simple roots of E 8 and E 8 , given in Table 5 (note that for convenience in regard to the EDD diagram, we take different conventions for simple roots of the two groups) . Our conventions for the simple roots and fundamental weights w i , w i , of E 8 and E 8 are collected in Table 5. We have also written down the lowest root α 0 = − 8 k=1 κ k α k , and similarly for α 0 . The κ i and κ i are the Kac marks, shown in red in the Figure 1. By definition κ 0 = κ 0 = 1 and sometimes we will set w 0 = 0, w 0 = 0.  In [40] (see also [41] Once |Z is found, the action on the moduli is deduced by imposing that p R = 0 transforms This is a shortcut to requiring invariance of the spectrum. For example, writing only the transformed quantities, from the nodes 1, 0, and C we obtain  The prescription to obtain a non-Abelian gauge group G r is to delete 19 − r nodes of the EDD such that the remaining ones give the Dynkin diagram of the desired semi-simple Lie Algebra. The total gauge group is G r × U(1) 17−r . The Wilson line and the radius are determined by saturating the inequalities in Table 6 corresponding to the r undeleted nodes.
In this manner one can obtain all the allowed groups and the corresponding moduli. For example, for maximal enhancement, all but 2 of the inequalities are saturated. The allowed groups of maximal rank are precisely found by deleting one node in the E 8 side and one node in the E 8 side, while the central node C corresponding to E = 1 cannot be erased. In section 4.1.3 we will discuss a simplified way to implement this method, that we call saturation. Having explained how the EDD enables us to determine the allowed groups G r × U(1) 17−r and the corresponding moduli, we can draw some results. For instance, it is easy to see that all ADE G r of r ≤ 9 are allowed, consistent with Theorem 1.12.4 in the Nikulin formalism [18].
The diagram also shows that for r = 10 all ADE G r can appear and that for r = 11 only 11A 1 is forbidden. There are 44 allowed groups with maximal rank r = 17. They were determined in [23] and are collected in Table 11. On the other hand, there are 1093 forbidden groups with r = 17, e.g. 2D 8 + A 1 , which clearly cannot be obtained from the EDD. The connection with the Nikulin formalism for the case of maximal rank will be further discussed in section 4.2.

Embedding of Γ 16
The moduli in the HO theory can be obtained by adapting the EDD to embed Γ 16 explicitly.
To this end we need to write the charge vectors of the nodes in terms of the simple roots β k , plus the spinor weight w 16 of SO (32). The simple roots and the corresponding fundamental weights are The lowest root of SO (32) is The Kac marks are κ k = 1 for k = 1, 15, 16, 17, and κ k = 2 for k = 2, ..., 14. The EDD embedding Γ 16 is shown in Figure 2. The charge vectors of the nodes read It is straightforward to carry out the analysis of the Weyl reflections (4.5) to identify the generators of O(1, 17, Z) and the boundaries of the fundamental region. A choice of fundamental region for the moduli space of the HO theory is given in Table 7 (our conventions for the roots differ by a sign from those in [23]).
As in the HE theory, the procedure to determine the allowed groups G r ×U(1) 17−r , and the Node Fundamental region for Γ 16 corresponding moduli, consists of deleting nodes such that those remaining give the Dynkin diagram of an ADE algebra. Obviously the groups will be the same as in the HE, but the moduli will differ. They are simply deduced by saturating the inequalities in Table 7 that pertain to the undeleted nodes.
From the EDD we can also find the group due to some given moduli but, if necessary, A and R have to first be brought to the fundamental region by dualities, namely shifts and Weyl reflections in Γ 16 , e.g. A I → −A I or A I → 1 − A I in pairs, and the T-duality (4.6c).

For instance, in this way
From the latter data we find that the nodes 2 and 19 must be deleted so that the gauge group is , which implies gauge group D 17 because nodes 1 and 19 must be deleted.

The shift algorithm
As we have seen, Wilson lines of a given order are relevant to relate the moduli with lattice data obtained in the formalism of section 3. Recall that the order of A is defined as the smallest integer N such that N A ∈ Υ 16 , with Υ 16 equal to Γ 8 × Γ 8 in the HE and to Γ 16 in the HO. There exists an algorithm, based on original work of Kac [24], to find Wilson lines ("shift vectors") of specific order. It was applied to heterotic compactifications originally in [42]. The name shift vector comes from the orbifold terminology. The algorithm also prescribes how to obtain the group left unbroken by the action of the shift. In fact, another motivation to review it is its relation to the method of saturating inequalities of undeleted nodes in a Dynkin diagram in order to find the moduli.
The shift algorithm can be applied to any ADE group starting with its extended Dynkin diagram. We will describe the E 8 case following [43]. The simple roots α i and the fundamental weights w i are given in Table 5, while the extended Dynkin diagram of E 8 is formed by the nodes 0, 1, . . . , 8, in Figure 1. Consider now a set of non-negative relative prime integers (s 0 , s 1 , . . . , s 8 ) and define where κ i are the Kac marks. Then construct the shift vector Note that N δ ∈ Γ 8 so that δ has order N . The subalgebra left invariant by this shift is obtained by deleting the nodes of the extended Dynkin diagram associated to non-zero s i , and adding U(1)'s to preserve the rank. The reason is that δ in (4.11) satisfies Notice also that in order to break to a group of rank 8, necessarily only one s k , k = 0, . . . , 8, is different from zero at a time. In this case, δ = w k /κ k . In particular, since w 0 ≡ 0, k = 0 corresponds to δ = 0, consistent with deleting node α 0 and leaving E 8 unbroken. For the E 8 factor in the HE theory one constructs a shift δ in analogy to δ for E 8 .
From (4.12) one also obtains These are the conditions for δ to be in a fundamental region [42,44]. By translations in the root lattice of E 8 and/or transformations in the Weyl group of E 8 one can obtain a shift that gives the same breaking but is outside the fundamental region. For the shift δ of E 8 there are conditions analogous to (4.13).
The shift algorithm can be extended to the HO theory taking care that Γ 16 is the root lattice of SO(32) with the spinor weight w 16 added [42]. The starting point is the extended Dynkin diagram of SO (32) which is formed by the nodes 1 to 17 in Figure 2 where the Dynkin marks are also shown. The simple roots β k and the fundamental weights w k are given in (4.7), and the lowest root β 17 in (4.8). We now introduce a set of non-negative relative prime integerss k , k = 1, . . . , 17, and define the order N and the shift ∆ as It is necessary to further enforce the constraint k odds k = even (4.15) in order to guarantee that N ∆ ∈ Γ 16 . As before, the subalgebra left invariant by the shift ∆ is obtained by deleting the nodes of the extended Dynkin diagram associated tos k > 0, and adding U(1)'s to preserve rank 16. The algorithm can produce pairs of shifts that are equivalent under a translation by w 16 .
Let us now discuss the generalization of the shift algorithm to II 1,17 in the HE theory. As in the saturation method, we begin by deleting some nodes in the EDD of Figure 1 such that the surviving ones form an allowed Dynkin diagram of a semi-simple Lie Algebra. As before the emerging group is identified from this allowed Dynkin diagram, appending enough U (1) factors to add to rank 17. The Wilson line that produces the emerging group is simply given with δ given in (4.11), and similarly for δ . The values of s i are now fixed to be zero or one according to whether the i-th node is undeleted or not, and likewise for the s i . Indeed, the inequalities that would have to be saturated to find A are a subset of those connected to the nodes i, i = 0, 1, . . . , 8, in Table 6, which precisely amount to the conditions (4.13). The value of the radius depends on whether the node C is undeleted or not. If it is not, the constraint E = 1 must be imposed. Since δ and δ are in the fundamental region, it is not hard to show It is useful to work out the case of maximal enhancing with the shift algorithm. As mentioned before, maximal rank 17 requires deleting one node in the E 8 side and one node in the E 8 side, while keeping the central node C. The moduli are then Here k, m = 0, 1, . . . , 8, but the choice k = m = 8 is excluded because it would lead to A 2 = 2 and R = 0, which is unphysical. Thus, altogether there are 44 different groups with maximal rank. The moduli in (4.17) agree with the results in Table 2 of [23], except for irrelevant overall minus signs in the Wilson line due to different conventions. The groups of maximal rank and the corresponding moduli are collected in Table 11.
The algorithm can also be used to determine the moduli corresponding to groups of lower rank. For example, SU(16) × SU(2) × U(1) can be obtained dropping the nodes 1, 1 , 7 . From the algorithm we deduce Since node C is undeleted, E = 1 and the radius is fixed to be R = 8 63 . We will not attempt to generalize the shift algorithm to II 1,17 with HO embedding. For one reason, for the HO the allowed groups and the corresponding moduli can be obtained by the saturation method discussed in section 4.1.2. In particular, the moduli for the 44 groups of maximal enhancing are presented in Table 1 in [23]. Moreover, we can use the map (2.2) to obtain a point (R O , A O ) in the moduli space of the HO theory from a given one (R E , A E ) in the HE theory, or vice versa. For all the 44 cases of maximal enhancement we have verified that (4.17) agree with the data found using the saturation method [23]. These results are listed in Table 11. 4.2 All maximal rank groups for d = 1 As mentioned previously, there are 44 different groups of maximal rank that are realized in heterotic compactification on S 1 . We collect them in Table 11 in appendix C, where they are denoted by its root lattice L. The Table includes the Tables 6 and 7. They can be obtained using the saturation method, or equivalently the shift algorithm in the HE. The moduli for the HO can be derived from the map (2.2) too. In For each maximal group in Table 11 we also give its discriminant group A L = L * /L, its appropriate isotropic subgroup H L , and its complementary lattice T . For the lattice T , the notation A 1 m is simplified to m . Besides, d(T ) = 2m. It is easy to check that in all cases  19) where N is the order of A and we used e 1 = R. The Gram matrix is then Q = 2N 2 R 2 = d(T ).
On the lattice side, T = A 1 m with d(T ) = 2m. Therefore, it must be that where we used E = 1 in all cases of maximal enhancing. It is straightforward to confirm this relation using the data for m and A in Table 11. In the HE case the Wilson line A E is given in (4.17) and the order is In the HO, A O and its order N O are of the form in (4.14).
Another interesting question is the relation of generic p R to the complementary lattice T .
In section 3.2 we argued that in general p R takes values in T * . When d = 1 the proof is rather simple. Since E = 1, (4.1) reduces to We now use that A has order N to set π · A =l/N ,l ∈ Z. Inserting in p R above gives 2N R , with l integer. Hence, p R lies in a lattice generated by u * , with u the generator of T in (4.19). We conclude that p R lies on T * and the allowed values of p 2 R are q T mod 2.

Compactifications on T 2
In heterotic compactification on T 2 there are 36 real moduli, namely {g 11 , g 12 , g 22 , b 12 }, plus two 16-dimensional Wilson lines {A I 1 , A I 2 }. The II 2,18 lattice vectors (p R ; p L , p I ), which depend on these moduli, are given in (2.2). For the purpose of studying enhancement of symmetries it is actually more appropriate to use as moduli the components E ij , cf. (2.1), together with the A I i . Indeed, as we have seen in section 3.2, enhancement requires the E ij to be rational numbers and the A i to be quantized in the sense of eq. (3.7). On the other hand, to discuss the moduli space and duality symmetries it is also convenient to work with complex parameters. However, it has been argued that the even, self-dual lattices of signature (p, q) with both p, q > 1 (that is, with a signature with more that one negative sign), do not possess a system of simple roots and cannot be described in terms of generators and relations similar to Kac-Moody or Borcherds algebras [45]. Nevertheless, although the addition of a new Kac-Moody simple root introduces multiple links and loops in the structure of the quadruple extension of simple Lie algebras, it was shown in [46] that the "simple-links" structure can be preserved if the extra root is a Borcherds (imaginary) simple root. In any case, a generalized Dynkin diagram for II 2,18 is not known and it is not even clear whether it exists. Hence, we will proceed in a constructive way.
In section 3 we explained that all allowed groups G r × U(1) d+16−r in heterotic compactification on T d can be obtained by lattice embedding techniques. For T 2 the full results are known from the work of Shimada and Zhang who classified all possible ADE types of singular fibers in elliptic K3 surfaces [20,21]. The classification translates into all possible heterotic gauge groups because the lattice embedding conditions are the same in the K3 and heterotic contexts. This can also be seen as a further element in favor of the conjectured duality between heterotic on T 2 and F-theory on K3.
Knowing all allowed groups it remains to compute the corresponding moduli. We will focus in the HE since the moduli in the HO can be derived from the map elaborated in section 2.2. We will mostly consider the case of maximal enhancing, i.e. r = 18. As argued in section 3.2, this can occur only if the E ij are rational numbers and the A i are quantized. In section 4.1.3 we explained a shift algorithm to find such Wilson lines. In particular, in the HE we can find all pairs of quantized Wilson lines that break E 8 × E 8 to a subgroup of rank 16, hence with a Dynkin diagram having 16 nodes. We can then look for values of the E ij that allow to add two additional nodes, thereby leading to a semisimple group of rank 18. This is analogous to the procedure of finding all maximal enhancements from the EDD in the circle compactification.
In section 5.2 we will explain the EDD inspired method in more detail. We will see that it fails to give several of the known groups of maximal rank. In section 5.3 we will then develop more general procedures in order to obtain all such groups. The results are summarized in section 5.4.

Complex moduli
Without Wilson lines we know that it is revealing to combine the parameters from the metric and the antisymmetric field into complex structure and Kähler moduli, denoted τ and ρ respectively. In particular, the duality transformations and the fundamental moduli region can be described very efficiently in terms of τ and ρ. It is then reasonable to use these complex parameters in the presence of the A I i , which in turn can be combined into complex moduli ξ I as well. Altogether we have the 18 complex moduli where g = det g ij . The conditions g ii > 0 and g > 0 imply the restrictions where the subscript 2 refers to the imaginary parts. The moduli (τ, ρ, ζ I ) were considered in [47], see also [48,49]. As expected, the Kähler modulus, which is more stringy, receives corrections depending on the Wilson lines whereas τ , purely geometrical, is not affected.
The II 2,18 lattice vectors (p R ; p L , p I ) can also be written in terms of the complex moduli. Now, we are mostly interested in the duality transformations of the moduli which can be derived from invariance of the spectrum. By virtue of (2.4) it then suffices to determine p 2 R . We obtain Imposing invariance of p 2 R and (p L + p I ) 2 − p 2 R = π · π + 2n i w i we deduce the duality transformations where we have dropped the superscript I in ζ to simplify the expressions. These transformations were also found in [47].
Together with Weyl automorphisms in Υ 16 , {Z 1 , Z 2 , A 1 , S 1 , Γ 1 } generate the duality group O(2, 18, Z). We recognize A 1 and S 1 as the generators of SL(2, Z) changes of the (e 1 , e 2 ) basis, whereas Z 2 is the parity e 1 → −e 1 . The transformation Γ 1 is the translation of A I 1 by the lattice vector Λ. The shift b 12 → b 12 +1, implying ρ → ρ+1, is just Z 1 A 1 Z 1 . The composition S 1 Z 1 S 1 Z 1 gives the full T-duality (i.e. in directions e 1 and e 2 ), generalizing R → 1/R, with The factorized duality in the direction e 1 of T 2 is Z 2 Z 1 , while Z 1 is 'mirror symmetry'. The Υ 16 automorphisms include the transformation τ = τ , ρ = ρ, ζ = −ζ, which amounts to The moduli E ij are related to (τ, ρ, ζ) by The duality transformations of E ij and A i can be efficiently derived as explained in section 2.1. For instance, the factorized duality in the direction e 1 , i.e. Z 2 Z 1 , is given in (2.41).
Analogously, the factorized duality in the direction e 2 , i.e. S 1 Z 1 S 1 Z 2 , amounts to The product of the two factorized dualities yields which corresponds to the transformation in (5.5).
It is instructive to consider a particular slice of moduli space defined by restricting the Wilson lines to break an SU(2) in E 8 . This can be achieved taking A i = a i w 6 × 0, so that There are then three complex parameters (τ, ρ, β). The duality group acting on them reduces to O(2, 3, Z), whose generators are given in (5.4), with Λ = w 6 × 0 in Γ 1 . It is known that O(2, 3, Z) has a subgroup which can be identified with Sp (4, Z), see e.g. [50]. A minimal set of generators is provided by {Z 1 , A 1 , S 1 , Γ 1 }. The standard Dehn twists (shown e.g. in [51]) can be expressed in terms of the elements of this set. In fact, there is an isomorphism from the moduli space of (τ, ρ, β) to the genus-two Siegel upper half-plane parametrized by Ω = τ β β ρ , see [51] and references therein. Thus, (τ, ρ, β) can be regarded as the moduli of a genus-two surface. Several useful results about the moduli space of genus-two curves are known. In particular, the fundamental region and fixed points of finite subgroups have been determined [52][53][54]. Some special duality transformations, needed for future purposes, are where ξ = ρτ − β 2 . At generic values of the moduli the gauge group is U(1) 3 × E 7 × E 8 , but at the fixed points the U(1) 3 can enhance for instance to SU(2) × SU (3) or SU(4) [55]. More details will be given in section 5.4. This slice of heterotic moduli space is specially interesting because an explicit map to the moduli of elliptic K3 surfaces with E 7 and E 8 singularities was established recently [50], see also [51] and references therein.

Generalizing the EDD algorithm to two Wilson lines
The EDD algorithm in circle compactifications uses the fact that the T-duality group O(1, 17, Z) is completely generated by simple reflections. This ceases to be true for d > 1 and so it cannot be generalized with its full power. What we can do, instead, is to develop a more general method to find maximal groups and their associated moduli which works for all d, and reduces to the EDD algorithm in d = 1.
The key idea is that the EDD algorithm in d = 1 can be stated in an equivalent but  and π 2 + 2nw = 2. These conditions are also satisfied by node ϕ C provided E = 1, while it is not satisfied by the nodes ϕ k and ϕ m which are deleted. Notice that the node ϕ C gives the extension to a group of rank 17 and that actually ϕ C ∈ II 1,1 .
These observations motivate a similar procedure for the T 2 compactification. The nodes in the generalized diagram now have charge vectors |w 1 , w 2 , n 1 , n 2 ; π . As before it is convenient to introduce nodes associated to the simple roots of E 8 × E 8 , namely They will correspond to roots of the resulting gauge group whenever they satisfy the massless conditions p R = 0 and p L 2 = 2, leading in turn to (2.9) and (2.10). Explicitly, To proceed we need to specify the moduli.
The Wilson lines are conveniently written as We are interested in the case in which the two Wilson lines together break E 8 × E 8 to a subgroup of rank 16 for generic E ij . To achieve this we first take δ 1 and δ 1 exactly as in  Here we are assuming that δ 2 = 0 and δ 2 = 0. If δ 2 = 0, thenα k is not appended and α p is not deleted. Likewise, if δ 2 = 0,α m is absent and α q remains.
The advantage of choosing A 1 and A 2 as just described is that we can now construct extended nodes that satisfy the massless conditions in (5.13). Indeed, to the original affine roots of E 8 × E 8 we associate two extended nodes with momentum number in the direction 1 For E = E 1 the following charge vectors satisfy the massless conditions (5.13) Since they are orthogonal, they are not connected to one another in the Dynkin diagram.
Notice that ϕ C 1 corresponds to ϕ C in the S 1 compactification. On the other hand, setting E = E 2 gives the vectors which enter our extended diagram as an A 2 subdiagram joined to ϕ 0 and ϕ 0 . We finally have to delete two nodes 3 .

Before giving some examples, let us point out once again that this algorithm does not
give all the possible enhancements. As we explain in more detail later, further generalizations that do not involve extended diagrams are required to get all the possibilities, as explored in section 5.3.

Extended diagrams with trivial second breaking
We now give some examples, starting from the simplest. For the sake of clarity, we will use a color coding for the nodes which partly or completely lie in the II 2,2 sublattice. We will paint with green the roots ϕ 0 , ϕ 0 and ϕ C 1 , and with blue the roots ϕ −1 , ϕ −1 , ϕ C 2 or ϕ C 3 . This will help us keep track of the extensions of the diagram and how they relate to the Wilson lines.
The simplest example of an extended diagram in d = 2 compactifications is obtained by taking our second breaking to be trivial, namely taking A 2 = 0. For this choice, our task is easier because there is no need at all to apply the conditions (5.16). In practice we just have to supplement the EDD for S 1 with the node ϕ C 2 or ϕ C 3 . Concretely, taking E = E 1 , we get the extended diagram shown in Figure 3, where to obtain the rank 18 maximal groups we have to delete two nodes. With this we can obtain all the groups of the form G 17 × A 1 , where G 17 is one of the 44 maximally enhanced groups in S 1 compactifications. If we take instead E = E 2 , we get the diagram shown in Figure 4. With this simple construction we are now able to get non-trivial enhancements by deleting two nodes such that the resulting diagram is ADE. For example, by deleting nodes 5 and 5 we get the group E 3 6 , with moduli A 1 = 1 3 w 5 × 1 3 w 5 , A 2 = 0, E = E 2 . At this point it is useful to introduce an operation on the diagrams which consists of interchanging the last eight components of the two Wilson lines, namely This amounts to exchanging n 1 ↔ n 2 in ϕ 0 and ϕ −1 . If we follow the rule that nodes of the same color couple together, then this operation simply exchanges the colors of the affine roots relating to E 8 . Because of the way the diagrams transform, we call this operation "twisting".
If we twist the diagram in Figure 4, we get the one shown in Figure 6. Now we can get groups such as SU (19) with A 1 = 1 3 w 1 × 0 and A 2 = 0 × 1 3 w 1 , as well as SO(36) with A 1 = 1 3 w 1 × 0 and A 2 = 0 × 1 2 w 8 . In both cases E = E 2 .  Figure 6: below have been confirmed to work as intended. We will see that the same problem arises in the algorithms of section 5.3, but there is a systematic prescription to determine the correct gauge group.

Extended diagrams with nontrivial second breaking
Now we construct some extended diagrams for models with A 2 = 0. To keep things clear and unambiguous, we impose the restriction that the affine nodes ϕ 0 and ϕ −1 cannot belong to the same connected component of the diagram, and similarly for ϕ 0 and ϕ −1 .
As a first example we take A 1 = 1 2 w 6 × 1 2 w 6 . In the notation of section 5.2.1, k = m = 6 and the unbroken subgroup is the product of H 6 = E 7 × A 1 and H 6 = E 7 × A 1 . Our algorithm dictates that we add two affine nodes, and the restriction above says that these cannot extend A 1 nor A 1 , since these include the nodes ϕ 0 and ϕ 0 . Hence we should add the affine roots for E 7 and E 7 and color them blue. With E = E 1 we then get the extended diagram shown in In this example the new affine roots that build ϕ −1 and ϕ −1 in (5.18) are the lowest roots of E 7 and E 7 given bŷ The coefficients in the root expansion ofα 6 are the Kac labels for E 7 , and likewise forα 6 . In other examples the new affine roots are found in an analogous way. For example if k = 5, H 5 = E 6 × A 2 , andα 5 is the lowest root of E 6 , i.e.α 5 = −(2α 1 + 3α 2 + 2α 3 + α 4 + 2α 7 + α 8 ).
Deleting any one of ϕ −1 or ϕ −1 in Figure 7 gives us a group that could have been obtained with a simpler diagram, setting the first and/or last eight components of A 2 to zero. Similarly, the affine roots ϕ 0 and ϕ 0 cannot be deleted, since this would lead to a non-ADE diagram.
If we take E = E 2 , we get an extended diagram in which the node C 2 in Figure 7 is replaced by C 3 , and is connected to C 1 . Here one cannot delete any pair of nodes as we would not get an ADE group. This means that for A 1 = 1 2 w 6 × 1 2 w 6 and E = E 2 there is no second Wilson line with δ 2 = 0 and δ 2 = 0 that gives maximal enhancement. What we can do is apply the twisting operation (5.22), interchanging the colors of ϕ 0 and ϕ −1 . The resulting diagram is shown in Figure 8. To get for example the group A 1 × A 9 × D 8 we delete the nodes 1 and 4 . The Wilson lines are then obtained from those in the previous example by exchanging the last eight components.

Exceptional extended diagrams
The construction of extended diagrams considered so far can be thought of as gluing two subdiagrams of nine nodes via the nodes {ϕ C 1 , ϕ C 2 } or {ϕ C 1 , ϕ C 3 }. The two subdiagrams are in turn assembled via the two-step shift algorithm applied to E 8 and E 8 . There are, however, three extra subdiagrams which do not exactly conform to this procedure, but arise naturally when one considers how the affine rootsα i , with i = 4, 5, 6, described in section 5.2.1, are linked to the simple roots of E 8 . Similar considerations for the other affine roots do not lead to analogous conclusions, in part due to the fact that they extend A n diagrams.
In Figure 9 we have drawn the extended Dynkin diagram of E 8 , with its usual lowest root α 0 , together with the three affine roots mentioned above. The black (red) links represent inner products with value -1 (+1). The inner products between theα i are not shown, as they are not of interest. The color coding is exactly as before, meaning that the charge vectors of the  Figure 9: Links between the affine rootsα 4 ,α 5 ,α 6 and the roots of the affine E 8 diagram. Black (red) links correspond to inner products with value -1 (+1). The diagram to the right is obtained by flipping the signs of theα i . nodes corresponding toα i have n 2 = −1 and n 1 = w 1 = w 2 = 0. We see that deleting the i-th node, and adding the affine rootα i , gives us three of the subdiagrams which are predicted by the method of 5.2.1. However, as suggested by the right side of the figure, if we flip the sign of theα i we are now able to construct three more subdiagrams. These are shown in Figure   10, with the blue extending nodes defined in each case as  Figure 10: Three extra subdiagrams which do not come from a two-step shift-vector construction. They can be inferred from the right side of figure 9 These new subdiagrams are qualitatively different from those obtained in the previous section in two ways. On one hand, they do not respect the restriction that a connected part cannot have two extending nodes. On the other hand, they are not associated to fixed values of δ 1 or δ 1 , as they do not come from a two-step shift algorithm. To illustrate this, consider the diagram (a) in Figure 10 and break the fourth node, leaving out a 2D 4 diagram. Solving  Figure 11: Extended Dynkin diagram constructed with the exceptional extension shown in Figure 10 (a) for both E and E 8 .
(5.13) for all the remaining nodes yields with δ 1 , δ 2 and E ij arbitrary, since the nodes are of the form |0, 0, n 1 , n 2 ; π 1 , . . . , π 8 , 0 8 . Instead, if we break the third node, corresponding to an A 3 + D 5 diagram, we obtain The Wilson line A 1 clearly differs from that of the previous breaking.
Apart from the two considerations mentioned above, the construction of EDD's with the new subdiagrams is exactly as before. For example, we can take two copies of the subdiagram (a) of Figure 10 and add the two nodes ϕ C 1 , ϕ C 2 to get the EDD shown in Figure 11. Some enhancements obtained from this diagram are 2D 6 + 2A 3 and D 5 + D 6 + A 7 .
Exhausting the method of extended diagrams allows us to find 300 out of the 325 known maximal rank groups obtained in [20]. Remarkably, without the three subdiagrams in Figure   10, this number is reduced to 150. The incompleteness of the method is due in part to the complexity of the moduli space and the T-duality group O(2, 18, Z), which makes it hard to establish ways of obtaining global data. This is in contrast with the situation for d = 1, where a fundamental region can be easily constructed (see Tables 6 and 7).
The maximal rank groups which are missing from our results so far are As we will see, these can be obtained with the more powerful algorithms developed in section 5.3. Actually, among the 300 groups found with the EDD method, there are 3 that can only be obtained with one of the possible T lattices. The algorithms presented shortly also determine the moduli corresponding to the other T lattices. The full set of maximally enhanced models, taking into consideration inequivalent models with the same gauge group, are collected in Table 12 and further discussed in section 5.4.

Exploring the moduli space
In section 4 we have seen that to find maximal enhancements in the circle compactification, In the case of T 2 compactifications things are not so simple. The techniques of section 5.2 do lead to many maximal enhancement points starting from a collection of extended Dynkin diagrams, but this construction requires taking the particular values of E ij defined in (5.19).
With this limitation it is impossible to get some maximal enhancements, such as SU(4) 6 , known to exist from the lattice embedding results in [20]. and A 3 + A 6 + A 9 . In section 5.3.2 we will solve this issue by implementing an alternative algorithm which does not fix the Wilson lines.
We will apply the algorithms in the E 8 ×E 8 heterotic theory. The moduli for the Spin(32)/Z 2 theory will then be determined using the map described in section 2.2.

Fixed Wilson lines algorithm
This algorithm assumes a pair of Wilson lines fixed by the shift algorithm in such a way that E 8 × E 8 is broken to a maximal subgroup, say G 16 . This is the same assumption of section 5.2 where we explained that A 1 and A 2 take the form (5.14) or (5.22).
k, m = 0, . . . , 8, but k = m = 8 excluded. For A 2 , δ 2 and δ 2 are determined according to (5.16). We now want to explore the available four-dimensional region of the moduli space searching for values of E ij that give new maximal enhancements to a group of rank 18.
The great advantage of starting with Wilson lines fixed by the shift algorithm is that the 16 simple roots of G 16 are determined systematically. Moreover, we know the associated charge vectors |w 1 , w 2 , n 1 , n 2 ; π of the 16 nodes, cf. eqs. (5.12), (5.17) and (5.18). These charge vectors satisfy the massless conditions (5.13) regardless of the values of E ij . Therefore, they will still correspond to roots of the enhanced gauge group if we take special values for E ij . At points of maximal enhancement we must have these 16 roots plus 2 additional simple roots.
The algorithm first finds a subset of the possible pairs of extra roots and then computes the values of E ij by demanding that they satisfy the quantization conditions in (5.13a). It is also necessary to check that the moduli correspond to a physical torus, i.e. that the resulting torus metric satisfies g ii > 0 and det g > 0. The gauge group is determined from the 18 simple roots.
In agreement with the lattice analysis of section 3.2, we will see that maximal enhancement can only be obtained when the E ij take rational values.
The fact that the E ij can now take generic rational values means that we will get new maximally enhanced groups that could not have appeared with the method of the previous section. However, as already mentioned, the algorithm still misses known groups with maximal enhancement as we now argue. For simplicity, we will mostly denote the groups by their algebras. With only one Wilson line A 1 the first E 8 can only be broken to These subgroups are just obtained with δ 1 = w k κ k , k = 0, . . . , 8. Combining with A 2 gives more possibilities. For example, 2A 1 + D 6 can occur breaking first to A 1 + E 7 with δ 1 = 1 2 w 6 , then extending E 7 withα 6 and deleting the node 4, so that δ 2 = 1 2 w 4 − w 6 . The additional distinct groups that can originate from two Wilson lines are 4 Thus, necessarily G 16 = G 8 + G 8 , where each factor can only be one of the above 13 groups of rank 8. Now, the possible maximal groups G 18 that can appear for specific values of E ij should have a Dynkin diagram (DD) that consists of the nodes of the G 16 diagram plus two additional ones. If we want G 18 = 3A 6 , then we should be able to remove two nodes from its DD and get one of the algebras G 8 + G 8 . It is easy to see that there is no way of removing only two nodes without leaving behind at least an A 6 . Since none of the possible G 8 has an A 6 factor, we conclude that 3A 6 cannot be found starting with Wilson lines fixed by the shift algorithm. Although a bit longer, a similar reasoning shows that A 3 + A 6 + A 9 cannot be obtained either. Except for these two groups, with the algorithm we can reproduce all the other known maximal enhancements found in the K3 context [20].
We will explain how the algorithm works with an example leading to 6A 3 , which cannot appear with the E ij of (5.19). To begin, we delete the nodes 6 and 6 and then 2 and 2 . The shift algorithm fixes the Wilson lines to be The 16 unbroken simple roots provide the nodes ϕ j = |0, 0, 0, 0; α j , 0 8 , ϕ j = |0, 0, 0, 0; 0 8 , α j , j = 1, 3, 4, 5, 7, 8, The two Wilson lines break E 8 × E 8 to the rank 16 subgroup 4A 1 + 4A 3 with DD shown in Figure 12. It can be obtained from the extended diagram in Figure 7 by removing the nodes 2 and 2 , as well as the nodes C a associated to II 2,2 . For maximal enhancement we have to add two additional nodes. To illustrate the procedure we first add a single node denoted N 1 . The charge vector ϕ N 1 must have norm 2 and the inner product with the 16 nodes in (5.33) must be 0 or −1. We then generate a list of all possible single nodes satisfying these conditions. The second node to be added is also picked from this list.
Without demanding the corresponding DD to be ADE, we would have 2 16  two positive integers which we take as input parameters. In this example it is necessary to take at least λ 1 = λ 2 = 2, otherwise the algorithm would just not find the enhancement to 6A 3 . Considering the whole set of Wilson lines fixed by the shift algorithm, these bounds give all the maximal enhancements of the T 2 compactification except for 3A 6 and A 3 + A 6 + A 9 .
Some possibilities for the new node are depicted in Figure 13. The links in cyan or red would give 5A 3 + 2A 1 , whereas those in blue or magenta would give A 7 + 2A 3 + 4A 1 . The gray connections would lead to a DD which is not ADE and will be discarded later. The orange line implies A 4 + 3A 3 + 4A 1 . We could also disconnect the node from everything, obtaining 4A 3 + 5A 1 .
The quantization conditions (5.13a) will be imposed later, thereby determining the E ij .
At this stage we have assembled a list of all the possible simple roots that can be added such that the resulting DD is admissible, although not necessarily ADE. This means that the Cartan matrix is symmetric, with diagonal elements equal to two, and off-diagonal elements equal to 0 or −1. In our example, considering all the possible connections, and with λ 1 = λ 2 = 2, there are 1082 possible simple roots. From this list we can extract all possible pairs of simple roots that can be adjoined to the original 16. The two roots must be compatible, i.e. their inner product must be 0 or −1. We then collect all the allowed pairs. In the case at hand there are 191501 such pairs. For example, some of the possible partners ϕ N 2 for the simple root ϕ N 1 = |1, 0, 1, 0; 0 8 , 0 8 (correlated with the cyan connections) are The corresponding Dynkin diagrams are shown in Figure 14. The green connections for the node N 2 should be discarded because they give an affine A 3 subdiagram which is not ADE.
If we choose the pink connections we would have 6A 3 , and A 7 + 3A 3 + 2A 1 if we choose the yellow or the brown. Next, for each of the possible pairs, distinguished by two sets of charged vectors |w 1 , w 2 , n 1 , n 2 ; π , we substitute in (5.13a) to compute the four components E ij . In all cases we find E 11 = 1 and E 21 = 0. For the pink links, E 12 = − 1 2 , E 22 = 1; for the yellow E 12 = −1, E 22 = 3 2 ; and for the brown, E 12 = 0, E 22 = 1. For the green connections E 12 and E 22 remain undetermined, reflecting the fact that the associated DD is not ADE. We still have to check that g ij = 1 2 (E ij + E ji − A i · A j ) verifies g ii > 0, and det g > 0. In the end we have a list of all consistent pairs of simple roots that can be added, with the corresponding moduli. In this example there are 192 elements on the list.
We finally deduce the gauge group from the 18 simple roots. We developed a routine that takes a base of simple roots and detects if its Dynkin diagram is of ADE type and, in that case, it identifies the group. We also compute the Gram matrix Q corresponding to the moduli, as explained in section 3.2.1. We apply this algorithm to all the elements in our list.
In our example, this process yields 53 maximal enhancement points, but there are only 3 inequivalent enhancements because 50 of these points are T-dual to the 3 presented in Table   8. The corresponding diagrams are displayed in Figure 15.
In general, there will be various pairs (N 1 , N 2 ) that return the same moduli. In the simplest  case, all corresponding sets of 18 simple roots will have the same Dynkin diagram and, in consequence, the same gauge group. In this situation we simply discard all except one of the pairs. However, in some cases there might be pairs that, combined with the 16 original roots, actually give a subgroup of the real group which is obtained with different (N 1 , N 2 ) but same moduli. This is the same problem noticed at the end of section 5.2.2. The solution in this situation is to keep only one of the pairs belonging to the group of highest dimension.

Neighborhood algorithm
The previous algorithm starts with fixed Wilson lines that determine 16 initial simple roots.
It is then plausible to search for consistent ways of adding two nodes to the original Dynkin diagram, deducing in the process the remaining E ij moduli. If we do not want to make any assumptions on the A i , nor the E ij , for a procedure based on adding nodes to be feasible, it would be necessary to know beforehand most of the simple roots. The new Neighborhood  Table 8 algorithm goes in this direction.
The main idea is to find new maximal enhancements that are close to those already found, but whose Wilson lines are not necessarily given by the shift algorithm. More precisely, we start at a point of maximal enhancement where the group G 18 , and its 18 simple roots, are known. Then we move along surfaces in moduli space where the symmetry is broken to simple roots correspond to states that satisfy the massless conditions (5.13). We then check that the torus metric g ij is well defined and finally read the gauge group from the simple roots.
We end with a list of points of maximal enhancement that are on the neighborhood of the original point, i.e. they are connected through a 17-dimensional enhancement surface. The algorithm can be repeated to explore regions of the moduli space that are far away from the starting point.
We illustrate the algorithm with an example defined by the starting point A 1 = A 2 = 0, To further elaborate on the algorithm we analyze first the case in which the node C 1 is removed. The effect is simply to break E 8 + 2A 1 to E 8 + A 1 . We then add one node, called N, to its Dynkin diagram. The 2 possibilities for the connections of the new node are displayed in Figure 16. Generically, the charge vector corresponding to N is ϕ N = |w 1 , w 2 , n 1 , n 2 ; π 1 , . . . , π 8 , 0 8 .
The last 8 components of π are zero just because the new node is always disconnected from the second E 8 . The way that N is linked in each of the possible Dynkin diagrams gives 9 conditions for the 12 unknowns w i , n i , plus the eight non-zero components of π. We use these conditions to determine all except 3 of the unknowns. It is convenient, and always possible, to leave w 1 and w 2 undetermined. The following steps are very similar to those in the algorithm described in 5.3.1. We just consider all possible values for the 3 unknowns, with a fixed bound for the maximum of their absolute values. As in the previous section, for computational reasons, this truncation is necessary to avoid infinitely many possibilities. Concretely, we introduce two parameters λ 1 and λ 2 , which define the truncation, and consider only states with For this example it is enough to use λ 1 = 1 and λ 2 = 2. Afterwards, we filter all the candidates by imposing that ϕ N has norm squared 2 and π ∈ Υ 16 . In some cases it might occur that, regardless of the values of λ 1 and λ 2 , there are actually no solutions with w i , n i ∈ Z and π ∈ Υ 16 .
The case of E 8 + 2A 1 , on the left in Figure 16, is rather trivial because we are just restoring the deleted node C 1 . The algorithm will find charge vectors ϕ N which are not necessarily equal to ϕ C 1 , but at the end of the day all of them should be equivalent to it. When we compute the moduli we obviously get E ij = δ ij , A 1 = A 2 = 0, or some T-dual point. We just restored the simple root that we removed, thus returning to the original point in the moduli space. In general, this possibility will occur in all the breakings.
In the less trivial case E 8 + A 2 , on the right of Figure 16, N is linked to C 2 . Imposing In this case we readily find A 1 = 0 and A 2 = 0. From ϕ C 2 we obtain E 12 = 0 and E 22 = 1, whereas from ϕ N , n 1 = E 11 w 1 and −2w 2 − 1 = E 21 w 1 . The 4 elements in the list (5.40) solve these equations with E 11 = 1, and E 21 equal to 1 or −1. It is easy to see that the corresponding g ij is well defined and that these points are T-dual to each other.
The algorithm proceeds in the same fashion for all the 9 possible breakings of E 8 + 2A 1 . The moduli are determined as explained before. Taking into account all nodes except N, we arrive at There is a feature of the algorithm than can be explained considering again the enhancing to A 8 + 2A 1 , but now with A 8 formed by connecting ϕ N to ϕ 6 . The algorithm finds the charge vector |0, 0, 0, 0; −w 6 , 0 8 for ϕ N . The moduli are again of the form (5.42), but now the quantization conditions from ϕ N imply (γ 1 , γ 2 ) = (0, 0). Thus, the predicted moduli are A 1 = A 2 = 0, E = δ ij , and we know that this point has trivial enhancement to 2E 8 + 2A 1 .
On the other hand, the Dynkin diagram that results adding N indicates enhancement to The problem here is that the ϕ N , which has zero winding and momenta, corresponds to a root of E 8 . In fact, −w 6 = α 0 is the lowest root. Since the quantization conditions are linear equations, if we replace one of the original simple roots of 2E 8 + 2A 1 with any other root, the moduli that solve the system will be the same, but the other root is no longer simple. This is the same issue discussed at the end of section 5.2.2. Our prescription to solve it is to classify all the enhancements, originating from the same starting point, by the resulting moduli. If there is more than one enhancement for the same moduli we just pick the one with higher dimensional group. In this case, we choose 2E 8 + 2A 1 over E 8 + A 8 + 2A 1 .
In Table 9 we collect the maximal enhancements in the neighborhood of the original point A 1 = A 2 = 0, E = δ ij , which has G 18 = 2E 8 + 2A 1 . The node shown in the first column is removed from the set in (5.37) at the start. The effect is to break G 18 to G 9 × E 8 × U(1), with G 9 given in the second column. Appending a new node then leads to G 10 × E 8 , with the various possibilities for G 10 listed in the third column. To arrive at this list we have only kept the groups of higher dimension as explained before, and we have used λ 1 = 1 and λ 2 = 2 in the bounds in (5.39). deleted node Table 9: Maximal enhancements G 10 + E 8 in the neighborhood of A 1 = 0, A 2 = 0, E ij = δ ij , found setting λ 1 = 1 and λ 2 = 2 in the bounds of (5.39).
The Neighborhood algorithm can be iterated and can ramify from a different point of maximal rank. In particular, in this way we can find the maximal enhancements A 3 + A 6 + A 9 and 3A 6 , which, as we have argued, cannot be deduced using the algorithm with fixed Wilson lines. To this end we will set the bounds (5.39) as before. We will see that this is enough to obtain the missing groups, although a priori there was no guarantee for it. We now start at a point with group G 18 = A 6 + A 3 + A 1 + E 8 , which in turn was found by the algorithm initiating from the point E ij = δ ij , A 1 = 0, A 2 = 0, cf. Table 9. Concretely, G 18 arises after deleting the node ϕ 3 in (5.37) and then appending the extra node N with charge vector We can now readily apply the algorithm to G 18 whose Dynkin diagram is shown in Figure 17.a. All the enhancement points on the neighborhood of this point can be computed.
However, to reach the desired maximal enhancements, the nodes C 1 and C 2 will be maintained during the whole process. Therefore, E ij will remain equal to the identity as we move through the neighborhood. To proceed we remove the node 1 , thereby breaking G 18 to G 17 × U(1), with G 17 = A 1 +A 3 +A 6 +A 7 , as shown in Figure 17.b. The neighboring point is on the surface characterized by A 1 = − 1 8 w 3 × γ 1 w 1 , A 2 = 1 4 w 3 × γ 2 w 1 . The algorithm then searches for new nodes that can be consistently added. It finds N with charge vector |−1, −1, 1, 0; 0 8 , −w 8 , which leads to A 3 + A 6 + A 9 , as seen in Figure 17.c. The point is (γ 1 , γ 2 ) = (− 2 5 , − 1 5 ). Luckily, from this point we can attain 3A 6 in a couple of steps. With the algorithm it is easy to see what is needed. As displayed in Figure 17.d, the node 8 is next removed to break the symmetry to 2A 6 + A 3 + A 2 , plus U(1). The surface is given by 5w 8 )). The algorithm then discovers the extra node S, with charge vector |−1, 0, 1, −1; −w 6 , w 8 − w 1 , which has enhancement to 3A 6 , as indicated in  (e) Figure 17: Dynkin diagrams for the steps leading to the enhancements A 3 + A 6 + A 9 (c) and 3A 6 (e), starting from a point with A 6 + A 3 + A 1 + E 8 (a). Intermediate stages where the symmetry is broken are shown in (b) and (d).
In conclusion, we have arrived at A 3 + A 6 + A 9 and 3A 6 . The former has Wilson lines

All maximal rank groups for d = 2
From the results in [20] we infer that there are 359 distinct maximally enhanced heterotic models on T 2 , some of which share the same gauge group. The number of distinct maximal rank gauge groups found is 325. Using the extended diagram formalism of section 5.2 we are able to obtain the moduli for 331 of these models. The more powerful computational methods described in sections 5.3.1 and 5.3.2 allow us to obtain the moduli for the remaining 28 models, as well as alternative moduli for the other 331.
In Table 12 Table 12.
The torus metric and the b-field can be easily derived from the moduli E ij and A i sub- The complex structure and Kähler moduli, τ and ρ, can then be computed from their definition in (5.1), or alternatively from the relations to the E ij in (5.6). Note that in most cases in Table 12, the enhancements occur at points with ρ = τ . The exception is # 2, but as mentioned before, this group can also be reached with E ij = δ ij and suitable Wilson lines.
The transformations of the moduli under the duality group are best found as explained in section 2.1. We conjecture that all possible heterotic models on T d with maximal rank gauge group and given pair (L, T ), are unique up to T-dualities. We know that this is true in d = 1, since the extended Dynkin diagram for the lattice II 1,17 uniquely encodes all such models within a fundamental region of the moduli space. Indeed, the only freedom in the diagram in Figure 1 corresponds to a reflection about the central node, which is an automorphism of the lattice II 1,17 . For d = 2, the conjecture implies that Table 12 exhibits all maximally enhanced HE models up to T-dualities. In particular, we have checked that in cases such as # 15, the two sets of moduli can be connected by an element of O(2, 18, Z). Table 12, the moduli in the Spin(32)/Z 2 heterotic can be obtained by using the map described in section 2.2. We have explicitly verified that the Gram matrices of the lattices L and T are preserved under this map, which is to be expected from an orthogonal transformation. Some examples of these transformed HO models are given in Table 13. Gottschling [52][53][54]. In particular, in Theorem 4, Lemma 7 in [54], it is shown that the point

For each model in
, with η given in (5.43), is fixed by the octahedral group (O) of order 24.
In fact, this point Ω G can be shown to be precisely dual to the maximally enhanced point of entry # 325 in Table 12, which corresponds to At a generic point Ω, the gauge group is G = U(1) 3 × E 7 × E 8 , while at Ω P (or equivalently Ω G ) it is enlarged to G P = SU(4) × E 7 × E 8 . It is natural to propose that the transformations that leave Ω P fixed are generated by Weyl reflections about the simple roots that extend G to G P . We have checked that this is indeed the case. The simple roots of SU(4) are associated to the nodes ϕ 0 , ϕ C 1 and ϕ C 3 , shown in (5.17) and (5.21). As expected, the group generated by the Weyl transformations is the permutation group S 4 , which is isomorphic to the octahedral group O. It is easy to verify that Ω P is fixed by the transformations of order 3 and 4 displayed in (5.10), which are just products of Weyl reflections about ϕ 0 , ϕ C 1 and ϕ C 3 .
Actually, the maximal enhancements in # 296, #297 and # 324 in Table 12, which also lie in the slice of moduli space with ζ = βw 6 × 0, correspond to fixed points analyzed in [53,54]. Specifically, we can take the E ij given in (3.15)   Some results obtained applying this algorithm in d = 3 are presented in Table 10. All of them were found taking 3 or less steps from 2E 8 + 3A 1 , and setting (λ 1 , λ 2 ) = (1, 2) in (5.39).    [18,31], or by further studying the dependence of the full heterotic spectrum on the data of L and T .
We also remark that all the examples in table 10 have E ij = δ ij or can be shown to be T-dual to a model satisfying this condition. Taking into account the fact that all maximal enhancements in d = 1 and 2 can be constructed with E ij = δ ij , we expect that this fact extends to the case at hand with d = 3. In fact, we conjecture that this is a generic feature of all Narain moduli spaces, with arbitrary d. To see the physical significance of this statement, note that the condition E ij = δ ij implies that the antisymmetric field b ij is turned off. In many cases it is also true that the Wilson lines are orthogonal, A i · A j = 0, i = j, further implying that the metric g ij is diagonal and so T d = S 1 × · · · × S 1 . However, we do not have a formal proof that this can be done for all the maximally enhanced models.

Final remarks
In this paper we have explored the rich landscape of perturbative heterotic string compactifications on T d . These lead to non-chiral theories in (10−d) dimensions with rank (d + 16) gauge groups, which realize the upper bound on the rank arising in string constructions with 16 supercharges [15]. At special points in moduli space, the (d + 16) U(1) symmetries can get enhanced, and we stated lattice embedding criteria to determine whether a given gauge group is realized or not in a toroidal compactification. The use of these criteria was explained in several examples.
We also introduced different algorithms to systematically explore the moduli space and All maximal enhancements in the heterotic compactification on T 2 coincide with all possible singular fibers of extremal K3 surfaces classified in [20]. This gives additional evidence for the duality between compactifications of the heterotic string on T 2 and F-theory on K3, as well as relevant information for the study of extremal K3 surfaces. Some realizations of these surfaces have been studied in detail, see [28,57] and references therein. In the early days some examples were found by analyzing F-theory on orbifold limits of K3 [58]. Other examples have been obtained more recently by considering enhancements at special points in the moduli space of K3 surfaces with Picard number less than 20 [55,59,60]. The identification of the moduli that give particular enhancement points supplies further ingredients for a closer examination of the explicit map between heterotic and K3 moduli. This map was constructed in [61], in the particular case when all Wilson lines vanish, hence with two complex moduli τ and ρ. A step further is the map of [50], which includes Wilson lines that break a SU (2) in E 8 such that the 16 complex moduli ζ I reduce to the single complex parameter in (5.9). In the latter case the matching of the moduli was presented in [55], where also the moduli at points of maximal enhancement were identified.
Many other interesting questions deserve further study. For instance, we would like to identify the fundamental region in moduli space for d ≥ 2. In the HE theory compactified on the circle, this region is given in Table 6, and it was nicely described in [40] in terms of a chimney with side walls at certain values of A I , and bottom bounded by a spherical wall at E = 1. In general it is also practical to use as moduli the Wilson lines A I i together with the E ij that depend on the torus metric and the Kalb-Ramond field, cf. (2.1). Our work hints at two important features of the fundamental region. One is that all groups of maximal enhancement arise at det E = 1. This is obvious in d = 1, as the central node in the Extended Dynkin diagram of Figure 1, corresponding to E = 1, cannot be deleted. In d = 2 we have explicitly verified it, and for higher d it seems to be always possible. The second observation is that all groups of maximal enhancement arise at a single point in the fundamental domain. These two features imply that any maximal enhancement point at det E = 1 is not in the fundamental region, and can be brought to det E = 1 by dualities. This suggests that det E = 1 is always a component of the boundary of the fundamental region (it corresponds to the bottom of the chimney for d = 1). We conjecture that these two features are generic properties of the fundamental region and leave the proof for future work.
Classification of all allowed groups that can appear in compactifications of the perturbative heterotic string on T d is an important problem, posed already in the early days [1] and revived recently in the context of the swampland program [15]. In this work we have stated criteria to solve this problem, and given the answer for d = 1, 2. Actually, the solution includes not only the groups with maximal enhancement, but also groups G r × U(1) d+16−r , with r ≤ (16 + d).
For d = 1 all possible G r can be deduced from the EDD, and for d = 2 they are listed in [21].
A natural question is whether different G r could arise in other non-chiral string constructions with 16 supercharges. For d = 2, our results contain the groups with maximal enhancement found in the covariant lattice formulation [62]. On the other hand, it is well known that (10−d)-dimensional theories with semisimple non-ADE groups of rank (8 + d), e.g. USp (20) for d = 2, can be built in the fermionic formulation [63]. It would be interesting to know if some other CFT construction could give for instance 8-dimensional theories with 16 supercharges and an ADE gauge group of rank 18, such as E 8 × SO(14) × SU(4), which is forbidden in the heterotic on T 2 . It would also be helpful to understand if a theory with a forbidden group could suffer from global anomalies as discussed in [64].
Finally, we have observed that the landscape becomes less constrained as the internal torus dimension increases. Presumably, in d = 8, i.e. in two-dimensional theories, any rank 24 ADE group can appear in a toroidal compactification of the heterotic string.
A Notation and basics concerning lattices L, even positive definite lattice of rank r Typically L will be the sum of ADE root lattices. There is a basis formed by roots α i with The Gram matrix of L has elements α i · α j . It is equal to the Cartan matrix when L is the root lattice of an ADE group. It can be shown that A L is a finite Abelian group of order d(L).
T , even positive definite lattice of rank d It is characterized by the Gram matrix (Q) ij = u i · u j , where u i are the basis vectors.
A generic even 1 dimensional lattice, denoted A 1 m , is a multiple by m of the A 1 lattice.
It is generated by a vector u 1 with u 2 1 = 2m and has discriminant group Z 2m , in turn generated by (u * 1 ) 2 = 1 2m . We will mostly consider d = 2 and as in [20], represent Q as [u 2 1 , u 1 ·u 2 , u 2 2 ]. For classification of even 2-dimensional lattices see chapter 15 in [35], and section 2 in [20] for a short account.
Q can be brought to Smith normal form diag(s 1 , s 2 ), with positive integer entries. Then Notice that if s 1 and s 2 are coprimes then A T ∼ = Z s 1 s 2 . We will also need to compute the discriminant form q T . From Q −1 we can read off u * i · u * j , where u * 1 , u * 2 are the basis vectors of the dual lattice T * . Besides, Q −1 gives the e * i in terms of e i . With this data we can then find the generators of A T and derive q T . For example, for T with Q = [2,1,4], 2 7 ]. The generator of A T can be taken to be u * 2 which satisfies 7u * 2 = −u 1 + 2u 2 ∈ T , and has the lowest norm. Then q T takes values 2j 2 7 mod 2, j = 0, . . . , 6. proposition α in [30]). This means that the elements of M H are weights that can be written as roots plus generators in H L . Besides, the discriminant form q M H is given by the discriminant form q L restricted to H ⊥ L /H L . Orthogonality is defined with respect to the bilinear quadratic form b L [30]. In practice, y ∈ H ⊥ L if y ∈ A L and y · x = integer for all x ∈ H L . To avoid cluttering we will drop the subscript in M H when H L has been specified.
As an example, take L = A 8 and H L = Z 3 so that M/L ∼ = Z 3 and d(M ) = 9 3 2 = 1. Then M has elements x = y + nw 3 , with y ∈ L and n = 0, 1, 2. It can be shown that this M is isomorphic to E 8 , which is the unique rank 8 even unimodular lattice.
For L = D 8 the overlattice associated to H L = Z 2 has elements x = y + ns, with y ∈ L and n = 0, 1. This is nothing but E 8 , as expected since the overlattice has d(M ) = 4 2 2 = 1. Primitive embedding A lattice S is primitively embedded in another lattice Γ if S ⊂ Γ and Γ/S is torsion-free.
For example, A 8 ⊂ E 8 but the embedding is not primitive because E 8 /A 8 ∼ = Z 3 as explained above. An example of primitive embedding is A 3 ⊂ E 8 . Since A 3 has rank 3 and E 8 is even unimodular, this follows from Theorem 1.12.4 of Nikulin [18] quoted below. It can then be shown that D 5 ⊂ E 8 is primitive because D 5 is the orthogonal complement of A 3 in E 8 , and also that E 8 is an overlattice of D 5 + A 3 .

B Complements to section 3
In this appendix we present some additional material for the discussion of the lattice embedding formalism.

B.1 Embeddings of groups with rank r < d + 16
The problem is now to embed L of signature (r, 0), r < d + 16, in the even unimodular Narain lattice II d+16,d . In this case there are also three criteria that read Criterion 1, from Corollary 1.12.3 [18] If (A L ) < 16 + 2d − r then L has an embedding in II d+16,d .
Criterion 2, from Theorem 1.12.2(c) [18] L has a primitive embedding in II d+16,d if and only if there exists a lattice T of Criterion 3, from Theorem 7.1 [21] L has an embedding in II d+16,d if and only if L has an overlattice M with the following properties: Recall that Theorem 1.12.4 [18] further implies that when r ≤ (8+d) there is always a primitive embedding. The above criteria clearly reduce to those in section 3.1 setting r = d + 16. The lattice T now has indefinite signature so the application would be more complicated.
B.2 More on the complementary lattice T of signature (d, 0) In section 3.2 we have argued that T = K −1 . To complete the proof that (A M , q M ) ∼ = (A K , −q K ) we can use the following theorem of [35]: Let L 1 and L 2 be two sublattices of a unimodular lattice L 3 such that 5 Then the discriminant groups L * 1 /L 1 and L * 2 /L 2 are isomorphic. The isomorphism is given by y 1 + L 1 → y 2 + L 2 , where y 1 ∈ L * 1 /L 1 and y 2 ∈ L * 2 /L 2 , whenever y = y 1 + y 2 generates an isotropic subgroup of L 1 ⊕ L 2 .
To apply this theorem to our problem we take L 1 = M , L 2 = K, and L 3 = II d,d+16 , with K and M given in (3.3) and (3.8). We have M ⊗ R = R 0,d+16 and K ⊗ R = R d,0 .
Moreover, R 0,d+16 ∩ II d,d+16 = M and R d,0 ∩ II d,d+16 = K. It follows that M and K have isomorphic discriminant groups. It remains to show that they have isomorphic discriminant forms. The Narain lattice II d,d+16 is generated by the lattice sum M ⊕ K together with some isotropic vectors (glue vectors in the language of [35]). These vectors are generically of the form y = y 1 + y 2 , where y 1 and y 2 are non trivial vectors in the discriminant groups of M and K, respectively, and are connected by the discriminant group isomorphism. Since y must be even, we have y 2 = 0 mod 2. Therefore, y 2 1 + y 2 2 = 0 mod 2, because M and K are orthogonal. We thus find y 2 1 = −y 2 2 mod 2. This shows that q M ∼ = −q K , and so T as defined is the complementary lattice of M .
C Groups of maximal enhancement in d = 1 and d = 2 In this appendix we present the Tables containing all the groups of maximal enhancement in one and two dimensions. The list of groups realized in S 1 compactifications of the heterotic string is displayed in Table 11. The groups realized in T 2 compactifications of the E 8 × E 8 heterotic string are shown in Table 12. To simplify notation we dropped the primes in the E 8 weights. In Table 13 we give the realization of some of these groups in the Spin(32)/Z 2 5 L ⊗ R means the set of all points obtained by real linear combinations of the basis vectors of L theory.