Abelian gauge theories on the lattice: $\theta$-terms and compact gauge theory with(out) monopoles

We discuss a particular lattice discretization of abelian gauge theories in arbitrary dimensions. The construction is based on gauging the center symmetry of a non-compact abelian gauge theory, which results in a Villain type action. We show that this construction has several benefits over the conventional $U(1)$ lattice gauge theory construction, such as electric-magnetic duality, natural coupling of the theory to magnetically charged matter in four dimensions, complete control over the monopoles and their charges in three dimensions and a natural $\theta$-term in two dimensions. Moreover we show that for bosonic matter our formulation can be mapped to a worldline/worldsheet representation where the complex action problem is solved. We illustrate our construction by explicit dualizations of the $CP(N\!-\!1)$ and the gauge Higgs model in $2d$ with a $\theta$ term, as well as the gauge Higgs model in $3d$ with constrained monopole charges. These models are of importance in low dimensional anti-ferromagnets. Further we perform a natural construction of the $\theta$-term in four dimensional gauge theories, and demonstrate the Witten effect which endows magnetic matter with a fractional electric charge. We extend this discussion to $PSU(N)=SU(N)/\mathbb Z_N$ non-abelian gauge theories and the construction of discrete $\theta$-terms on a cubic lattice.


Introduction
An important aspect of many quantum field theories is the fact that they can be augmented with topological θ-terms which can cause dramatic changes in the low-energy physics. The corresponding physical phenomena are nonperturbative in nature such that genuinely non-perturbative approaches are necessary to study these systems.
Such terms are well known in the context of non-abelian gauge theories, as they are the source of the famous strong CP problem. However θ-terms are also a feature of many condensed matter systems, often in the context of effective abelian gauge theories. A famous example is the spin-chain described by an effective U (1) abelian gauge theory with a θ-term. The θ-terms also appear in the context of topological insulators (see, e.g., [1][2][3]).
In higher dimensions U (1) gauge theories generically have monopoles. In fact in the conventional lattice formulations of U (1) gauge theories monopoles seem like an unavoidable curse of the formalism. Yet while many effective theories have monopoles, they do not appear as unavoidable, and their presence and/or charge is dictated by the underlying symmetry of the UV theory. For the example of (2+1)d anti-ferromagnets, a good effective theory is a U (1) gauge Higgs theory, but with monopoles of a particular charge (see [4][5][6][7][8][9]). The constraint is imposed by the presence of Z N lattice symmetries, which are mapped into the conservation of the magnetic flux modulo 2πN in the corresponding (2 + 1)d effective quantum field theory. This symmetry is sometimes referred to as the magnetic center symmetry or the topological symmetry 1 .. This requirement means that the effective theory cannot be allowed to have monopoles (i.e., space-time flux changing events) whose charge is not a multiple of N .
All of the scenarios above have interesting setups where partial answers about their long-distance properties are provided by anomaly matching [10][11][12][13][14][15]. In this work we are interested in formulating such theories on the lattice in a way amenable to numerical simulations. To achieve this, the discretization on the lattice has to be done in a way such that the symmetries of the continuum theories are implemented exactly in order to compare to the anomaly matching constraints. Standard lattice discretization often does not meet these criteria. For example the U (1) gauge theory in (1 + 1)d can 1 The terms topological is sometimes used because the symmetry is a remnant of the topological U (1) symmetry for which the current j = 1 2π F is conserved identically by the Bianchi identity, not due to the Noether theorem. However the distinction is not a physical one, and this symmetry is a usual Noether symmetry in other dual representations of the theory.
be supplemented by a θ-term, but a crucial anomaly matching ingredient is the preservation of charge-conjugation symmetry at θ = π [10,13,14]. In (2 + 1)d there are also anomaly matching conditions involving a discrete subgroup of the U (1) magnetic center (or topological) symmetry [11,14,16], the preservation of which requires monopole charges to be multiples of some integer other than unity. The conventional lattice discretization is also difficult to couple to monopole matter in a satisfactory way. It is also not clear that it enjoys an electric-magnetic duality, well known for abelian gauge theories in the continuum.
The second obstacle towards a successful lattice treatment is the fact that appropriate definition of the path-integral representation may still suffer from the complex action problem that has to be overcome before the formulation can be used in a Monte Carlo simulation. Consequently the lattice discretization of the theory has to be such that it admits a solution of the complex action problem if the theory is to be useful for simulations. This can sometimes be achieved by a transformation to dual variables which are worldlines for matter fields and worldsheets for the gauge degrees of freedom.
In this paper we revisit the problem of finding suitable lattice discretizations in order to properly define and simulate the abelian gauge theories discussed above. Our construction is based on a formulation of a non-compact abelian gauge theory, and subsequent gauging of its R center symmetry down to U (1). The procedure results, up to a gauge fixing, in a Villain action for the gauge field. As we will see, this approach will allow us to couple magnetic matter, and implement an electric-magnetic duality even in the presence of electric and magnetic matter. It also serves as a natural way to define θ-terms in both 2d and 4d lattice gauge theories.
We will also discuss the application of this construction to three model systems: The 2d gauge Higgs model with a θ-term, the 2d CP (N −1) model with a θ-term, and the 3d gauge Higgs model with a new type of term that allows to control the charge of the monopoles. For all three model systems we work out the details of the lattice formulation and discuss the corresponding dual worldline/worldsheet representation where the complex action problem is resolved 2 .
The paper is organized as follows. Sec. 2 is devoted to the general discussion about the discretization we use in all dimensions, and the motivation behind it. Here we discuss electric and magnetic matter-matter coupling, and dualization. In 4d the theory has self dual points with interesting consequences. In Sec. 3 we discuss the CP (N − 1) nonlinear sigma model and the U (1) gauge Higgs model in 2d. In Sec. 4 we focus on 3d theories with constrained magnetic charges. In Sec. 5 we discuss θ-terms in 4d, and the Witten effect associated with such terms.
2 Gauging center symmetry and lattice discretization

Compact vs. non-compact abelian gauge theory
To motivate the steps we later take for the lattice regularization, we begin with a review of compact vs. non-compact formulations of abelian gauge theories in the continuum, as well as the connection between the two. We first consider non-compact abelian gauge theory, i.e., an R-gauge theory on a d-dimensional torus T d . The minimal (Euclidean) gauge action is given by where the field strength is given by F µν = ∂ µ A ν − ∂ ν A µ and A µ is the gauge field. Making use of the differential form language 3 we may write where the field strength F is a 2-form and A is the 1-form gauge field, with d denoting the exterior derivative. We note that F is a total derivative globally, meaning that A is a globally well defined gauge field. Due to the nilpotency of the exterior derivative (d 2 = 0), the theory is invariant under the gauge symmetry It is crucial that Ω is a single valued function on the torus, i.e., the gauge transformation 0-form Ω takes values in the non-compact group R. This is in distinction to the compact formulation where the gauge transformation parameter Ω parametrizes a circle, which is only well defined mod 2π. Note that the non-compact abelian gauge theory cannot have a global flux. Indeed, A is a single valued gauge field on the torus, and the field 3 Here we use the notation of differential forms, where F = 1 2! Fµν dx µ ∧ dx ν = strength is a total derivative, such that Wilson line operators are defined as where γ is some closed curve. Unlike the compact U (1) gauge theory which we will discuss below, the non-compact gauge theory allows the charge k of the test particle to take any real (non-quantized) value. Finally, there exists a symmetry transformation where α is required to obey d α = 0. In other words, A can be shifted by a flat connection α, without changing the action. The operators charged under this symmetry are Wilson loops along a non-contractable curve γ, and not local operators as is the case with the conventional global symmetries. As a consequence the conserved charge of such a symmetry is an integral over a co-dimension 2 hypersurface. The term 1-form symmetry was used in [10,17,18] to distinguish such symmetries from the usual (0-form) global symmetries, which have local operators charged under them. We will also refer to (6) as the electric center symmetry, because the objects charged under it are electrically charged Wilson loops. Let us now switch to compact U (1) gauge theory. The action is the same as before, except that now gauge transformations are given by where ω is only defined modulo 2π (i.e., it is the parameter of the gauge group U (1)). Clearly, now the gauge invariant Wilson loops are well defined only for integer charges, i.e., test charges k are quantized in integer units. Also it can easily be seen that the electric center symmetry is now a U (1) symmetry. Furthermore, F is now a closed, but not an exact 2-form (if the theory does not contain dynamical monopoles), and the description in terms of a global gauge field A is not admissible. In particular the theory allows for a non-trivial flux through a 2-cycle Γ, As a result the operator e is a non-trivial operator in the compact gauge theory. This operator is a topological θ-term in d = 2 space-time dimensions.
In higher dimensions, the operator (10) it is a generator of the magnetic center symmetry. The operators charged under this symmetry are monopole operators which are co-dimension 3 operators (i.e., spacetime points in 3d, lines in 4d, sheets in 5d, etc.), which we label as M q (C), where C is a codimension 3 hypersurface. The defining property of the monopole operator where Γ is a surface, and (Γ, C) is the linking number of Γ and C. In other words (Γ, C) = 1 if the surface Γ wraps once around the monopole operator along C. Another way of saying this is that we require that an arbitrary surface wrapping around a monopole has q-units of flux (9). If monopoles are not dynamical, and we have a pure U (1) gauge theory, then the operator (9) is clearly a conserved quantity. This can also be seen from the Bianchi identity dF = 0 , so that the 2-form current is conserved, where is the Hodge star operator. The objects charged under this symmetry are the monopole operators, which are (d − 3)-dimensional operators, so the symmetry is a (d − 3)-form symmetry (see the discussion in [18]). Now we introduce matter fields, or more specifically electric matter 4 . We will discuss only the bosonic case, but a similar discussion holds for fermionic matter. In both cases we introduce matter fields via terms in the action of the form where D µ (k i ) = ∂ µ + ik i A µ is the covariant derivative with charge k i and the dots indicate gauge-invariant interaction terms of φ i . Clearly the fields φ i transform as charge-k i matter fields under the gauge transformation. If A is a non-compact gauge field then the charges k i can be arbitrary real numbers. However, in the case of the compact gauge field, the charges can only be integer 5 . This is because a gauge transformation The presence of matter reduces the center symmetry. In particular the center symmetry acts as A → A + α, where dα = 0. We can always write α = dρ, where ρ is not single valued on the manifold, so that the transformation may affect the Wilson loops. This means that ρ is not necessarily well defined globally. If we can now transform φ i → e −iρk i φ i in a way such that e −iρk i is well defined globally for all k i , then we can say that there exists a residual center symmetry. Indeed, let us assume that all ratios of charges are rational numbers k i /k j ∈ Q, ∀i, j. Then there exists a constant c ∈ R such that k i /c ∈ Z. Now define ρ = ω/c, where ω(x) is well defined modulo 2π, i.e., it is an angle. Then is well defined, hence the center symmetry group is Z. On the other hand, if there exist i, j, such that k i /k j ∈ R\Q, the center symmetry is completely broken by the presence of matter fields. Similar reasoning can be used to see that choosing ρ(x) = ω(x) GCD({k i }) in the compact gauge field case, where ω(x) is well defined mod 2π, results in having a Z GCD({k i }) center symmetry, where GCD({k i }) = GCD(k 1 , k 2 , . . . ) denotes the greatest common divisor of integers k 1 , k 2 , . . . . We summarize the properties of compact and non-compact gauge theories in Table 1.
In fact one can obtain the U (1) compact gauge theory from a noncompact gauge theory by gauging a discrete center symmetry. Because this is best understood in the context of lattice field theory, we will discuss this procedure upon lattice discretization. In fact it is this procedure which will allow us to formulate a lattice discretization which is useful for our goals.

The lattice discretization: Gauge fields
For our discretization we consider a cubic lattice Λ with periodic boundary conditions and denote the lattice sites as x, lattice links as l, plaquettes as p, cubes as c, hypercubes h and general r-cells as c (r) , such that x ∼ c (0) , l ∼ c (1) , p ∼ c (2) , c ∼ c (3) and h ∼ c (4) . In parts of this paper we will borrow the language of discrete differential forms and the theory of simplicial complexes adapted to cubic lattices. Furthermore, some of our notation is similar, but not identical to previous work (see, e.g., [17,[19][20][21]). We also emphasize that our construction is for cubic lattices, rather than simplicial complexes (i.e., triangulations of manifolds) like in [21]. In Appendix A we provide a summary of the details of our notation for discrete differential forms on cubic lattices. We define U (1) non-compact gauge theory coupled to scalar fields on the lattice using the gauge degrees of freedom A l ∈ R living on the links l of the lattice and matter fields φ x ∈ C living on the lattice sites. A natural gauge-kinetic action of this theory is given by where the sum is over the plaquettes p of a given orientation, which we take as positive 6 . F p is a discretization of the field strength tensor, which may be chosen as the oriented sum along the links in the boundary of p, ∂p is the set of all links that bound the plaquette p, taking into account the orientation of the links (see Appendix A). We also identify l and −l as the same link but with opposite orientation, and we have chosen a convention in which A −l = −A l . If we denote a link l by its base site x and its direction µ, and a plaquette p with its base point x and its two directions µ and ν, the above definition amounts to which is a natural discretization of the field strength tensor. As we summarize in Appendix A, Eq. (17) defines an exterior derivative operator on link fields, i.e., An analogous exterior derivative operator d can be defined for any "higherform" fields living on r-cells of the lattice, as we show in Appendix A. The action has a gauge symmetry, given by where Ω x is an arbitrary lattice field on sites, and gauge invariance follows from the identity d 2 = 0 (see Appendix A). Gauge invariant Wilson loops are given by where γ is some closed oriented contour built out of lattice links. Let us now pick an oriented co-dimension 1 hyper-surface S on the dual lattice (an example in 2d is given by the dashed line in Fig. 1). Let L S be the set of all links which intersect S, such that the intersection number between every link in L S and S is positive. Now consider the following transformation Obviously, this transformation leaves the action invariant, but may affect Wilson loops. More specifically, if the contour γ has a non-vanishing sum N γ,S of oriented intersections with S (i.e., each intersection is counted with ±1 depending on whether intersection of γ and S is right-hand or left-hand oriented), then the Wilson loop transforms as: Note, however, that we can always perform a gauge transformation to deform the hyper-surface S: For example if x 0 is the site marked with a black dot in Fig. 1, we can perform a gauge transformation defined by Ω x 0 = −α and Ω x = 0 ∀x = x 0 and transform the dashed contour in the lhs. plot of Fig. 1 into the one on the rhs. Thus it is clear that the center symmetry is a gauge tranformation if S is contractable. If S is not contractible, then the transformation corresponds to a global symmetry transformation which we call an electric center symmetry transformation. So far our center symmetry transformation was an R symmetry 7 . Now we wish to construct a theory with a U (1) center symmetry. We do this by gauging the subgroup Z of the center symmetry R. In other words we now want the transformations which correspond to shifts of A l by 2π Z to be 7 More accurately for the d-dimensional torus it is a direct product of d copies of R, one for each 1-cycle of the torus. In general the center symmetry group of the R field is the 1st cohomology group of the manifold with coefficients in R, i.e., H 1 (M, R). This is made obvious either by noting that δ is a representative of H 1 (M, R), or that the hyper-surface S is a member of the (d−1)-st homology of H d−1 (M, R), which by Poincare duality is isomorphic to H 1 (M, R). gauge transformations. Choosing the center transformation as α l = 2π n l with n l ∈ Z we find that the field strength transforms as which is clearly not an invariance of the action (16). To make this an invariance of the action we introduce a discrete gauge field B p ∈ 2π Z based on plaquettes p, and promote the field strength to Now we demand that under the transformation A l → A l + 2π n l our discrete gauge field B p transforms as Thus when using the gauged field strength F p + B p in the action, this action is gauge invariant under the transformation A l → A l + 2πn l . In fact we have obtained a compact gauge theory, with action that, in addition to the link-based fields A l , is endowed with a 2-form, Zvalued gauge field B p based on the plaquettes. In 2 dimensions we can deform the action by adding the gauge invariant term In fact this is precisely the θ-term, as we will show in a moment. For more than 2 dimensions the field B p may have more degrees of freedom. In fact the introduction of the field B p on plaquettes now allows for monopoles. We define a monopole operator as an operator on a cube c (i.e., a 3-cell) of the lattice. It is obvious that and for q = 0 we say that a monopole of charge q sits on the cube c. In d = 3 dimensions this defines a monopole operator that is a point operator on the dual lattice.
In dimensions d > 3 the monopole operator is an extended operator on the dual lattice consisting of adjacent cubes c which span a (d − 3)dimensional hypersurface on the dual lattice (i.e., it is a particle in 4d, a string in 5d, et cetera).
Therefore, upon introducing the fields B p we have changed the theory in a significant way, as we now have locally very different configurations compared to what we had in the non-compact theory, and in d > 3 there are even new states (particles, strings...) corresponding to the monopoles. All this is well known for the compact gauge theory. The conventional lore is that these monopoles are an inescapable curse of the abelian gauge theory on the lattice, but this is not true in our formalism. Indeed we can choose to gauge the center symmetry with the field B p in such a way so that its curvature is flat, i.e., by imposing the constraint that Now this means that B-flux is topologically conserved and quantized, which in turn implies the presence of a magnetic center (or topological) U (1) symmetry. Indeed the object which transforms under that symmetry is precisely the monopole operator. Let us formulate this a bit more precisely. We impose the above constraint by introducing a delta function in the partition sum, which is equivalent to introducing the following term in the action: Here the sum is over all the cubes c of the lattice, and ( A m ) c is a R-valued 3-form on the lattice Λ which lives on the cubes c. We choose to think of this 3-form as the -dual of the (d − 3)-form A m on the dual lattice (see our definition of -duality in Appendix A). When integrating ( A m ) c over the interval [−π, π] at each cube, the Boltzmann factor with the exponent (29) gives rise to Kronecker deltas that impose the constraints (28) on all cubes c. The shift ( A m ) c → ( A m ) c + δ is a symmetry of the theory as long as (dδ)c(d−3). This can be seen by a use of partial integration formula from the Appendix A. Moreover, since ( A m ) c is an angular variable taking values ( A m ) c ∈ [−π, π), there is a U (1) symmetry in the theory associated with the topological symmetry (see also a related discussion in [11,16,22]). The reason why it is useful to think of the Lagrange multiplier as the -dual of the (d − 3)-form fields A m on the dual lattice, is because A m also enjoys an abelian gauge symmetry. Indeed if we transform the action Q remains unchanged, where we used the partial integration theorem 8 (see Appendix A). We have therefore obtained another U (1) (d − 3)-form gauge field A m which naturally lives on the dual lattice. This is a magnetic gauge field. In d = 4 the U (1) gauge field is the usual 1-form gauge field, and in d = 3 it is just a scalar field on the dual lattice.
To describe the corresponding monopole operator, we must take a prod- This is the 't Hooft loop operator of a monopole in d-dimensions.

r-form U (1) abelian gauge fields in d dimensions
We briefly comment on the construction of U (1) r-form gauge fields in d dimensions. Let us start with the R-valued abelian r-form field A c (r) where r < d, i.e., a real field that lives on the r-cells of Λ. In an analogous way as before we can define the gauge field kinetic term as The theory possesses an r-form R-symmetry under the transformation As before we may lift this constraint and introduce an (r In the special case of r = 0, we have upon renaming which is just the Villain-type discretization of the xy model in d-dimensions. By imposing the constraint (dn) p the model can be made vortex free.

The lattice discretization: Matter fields with electric and magnetic charge
Now we discuss the lattice discretization of matter fields. Here we will consider only bosonic matter, although similar formulas can be derived for fermionic matter, with the caveat that some lattice formulations that do not suffer from the sign problem in bosonic formulation will suffer from it in the case of fermionic matter. We impose periodic boundary conditions for all fields on our lattice Λ of size N d−1 s × N t (with the lattice spacing again set to 1). The matter fields φ x ∈ C are assigned to the sites x ∈ Λ. For coupling the gauge fields we introduce the U (1)-valued link variables where A x,µ are the link-based gauge fields introduced before. Note that coupling the gauge fields via the U (1)-valued link variables (36) serves equally well for compact as well as for non-compact gauge fields. The discretization for the matter field action is the conventional one: the derivatives in the continuum are replaced by nearest neighbor differences and we obtain the lattice action where the superscript/subscript e stands for "electric" to emphasize that the matter carries an electric charge. We will sometimes drop this label for the electrically charged matter. We defined the mass parameter M e as M e = 2d + m 2 e , where m e is the bare mass and the additional term 2d comes from the on-site contributions in the discretized second derivatives. We will often switch between notations of labeling an r-cell by c (r) for r-cells, or by its base vertex x and directions µ 1 , µ 2 , . . . , µ r that span the r-cell. E.g., a link may either be denoted by l, by c (1) or by (x, µ), a plaquette by p, c (2) or (x, µν) et cetera (see Appendix A).
In the d = 4 case there is another kind of matter action that our gaugefield discretization allows. As we have shown, by insisting that the theory is monopole-free, we have introduced a dual-lattice, (d − 3)-form gauge field A m living on the c (d−3) -cells. These are just links of the dual latticeΛ in d = 4. So we can introduce lattice scalar (or fermion) fields which carry monopole charge in the same way as we did for the electric charge where we have introduced a dual-magnetic link variable U m x,µ = e iA m x,µ in a way analogous to (36).
The above magnetic-matter can only be formulated in d = 4 dimensions, because only in d = 4 the magnetic potential is an ordinary 1-form gauge field which can be coupled naturally to matter fields.
In d = 3 the field A m is a compact scalar field on the dual lattice. We can therefore write a potential for σ itself 9 , with the only restriction that it is periodic when σ → σ + 2π. So in general we have an action of the form If we choose m n = 0 whenever n = 0 mod N for some N ∈ Z, then there is a remaining 0-form Z N magnetic symmetry, sometimes also referred to as the topological symmetry. In all dimensions we can define electric matter. The partition sum Z lat e [U ] for the electric matter field in a background configuration U of link variables is then given by where the path integral measure D[φ] is defined as the product measure D[φ] = x∈Λ C dφ x /2π. In d = 4 we analogously can define the partition sum Z lat m for magnetic matter using S lat m instead of S lat e .
We are now ready to finalize the construction and discretize the Boltzmann factor for the gauge field which also includes the term Q[A, A m ] defined in (29) which corresponds to the θ-term for d = 2 and to the magneticgauge-field coupling in higher dimensions. This Boltzmann factor is given by where both the gauge action S G [A] and the monopole term Q[B, A m ] we consider are functionals that have the form of an "integral" over space-time, i.e., discrete sums over sites, links and plaquettes. It is useful to define the Boltzmann factor The first exponent in (41) is the quadratic term from the gauge action, while the second term corresponds to (29). Here F m c d−2 lives on d − 2-cells of the dual lattice and is identified as the (d − 2)-form gauge field strength of the (d − 3)-form magnetic gauge field A m l (see the discussion below Eq. (29)) in dimensions d > 2, while for d = 2 we can set ( F m ) x,µν = θ µν to obtain the θ-term (note however that the A m field is not defined in 2d) .
We will also often make more explicit the 2π-periodicity of B P and write In the absence of the action Q the Boltzmann factor reduces to the usual Villain form 10 [23], and for this reason we will sometimes refer to the plaquettebased integers n p ∈ Z as "Villain variables". The imaginary term in (41) has introduced a complex action problem, which in the next subsection we will solve with an exact transformation to worldlines and worldsheets as the new dynamical degrees of freedom. Let us comment on this a bit. In d > 2 in the absence of monopoles, the sign problem is easily solved by simply imposing the constraint (dB) c = 0. We can also impose a less stringent constraint that (dB) c = 0 mod q, so that we only allow charge q-monopoles. But this would not control the dynamics of the monopoles very precisely, and would not account for their short-range interactions. In fact this too may be possible to account for by just adding terms in the action which depend on powers of (dB) c . However, coupling the theory to magnetic matter allows an easy control over the monopole bare mass and the short-range interactions, as well as endowing them with fermionic or bosonic statistics by coupling the gauge field to either bosons or fermions. It also allows for formulations of theories which exhibit a nice electric-magnetic duality in four dimensions.
We complete our construction by defining the path integral measure for the non-compact gauge fields as the product measure which for later use we have normalized with factors 1/(2π), as we will often gauge-fix to set A x,µ ∈ [−π, π). The final form of the lattice discretization of the partition sum is then given by with B lat G defined in (41) and Z lat e [U ] in (40), withZ lat m [U m ] given for d = 4 by a similar expression with the action of electric matter in (37) replaced by the magnetic matter in (38). In d = 3 we can define a magnetic monopole potential as in (39), and add it to the action. Each cosine term can then be expanded in the dual variables on the sites of the dual lattice (or cubes of the original lattice), and the dual-magnetic field A m can be integrated out, imposing constraints without introducing the sign problem as long as all m n in (39) are positive. In the subsequent sections this general form of the lattice discretization with non-compact fields will be used and worked out in detail and applied to three examples.

General form of the dual representation with worldlines and worldsheets
We now come to a general discussion of the dual representation in terms of worldlines and worldsheets that solves the complex action problem introduced by the term Eq. (29). In subsequent sections we discuss various models with our discretization. There we will work out the corresponding specific dual form in more detail, but the general structure of the dualization is the same as the one here presented here. The discussion here is for theories in d dimensions which are described by the partition sum (44) with the gauge Boltzmann factor (41) and some partition function Z lat e [U ] for the matter sector, for example the one defined by (40) and (37). The details of Z lat e [U ] are actually irrelevant for the current discussion -we only assume that it is a gauge invariant function of the link variables U x,µ (for a more concrete example see, e.g., the discussion in [24,25], or also the short presentations in Appendices C and D).
The gauge invariant functions Z lat e [U ] have a simple form: To maintain gauge invariance, the link variables U l must form closed loops. The loops can be superimposed and a link can be visited several times. This gives rise to powers (U l ) k l of link variables, where the current variables (sometimes also referred to as the flux variables 11 ) k l ∈ Z assigned to the links of the lattice denote how many times a link l = (x, µ) is run through in either positive (k l > 0) or negative (k l < 0) µ-direction. A value k l = 0 indicates an empty link l.
The fact that the link variables must arrange along closed loops can be expressed as a zero divergence condition for the flux variables k x,µ : The above condition can also be expressed more concisely as (see appendix) i.e., k is a flat (or closed) (d − 1)-form on the dual lattice. The zero divergence condition ensures that the flux variables form closed loops and that the product of all link contributions (U l ) k l indeed gives a gauge invariant combination.
The matter partition sum Z e [U ] then can be written in the form where δ(n) = δ n,0 is the Kronecker delta. We defined a sum over all configurations of the flux variables k l . For magnetic matter we can analogously define Z lat m [U m ] 12 11 The term flux may be slightly confusing here because, as we shall see, they arise because of the presence of an ordinary symmetry, which results in conservation of an ordinary current. The conservation of a 1-form symmetry will give rise to plaquette-valued integers which obey conservation of 2-form currents -i.e., fluxes. 12 Hoping that it will not cause confusion, we will keep the same notation for the magnetic Each configuration comes with a weight factor W e [k], which is specific for the theory under consideration. For the example systems which we discuss later the weights W e [k] are positive such that they are suitable for Monte Carlo simulations. The configurations of the flux variables are subject to the zero-divergence conditions at all sites, which in (47) we implement as the product of Kronecker deltas. Finally the link variables are taken into account in the product of the e iA l k l at all links.
The next step is to rewrite the general gauge field Boltzmann factor B lat G [A] defined in (41). However, before we do that, let us first set the dimensionality to d = 4 and consider a theory with one flavor of electric matter (37) and one flavor of magnetic matter (38). Recall that the magnetic gauge-field featured in the Boltzmann factor (41) only as a linear factor in the action. Writing the magnetic matter (38) in terms of the world-line representation (47) we find that the total partition function with a single flavor of the magnetic matter has the form Upon integrating over A m , we find that kl = −( dn)l. Notice that this automatically satisfies the (δk) x = 0 condition, because d 2 = 0. The final form of QED with one magnetic flavor is given by In this form we have solved for all constraints, and as long as W m is a positive-definite weight we have managed to write a sign problem-free form of a theory with a single magnetic-matter field in d = 4. We have thus found a lattice description of a theory of magnetic and electric charges which is current variable k, keeping in mind that it is a current on the dual lattice. The only place where this would need to be distinguished is when both magnetic as well as electric matter is written in a worldline formulation. While possible, none of our expressions are written in this form.
completely sign problem free, at least as long as the magnetic matter is bosonic. We will soon see that such a theory can be dualized and the requirement is that either magnetic or electric matter is fermionic. We can also generalize the construction to N f flavors of magnetic matter. We have where the worldline factor W m now depends on the U (1) currents of N f different monopole flavors, and where Integrating over A m l now introduces the constraint that k Let us go back to the original gauge-theory in d dimensions in Eq. (41), and add electric matter in the form of world-lines (47). The Boltzmann factor (41) is a product over all plaquettes p. At each plaquette we have a factor which in the second line we have already expressed using the Fourier representation, i.e., the Poisson summation of Appendix B. Note that the final mixed term ( F m )F will drop out upon summation over all plaquettes and partial integration 13 . However it would behoove us to notice that we can naturally define the Poisson-dual variablesñ m as integers living on the dual lattice. So let us defineñ m p = ( n m ) p , where n m is a Z-valued (d − 2)-form of the dual lattice.
We can therefore rewrite the product of these factors over all plaquettes p in terms of the dual plaquettes, which are (d − 2)-cellsc (d−2) = p. The Boltzmann factor (41) can be rewritten as In the second line we have introduced the normalization factor defined as Now we want to integrate over the gauge field A and eliminate the phase in the above formula. We write the phase as Combining the above expression with the corresponding gauge field factor in the matter partition function (47) and integrating over the measure (43) we have The integral over all gauge field configurations gives rise to a new constraint that sits on the links: At every link l the total flux generated by the variables k l for the matter field and by the occupation numbersñ p of the plaquettes p whose link l is in their boundary (i.e., for all p ∈∂l) must vanish. The final form of the dual representation of the partition function Z lat then reads Note that if we solve the second constraint k l = −( dn) l , the first one is automatically satisfied. So for one flavor of electric matter we can simply write If we have N f flavors of electric matter then the expression is given by where In 4d we can also couple the magnetic matter in a usual fashion, by just using the action (38) for the magnetic matter (or its fermionic counterpart). We write explicitly only the electric 1-flavor case, but the generalization to more flavors is straightforward Notice that the similarity between the expression above and (51) in d = 4. This establishes a duality between U (1) lattice gauge theory with electric and magnetic matter, and the same theory where electric and magnetic sectors are mapped into each other and β → 1 (2π) 2 β (see a related discussion in [26]). This means that the lattice field theory with identical electric and magnetic matter enjoys a self duality when β = 1 2π . Furthermore we note that these theories can be formulated on the lattice without a sign problem as long as either magnetic or electric matter is bosonic. Specifically a theory with bosonic electric and magnetic matter has a self-dual point, and does not suffer from the complex-action problem.
It is perhaps useful to speculate on the phase diagram of a theory with equal number of electric and magnetic flavors of the same masses, such that at β = 1/(2π) the theory is self-dual. Since only bosonic matter is free of the sign problem in our formulation, we will restrict our attention to this case. We expect the phase diagram to be symmetric with respect to the singe change of the parameter log(2πβ) which changes its sign under the duality transformation. Further we can distinguish four phases: the photon phase where neither electric nor magnetic matter condenses, the (dual-)superconductor phase where electric (magnetic) matter condenses, and the mixed phase where both electric and magnetic matter condenses. The last alternative is a strange one, as it is not expected to appear in the continuum. This is because a superconducting phase has monopole confinement, and the dual-superconductor phase has electric confinement. The confining strings are ANO vortices for which, depending on the phase, one of the scalar field's (electric or magnetic) phase has nontrivial winding around a worldsheet of the vortex. In the continuum this requires the scalar field to go to zero in the center, endowing the vortex with tension, and confining electric (magnetic) charges when magnetic (electric) condensation occurs. This argument may break down on a finite lattice for some parameters which compress the string to the lattice-spacing size, allowing a condensation of both electric and magnetic charges.
The mixed phase would be expected when the mass parameters m 2 e and m 2 m are negative and large compared to the inverse lattice spacing squared. For less extreme, but still negative values of m 2 e,m we expect a superconductor/dual-superconductor phase transition as a function of β, which for identical parameters of electric and magnetic matter will be exactly at the point when β = 1/(2π), likely in the form of a first order phase transition. This phase transition line should end with a critical, second order phase transition to the photon phase for even larger values of m 2 e = m 2 m = m 2 .
We note that the magnetic and electric superconductor phases may be hard to distinguish in case of the single flavor unit-charge electric and magnetic matter, because there is no symmetry in the problem other than the electric-magnetic duality which is only present when β = 1/(2π). It may therefore be more precise to consider a theory with charge-2 magnetic and electric matter, so that there is a Z 2 × Z 2 electric-magnetic center symmetry. The superconductor and the dual-superconductor can then be defined as phases for which non-contractible Wilson loops for A and A m get a vev respectively, breaking either one Z 2 or the other. In fact, using arguments similar to the ones in [11], one can show that there is a mixed anomaly between the two center symmetries, and the gapped phase where both are restored is not permissible. Alternatively we can also consider a theory with n e f and n m f flavors of electric and magnetic matter respectively in such a way that they form SU (n m f ) and SU (n e f ) multiplets. The electric/magnetic condensation can then be associated with spontaneous breaking of P SU (n m f ) and P SU (n e f ) global symmetries 14 . We conclude by commenting on the theories with fermions. For fermionic matter a positive-definite form of the wordlines is not so simple to achieve, but at least in 2d some fermionic systems were shown to have positive weights W e [k] (see e.g., [27][28][29]). This implies that the wordline/worldsheet representation can be simulated with Monte Carlo techniques and for a discussion of suitable updating techniques we refer to [25]. However as we have seen, the theory only requires a world-line representation of magnetic or electric matter, but not both. This means that as long as either magnetic or electric sector is purely bosonic, the theory can be formulated in a representation that does not suffer from a sign-problem.
3 2d U (1) gauge theories with a θ-term As a first example of our approach with mixed compact/non-compact lattice fields we discuss two 2d abelian gauge models. One is the Higgs model with a θ-term, and the other one is the CP (N − 1) model with the θ term. The former can easily be generalized to arbitrary number of flavors, but to keep formulas simple we here discuss only one flavor. For a proper understanding of the model from lattice simulations it is necessary to discretize the θ-term such that it is integer-valued and has a form that is suitable for solving the complex action problem by a transformation to worldlines and worldsheets. Both these conditions are met by our discretization approach and as a consequence the lattice model at non-trivial topological angle θ = π has an exact charge conjugation symmetry.
In [30] we already numerically studied the 1-flavor gauge Higgs model. This system undergoes a spontaneous breaking of charge-conjugation symmetry as a function of the mass parameter and the transition is in the 2d Ising universality class (see also [16]), thus demonstrating the power of our approach. When switching to charge-2 matter fields or more than one flavors of matter one expects that the critical behavior changes, and currently we are exploring the corresponding physics (see [31] for our preliminary results).

The models and their duals
In the continuum the actions of the 2d models we consider are and where z j (x), j = 1, 2 ... N are N species of complex scalars with the constraint N j=1 z j (x) * z j (x) = 1 ∀x. The covariant derivative in the CP (N − 1) case contains a non-dynamical auxiliary gauge field which can be integrated out because there is no gauge-kinetic term. Both theories can also be supplemented with a topological θ-term which in the continuum is given by ( µν denotes the completely anti-symmetric tensor) The lattice discretization would involve a term iθ 2π p B p , where B p = 2πn p is B p is the Z gauge field that we used extensively. In fact the construction is identical to that in general dimensions upon replacement of ( F m ) p → θ. Indeed in the first line of Eq. (55) this replacement amounts to adding the θ-term in 2d, using the prescription above.
However, this will only work if the gauge-kinetic term is present, which is not the case in the continuum version of the CP (N − 1) model. The naive discretization of the continuum formulation without the gauge-kinetic term will yield a meaningless result, rendering a vanishing partition function for any value of θ except 0 mod 2π. This is because the 2-form variable B ∈ 2πZ, or equivalently the Villain variable n ∈ Z, decouples from the theory. Since the θ-term couples only to B, the sum over B will force the partition function to vanish, a clearly unphysical result.
The problem comes from the ill-defined topology of the lattice model. In fact without the gauge-kinetic Villain term there is no penalty for instantons at the lattice scale (so called "defects"), and the theory will not have a proper continuum limit. On the other hand the introduction of the gauge-kinetic term is harmless, and indeed necessary, as long as β is held constant as the continuum limit is performed. This can be seen in several ways. One is to observe that on dimensional grounds the gauge-kinetic term must be proportional to a 2 β d 2 xF 2 . Since β is held constant as a → 0, the term vanishes in the continuum limit, which is attained by sending J → ∞ in this model.
Another way to see that indeed the term will do no harm in the continuum limit is to consider the physics of this term. Physically the term will induce a Coulomb interaction between oppositely charged particles. Since we are in one spatial dimension, the Coulomb interaction is confining, and the typical worldline separation of oppositely charged wordlines in the vacuum will be given by a distance ∼ β in lattice units. In the limit of a vanishing gauge-kinetic term, all U (1) charged worldlines collapse to only U (1) gauge-neutral wordlines. However, if a fixed β is imposed on the lattice, this will fix the typical distance between U (1) charged wordlines to ∼ β in lattice units. Since any finite length in lattice units collapses to zero in the continuum limit, both the theory with and without kinetic term have the feature of suppressing wordlines with a U (1) charge, with the added bonus that the kinetic term smoothens out gauge-field configurations at the lattice scale. So in what follows we will always endow the CP (N − 1) model with a gauge-kinetic term, keeping in mind that its coupling will be held fixed in the continuum limit.
Upon replacement ( F m ) p → θ we find from the general dual expression (60) that the model with one flavor is given by where in the last step we solved for the constraint k l = −( dn m ) l . In the case of the CP (N − 1) model we have N flavors that generate N different U (1) currents, so we must do the replacement ( F m ) p → θ in (61) and find Note that at θ = π the models enjoy a charge-conjugation symmetry which takes n m x → −n m x − 1, as long as the matter field weights obey W e [k] = W e [−k]. All that is left is to find the expressions for W e [k] in the case of specific models. We will discuss these matter field weights for the gauge Higgs model and the CP (N − 1) model.

Worldlines for the mater field weights
Now we state the worldline expressions for the two models we study. As derived in Appendix C the worldline expression for the gauge-Higgs model is For the CP (N − 1) model we have (see Appendix D) where a x,µ ∈ N 0 in (69) and a (j) x,µ ∈ N 0 in (70) are auxiliary link variables on the original lattice.

Some comments on gauge choices and the θ-term in 2d
In this section we will discuss some specific gauge choices in 2d and make contact with more traditional definitions of the θ-term. However, before we begin let us note that the most obvious gauge in any dimension is the Villain gauge, which sets the link gauge-fields A l to be in the interval A l ∈ [−π, π) for every link l of the lattice Λ. This is simple because we can always perform a discrete 1-form gauge transformation at each link individually. Now we want to show that the θ-term we suggested in (26) really is the θ-term by connecting it with conventional formulations. To do this let us first open up the lattice 2-torus, and put it on a grid of size N t × N s . Normally, for implementing toroidal boundary conditions, we identify each vertex and link on the far-left with the corresponding vertex and link on the right, and the same with the vertices/links on the upper/lower edge of the grid. However, let us for the moment drop this condition. In this case we can gauge away the field B p completely, by just setting it equal to a total derivative B p = (dλ) p , where λ l ∈ 2πZ is a link-valued field. This is indeed possible because we can choose λ l = 0 for all links l that are horizontal and then set the vertical links to be equal to the sum of all B p on the plaquettes to the left of the link. We can then perform the gauge transformation (24) and gauge away B p completely. However, now the gauge parameter on the opposing vertical links which are to be identified are not the same, which means that the gauge fields A l are no longer the same on the opposing links, but differ by a value in 2πZ. This indeed makes sense because now the gauge invariant combination θ 2π p (F p + B p ) needs to be used as the θ-term, and since we have set all B p to zero, the contribution to the θ term must be coming from the edges of the grid. The gauge field A l can now be thought of as a U (1) gauge field, since it is not periodic on the torus, but only periodic up to a U (1) gauge transformation.
Another way to make the connection with the θ-term is to define the U (1) gauge theory in the conventional way, i.e., with the Wilson action for compact U (1) lattice gauge fields and a naive discretization of the topological charge. Using F p = (dA) p the action with the θ term reads In the conventional representation the link field A l defines a phase on links, such that it assumes values A l ∈ [−π, π). However, we can redundantly assume that A l ∈ (−∞, ∞) and in this way have an explicit gauge invariance A l → A l + 2πn l , n l ∈ Z. Now if we take β to be large, we can approximate the trigonometric functions in (71) by their expansion around the minimum of − cos(F p ). However there are infinitely many minima of the cosine, and we must sum over them. In this way we obtain (constants were dropped) where n p ∈ Z labels the minimum of the cos F p around which we expand. Since F p is a total lattice derivative, it will drop in the linear term under the sum. By identifying B p = 2πn p , we get back the action (25), with the θ-term (26). It is instructive to discuss another gauge choice in 2d where we can remove the field B p everywhere except on a single plaquette. For this we use (24c) which states that under the transformation A l → A l + λ l with λ l = 2πn l and n l ∈ Z the field B p transforms as B p → B p − (dλ) p . For defining the gauge transformation we switch to a notation where we denote sites as x = (x 1 , x 2 ), the link fields λ l as λ(x 1 , x 2 ) µ and the plaquette-based fields B p as B(x 1 , x 2 ), where we again make use of the fact that in 2d plaquettes can be labelled by their lower left corner x = (x 1 , x 2 ).
The gauge transformation proceeds in two steps. For a first gauge transformation we define The transformed field B p = B p − (dλ) p is zero everywhere except on the upper strip of the open torus. For the second step we define and obtain for the transformed field B p = B p − (dλ ) p a field that vanishes everywhere except for the plaquette at (x 1 , x 2 ) = (N s , N t ). So by a gauge transformation we were able to set the field B p to zero everywhere except on a single plaquette. The value of the field B p on this plaquette determines the θ-dependence of the system. Note, however, that this gauge choice does not specify the gauge completely. To see this, imagine an arbitrary closed contour on the links of the dual lattice. Let {l} be the set of all links l of the original lattice which intersect the contour. Now we implement a Z-valued 1-form gauge transformation on all links l ∈ {l}, i.e., A l → A l + 2πm l , where m l = m l if l, l ∈ {l}, and m l = 0 if l / ∈ {l}. This clearly does not change B p .
We remark at this point that when using this particular gauge for the mapping to dual variables, which we discuss in the next section, gives rise to the same worldline and worldsheet representation we derive below.
Finally let us make contact with the geometrical topological charge [32,33]. To do this let us also revert back to the usual formulation of the abelian gauge theories in terms of lattice U (1)-valued link fields U l = e iA l , and redundantly integrate over A l ∈ R. Clearly this just adds an infinite multiplicative factor which is a gauge symmetry artifact because the transformation A l → A l + 2π is a gauge symmetry of the theory. Note, however, that this formulation does not have an associated 1-form gauge field B p . We can define the field strength in two ways. One way is to define it as before and set F p = (dA) p . The other way we can define it through V p as V p = e ifp , in which case f p is only defined mod2π. Note that F p is clearly not invariant under the 1-form gauge symmetry, as it can shift by 2π. The definition of f p on the other hand is ambiguous and a prescription of what it means is required before it can be used to define the θ-angle. The geometrical prescription is to define the θ term using f p in such a way that it is picked to satisfy −π ≤ f p < π, and we write the θ-term as S θ = θ 2π p f p . We want to connect this definition with our definition given in terms of the B-field. To define the θ-term in that way we will need to first define an adequate B p field. We proceed as follows: we first insert unity for every plaquette p into the partition function in the form where Θ(x) is a Heaviside-like function defined as Note that we have not changed the partition function at all by this introduction. What we have done is to partition F p into individual segments in the interval −π − 2πn p ≤ F p < π − 2πn p . However, the combination 2πn p now behaves as the gauge field B p . Notice that the combination F p + 2πn p can be identified with f p . This would exactly correspond to taking the combination F p + 2πn p for the θterm, as per Lüscher's prescription [32,33]. However F p is an exact 2-form, and will drop out under the sum, rendering the Lüscher θ-term equivalent to our definition: Q = 1 2π p (F p + 2πn p ) = p n p . 4 3d U (1) gauge theory with constrained monopole charge The next system we consider is the 3d U (1) gauge theory with a general monopole charge. Recall that in the absence of monopoles -or magnetic flux changing events -the theory has an ordinary U (1) symmetry associated with magnetic flux conservation, sometimes referred to as the U (1)topological symmetry which we will refer to as U (1) T . If the monopole charge is restricted to be a multiple of some integer N , then U (1) T is reduced to Z T N . In Sec. 2.4 we already touched on how the monopole charges can be restricted.
Such a setup is interesting in several contexts. Firstly, various nonabelian gauge theories in 3d and 4d have regimes where the effective theory is an abelian gauge theory with monopoles. In some of them, on symmetry grounds, odd monopole charges are forbidden.
Secondly, (2 + 1)d spin-1/2 anti-ferromagnets may support a Valence Bond Solid (VBS) phase -a phase which can be visualized as a pairing of spins into singlet dimers -which is also effectively described by an abelian gauge Higgs theory with two scalars (see, e.g., [6][7][8][9] and references therein). The lattice symmetries of these spin systems map into the topological symmetry Z T N discussed above, which in turn restricts the monopole charges of the effective theory. The effective theory has been used to argue that the transition from the VBS phase (i.e., monopole phase) to the Néel phase (i.e., Higgs phase) is a second order quantum phase transition.
In this section we will briefly discuss how to formulate the theory with restricted monopole charges on the lattice and subsequently show how the complex action problem is overcome by switching to the worldline/worldsheet representation.

Defining the constraints for the monopole charge
We begin with the definition of the monopole charge density q(x) at a spacetime point x in the continuum, which is simply given by the divergence of the field components in the field strength tensor, We already briefly discussed monopoles on the lattice -see the discussion around Eq. (39). The prescription there can also be thought of in terms of a monopole charge density q x that corresponds to (77) by discretizing the derivative ∂ σ and implementing the prescription (24). The result is the monopole charge density q x assigned to the cubes of the lattice (i.e., the dual lattice site), which we label by the dual-sitex: Note that here we sum over µ < ν which gives rise to an extra factor of 2 and thus to a normalization with 1/2π. The definition above is consistent with our discussion around Eq. (28). The constraint for the monopole charge assigned to the cube at x is imposed with a Lagrange multiplier as We see that this is the same as setting A m x = 2πax N . We can therefore easily write the dual version by replacing A m x → 2π N ax in the expression, and converting the integral over A m x into a sum over ax. We therefore write the expression for the dual representation of the partition function by the appropriate replacement in Eq. (60). For one flavor we have We note two things: Firstly, the above construction can be seen as a limiting case of a N -clock deformation of the theory, i.e., by adding the monopole action (39) and setting m q = 0 for all q = 0 and sending m N → +∞. This potential precisely pins down the A m field to be (A m )x = 2πax/N with ax ∈ Z. Secondly, the whole construction can easily be repeated for the general monopole action defined in (39), by simply writing the cosines as sums of exponentials, and applying our standard construction. Note that if some of the coefficients m n in (39) are negative, we might face sign problems. All that is left is to write down the expression for the worldlines W [k]. In fact this expression is identical to the one in 2d. We write it out again for convenience

The θ-terms in four dimensions and the Witten effect
In this section we will discuss some θ-terms in four-dimensional gauge theories which arise naturally from our discussion in the rest of the paper. We discuss two cases: the abelian U (1) gauge theory in 4d and the SU (N )/Z N gauge theory. The basic idea is along the spirit of [17], where non-abelian SU (N )/Z N = P SU (N ) gauge theory was discussed. In [17] a deformation of such theories by a discrete θ-term was discussed in the continuum and on manifold triangulations (i.e., simplicial complexes). To our knowledge no construction of these θ-terms was presented for cubic lattices. We also are unaware of any discussion along these lines for abelian gauge theories either on triangulations or cubic lattices. We note that this section discusses cases which are manifestly suffering from the complex-action problem, and we will not try to dualize them here. This seems to be possible however, but is beyond the scope of this work and will be discussed elsewhere 15 .

The U (1) gauge theory
In d = 4, and in the absence of magnetic matter, we can write a natural θ-term, as we will discuss momentarily. However, the construction needs slightly more structure. Namely since the cubic lattice Λ has as its dual lattice also a cubic latticeΛ, there is a natural map F :Λ → Λ which performs a pure translationx → x. Furthermore this map also induces a map between fields of the dual lattice and the original lattice. We will therefore identify the two lattices as equivalent, having the same field content. This allows us to define the operator F = F • , which maps r forms on Λ to d − r forms on Λ. Note, however, that the square ( F ) 2 c (r) = F ( F ( c (r) )) = (−1) r(d−r) F 2 (c (r) ) does not leave the cell invariant, but instead translates 15 We are thankful to Bruno Le Floch for discussions on this topic it by one lattice unit in all (negative) directions. This operator should be thought of as the Hodge dual operator on the lattice, but note that, unlike the Hodge dual, it also translates the lattice. This will be important below.
Let us therefore define the fieldsB p ≡ B F ( p) andÃ l ≡ A F ( l) . We can now write a θ-term for U(1) gauge theory in 4d as When we impose the condition dB = 0 then the above term is invariant under θ → θ + 2π if dB = 0, as we will show in a moment. First, let us make sure that the θ-term is gauge invariant under the 1form gauge symmetry B p → B p + 2π(dn) p , where n l is a gauge variation, as long as (dB) c = 0, ∀c. Indeed where in the last step we used the partial integration theorem of Appendix A. Indeed the above variation vanishes identically if dB = 0. Now we show that the term is also invariant under a shift of θ → θ + 2π. This shift produces a term where we wrote B p = 2πb p with b p ∈ Z. The individual contributions from the plaquettes can indeed be odd. We must therefore show that the number of odd contributions is even. Let's assign for every odd b p an integer k p = 1 on the dual lattice, and for every even b p and integer k p = 0. Then because we have (db) c = 0, we must have that (δk)l = 0, in other words that k = 1 two-dimensional surfaces on the dual lattice are closed surfaces. The same is true forbp on the dual lattice, to whichk p = 0 ork p = 1 on the original lattice depending on whetherb p is even or odd respectively. Then each plaquette on the original lattice contributes a term The above term is −1 whenever the k = 1 surface on the dual lattice intersects thek = 1 surface on the original lattice, but is 1 otherwise. However, because k andk are related by a simple translation of the lattice to the dual lattice F : Λ →Λ, there is a doubling of the intersection points, and the product over plaquettes yields unity 16 . So far all the discussion was without monopoles. To couple monopoles we replace the constraint (dB) = 0 with a Lagrange multiplier by inserting the term (29) which can also be written as Now we are forced to define the 1-form gauge symmetry as a simultaneous transformation Note that in order for the formulas to make sense for general θ, we must take A m l ∈ R. If we restrict the interval A m l ∈ [0, 2π) then the last replacement should be thought of as a mod 2π statement.
The expression above makes it clear that in order to couple the magnetic monopoles with the above theory, one must endow them with electric charge. Note, however, that the coupling of monopoles to electric fields is unusual, as the lattice hopping term must contain a combination A m l − θ 4π Al + A F −2 (l) . This is a consequence of the fact that F = F • is not idempotent. In the continuum the two link fields Al and A F −2 (l) are infinitesimally close, and monopoles can be thought of as carrying the fractional charge θ/(2π) (two times charge θ/(4π)). This is the famous Witten effect [34]. 16 By a version of this argument one can see that the θ-term is really a cup product B 2π ∪ B 2π ∈ H 4 (M, Z). The argument uses the -operator to construct closed surfaces on the dual lattice and the original lattice as before, and shows that the contribution is the intersection number of these surfaces, which is Poincare dual to the cup-square of B ∈ H 2 (M, Z). (N ) non-abelian gauge theory, discrete θ-term and the non-abelian Witten effect

P SU
Recently there was a lot of discussion in the literature about gauging the center of the SU (N ) non-abelian gauge theory to obtain an P SU (N ) = SU (N )/Z N gauge theory (see, e.g., [35], [17], [10]). A prescription to do this is quite straightforward, and was discussed in detail in these papers.
Here we mention just the highlights. An SU (N ) gauge theory on a cubic lattice is regularized in the usual way with action where V p is the traced plaquette with U l ∈ SU (N ), and the trace is over the color index. The system has a 1-form center symmetry given by such that (dδ) p = 0 mod 2π , ∀p .
This is a 1-form Z N center symmetry. Now we can gauge the center symmetry by introducing a Z N valued plaquette field e iBp ∈ Z N , which is parametrized by a 2-form gauge field B p . The Z N center symmetry is now a gauge symmetry because under the transformation the action is invariant. Notice however that B p also has a 2-form gauge symmetry This gauge symmetry can be thought of as an equivalence of δ l ∼ δ l + 2π of the gauge transformation parameter δ l . However, it is more practical to treat δ l as a single-valued parametrization of the Z N 1-form gauge transformation, and separately treat (94) as a gauge symmetry.
Now we can define a monopole operator of charge m = 1, . . . , N − 1, as an object for which (dB) c (dB) c = 2πm/N mod 2π .
We can impose this constraint by inserting a Lagrange multiplier at every cube c a c∈Z e ia c(dB)c .
The sum over a c imposes the constraint that there are no Z N monopoles. We have redundantly summed over all integers, but the a-field has a gaugeshift symmetry al → al + 2πN zl, for zl ∈ Z. The field a can therefore be thought of as a (magnetic) Z N gauge field. Now if we want to couple (electric) matter to this theory, we must use P SU (N ) representations only. This is because the link-fields U l which are in the representation of SU (N ), but not in the representation of P SU (N ), are not gauge invariant under the center-gauge symmetry (90) and we cannot use them to couple electric matter.
We now define the discrete θ-term as We need to choose k such that B p → B p + 2πm p is a gauge symmetry. We have The above expression is obviously a 2πi multiple of an integer when k is even. We also must have invariance when we let B p → B p − (dδ) p for δ l = 0, 2π/N, . . . , 2π(N − 1)/N . We have that upon partial integration whereδl = δ F (l) . Indeed the above is clearly zero mod 2πi if we impose that there are no monopoles (i.e., m = 0 in (95)), and k is even. Now consider imposing the constraint dB = 0 mod 2π with the Lagrange multiplier term (96). To maintain the 1-form gauge invariance, we must also shift a l as We could now couple monopole matter, by coupling the lattice Z N gauge field al to a, say, scalar field on the dual lattice. If k = 0 then we can do this with the term But if k = 0, the monopole must be a color multiplet. Indeed let U l (R s ) be an SU (N ) link field in the representation R s , where s signifies the number of boxes in the Young tableau of the representation (we refer to such a representation as a s-index representation). Under the 1-form gauge symmetry transformation we have that U l (R s ) → e isδ l U l (R s ). Consider the coupling of magnetic matter in the form where φ m is a monopole field containing indices in the s 1 -index and s 2 -index representation such that s 1 = k/2 mod N and s 2 = k/2 mod N . This is the non-abelian version of the Witten effect discussed previously. Note that this also gives another insight why in this lattice regularization we could not have odd k. If this was the case we could not couple monopole operators, as we did above, as we need to be able to split the gauge-representation into two parts. Let us comment a bit more about this. The discrete θ-term labeled by k can be thought of as changing a theory where monopoles can only be charged electrically in the P SU (N ) representation (k=0) to a theory where monopoles can carry a k-index representation (modulo N ). So by setting k = N we return back to the original k = 0 case where only P SU (N ) representations are allowed. However, the construction here requires us to split the electric charge of the monopole to two different links of the lattice. For odd N this is not an issue as even k = 0, 2 . . . , 2N are enough to construct all the representations from s 1 , s 2 = k/2 mod N (i.e., if k = 2, 4, 6, N − 1, then we can make a k-index representation, while if k = N + 1, . . . , 2N − 1 we can make 1, 3, . . . N − 2 representations). However, if N is even, we only have N/2 distinct theories, but expect N distinct theories. It is an interesting question whether our construction can be modified to accommodate the missing values of the discrete θ-angle.

Summary and outlook
In this paper have discussed a particular discretization of abelian gauge theories on the lattice. The construction was motivated by reducing the center symmetry group of the non-compact abelian gauge theory from R to U (1) = R/Z, by introducing the Z-valued 2-form gauge fields living on lattice plaquettes. This construction has many benefits over the conventional U (1) gauge theory construction. Firstly, in addition to the electric matter, one can couple magnetic matter to the theory in a natural way. Secondly, because the action is Gaussian in the gauge degrees of freedom it allows for a natural electric-magnetic duality, even in the presence of matter. This enables one to formulate self-dual abelian gauge theories in four dimensions which is free from sign problems, as long as the matter is bosonic. The construction also allows a natural way to introduce θ-terms in 2d and to constrain monopole charges in 3d (and also in higher dimensions). These low dimensional examples are important effective theories for anti-ferromagnetic materials.
We also showed that this logic can be used to construct natural θ terms in 4d theories. The construction parallels that of the work [17] where a discrete θ-term was constructed for P SU (N ) = SU (N )/Z N gauge theories on the triangular lattice (i.e., simplicial complexes). We showed here that the construction goes through on cubic lattices as well. While at the moment we did not attempt to solve the complex-action problem in these cases, several avenues exist which may be useful for a numerical study of these theories. One is to notice that the θ-term can be reduced to a single 4d hypercube by a gauge transformation. It is therefore possible that an efficient algorithm can be used which will sum over the degrees of freedom at this spacetimepoint, without paying a prohibitively large cost as the infinite volume limit is taken.
Furthermore there remains a question on what can be done in 4d SU (N ) gauge theories with the conventional (i.e., continuous) θ-term. An interesting avenue to explore here would be to construct an SU (N ) lattice gauge theory on a trivial SU (N ) bundle. In [36] (see also [37]) such a theory was constructed by constraining the instantons to be multiples of a particular charge q. The theory on a trivial gauge bundle is then obtained in the limit q → ∞. But such a theory can also be constructed by viewing the gaugefields on the links as algebra-valued, not group-valued. Such theories have a Z 3-form global symmetry, under which an integral over the Chern-Simons form is charged. The symmetry transformation can be thought of as the would-be large gauge transformation which has a non-trivial winding over a closed 3-cycle, which shifts the Chern-Simons integral by discrete steps. The transformation is however not a gauge transformation on a theory formulated on a trivial SU (N ) bundle, but is a global symmetry transformation. The problem then becomes one of finding an expression for a Chern-Simons form on the lattice in terms of the algebra valued fields, such that its lattice exterior derivative gives a topological charge. A construction of this seems to have been made in [38] for usual lattice gauge theories with group-valued gauge fields. If this is possible to do for the theory on the trivial gauge bundle, then a similar construction to the one we showed here can be performed for non-abelian gauge theories, where a 4-form discrete gauge field B h living on hypercubes h is introduced to turn a Z 3-form global symmetry to a local one. The θ-term would simply be proportional to the sum h B h .

Acknowledgments:
We would like to thank Maria Anosova, Costas Bachas, Zohar Komargodski, Bruno Le Floch, and Yuya Tanizaki for the discussions and comments on the draft, especially Bruno Le Floch for his detailed reading of the draft. We would also like to thank Daniel Göschl for discussions about computational aspects of the dual representations. This work is supported by the Austrian Science Fund FWF, grant I 2886-N27. The authors would like to express a special thanks to the Mainz Institute for Theoretical Physics (MITP) for its hospitality and support during the workshop "Progress in Diagrammatic Monte Carlo Methods" which facilitated this collaboration.
In the subsequent appendices we collect several somewhat technical parts needed for the presentation and in particular for the transformation of our example systems to worldline and worldsheet representations.

A Differential forms on the lattice
In this appendix we collect our conventions for differential forms on a cubic lattice which we use for parts of our presentation. For a more general introduction based on triangulated manifolds see, e.g., [39].
We define the boundary operator ∂ acting on r-cells c (r) to be the operator that gives the oriented sum of the c (r−1) cells in the boundary of c (r) , where µ o k indicates that this index is omitted. For 0-cells, i.e., sites, we define ∂ c (0) (x) = 0. We also define the co-boundary operator∂ acting on an r-cell c (r) to be the operator that gives the oriented sum of all r + 1 cells which contain c (r) in their boundary, with the convention∂ c (d) (x) 1 ... d = 0. It is easy to show that the boundary and co-boundary operators are nilpotent, i.e., ∂ 2 = 0 and∂ 2 = 0.
The dual latticeΛ is the cubic lattice that has its sitesx at the centers of the d-cells of Λ, i.e.,x = x + 1 2 (1 +2 + ... +d). There is a natural identification of the r-cells c (r) of Λ with the (d−r)-cellsc (d−r) ofΛ. The dual operator implements this identification, taking into account also the orientation of the cells, It is easy to show that up to a sign (only for even dimensions) the square of the operator is the identity, 2 c (r) = (−1) r(d−r) c (r) , 2c(r) = (−1) r(d−r)c(r) .
Also notice that we can write the co-boundary operator aŝ or, equivalently We define an r-form A c (r) (often also referred to as r-chain), to be an object that lives on an r-cell. When we refer to a specific r-cell as c (r) (x) µ 1 µ 2 ... µr , with µ 1 < µ 2 < ... < µ r , we also use the notation to denote the r-forms and in the second part of (108) already have introduced our convention for the orientation of r-forms, i.e., A −c (r) = −A c (r) .
The star operator also induces a map from r-forms on Λ to (d − r)-forms onΛ. For an r-form on Λ we define an (d − r)-form A on the dual lattice as Also for the action of the dual operator on r-forms one finds the relation It is straightforward to show that the exterior derivative operator is nilpotent, i.e., d 2 = 0. The boundary operator δ for r-forms (often also referred to as divergence operator ) maps an r + 1-form A c (r+1) to an r form (δA) c (r) (with the convention δA c (0) = 0), Also here nilpotency is straightforward to show, i.e., δ 2 = 0. The operator δ can also be expressed as δc (r) = (−1) (d−r+1)(r+1) d c (r) or δ = d . The exterior derivative operator d and the boundary operator δ are dual to each other with respect to the l 2 norm. In other words, they obey the partial integration formula Another form we will use involves a product of forms on the lattice and the dual lattice. We have To derive the above formula we used d = δ in (112), withBc(d−r) = ( B)c(d−r). We finish by quoting the Hodge decomposition formula. For any r-form A c (r) there exist an r + 1 form B c (r+1) , an r − 1 form C c (r−1) and a harmonic (defect) r-form H c (r) , which obeys d H c (r) = δ H c (r) = 0, such that

. (115)
All gauge field Boltzmann factors we consider in this paper are products of terms b(F ) that depend on a single component F ≡ F x,µν of the field strength tensor at a fixed site x, where γ is some real number. Obviously the function b(F ) is 2π-periodic in F such that it has the Fourier representation The Fourier transform b(p) can be evaluated in closed form, Inserting this Fourier transform b(p) in (116) gives rise to the Fourier representation of the Boltzmann factor used for the mapping to dual representations.
C Worldline representation for the φ 4 field in a gauge background In this section we briefly outline the steps for obtaining the worldline representation for the partition sum Z e [U ] of the φ 4 field in a background gauge configuration U . For a detailed derivation we refer to [25].
In terms of conventional fields the partition sum Z e [U ] in a background of the group-valued link variables is defined in (40). Rewriting the sums in the action (37) that appears in the exponent of the Boltzmann factor we find (here we set V e (|φ x |) = λ|φ x | 4 and drop some of the subscripts) x,µ φ * x U x,µ φ x+μ nx,µ φ x U * x,µ φ * x+μ nx,µ n x,µ ! n x,µ ! .
In the second line we have expanded the exponentials for the nearest neighbor terms and introduced the notation {n,n} = x,µ nx,µ∈N 0 nx,µ∈N 0 for the multi-sum over the corresponding summation indices. Next we organize the powers of the fields φ x and φ x with respect to sites and subsequently switch to polar coordinates φ x = r x e iαx . The partition sum turns into (we define f x ≡ µ [n x + n x + n x−μ + n x−μ ]) where we use the measure in polar coordinates D[U ] = x 2π 0 dαx 2π ∞ 0 dr x r x . The integral over the moduli r x obviously gives rise to the integral weight I(f x ) defined in (69) and (81), while the integral over the phases α x generates the constraints µ [n x,µ + n x,µ − n x−μ,µ − n x−μ,µ ] = 0 ∀x.
The final step is to reorganize the summation variables by introducing the flux variables k x,µ ∈ Z and the auxiliary variables a x,µ ∈ N 0 , such that n x,µ − n x,µ = k x,µ and n x,µ + n x,µ = |k x,µ | + 2a x,µ .
The multiple sum {n,n} is replaced by two sums {k} = x,µ kx,µ∈Z and {a} = x,µ ax,µ∈N 0 . The constraints can be written as a product over Kronecker deltas which we here denote as δ(n) ≡ δ n,0 . They enforce the zero divergence condition ∇ · k x = µ [k x,µ − k x−μ,µ ] = 0 ∀x for the flux variables k x,µ . The partition sum thus can be written in the worldline form where all weight factors and the sum {a} over the auxiliary variables were collected in the real and positive weight W e [k], which is given in its explicit form in (69) and (81).

D Worldline representation for the CP (N − 1) field
In this appendix we provide a brief summary of the steps that lead to the worldline representation of the partition function Z e [U ] in a background configuration of the compact link variables U x,µ (see [40] for a complete derivation). The conventional partition function Z e [U ] is given by a straightforward discretization of the continuum action (65), and again the first step is to write all sums that appear in the action, i.e., the exponent of the Boltzmann factor as a product over the individual Boltzmann factors, x,µ N j=1 e Jz * x,j Ux,µ z x+μ,j e Jz x,j U * x,µ z * x,µ − n (j) x,µ ] x,µ N j=1 J n (j) x,µ + n (j) x,µ n (j) x,µ ! n (j) x,µ ! × D[ z ] x,µ N j=1 z * x,j z x+μ,j n (j) x,µ z x,j z * x+μ,j n (j) x,µ , (122) where in the second step we have again expanded the individual Boltzmann factors. Since here we have vectors z x with N components z x,j we need expansion indices n (j) x,µ ∈ N 0 and n (j) x,µ ∈ N 0 for the two nearest neighbor terms for each component j = 1, 2, ... N . The corresponding multiple sum is denoted by {n,n} = x,µ N j=1 n (j) x,µ ∈N 0 n (j) x,µ ∈N 0 . In order to solve the integral over the moments of spin components z x,j one switches to polar coordinates similar to the case of the φ 4 theory discussed in Appendix B, and sets z x,j = e iα x,j r x,j , where the moduli r x,j obey the constraint N j=1 r 2 x,j = 1 ∀x, which ensures the normalization condition N j=1 |z x,j | 2 = 1 ∀x. Thus the r x,j can be parameterized by N − 1 polar angles θ x,j , j = 2, 3, ... N (see [40] for an explicit parameterization).
As for the φ 4 case discussed in Appendix B, the integrals over the phases α x,j give rise to constraints, which here appear for each component: x,µ + n (j) x,µ − n (j) x−μ,µ − n (j) x−μ,µ ] = 0 ∀x ∀j. The integrals over the polar angles θ x,j give rise to real and positive combinatorial factors [40].
The constraints then take the form of zero divergence conditions for each flux, ∇ · k (j) x,µ − k (j) x−μ,µ ] = 0 ∀x ∀j, and we can write the worldline representation for Z e [U ] in the form All weight factors were collected in the real and positive weights W e [k], which are a sum over the configurations of the auxiliary variables a (j) x,µ . The explicit form of the W e [k] is given in (70).