Comments on Defining Entanglement Entropy

We revisit the issue of defining the entropy of a spatial region in a broad class of quantum theories. In theories with explicit regularizations, working within an elementary but general algebraic framework applicable to matter and gauge theories alike, we give precise path integral expressions for three known types of entanglement entropy that we call full, distillable, and gauge-invariant. For a class of gauge theories that do not necessarily have a regularization in our framework, including Chern-Simons theory, we describe a related approach to defining entropies based on locally extending the Hilbert space at the entangling edge, and we discuss its connections to other calculational prescriptions. Based on results from both approaches, we conjecture that it is always the full entanglement entropy that is calculated by standard holographic techniques in strongly coupled conformal theories.


Introduction and summary
Studying the structure of entanglement in quantum field theory and many-body systems has long been the focus of a tremendous amount of activity. 1 One of the most fundamental measures of entanglement in such systems is the entropy associated to a spatial subregion. This paper is fully devoted to exploring certain subtle issues that arise in defining this quantity.
It is common -but imprecise -to define the entanglement entropy S V of a spatial region V in a quantum state ρ as the von Neumann entropy, −Trρ V log ρ V , of the reduced density matrix ρ V obtained by tracing out the degrees of freedom outside of V, i.e. as ρ V = TrVρ. The issue is that this definition assumes that the Hilbert space factorizes into a direct product of degrees of freedom on V and its complementV. This assumption fails in many cases, including in strictly continuum QFTs (see the remarkably clear note [11] and references within) and in any lattice gauge theory [12][13][14][15][16][17][18].
A more precise approach is to define S V as the entropy of an algebra of operators A V supported on V (see [19,20] and references therein). If the Hilbert space does factorize and if A V is the maximal algebra supported on V, its entropy agrees with the one defined via tracing out. If the Hilbert space does not factorize but the theory is fully regularized (e.g. it is defined on a finite lattice), the algebraic definition of entropy is meaningful even though tracing out is not defined.
If the theory is defined directly in the continuum, the entropy associated to a subalgebra is not definable -but related quantities, such as relative entropy, will still be well-defined algebraically.
A catch in the above definition is that there is no unique algebra supported on a given region.
For instance, even if the Hilbert space factorizes, if A V is not the maximal algebra on V, the associated entropy will not generically agree with the tracing-out prescription. Moreover, for every non-maximal algebra there will be several natural entropic measures that can be associated to it. This is well known and has been discussed in, for example, refs. [14,21].
In this paper we will explore these algebraic choices in more generality. We will focus on theories with explicit regularizations: spin systems, fermion and scalar lattice field theories, and lattice gauge theories. (It is perhaps worth stressing that all of these theories require similar choices in their definitions of entropies; the issues we explore are not fundamentally due to the non-factorizability of gauge theory Hilbert spaces.) Our goal is to clarify which entanglement entropy one talks about when computing it using various prescriptions that exist in the literature. Many of the ideas here are not new; here we publicize them further and show how they are connected to each other.
Our main focus will be on replica trick path integrals, which are perhaps the most useful way of computing entanglement entropy in field theories. One of our main results is an explicit dictionary that, for a fixed entangling region V, translates between certain choices of algebras and boundary conditions in these path integrals. (Basic aspects of this connection were presented in [22].) We will identify algebras that correspond to open, Dirichlet, and Neumann boundary conditions on the entanglement edge ∂V in path integrals with matter fields. In gauge theories, we will similarly identify algebras corresponding to natural gauge-invariant boundary conditions that we will call electric and magnetic. All of these boundary conditions are imposed on the entanglement edge only on a single time slice, and at other times the fields are unconstrained.
We will also demonstrate several new points. One is that when a particular choice of algebra A V corresponds to a particular type of a boundary condition, then it generically corresponds to a combination of all possible conditions of that type. For instance, an algebra corresponding to Dirichlet conditions for a scalar field ϕ(x) will have a natural entropy calculated by a (weighted) sum over all possible boundary conditions {k(x )} of the type lim x→x ϕ(x) = k(x ) for x ∈ ∂V.
Another important lesson will be that the choices of algebras have relatively little to do with the entangling edge itself. While some choices of A V will correspond to boundary conditions of various sorts on ∂V, other choices will correspond to "boundary" conditions (or constraints) in the interior of V. The choices in the definition of entanglement entropy that we discuss here are thus much more general than the ambiguities in introducing a regulator for the conical defect in the replica path integral, and our analysis holds even in these more general cases.
The analysis described so far, being rather microscopic and micromanaging in nature, will not apply to theories that do not have known lattice discretizations. Examples include many field theories of interest, including chiral theories in even spacetime dimensions and Chern-Simons theory.
However, a different prescription for calculating entanglement entropy allows us to say a bit about some of these theories, too [12,13,17,18,23,24]. The procedure in question involves local extensions of the Hilbert space that make it factorize on the entanglement edge: instead of regularizing these theories fully, we add the minimal amount of degrees of freedom needed to regularize the entangling edge alone. This allows us to apply the original tracing-out prescription to e.g. Chern-Simons theory, and to draw some instructive parallels to the algebraic approach.
Having thus whetted the reader's appetite, we overview the structure of the paper. In section 2, we set the notation and carefully review some dry (but important) facts about finite systems. We set up the analysis so that it works for arbitrary lattice theories, so our results will have obvious analogs in continuum scalar, matter, and gauge theories with known actions and field content.
In section 3, we connect different operator algebras on spatial lattices M to different types of boundary conditions on boundaries ∂M of these lattices. This is a warm-up: we focus on pure states, and there are no entangling regions, reduced density matrices, replica tricks, etc. This analysis is also important unto itself, e.g. for the purposes of analyzing exact dualities of quantum theories on manifolds with boundaries.
In section 4 we perform a similar analysis for algebras on subregions V ⊂ M. The only difference between scalar and gauge theories arises at this step: for scalar theories, maximal subalgebras will never have a center, while for gauge theories, maximal gauge-invariant subalgebras always will. We will establish how analyzing the center of a chosen algebra A V tells us all we need to know about the type of boundary condition that will be obeyed by the appropriate reduced density matrix.
In section 5 we introduce several measures of entanglement that can be associated to the reduced density matrices constructed so far. In section 6 we show how these entropies are computed using replica trick path integrals, and we demonstrate how choices of algebras are reflected on the path integral side. In these sections we will focus on three natural types of entropies: the full entropy, the distillable entropy, and the gauge-invariant entropy. (These will be three out of many possible entropies one can define.) We will describe how they are related to each other and give precise path integral expressions for each of them.
In section 7 we present several important remarks that that connect our analysis to other approaches of calculating the entanglement entropy. For instance, we comment on how choices of algebras in conformal field theories are reflected by conformal boundary conditions in the 2D Ising model, based on the analysis in [25]. In the context of CFTs more generally, we also argue that the full and gauge-invariant entanglement entropies are natural candidates for the types of entropies that may contain universal information on trace anomalies, meaning that either could agree with the holographic entanglement entropy of Ryu and Takayanagi [5].
In section 8 we return to the discussion of entropies in theories where a lattice realization is unknown, where we employ local extensions of the Hilbert space. We review a cross-section of the existing literature on entanglement entropy in gauge theories, present some archetypical calculations using the extended Hilbert space, and suggest how they fit into our general paradigm. Building on this, we extend our earlier arguments and conjecture that it is precisely the full entanglement entropy that contains the universal CFT information obtained using holography and other techniques. We conclude and stress a few open problems in section 9.

Formal preliminaries
Consider a Hilbert space H composed of N copies of a K-dimensional target space H 0 , The use of a regular direct product means that this system is bosonic. For fermionic theories we should use graded products. Instead, we exploit the fact that fermionic systems can be dualized to bosonic systems in which the target has dimension K = 2; this is possible even in higher dimensions, with only mild assumptions on the regularity of spatial lattices [26,27]. This way we can always work with a Hilbert space H defined as a conventional direct product.
The maximal algebra of operators that acts on this space is the algebra of complex matrices C D×D . Recall that an algebra is a vector space (in this case, over C) equipped with and closed under a vector product (in this case, matrix multiplication). This maximal algebra has D 2 complex dimensions. It is very convenient to express the basis as the set of all possible products of a small number of generators. Due to the direct product structure of H, it is natural to pick the basis of C D×D to be generated by operators of the form where O i is an operator that generates a basis of C K×K , the maximal algebra on the i'th target space. For brevity, we will drop the ⊗ signs and factors of 1, so O i will denote the entire direct product (2).
Only two generators are needed to generate the full basis of H i , and we will call them the generalized position and momentum generators Φ i and Π i at location i. One simple choice is For a clock model (a discretized version of the compact scalar theory) these are actual position and momentum operators. A particular Hamiltonian may describe theories very different from this one, e.g. a σ-model whose target space is a (discretization of) a curved manifold, but any such theory will have an operator algebra isomorphic to the one generated by the above Φ i and Π i .
From now on, "generators of an algebra" will refer to a set of operators G whose all possible products form a basis that spans the entire algebra. For a general case of N sites with a K-dimensional target space on each site, the canonical choice for generators of For a spin system, the target space has K = 2 and the canonical generators from eq. (3) are the Pauli matrices, Φ i = Z i and Π i = X i . For spinless complex fermions, one typically chooses The algebra generated by G ferm is isomorphic to that of a K = 2 bosonic system.
Conversely, any set of expectation values induces a density matrix. To see this, it is very useful to choose an orthonormal basis {O a } a=1,...,D 2 for C D×D where all O a are invertible and, except the identity, traceless. The orthonormality is defined with respect to the natural trace inner product, One example is the canonical basis generated by Φ i and Π i in eq. (3). The explicit expansion of the density matrix in any such basis is Let us now consider non-maximal algebras A ⊂ C D×D . For our purposes, the relevant objects are unital * -algebras A. These are algebras that contain the identity and that are closed under Hermitian conjugation. 3 In practice, we will only look at non-maximal algebras generated by different products of generalized positions and momenta Φ i and Π i , e.g.
Not only will algebras thus obtained all be unital and * , the bases generated by these generators will also automatically be orthonormal, with all basis operators traceless (except the identity) and invertible.
2 This isomorphism can be made very explicit in one spatial dimension, where it is known as the Jordan-Wigner transformation. It maps a chain of fermions ψv for v = 1, . . . , N to a spin chain, via ψv = (Xv + iYv) v−1 u=1 Zu. 3 An algebra encodes the allowed operations that can be performed on a given quantum system. We require that A be unital because we should always be allowed to leave the system as it is, by acting on it with the identity. We require that A be a * -algebra because ρ is necessarily Hermitian, so operators O that appear in the expansion (5) of ρ must either be Hermitian themselves, or must come in pairs of Hermitian conjugates. If an operator is in A but its conjugate is not, then it cannot appear in (5). Any density matrix in A thus also belongs to the maximal subalgebra of A that is a * -algebra. Therefore the entire discussion may be phrased from the outset for * -algebras alone.
Given a non-maximal, unital * -algebra A spanned by a basis {O a } of the kind just described, there exists a unique density matrix ρ ∈ A that reproduces any list of specified expectations of At this level of generality, ρ is still a D × D matrix, i.e. an operator acting on the full Hilbert space H.
An important fact is that any operator that is not in A and has zero inner product with all operators in A will have a vanishing expectation in state ρ. This is an abstract form of Elitzur's theorem [28]. A reduction of the algebra from C D×D to A is intimately related to gauging degrees of freedom, i.e. to imposing constraints on the space of allowed density matrices.
As a concrete and nontrivial example of these ideas, let us explore the connection between nonmaximal algebras and gauging in the context of pure Z 2 gauge theories in d = 2 spatial dimensions. 4 This will also set the stage for our discussion of gauge theories in general. Here we start with the full (ungauged) Hilbert space H, given as in eq. (1) by a tensor product of a K = 2 bosonic Hilbert space over each link of a lattice M. This is the setup of Kitaev's toric code [29]: no gauge constraint has been introduced yet. 5 The maximal algebra of observables is canonically generated by Pauli matrices on links, {Z , X }. Now, consider the algebra A generated by {X , W f }, where W f = ⊂f Z are products of Z operators along faces (plaquettes) f . 6 This algebra has a huge center generated by Gauss operators G v = ⊃v X , one per vertex v of the lattice. Elements of A are precisely the familiar gauge-invariant operators.
The fact that the gauge-invariant algebra has a center means that any density matrix ρ ∈ A must be block-diagonal in a Hilbert space basis that diagonalizes the center. In other words, the original Hilbert space splits into superselection sectors, one for each of the two possible eigenvalues ±1 of each G v . For a connected lattice with N vertices and no special boundary conditions, this means that there are 2 N −1 sectors (the product of G v over all sites is identically the identity, hence there is one central element fewer than would be naively expected). For every state whose density matrix is gauge-invariant, the expectation of any operator orthogonal to A -say, Z -is zero. This is the original Elitzur's theorem.
In a Z 2 gauge theory, the Gauss law G v = 1 is usually imposed at each vertex. (Sometimes background sources are inserted, meaning that G v = −1 is imposed on a finite number of sites.) This operator equation is tantamount to restricting our attention to just one superselection sector of the full Hilbert space H. (Note that Elitzur's theorem holds even without this restriction to a single sector.) In the toric code, and more generally in condensed matter gauge theories, these gauge constraints are imposed dynamically, by adding − v G v to the Hamiltonian and then focusing on the low-energy sector; in particle physics gauge theories, this constraint is imposed by fiat.
The gauge theory example is an instance of a more general phenomenon: a non-maximal algebra always has an associated center, and eigenvalues of generators of the center label different superselection sectors. All density matrices are direct sums (statistical mixtures) of smaller density matrices that act only within specific sectors. Sometimes, as with gauge-invariant algebras and states obeying the Gauss law in the preceding paragraph, only one superselection sector will be populated. At other times, as with more general subalgebras and states to be discussed below, multiple sectors will be populated. In those cases, within each sector, its labels can be interpreted as constraints. When the center generators have support only on the edges of a spatial lattice, these sector labels denote different boundary conditions and are called edge modes.

Algebras and boundary conditions
Consider a system defined on a spatial lattice M with boundary. 7 There exist several families of algebras that are supported on all of M, but that differ in the choice of generators present at the boundary ∂M. The purpose of this section is to show which families naturally correspond to which familiar sets of (lattice) boundary conditions. As a warm-up, we start with a spin chain with N sites. Here we will study families of algebras obtained by removing edge generators from the maximal algebra C D×D with D = 2 N . The generalization to higher dimensions and arbitrary compact scalar theories is immediate. 8 Fermion systems in one spatial dimension will be examined next, and they also generalize to higher dimensions and parafermionic models. Finally, we will show how edge modes arise in gauge theories, where subalgebras of the non-maximal, gauge-invariant algebra A are considered. 7 The boundary of a 2d lattice is the set of all links that do not belong to exactly two faces. On a general triangulated d-manifold, the boundary is the set of all codimension-one simplices which do not belong to two codimension-zero simplices, together with any nonzero-codimension simplices that do not belong to any codimension-zero simplices. 8 Noncompact scalars, on the other hand, do not have an algebraic formulation unless they are embedded into a compact scalar theory. We will only discuss compact target spaces in this paper.

Spin chains and scalar matter
A spin chain has a maximal algebra generated by Pauli operators X v and Z v on each site v. (An analogous discussion applies if we start from other generators, say X v and Y v .) Consider now the algebra A D,O generated by The difference from the maximal algebra is that one generator from the edge of the system, Z 1 , is removed. The center of A D,O is generated by X 1 , the remaining generator on the edge. All pure states with density matrices in this reduced algebra thus must be eigenstates of X 1 . Moreover, a general density matrix will be a statistical mixture of X 1 = 1 and We can also consider "coarse graining" generators on two adjacent sites near the edge, so the remaining ones are only sensitive to some (but not all) degrees of freedom near ∂M. For instance, take an algebra that cannot measure the z-component (magnetization) of individual spins at sites 1 and 2, but that can measure the parity of the total magnetization on these sites. This algebra is generated by The resulting algebra, A N,O , has the same number of generators as the Dirichlet-open one, A D,O .
Its center is generated by X 1 X 2 , and so states whose density matrices belong to this algebra are (statistical mixtures of) eigenstates of X 1 X 2 . If eigenvalues of X v are labeled by e iπφv with φ v ∈ Z mod 2, then this algebra contains density matrices of states with definite values of φ 1 − φ 2 ∼ ∂φ 1 .
It is also possible to choose algebras where different fields are subject to boundary conditions at the The corresponding algebra has a center generated by X 1 and Z N , so the density matrices in it correspond to states with definite values of φ 1 andφ N . This notation is inspired by the fact that Z N is the momentum operator conjugate to the position X N , so its eigenvalues, schematically, correspond to time derivatives of the field φ N at the edge.
The same considerations apply in higher dimensions. Different pairing up of generators on the boundary can be performed to obtain algebras that correspond to fixed derivatives of fields parallel or perpendicular to the boundary. (Links are perpendicular to ∂M if one of their vertices is on ∂M and the other one is not.) It is also straightforward to generalize to bosonic systems with more complicated target spaces: all the operators Z v and X v can be replaced by Φ v and Π v from eq. (3) or by their inverses, as appropriate.

Fermions
The examples given in this section will focus on fermionic systems in one spatial dimension. As with spin systems, our conclusions can be generalized to higher dimensions, though there will be some additional subtleties we will discuss later. Consider any theory of complex fermions in d = 1, defined on N sites labeled v = 1, . . . , N . The maximal algebra is generated by {ψ v , ψ † v } v=1,...,N , but unlike the spin operators X v and Z v , the fermionic basis operators neither form a group nor are they all traceless -and, most importantly, the generators on different sites all anticommute. This system can, however, be dualized to a bosonic spin system via the nonlocal Jordan-Wigner map.
By thus bosonizing the fermions, the machinery from the last section can be imported wholesale.
This procedure might seem cumbersome, but matters are greatly simplified by the requirement that the Hamiltonian always be bosonic, i.e. that all fermionic systems have a fermion parity symmetry, generated by the product of operators 2ψ † v ψ v − 1 over all sites. If our attention is restricted to states of definite fermion parity and not to their superpositions, then only operators made out of an even number of fermionic generators ψ v and ψ † v will have nonzero expectations. In other words, the algebra of operators for fermionic systems with conserved fermion parity can be taken to be the non-maximal one generated by fermion bilinears ψ † v ψ v , ψ v ψ v+1 , and so on. These operators map locally under the Jordan-Wigner transformation, even in higher dimensions [26,27], and the dual algebra (acting on the bosonic Hilbert space of Ising spins) is generated by We will refer to this algebra as the maximal fermionic algebra on N sites, and we will assume that we only work with states of definite fermion parity. The center of this algebra is generated by the fermion parity operator, which is N v=1 Z v in the bosonic language.
What edge modes or boundary conditions can be imposed here? A natural first step is the removal of the operator X 1 X 2 from G f , resulting in the generating set This adds another central generator, Z 1 , to the existing one (the fermion parity). The extra superselection sectors that ensue are labeled by the number of fermions on the edge. This is the fermionic dual to Dirichlet boundary conditions.
The other natural alternative is The additional central generator here is X 1 X 2 , just like in the Neumann boundary condition for spins. In the fermionic language this central generator is rather nontrivial: it corresponds to Each algebra commutes with the product of all Z's, i.e. with the total fermion parity (−1) F . Locations of all additional central generators are red. In the case of Majorana boundary conditions, the removal of Z 1 is taken to mean that (−1) F is still a central generator, but that an overall constraint is imposed on superselection sector weights such that (−1) F = 0 hold as an operator equation. It is interesting to examine the generating set obtained by removing Z 1 from G f , This is a natural object in terms of Majorana generators χ v and χ v introduced in the preceding paragraph, as the corresponding algebra is generated by all Majorana bilinears built without χ 1 . 9 This algebra has no center. Moreover, it does not contain the fermion parity operator (−1) F . Thus, it only describes states with (−1) F = 0 and so it cannot contain the density matrix of any state with definite fermion parity; it can only contain equal statistical mixes of states with (−1) F = 1 and We can say that the algebra generated by G f M,O corresponds to "Majorana boundary conditions." We will return to such kinds of boundary conditions when discussing algebras on subregions.
The notion of Dirichlet and Neumann subalgebras of the maximal fermionic algebra can be extended to higher dimensions. The procedure is the same in spirit as the one outlined above: the algebra of fermion bilinears is dualized to a (non-maximal) subalgebra acting on a Z 2 bosonic system, and appropriate subalgebras with additional central generators at the edges are then considered.
The complication is that duals of fermionic systems in higher dimensions are gauge theories with non-standard Gauss laws [26,27]. Nevertheless, the fermion bilinears all dualize into local operators, and the procedure is conceptually straightforward and merely technically involved.

Abelian gauge theories
Let us now consider a Z 2 gauge theory in d = 2. (Generalizations to Z K and U (1) theories are straightforward.) To recap, the full Hilbert space is a product of K = 2 spaces on each link of the lattice M. The algebra A of gauge-invariant operators, described in section 2, is generated by electric fields X on links, magnetic fields W f on faces, and Wilson loops W c along homologically distinct noncontractible 1-cycles. Pure density matrices in A must describe eigenstates of Gauss What are natural ways to reduce this algebra by removing operators at the edges of the system?
A subalgebra of A without some of the Gauss operators will not contain density matrices of any pure gauge-invariant states; it will necessarily only contain mixtures of states with G v = 1 and G v = −1 for those Gauss operators G v absent from the subalgebra. This is analogous to what happened with fermionic subalgebras that did not contain the fermion parity operator. If our goal is to formulate gauge theory subalgebras that correspond to boundary conditions on pure states, the subalgebras must then contain all Gauss operators. Appropriate subalgebras will thus be obtained either by removing magnetic generators or by removing electric generators while keeping at least those products of theirs that form Gauss operators.
Consider first the generating set G E( 1 ) obtained by removing the magnetic field operator W f 1 from a plaquette f 1 that contains the link 1 ∈ ∂M, see fig. 3. The removal of W f 1 causes the operator X 1 to become a central generator. Thus pure states whose density matrices are in have a definite electric field on the boundary link 1 . We can similarly remove magnetic field . . from other plaquettes that contain boundary links 2 , 3 , and so on. If all the magnetic operators from boundary faces are removed, we will say that the remaining generators generate the electric algebra, and will denote it by A E . This algebra contains density matrices of all states with definite electric fields at the boundary. In the more common continuum notation, these M ∂M W f 1 X 1 Figure 3: A Z 2 gauge theory on a lattice M with boundary ∂M (drawn in blue). There is a central generator G v at every vertex of this lattice, including on edge sites v ∈ ∂M. Boundary plaquettes are those faces that contain boundary links; for instance f 1 contains a boundary link 1 ∈ ∂M. When W f1 is removed from the algebra, X 1 becomes another central generator. It corresponds to the electric field operator parallel to the boundary.
are states with definite values of the electric field E parallel to the boundary. Note that because of the Gauss law at each boundary site, knowing E as a function of the position along the boundary is the same as knowing E ⊥ , the electric field flowing into the boundary at each boundary site.
The analysis of what happens when certain electric field operators are removed from A is a bit more involved. The simplest way to obtain a nontrivial subalgebra that contains all the boundary Gauss operators is to consider the generating set G M that contains none of the individual X operators on the boundary of the lattice, but that does contain all the Gauss operators G v for edge sites v. Pure states whose density matrices are in this algebra A M are eigenstates of the Wilson loop along the boundary of the region; in continuum notation, this corresponds to a fixed value of A along the boundary. These states hence have definite values of total magnetic flux through the entire spatial surface. We will call the corresponding A M the magnetic algebra.
Other admissible subalgebras are obtained by removing more electric operators from plaquettes systems. However, this is not straightforward. A gauge theory on a lattice with boundary is dual to a spin system only if it contains no operators on the boundary -Gauss operators included [30,31].
A duality between boundary conditions can indeed be established, but the paradigm developed in this section would need to be altered to account for gauge theories without boundary operators.
We will not explore this issue here.
Finally, we note that in relativistic gauge theories there exists another terminology for boundary terms. Any boundary condition that fixes the field strength F µν with µ and ν both parallel to the boundary is a Dirichlet condition, while fixing F µν with µ or ν perpendicular to the boundary is a Neumann condition. This means that our magnetic conditions can be either Neumann or Dirichlet in d ≥ 3; in d = 2 magnetic conditions can only be Neumann, and in d = 1 they are not defined.
Our electric boundary conditions can only be Dirichlet in d ≥ 2 (if we are fixing X for ∈ ∂M) but can always be Neumann (if we are fixing X for ⊥ ∂M).
All X , W f except X , ∈ ∂M All Gv, and W f for f ∈ ∂M Magnetic

Nonabelian gauge theories
The direct approach indicated in section 2 is not very convenient for nonabelian gauge theories, so we adjust it as follows [17,32]. We start from a theory in which on each link we have a Hilbert space H spanned by {|U } for all U in a given gauge group G. Now, on each link we define an infinite series of finite-dimensional Hilbert spaces, Here we omit normalization factors and take dU to be the Haar measure on G. The dimension of States |R αβ have definite electric flux in representation R, but their products over all are where the product goes over all neighboring vertices of v, and L Λ vu |U equals |ΛU or |U Λ −1 , depending on whether the link is oriented from v to u or vice versa. 11 The operators L Λ vu are nonabelian generalizations of operators built out of electric flux generators X from the previous subsection, but unlike them L Λ vu are not gauge-invariant. It is common to view G as a Lie group and to employ its generators T a to write with the understanding that the electric flux generators J a vu act either from left or from right and have sign + or −, depending on the orientation of the link [17].
Gauge-invariant states are products of states |R αβ in the same representation along a cycle, with indices α, β, . . . contracted between neighboring links in this cycle. Gauge-invariant operators are Wilson loops W R c in representations R on cycles c, and Casimirs built out of electric flux generators J uv defined in eq. (16). The analysis of boundary conditions in non-maximal algebras now proceeds analogously to the Abelian case: removing e.g. all W R f from a face f near ∂V turns 10 A finite approximation to a nonabelian gauge theory can be obtained by keeping only representations below a certain dimension, but then the algebra of operators may only approximately close under multiplication. 11 In terms of states |R αβ , these two types of operators act on α and β by the matrices R(Λ −1 ) and R T (Λ), respectively. For example, all the Casimirs on the boundary link from f into central generators. Conversely, removing all Casimirs and local Wilson loops from ∂V makes all the W R ∂V 's become central.

Subalgebras and boundary conditions
The analysis so far has dealt with algebras that are supported on the whole lattice M, and a particular emphasis was placed on understanding which pure density matrices belong to which algebras. In this section we will deal with algebras A V of operators supported on a subregion V ⊂ M. We assume that we are given a density matrix ρ in the full algebra A -or, equivalently, a list of expectation values O of all basis elements O ∈ A. Each pair (ρ, A V ) uniquely induces a reduced density matrix via an analog of eq. (5), We seek to understand what kinds of different ρ(A V )'s can there be, given a state ρ and a region V.
We will focus on algebras A V that differ by operators at the edges of V, and the resulting set of different possible ρ V will correspond to different boundary conditions that can be put at the entangling cut of the system. This is analogous to section 3. Our analysis applies more broadly, and the same techniques can be applied to algebras A V lacking generators in the interior of V.
Any reduced density matrix in any subalgebra A V has the form where ρ V is a properly normalized density matrix of a state in H V (the product of all target Hilbert spaces H 0 associated to elements of V that carry degrees of freedom), and 1V acts only on the complement HV of dimension DV. This means that the algebra A V only contains density matrices of states that are uniform mixtures of all possible field configurations outside V. From now on we focus only on ρ V , for which there are three possibilities: there will be open boundary conditions on the edges of the interval, and all density matrices ρ V will be allowed.
2. If A V is not maximal but has a center generated by edge operators, ρ V will split into superselection sectors that contain states obeying a specific kind of boundary condition. Examples include Dirichlet and Neumann conditions from the previous section. Relative weights of different sectors depend on the original state and may take arbitrary values.
3. If A V is not maximal and has no center generated by edge operators, we can add a central generator and require that its expectation value always be zero. The reduced density matrix will then split into blocks labeled by eigenvalues of this central generator, but there will be a constraint on the relative weights of superselection sectors that will force ρ V to be impure.
An example is the Majorana boundary condition from the previous section. In this case the field at the boundary is random, i.e. it is an equal statistical mixture between states with and without a fermion at the edge.
Boundary conditions may effectively depend on ρ in the following sense. If A V is the maximal algebra on V, and if any operator that fails to commute with a given O ∈ A V has zero expectation, Let us now apply these ideas to our usual test subject, the Z 2 gauge theory. Gauge invariance has historically caused a lot of confusion when it came in contact with the study of entanglement.
By the following analysis we wish to very forcefully point out that even when working with the full Hilbert space the results will be gauge-invariant, as long as only gauge-invariant algebras are studied. These points have been made in [30].
Consider an algebra A V of gauge-invariant operators supported on a set V, which in this case is a collection of links. No operator in A V has support outside of V -in particular, no Gauss 12 The center of A V is generated by Gauss operators in the interior of V and by boundary electric fields If the original state ρ is gauge-invariant, then all Gauss operators will have G v = 1, and the appropriate reduced density matrix ρ V will contain only states that satisfy the Gauss law on all the 12 We assume that V is a subregion of M that is far away from the boundary ∂M of our spatial lattice, if any exists.
interior points, i.e. it will be of the form The blocks, where b 0 is the number of disconnected components of V. We will still refer to these boundary conditions as electric, but this caveat must be kept in mind, as the b 0 "correction" gives rise to universal quantities such as the topological entanglement entropy. 13 In nonabelian theories, the center of the gauge-invariant algebra is also given by the Gauss operators in the interior and by a set of operators on the boundary of V. These boundary operators are defined as Casimirs built out of products over all interior vertices u neighboring v ∈ ∂V, How do these operators act in the basis |R αβ from eq. (14)? Within each H R such that v ∈ ∈ V, we have depending on the orientation of (recall that we are summing over repeated indices, and when the argument of R is dropped it is understood to be the integration variable U appearing in (14)).
The product of these operators, E Λ v , has an analogous action on the total flux in representation R that enters the vertex v [17]. Thus, every central operator E Λ v in a nonabelian theory has an identity component when represented on the space H R , and hence the reduced density matrix will contain this product of identities, too. (We will give them a physical interpretation in section 13 Non-maximal gauge-invariant algebras, obtained by removing gauge-invariant operators from the vicinity of ∂V in a manner described in section 3.3, can also be viewed as having random boundary conditions for some of the central generators Ev. We will not use this point of view in this paper, but it may be a useful fact when comparing entropies of different algebras in a fixed quantum state. 8.) Beyond this, the analysis of nonabelian theories is analogous to the Abelian case: the existence of boundary central generators causes ρ V to split into superselection sectors labeled by the tuple R, which are direct generalizations of Abelian electric fluxes labeled by k.

Entropies of reduced density matrices
The algebraic point of view developed in the previous sections allows us to start from any theory with a known lattice regularization and define the Hilbert space in the natural representation of any subalgebra of operators A V . Roughly speaking, this space is the direct product H V = i∈V H i over all degree-of-freedom-carrying simplices i (vertices, links, faces, etc) on which at least one operator in A V acts nontrivially. More precisely, a non-maximal algebra A V restricts the possible quantum superpositions between the states in H V , so the resulting restricted space will be denoted H * V . This restricted space H * V has the same dimension as H V . The only difference between them is that H * V does not allow superpositions of states in different superselection sectors. If k labels these sectors, V is a smaller but more "traditional" kind of Hilbert space where all superpositions are allowed.
The natural entropy to be associated with ρ V is the von Neumann entropy, The trace is taken over H V or, equivalently, over H * V . 14 The latter formula is the basis of the replica trick, to be explored in the next section. We will call this quantity the full entanglement entropy.
We again stress that in a lattice gauge theory, we take H V to be the set of all states on links in V -gauge-invariant or otherwise. The projectors in (20) make sure that only states obeying G v = 1 for v ∈ Int(V) contribute to the trace. More interestingly, ρ V does not contain projectors that enforce G v = 1 for v ∈ ∂V. This is an important point whose ramifications we study below eq. (43) and in section 8.
If ρ V is block diagonal in some basis, we can first compute Tr k ρ If there is only one relevant superselection sector, i.e. if A V is the maximal algebra on H V or if all sectors but one have zero density matrices, this formula reduces to (23).
In the presence of superselection sectors, the entropy S V is not the only interesting quantity to define. Let us first assume that we are working with matter or Abelian gauge theories. It is useful to define unit-trace density matricesρ in each sector: The entropy associated to A V is now with S (k) The quantity is called the distillable entanglement entropy. 15 For a generic state, it is different from the full entropy S V whenever A V has central generators.
In case we are working with nonabelian gauge theories, recall from the discussion around eq. (21) that ρ V has more structure beyond splitting into sectors labeled by the representation R of the gauge group: within each sector, it is a tensor of a dimR × dimR identity matrix and a nontrivial matrix that we may call the proper reduced density matrix. Each representation R thus contributes an entropy of log dimR to S (k) V . (Here we are using k to denote all labels for superselection sectors; in general, R will be a subset of k, meaning that there may be multiple sectors k with the same label R.) In fact, it is natural to define S (k) V as the entropy of the proper reduced density matrix in sector k, as the log dimR contribution is also not distillable. Hence, in a nonabelian gauge theory, we will decompose the full entanglement entropy as where p R is the total weight of all sectors k that contain R.
With this convention, will be called the gauge-invariant entropy of V. This is the entropy that we would get if the trace in (23) was taken in the representation associated to gauge-invariant degrees of freedom only, instead of using the representation on the full space H V = H . We caution the reader that this name is slightly misleading, as the full entropy (29) is gauge-invariant, too.

From subalgebras to path integrals
We will now show how the various entropies defined in the previous section can be computed using path integrals. 16  The wave function of the ground state |Ψ of a theory with Euclidean Lagrangian L is given by The notation (k) means that the path integral variables within the region V on the τ = 0 slice are constrained to equal the eigenvalues k of central generators of A V . 17 The path integral is normalized so that 16 When working with theories with finite target spaces, like spin systems or fermions, we may either consider the time τ to be discrete, or we may take it to be continuous with the understanding that all integrals are constructed using the coherent state approach [33]. Either way, τ is always Euclidean. For gauge theories, it is most helpful to keep τ discrete, with fields A0 living on temporal links. Integrating out the A0's in any Maxwell/Yang-Mills theory enforces local conservation of charge, making the path integral include only gauge-invariant configurations [34]. 17 More precisely, we should also allow for constraints on links emanating from ∂V. Such constraints would play a role when computing, say, the entropy of the algebra G D,Ḋ in eq. (9). They will also play a role when studying various entropies of gauge theories. We will henceforth include this possibility when referring to boundary conditions at τ = 0. The reduced density matrix induced by the algebra A V is block-diagonal in the basis φ (k) , and each block has matrix elements On the other hand, the normalized density matrix in sector k (cf. eq. (25)) has matrix elements with the measure chosen so that Trρ  (25): Note that here the measure of the path integral is the same as in (31), meaning that when summed over all k the integrals in the above equation yield unity. The two measures are related by These probabilities can also be obtained from the expectation values of central operators. Let Note that the tuple m is conjugate to k, and the matrix K is simply the kernel of an M -dimensional Fourier transform. 18 This ensures that K is always invertible, and we can write This expression can also be written as The sum over individual contributions of sectors to the entropy S V can be written as where (M × R) n denotes the n-replicated Euclidean spacetime, and [dϕ] n k = [dϕ 1 ] k · · · [dϕ n ] k is the replicated measure for the path integral in sector k, normalized according to eq. (35). The same boundary condition k holds on each copy of the region V on the τ = 0 slice. The sum over boundary conditions (edge modes) does not depend on n and can be commuted past the derivative ∂ ∂n .
The full entropy associated to the algebra A V , given by eq. (26), can be calculated by modifying the edge mode contribution in (44) to get According to eq. (37), e −nI(k) [dϕ] n k = [dϕ] n , so the full entropy can also be written as the path integral with the original measure on each replica, in agreement with eq. (24): We also record the expression (41) for S dist V once eq. (37) is employed: In nonabelian theories, the same story as above plays out, with one significant difference. The (Recall from section 4 that any state in H R V has one "dangling" index α at each edge site, resulting in ρ V having factors of dimR × dimR identity matrices.) We can choose whether to fix the gauge on the edge; if we do not, these dangling degrees of freedom will get replicated and will contribute to S V . Gauge-fixing on ∂V thus reduces S V down to the "gauge-invariant" part S g-inv V given by (30).
We will discuss the physical nature of this gauge-fixing in section 8. Equation (43) should be taken as the regularized definition of the replica trick path integral. It gives a precise treatment of boundary conditions and distinguishes between entropies associated to algebras with different centers. In general, the entropy associated to a general subalgebra A V can be calculated algorithmically by following these steps: 1. Determine the center of A V .
2. Determine the set of degrees of freedom on which A V acts nontrivially, and pick the basis of the associated space H * V so that the center generators are all diagonal. This sets the variables to be used in the path integral. This procedure can be applied to any quantum theory, assuming we know how to discretize it such that we start off from a Hilbert space that factorizes. On the other hand, the existence of flux operators E v on v ∈ ∂V means that gauge theories will naturally have nontrivial superselection sectors, and since these are supported on edges it is reasonable to refer to them as edge modes. (Here we assume that the "natural" algebra associated to a region is the maximal allowed algebra of operators on that region.) Using the "balanced center" procedure of [14] it is possible to find a non-maximal gauge-invariant algebra that has no edge modes. However, in a topological phase of a gauge theory this kind of algebra does not give rise to the usual topological entanglement entropy. In general, it is not known how universal data about the gauge theory are encoded in entropies of algebras with non-maximal centers.

The edge mode action
The general prescription in the previous section can be straightforwardly applied to d = 1 systems.
However, d > 1 might seem hopeless, as the size of the center grows exponentially with |∂V|.
Fortunately, there are several situations in higher dimensions when the superselection sectors can be tamed. These are either free or infinitely gapped theories of various kinds, and here we will enumerate some examples. To simplify the discussion, we will focus on Dirichlet algebras for matter theories and on electric algebras for gauge theories. In both cases a sum over sectors generically appears.

Product states: The sum over superselection sectors is trivial if only one sector has nonzero
weight. In such a case there is no "classical" entropy from the − k p k log p k term in (26).
In a matter theory, this happens in massive phases with product states, such as in the Ising model at large external field. The ground state has all spins pointing in the same direction, say Z v = 1. If the center of A V is generated by Z's at the edge, only one superselection sector will be populated. Similarly, a lattice gauge theory at strong coupling will have a ground state with X = 1 on all links, and only one configuration of edge modes (electric fields piercing ∂V) will appear in the reduced density matrix.
2. Topological phases: All gauge theories with a finite gauge group have a topological phase at weak coupling. 19 In this limit, central generators are the electric flux operators E v , and topological states have the same p k for each set k of eigenvalues of E v , modulo global constraints (as discussed in section 3). A quick way to see this is to note that all electric flux operators have zero expectation values, so p k = 1 K M −1 follows from eq. (39) (with M denoting the number of sites at ∂V, and Z K being the gauge group).
3. Symmetry protection: The previous two examples dealt with extreme weak and strong coupling limits of simple theories. It is conceivable that with a sufficient amount of symmetry, only a few 19 If the gauge group is continuous, the topological phase may be inaccessible. Consider the case of U (1). We can imagine regulating it with ZK for K 1; the topological phase is reached when the coupling is much smaller than 1/K [32], which is not a limit one usually considers in U (1) theories. superselection sectors will be populated in more complicated models, as well. At the very least, we expect this to be the case in any symmetry-protected trivial (SPT) or symmetry-enhanced topological (SET) phases. We will see in section 8 that Chern-Simons theory naturally fits into this category, too. It would be interesting to discover other nontrivial theories in which the superselection sectors are simple due to a symmetry. 4. Free theories: In a free field theory the expectation values that enter eq. (39) are nontrivial, but they do factorize due to Wick's theorem. Consider a compact scalar, with central generators The expectations of central elements can be written as e i v mvφv ∼ e − v,u Gvumvmu . Plugging this back into (39), using k v ≡ e iκv and K −1 km ∼ e −i v κvmv , and summing over m v , we find sector probabilities p k ∼ e − v,u G −1 vu κvκu . This is an elementary way to derive the Gaussian distribution of edge modes that has played an important role in understanding the entanglement entropy in d = 3 Maxwell theory [21,35,36]. Note that the edge mode action I(k) = − log p k is nonlocal. The action that appears in the replica trick, eq. (44), is thus not equivalent to the naive restriction of the original action to the subregion V, as would be the case for an algebra A V without a center.

Lattice, continuum, and conformal boundary conditions
The discussion so far was centered on path integrals carried out over lattice fields. When such integrals are dominated by configurations that vary over length scales much greater than the lattice spacing, lattice boundary conditions can be replaced by continuum ones. If the field configurations of interest vary slowly and the theory remains weakly coupled, the type of boundary condition (open, Dirichlet, Neumann, electric, magnetic, etc) will be the same in the continuum and on the lattice, although the edge mode action I(k) may be renormalized. For instance, in a free theory we can approximate the sum over edge modes k with an integral over boundary configurations ϕ(x ) for x ∈ ∂V, and these continuum edge modes will still have Gaussian weights, with an effective action I[ϕ] [13]. This naive approach will not be possible for theories without an explicit Lagrangian description, for instance for strongly coupled theories defined as the infrared limits of known theories, where boundary conditions are more abstractly determined by bulk-to-boundary operator product expansions (see [37] for a modern take on this). It is not known how to generalize our discussion to these cases, though of course if we were powerful enough to compute path integrals directly in the UV, our analysis would apply.
In  [38]. There is one Cardy state for each primary operator. In a study of the Ising CFT [25], Cardy states at the entangling edges in the path integral construction were connected with choices of algebras. 20 In this reference it was also found that the leading universal term does not depend on these choices, which appears to be a non-generic phenomenon: as we will review in more detail below, the universal term depends on the choice of entropy in d = 3 free theories.
Specifically, for an interval V, consider the maximal subalgebra A V of the Ising model H = This is the only known example of a connection between conformal boundary conditions and algebras. It would be interesting to understand this link in more instances, and to check whether the universal leading-order behavior in other d = 1 CFTs does not depend on the choice of algebra, as was found to be the case in the Ising model.

Universal terms
In a CFT with a UV cutoff and in d > 1 space dimensions, it is common to say that the ground state entanglement entropy for a spherical region V of size R takes the form 20 Ref. [25] focused on the Rényi entropies (1 − n) −1 log Trρ n V in the limit n → ∞. We here assume that the established connection between subalgebras and this particular limit of Rényi entropies can also extend all the way to n = 1, where the usual entanglement entropy is recovered.
Here C d is a theory-independent constant 21 , and γ and a are universal (regularization-independent) and can often be interpreted as counting the number of degrees of freedom in the CFT [9,39]. Which of the entropies defined so far should be understood when writing such formulas?
This question is not trivial; different entropy choices lead to different values of γ and a. It is conceivable that they all have a counting interpretation and lead to c-theorems of interest [40,41].
However, for odd d, the quantity a can be connected to the trace anomaly of the CFT [42]. can be entropies whose universal terms can generically match the trace anomaly.
We have also not specified which algebra we want to compute the full or gauge-invariant entropy of. Based on calculations in free theories [21,35], we conjecture that in all theories the trace anomaly matches the universal term in the entropy when A V is the maximal algebra on region V. Moreover, based on calculations in topological and confined phases of lattice theories [14,32], we also conjecture that the quantity γ (sometimes also denoted F ) that is customarily defined in even d also matches the universal piece of the entropy of a maximal algebra on V.
In the context of gauge theories, we will provide more plausibility arguments for this conjecture in section 8. In particular, we will note that the topological entanglement entropy of Chern-Simons theory is reproduced only if no gauge-fixing is assumed at ∂V. Thus, we can sharpen our conjecture and claim that it is always the full entropy S V of the maximal A V that contains the conventionally defined universal terms.

Holographic entanglement entropy
If a theory is holographic, the replica trick path integral can be calculated using a replicated bulk geometry, and the entropy associated to this bulk partition function is approximated by the area of the Ryu-Takayanagi surface in the classical limit [5,43]. An important aspect of this story is that the Ryu-Takayanagi prescription does not involve a choice of subalgebra or of a type of boundary condition. Which of the many kinds of entropies that are associated to a region V does holography compute?
This question reduces to the one discussed in the previous subsection. The holographic entropy is known to reproduce the correct trace anomaly in its universal terms when the bulk contains Einstein gravity [39]. Moreover, in higher derivative theories of gravity, the Ryu-Takayanagi prescription is modified so that the holographic entanglement entropy still computes the correct trace anomalies [44]. Building on the conjectures from the previous subsection, we propose that, in all dimensions, it is the full entropy of the maximal algebra on V that is computed by the holographic entanglement entropy, defined via Ryu-Takayanagi or its generalizations. It is not known what gravity constructions would calculate any of the other entropies that can be associated to V.

Local extensions of the Hilbert space in gauge theories
In this section, we discuss the second universality class of approaches to define the entanglement entropy of a lattice gauge theory. In contrast to the previous sections, here we will take the perspective that the Hilbert space of the gauge theory contains only the gauge-invariant states that faithfully represent the gauge-invariant operator algebra. We then locally extend this Hilbert space along the entangling cut by adding the minimal number of degrees of freedom at the cut so that it splits into tensor factors. Although this operation may seem quite arbitrary, the two main points in this section are that (i) it is a physically meaningful procedure when the gauge theory emerges as an effective low-energy description of the physics, and (ii) it coincides with an especially natural set of boundary conditions in the replica trick, that roughly amount to smoothing out the conical singularity. (In section 7.4 we arrived at an analogous requirement: that the replicated path integral depend on the metric only through the action and the usual measure.) Much of this section serves as a review of a cross-section of the literature on entanglement entropy in gauge theories in which these points were crystalized.
In cases where we can put the gauge theory on a lattice, the results obtained in this section coincide with the full entanglement entropy of the maximal algebra, (29), in the conventions of the previous sections. This is because previously, we were already using the convention that the algebraic entanglement entropy for lattice gauge theories was defined w.r.t. a (globally) extended Hilbert space, as described in footnote 5 (and the extension of the Hilbert space away from the entangling surface does not affect the partial trace calculation). 22 Organizationally, we will start by introducing the extended Hilbert space approach both on the lattice and in the continuum. We first do this at a formal level, then provide a physical justification for it. We then discuss the replica trick boundary conditions, and finally conclude with assorted comments.

On the lattice
The extended Hilbert space definition on the lattice is easiest to introduce by example. Consider Yang-Mills theory on a d = 1 spatial lattice with two sites connected by two links, and suppose that we want to assign a reduced density matrix to one of the links. This is the problem of computing the entanglement across an interval in d = 1 Yang-Mills theory on a spatial circle [16].
Yang-Mills in two spacetime dimensions is solvable, see e.g. [45]. It's known for instance that the Hilbert space on the circle is the space of square-integrable class functions on the gauge group G (L 2 -functions on the group manifold s.t. ψ(gug −1 ) = ψ(u) for all g ∈ G), for which a convenient basis is furnished by the characters, The gauge-invariant operators in the theory are the Casimirs built out of the electric fields, which are diagonal in the representation basis, and the Wilson loop operators in all the representations of G. The Hilbert space (47) doesn't refer to the underlying spatial manifold and so clearly doesn't factorize. In the extended Hilbert space prescription, we're instructed to embed it into the minimal larger one that does.
Intuitively, the presence of extended operators that cannot be split into local constituents (i.e. the Wilson loops) is what prevents the Hilbert space that faithfully represents the operator algebra from factorizing. We can get around this by adding pairs of non-dynamical (infinitely massive) surface charges in all the representations of the gauge group at the ends of our entangling interval, which allow us to cut the Wilson loops into Wilson lines. This is tantamount to lifting the Gauss constraint at the lattice sites, so the extended Hilbert space is the tensor product of two link Hilbert spaces, which are spanned by the matrix elements of the group representations: (See section 3.4 for more details.) Under a gauge transformation Λ ∈ G on the first site, these states transform as and under a gauge transformation on the second site they transform as The physical Hilbert space H phys is embedded into H ext. as It is easy to see that the state above is indeed gauge-invariant. The physical picture is that, with the matrix indices labeling the infinitely massive surface charges, we want pairs of charges across the entangling cut to transform oppositely under gauge transformations in order to make a gaugeinvariant state, so we assign them the same index.
We can now take the most general state |Ψ = R ψ R |R ∈ H phys , embed it in the extended Hilbert space as R αβ ψ R dimR |R αβ left ⊗|R βα right , and compute the reduced density matrix by tracing out, say, the right tensor factor in the extended Hilbert space. Its von Neumann entropy is where p R = |ψ R | 2 . The first term is a probability distribution over the states; we'll call this the Shannon entropy. The second, " log dimR" term, comes from the statistics of fusing the nondynamical surface charges to make a singlet. (The factor of 2 comes from the entangling interval having two ends.) This concludes our review of the d = 2 example.
In higher-dimensional lattice gauge theories, the extended Hilbert space idea was discussed in refs. [12,13,17]. 23 There we find the same types of edge terms as in (52) when we promote the R's that label the edge states {|R } to instead label superselection sectors specified by the eigenvalues of the Casimirs at all the boundary lattice sites (as mentioned in section 4, where these were included in the general sector labels k). Then the entropy associated to a region V is ρ R being the normalized density matrix in the superselection sector R (see eq. (27)). The first two terms are the edge terms from each lattice site along the boundary, and the third captures the distillable [17] entanglement of interior degrees of freedom, that the d = 2 example was too simple to support.
In short, we see that the extended Hilbert space prescription on the lattice agrees with the full entanglement entropy, (29), w.r.t. the globally extended conventions of the previous sections. This was first pointed out in [17].
It's interesting to compare this result to the entropy S g-inv V of the maximal gauge-invariant subalgebra/electric algebra with respect to the gauge-invariant Hilbert space. As discussed around (29), (30), Note that the expression "log dimR" is the expectation value of an IR operator which is a function of the gauge group Casimirs. Hence, the result from the extended Hilbert space prescription is gauge-invariant despite that we got it from carrying around gauge-variant data. 23 The conventions in these references differ by some cosmetic details. In [13], the entangling cut intersects a collection of boundary links instead of boundary sites, and one extends the Hilbert space by adding a new lattice site at each such intersection where one doesn't impose the Gauss law. In [17], the extended Hilbert space on the lattice is taken to be the "globally extended" one, H V = ⊗H , instead of just lifting the Gauss law at the boundary sites. But as explained in section 4, an extension of the Hilbert space away from the entangling cut doesn't affect the entanglement entropy of states in the gauge-invariant subspace.

In the continuum
As mentioned above, one way to define the extended Hilbert space on the lattice is to lift the Gauss constraint at boundary lattice sites. The naively analogous operation in the continuum would be to quantize the phase space after partial gauge-fixing in the time direction (i.e. A 0 = 0), but without then imposing the residual gauge symmetry at the entangling surface ∂V, instead promoting the time-independent gauge symmetry to a global symmetry along the entangling surface. (See the discussion below eq. (44).) The embedding H phys ⊂ H ext. is then fixed by demanding that the states in H phys are singlets w.r.t. this new global symmetry.
We will say more about the formal justification for this operation below, but for now let us put it to use in an example. By following these steps we can recover the topological entanglement entropy (TEE) in Chern-Simons (CS) theory in d = 2, as recently discussed in [46,47]. Consider the CS theory on a spacetime M × R. Its action is On a compact M, its Hilbert space is the space of conformal blocks of the chiral WZW model on M with gauge group G and level k [48,49]. In particular, the Hilbert space of the CS theory on M = S 2 is one-dimensional and can't be meaningfully partitioned. On the other hand, the TEE of the Abelian CS theory across a disk V ⊂ M is [4] γ CS = 1 2 log k.
This is the universal piece of the entanglement entropy S V (see eq. (46)), which is clearly nonzero for k > 1. This raises the question of what it is that we are counting.
We can answer this by looking at the canonical quantization of CS theory on a disk, M = D 2 [49].
Let us briefly review the steps in that paper. We first chose the gauge A 0 = 0, so that the action becomes where the tilde means that we are restricting to the space components. We should also keep track of the Gauss law F 12 = 0 and the residual time-independent gauge symmetry. The Gauss law can be solved on the disk withÃ =dU U −1 , ford the spatial exterior derivative, and U ∈ G. Plugging this into (57), we find where φ is the angular coordinate on ∂M. This is the chiral WZW action. At this point, the authors of [49] conclude that the CS Hilbert space on the disk is the Hilbert space of the WZW theory on the boundary.
According to the bookkeeping so far, we seem to have decided by fiat to forget about the residual time-independent gauge symmetry at the boundary of the disk, promoting it to be a global symmetry instead. Historically, the argument was that the action (55) To finish computing the entanglement entropy of the disk V, all that remains is for us to decide where the sum runs over the (infinitely many) descendant states in the conformal module of the primary field associated with the identity representation of G.
Finally, tracing out one of the tensor factors in (60) In this way we see that the prescription described above is able to correctly compute the TEE. 24 24 One somewhat unsatisfactory aspect of this calculation is that the factor of k was buried in the thermal regulator, so although we are counting edge modes of the topological medium, we can't point to " √ k microscopic entangled degrees of freedom". A related situation where we can be somewhat more precise if we quantize Chern-Simons theory on S 2 with a Wilson line ending on static non-dynamical charges. In this case, repeating the above steps, we would find eq. (60) for the analogous state corresponding to the representation assigned to the Wilson line, and a TEE differing The origin of the continuum extended Hilbert space prescription can be understood more rigorously as follows. 25 For a gauge theory on a space with a boundary, requiring the boundary part of the variation of the action to vanish usually leads to a set of allowed types of boundary conditions that we can pick from to define the theory on that space.
For instance, consider the generator of time-independent gauge transformations Q = M E · ∇λ in a Maxwell theory, with λ the gauge parameter. (The generator for time-dependent gauge transformations doesn't have a boundary term on a manifold with spatial boundaries.) Integrating by parts, we see that on a closed manifold this operator vanishes by the Gauss law, but in the presence of a boundary, where E ⊥ is the component of the electric field perpendicular to ∂M. As long as Q isn't set to If the gauge constraint isn't relaxed at the boundary, the electric fields along it will have to vanish to make Q = 0, but this is impossible because the CS action requires there to be no magnetic flux, even right by the boundary, and it is impossible to enforce both E = 0 and B = 0 at ∂M, as these variables don't commute.
This analysis shows that both Chern-Simons and Maxwell theory admit consistent boundary conditions in which A 0 | ∂M = 0 is fixed using time-dependent gauge transformations, no additional constraint is imposed on the gauge-invariant fields at τ = 0 26 , and the appropriate generator Q of from the identity representation by log dimR. This is the log dimR type edge term of the Wilson line, quantifying the maximal entanglement of the static charges. 25 We thank Ronak Soni for discussions on these points. 26 Technically, this is true if we take the subregion to be a causal diamond instead of V × R. E.g. for Maxwell theory, the boundary conditions that lead to nontrivial large gauge transformations are A0| ∂M = 0 and B = 0 on V × R. The latter constrains a gauge-invariant operator so these BC's do not implement the extended Hilbert space prescription. But on a causal diamond, the second BC becomes ρB for ρ the local Rindler radius, that vanishes on ∂V [54]. time-independent gauge transformations is nonvanishing on the boundary. Choosing these boundary conditions on ∂M and its complement allows us to construct the continuum extended Hilbert space with Q having a nontrivial action on the edge modes.

Path integral boundary conditions
In section 6, we explained how the entanglement calculation for different choices of gauge-invariant subalgebras on the lattice lead to different boundary conditions in the replica trick path integral.
Which path integral boundary conditions does the extended Hilbert space prescription correspond to, even when applied to theories with no known lattice regulator? This question turns out to have the following nice answer in a wide range of compact gauge theories: the extended Hilbert space prescription corresponds to open boundary conditions in the replica trick.
For theories that we can discretize, this fact can be understood from the perspective of the earlier sections as follows. On the lattice, the extended Hilbert space definition equals the entropy of an extended, gauge-variant operator algebra that includes all the open Wilson lines ending on the entangling surface (see [17,21] for a related discussion). This larger algebra has no center (discounting the Gauss operators in the interior), so the path integral should have no constraints.
Several instances of this general claim (including also in Chern-Simons theories that we don't know how to discretize), were discussed piecewise in the literature. We finish this section by listing them here.

The replica trick in solvable gauge theories
In the Hartle-Hawking states of d = 1 Yang-Mills theory [16,55] and d = 2 CS theory [56] that are set up by a Euclidean path integral on a half-sphere, for any choice of entangling region, suppose we assume that the conical defect in the n-replicated manifold can be smoothed out without changing the topology of the manifold. E.g. for CS theory on a spatial S 2 , suppose that the n-replicated manifold for the entanglement entropy of a region V with disk topology has the topology of a smooth S 3 . Then the replica trick becomes quite straightforward to implement. E.g. for the CS theory, where we made use of formulas relating the CS partition function on three-manifolds to matrix elements of the modular S-matrix [57], e.g., Z(S 3 ) = S 0 0 . 27 27 See [58], [59] for replica trick calculations in the dual WZW theories.
A natural question is which Lorentzian prescription this "naive replica trick" corresponds to.
In the examples that were studied in the literature, the answer is the extended Hilbert space prescription. The CS calculation (64) is one example, since both the "naive replica trick" and the extended Hilbert space prescription correctly reproduce the TEE. Also in d = 1 Yang-Mills theory, the "naive replica trick" includes the log dim R-type edge term, (52), as an empirical fact (see ref. [16] for the calculation). In cases where the gauge theory can be put on a lattice (which is clear for Yang-Mills but not necessarily Chern-Simons theory), this result is merely a manifestation of our general statement above, where the extended Hilbert space corresponds to open boundary conditions at the entangling cut that then can be contracted to a point in the continuum limit.

Conformal anomaly for a U (1) gauge theory
In a continuum QFT, the entanglement entropy is dominated by UV-sensitive divergent terms.
However, in even (odd) spacetime dimensions, the coefficient of the log-divergent (constant) term in an expansion in powers of the UV cutoff is expected to be universal, (46).
For a Maxwell theory in d = 3, the computation of the log coefficient in the entanglement entropy of a ball-shaped region was historically the subject of some dispute. This theory is conformal. In CFTs, the log coefficient of the entanglement entropy of a ball-shaped region is a (known) function of the central charges and the extrinsic curvature of the entangling boundary on symmetry grounds.
In a d = 3 CFT, this universal term is proportional to the a-anomaly [39], and equals 31 45 log(R/ ) (with R a length scale associated to the entangling region and the UV cutoff) for the U (1) theory in particular.
However, a different answer was found in the literature [63] using what is now called the CHM map [64]. A general method to compute the entropy a ball-shaped region of a CFT, that relies on just the conformal symmetry, is to map the domain of dependence of the ball-shaped region to a hyperbolic or de Sitter spacetime, and the entanglement entropy to the thermal entropy on this space [64]. One can then find the thermal entropy by integrating the energy density with dE = T dS, or by finding the partition function on the dS/hyperbolic space with a periodic time β, and using the geometric entropy formula 28 S = (1 − β∂ β ) log Z(β)| β=2π .
(65) 28 Note that in the CHM map to hyperbolic space, Z(β) refers to the partition function on H d−1 × S 1 β which is a smooth space without a conical singularity for all β. On the other hand, if we are doing the replica trick on a space where we use the geometry to provide the analytic continuation [65], as e.g. when computing the entropy in the Rindler wedge (section 8.2.3), Z(β) refers to the partition function on a manifold which is singular for β = 2π.
The hyperbolic analog of this discrepancy was clearly explained in [67] (see also refs. [68] for the analogous explanation in dS space, which requires treating a conical singularity and is similar to section 8.2.3 below, as well as [21], which showed by directly analyzing the entanglement entropy of U (1) gauge theory on the lattice that the Shannon edge term contributes the difference of 1/3).
The upshot is that the CHM prescription by itself is incomplete: in the thermal entropy problem, one also has to pick boundary conditions as the analog of the boundary conditions at the entangling surface, and different choices give different answers. In particular, if we replace the entanglement entropy problem with the problem of computing the partition function of a U (1) gauge theory in hyperbolic space, we have to pick boundary conditions at the asymptotic boundary. Computing the thermal entropy with implicitly fixed asymptotic boundary conditions in a heat kernel approach [67], one finds a eff = 16/45. However, one can account for the discrepancy by adding to the heat kernel calculation the partition function of a free scalar on S 2 , which is the amount of residual gauge symmetry on the asymptotic boundary after we fixed the time-dependent gauge symmetry. Hence, the extended Hilbert space prescription gives the correct conformal anomaly, and the difference of 1/3 comes from the Shannon edge term.
Incidentally, this discussion is an explicit example of the principle that the choice of prescription for computing the entropy affects its universal term; see section 6. 29

Kabat contact term in the geometric entropy
For d = 3 Maxwell theory, another longstanding and closely related puzzle in the literature was the following. Consider the entanglement entropy of the half-space (Rindler wedge) V in the vacuum of the Maxwell theory. If we apply the geometric entropy formula (65) to compute the entanglement entropy, where Z(β) is the partition function on a manifold with a conical singularity at the origin for β = 2π, the entropy will acquire a contact term with the conical singularity [70], basically because the the spin-1 Laplacian is δ µν + R µν . For twenty years it was an open problem if this "Kabat contact term" had a state-counting interpretation.
This was recently answered in the affirmative by Donnelly and Wall [35,36] who explicitly showed the following: Kabat's Z(β) is equal to the partition function Z bulk on the replicated space with a tubular region removed around the conical defect at ∂V and the boundary condition E ⊥ = 0 placed 29 Relatedly, in case the Maxwell theory emerges from massive but dynamical charges, one finds a third value for the log coefficient, a eff = 16 45 + 1 [24], [69]. In this case, the dynamical charges are screened with a thermal entropy in a layer of size m −1 around the entangling boundary.

there, multiplied by
where I(E ⊥ ) is the on-shell Euclidean action of the edge modes (the continuum version of I(k) from eq. (40)), and the measure is obtained by taking the continuum limit of the discrete lattice measure.
In short, we impose open boundary conditions around the defect. Here we note that we can use E ⊥ = 0 to compute the entropy in each superselection sector; the distillable entropy is independent of E ⊥ , since the theory is free. Thus the path integral factorizes into Z = Z bulk Z edge . Hence, the statistical interpretation of the Kabat contact term is that it counts the Shannon edge modes of the U (1) gauge theory.

Emergence
Until now, our discussion of the extended Hilbert space was formal, and perhaps in poor taste from the usual point of view that gauge symmetries are fictional. A physical justification for it is that if we replace the extended Hilbert space with a local UV Hilbert space in an emergent gauge theory, then (53) will hold up to a constant that is independent of the state in the IR. One situation where this is trivially true is the toric code and "globally extended Hilbert space" of section 4.
Ref. [71] argued that it is true more generally. The argument is the following. On the one hand, in a low-energy emergent gauge theory, the UV reconstructions of IR Wilson loops as composite operators are able to factorize along ∂V by assumption. On the other hand, if we think of the entanglement entropy as an entropy of the maximal UV operator algebra on the region, the explicit expansion of the density matrix, eq. (5), has zero support on UV operators that are not either the UV analogs of gauge-invariant operators or of Wilson lines ending on ∂V. So the UV-exact entanglement entropy can only differ from the entropy of the "IR gauge-invariant algebra" by a constant related to the relative sizes of the Hilbert spaces in the UV and the IR. 30

Duality
An open question is how the edge terms map under duality. Euclidean replica trick results for (Seiberg-)dual nonabelian gauge theories appear to agree [72]. This result can be decomposed into the sum of distillable entropy and the entropy coming from edge terms. Given an exact duality map for all operators and states, the algebraically defined entropies S g-inv V of dual algebras must trivially agree, but the " log dimR" edge terms are more mysterious, since they seem to depend explicitly on the gauge group. Do the " log dimR"-type edge terms dualize to edge terms nonetheless? Preliminary evidence suggests yes [73], but it would be nice to clarify this in an analysis along the lines of ref. [74] for Abelian gauge theories.

Conclusion
We have given precise path integral prescriptions for calculating various entropies associated to a given subalgebra A V . Our approach is elementary and applies to a wide array of theories, and we have shown how to connect it to various other recipes for calculating entropy in QFTs. While the results of this paper do not facilitate the computation of particular replica trick path integrals, they do show how they should be understood in any formal proof concerning properties of entanglement entropy. Several interesting questions remain open, however.
As emphasized in section 5, several different yet natural types of entanglement entropy exist for each choice of algebra on a given region. We have seen that certain special prescriptions for calculating entropy (holography and CHM-like maps in conformal theories with appropriate boundary conditions) correspond to the full entropy of the maximal algebra A V on V in a small set of theories (holographic theories with Einstein gravity duals, the Ising CFT, free theories). An immediate goal is to fill in the blanks as much as possible. For instance, what bulk quantities calculate the full entropy of a non-maximal algebra? Answers to such questions may teach us more about the bulk reconstruction of operators.
Another set of notions that we have not studied involves extending our discussion to other measures of entanglement, such as mutual information, entanglement negativity, covariant entanglement entropies, etc. In particular, it would be interesting to find the analogues of the various choices directly in the Tomita-Takesaki framework for continuum QFTs [11]. An important ingredient in any analysis of the monotonicity of entropic measures will be a careful definition of which representation of A V is appropriate for a given type of center.
Finally, we remark that it may be possible to associate entropies (or other measures of entanglement) to sets of operators that are not necessarily algebras [75]. This provides yet another direction in which our analysis of centers and boundary conditions could be generalized.