Skip to content
QFT.org

Search QFT.org

Enter a word or phrase.

    You can also browse the main navigation and chapter contents.

    Encoding Gauge Fields and Gauss's Law

    A quantum register can contain states that no gauge theory allows. Even a vanishing average Gauss operator does not establish that the register is physical: positive and negative violations can cancel. Encoding, symmetry-preserving evolution, energy penalties and postselection address different parts of this problem.

    We will encode a short Schwinger chain, identify its physical states exactly, and compare these strategies in finite matrices. The example also shows why a successful symmetry check can coexist with an incorrect observable.

    Preparation: Occupation-number states, Pauli matrices and the open-chain Schwinger Hamiltonian. The flux selection on a tensor bond explains a different way of enforcing the same constraints.

    Use zero-based staggered sites, with

    ni=χi†χi,bi=1−(−1)i2,qi=ni−bi.n_i=\chi_i^\dagger\chi_i, \qquad b_i=\frac{1-(-1)^i}{2}, \qquad q_i=n_i-b_i.

    The backward link UiU_i raises the integer flux ℓi\ell_i. Our physical forward electric field is Ei=−gℓiE_i=-g\ell_i, and Gauss's law is

    Gi=ℓi−ℓi−1−qi=0.G_i=\ell_i-\ell_{i-1}-q_i=0.

    The phase convention for the matter field makes hopping positive. With open boundaries ℓ−1=ℓN−1=0\ell_{-1}=\ell_{N-1}=0,

    H=12a∑i=0N−2(χi†Uiχi+1+h.c.)+mlat∑i(−1)ini+ag22∑i=0N−2ℓi2.H=\frac{1}{2a}\sum_{i=0}^{N-2} \left(\chi_i^\dagger U_i\chi_{i+1}+\mathrm{h.c.}\right) +m_{\mathrm{lat}}\sum_i(-1)^i n_i +\frac{ag^2}{2}\sum_{i=0}^{N-2}\ell_i^2.

    Here mlatm_{\mathrm{lat}} is the bare lattice parameter. The small fixed lattice below is not a continuum extrapolation.

    Take N=2N=2, a=g=1a=g=1, mlat=1/4m_{\mathrm{lat}}=1/4, and keep link fluxes −1,0,1-1,0,1. Two matter qubits represent ni=(1−Zi)/2n_i=(1-Z_i)/2. Two additional qubits encode the link. If their bits are u,vu,v, let c=u+2vc=u+2v:

    Link code ccFlux ℓ\ellMeaning
    00−1-1retained flux
    1100retained flux
    2211retained flux
    33—unused register state

    For matrix calculations choose

    Pcode=diag⁡(1,1,1,0),ℓ=diag⁡(−1,0,1,0),P_{\mathrm{code}}=\operatorname{diag}(1,1,1,0), \qquad \ell=\operatorname{diag}(-1,0,1,0), U=∣1⟩⟨0∣+∣2⟩⟨1∣.U=\vert1\rangle\langle0\vert+\vert2\rangle\langle1\vert.

    The final zero in ℓ\ell is an arbitrary extension to an unused code; it does not introduce another zero-flux state into the physical model. Extend the Hamiltonian by zero on that unused block, and multiply its matter-only mass term by PcodeP_{\mathrm{code}}.

    Unlike an infinite rotor shift, UU is not unitary. Nevertheless,

    [ℓ,U]=U[\ell,U]=U

    holds exactly, including the edge where U∣2⟩=0U\vert2\rangle=0. Together with the matter commutators this gives [H,Gi]=0[H,G_i]=0. A hard flux cutoff can therefore preserve Gauss's law while changing the theory's dynamics. Testing symmetry and testing flux convergence are separate tasks.

    For two sites,

    G0=ℓ−n0,G1=−ℓ−n1+1.G_0=\ell-n_0, \qquad G_1=-\ell-n_1+1.

    The physical projector is

    P=Pcode 1G0=0 1G1=0.P=P_{\mathrm{code}}\,\mathbf1_{G_0=0}\,\mathbf1_{G_1=0}.

    Only two states survive. We write matter occupations in site order, n0n_0 then n1n_1:

    Stateq0,q1q_0,q_1ℓ\ell
    ∣01;0⟩\vert01;0\rangle0,00,000
    ∣10;1⟩\vert10;1\rangle1,−11,-111

    In this order the exact physical Hamiltonian is

    Hphys=(−1/41/21/23/4).H_{\mathrm{phys}}= \begin{pmatrix} -1/4&1/2\\ 1/2&3/4 \end{pmatrix}.

    The off-diagonal element moves a fermion from site 11 to site 00 while raising the link. Both Gauss operators remain zero. Direct construction in the full sixteen-state register gives this matrix and agrees with the independently constructed reduced Schwinger Hamiltonian.

    Means, squares and code validity

    Consider the normalized state

    ∣ψ⟩=∣01;−1⟩+∣01;+1⟩2.\vert\psi\rangle= \frac{\vert01;-1\rangle+\vert01;+1\rangle}{\sqrt2}.

    It has

    ⟨G0⟩=⟨G1⟩=0,⟨G02⟩=⟨G12⟩=1,⟨P⟩=0.\langle G_0\rangle=\langle G_1\rangle=0, \qquad \langle G_0^2\rangle=\langle G_1^2\rangle=1, \qquad \langle P\rangle=0.

    A mixture of the same two states gives the same diagnostic. In contrast, for a positive density matrix, tr⁡(ρGi2)=0\operatorname{tr}(\rho G_i^2)=0 implies support in the kernel of GiG_i: the positive terms cannot cancel.

    Even this test must be applied to the declared encoding. Our unused state ∣01;c=3⟩\vert01;c=3\rangle has G0=G1=0G_0=G_1=0 because of the chosen extension of ℓ\ell, but its valid-code probability is zero. One must also measure PcodeP_{\mathrm{code}}. In this register,

    1−⟨P⟩≤⟨G02+G12+1−Pcode⟩.1-\langle P\rangle \leq \left\langle G_0^2+G_1^2+1-P_{\mathrm{code}}\right\rangle.

    On a valid but unphysical basis state, the integer Gauss eigenvalues have squared sum at least one. On an unused state the last projector contributes one. This proves the inequality basis by basis. It is an upper bound on a probability, not an equality between probability and squared violation.

    All these operators are diagonal in the occupation/link basis. One computational-basis shot determines their simultaneous values. For noncommuting constraints or a different encoding, a measurement protocol would have to be supplied separately.

    What an energy penalty achieves

    If the encoded Hamiltonian preserves the physical space exactly, a penalty that vanishes there changes no physical evolution. Its purpose is to suppress specified couplings out of that space. Test

    Hκ,ϵ=H+κ(G02+G12+1−Pcode)+ϵ(U+U†),H_{\kappa,\epsilon}=H+ \kappa\left(G_0^2+G_1^2+1-P_{\mathrm{code}}\right) +\epsilon\left(U+U^\dagger\right),

    where the final term acts on the link without moving matter. It is an explicitly gauge-breaking imperfection, not a target interaction. Start from ∣01;0⟩\vert01;0\rangle and propagate the full register exactly.

    For ϵ=0\epsilon=0, every tested penalty leaves the state physical to numerical precision. With ϵ=0.1\epsilon=0.1, the retained results are:

    κ\kappaLargest sampled 1−⟨P⟩1-\langle P\ranglePostselected Z0Z_0 bias at t=2t=2
    000.155700.15570−0.0039883-0.0039883
    1/21/20.0402060.040206+0.0107355+0.0107355
    220.00388300.0038830+0.0004880+0.0004880
    880.00029150.0002915+0.0003696+0.0003696
    32320.000015530.00001553+0.0001136+0.0001136

    The maximum is taken over t=0,0.1,…,4t=0,0.1,\ldots,4; it is not a rigorous supremum over the entire trajectory. The last column compares the normalized state P∣ψ(t)⟩/⟨P⟩P\vert\psi(t)\rangle/\sqrt{\langle P\rangle} with ideal target evolution. The ideal value at t=2t=2 is 0.024318440.02431844.

    The penalty suppresses leakage but does not force the surviving state to equal the target state. Virtual excursions can change amplitudes and phases inside the physical space. Conditioning on survival can also increase the error of a particular observable, as the first two rows illustrate. Larger κ\kappa introduces a larger dynamical frequency and may increase the cost of a digital approximation; the exact-matrix comparison above does not model that cost.

    In an open chain, Gauss's law fixes every internal link from the matter occupations:

    ℓi=∑j=0i(nj−bj).\ell_i=\sum_{j=0}^{i}(n_j-b_j).

    Substitution replaces explicit links by long-range matter interactions. This is the encoding used in Muschik et al., Sec. 2.1, Eqs. (1)–(4), PDF pp. 6–7. We use the local site and occupation conventions stated above rather than silently importing the source's spin convention.

    For N=4N=4, four matter qubits suffice. Fixing both boundary fluxes to zero leaves

    Q=∑i=03ni−2=0,Q=\sum_{i=0}^{3}n_i-2=0,

    a six-dimensional sector. Internal Gauss constraints are already solved; a charge check does not diagnose independent link errors in a register where links no longer exist. Nor does it detect an incorrect mass or interaction that preserves QQ.

    The digital evolution example constructs gates that preserve charge after each completed exchange block. A matched XXXX/YYYY pair does this; its individual Pauli rotations need not. The distinction matters if noise acts between the constituent gates.

    Postselection has a statistical and a physical cost

    Let ρ\rho be the final four-qubit state, and let P0=1Q=0P_0=\mathbf1_{Q=0}. Accepting only neutral outcomes produces

    s=tr⁡(P0ρ),ρpost=P0ρP0s.s=\operatorname{tr}(P_0\rho), \qquad \rho_{\mathrm{post}}=\frac{P_0\rho P_0}{s}.

    This changes the question being measured. It estimates an expectation in the conditional state, not automatically the ideal target expectation. For diagonal observables such as Z0Z_0, charge and observable can be read in the same shot. For a general noncommuting observable, simply discarding occupation-basis outcomes would not implement its measurement.

    As a transparent noise model, apply an independent bit flip to each matter qubit with probability pp, once at the end of otherwise ideal evolution. For a neutral input, the acceptance probability is

    s=(1−p)4+4p2(1−p)2+p4.s=(1-p)^4+4p^2(1-p)^2+p^4.

    The accepted events include no flips, four flips, and four possible pairs containing one occupied and one empty site. Some accepted errors therefore remain physical. In the shared example, the initial state is Z0∣Ω⟩Z_0\vert\Omega\rangle, where ∣Ω⟩\vert\Omega\rangle is the exact finite-model ground state; the target measurement at t=2t=2 is

    μ=⟨Z0⟩=−0.38360456.\mu=\langle Z_0\rangle=-0.38360456.
    ppAcceptance ssNoisy ⟨Z0⟩\langle Z_0\ranglePostselected ⟨Z0⟩\langle Z_0\rangle
    0.0050.0050.9802490.980249−0.379769-0.379769−0.383566-0.383566
    0.020.020.9239050.923905−0.368260-0.368260−0.382966-0.382966
    0.050.050.8235380.823538−0.345244-0.345244−0.379395-0.379395

    Before selection, ⟨Q⟩=0\langle Q\rangle=0 but ⟨Q2⟩=4p(1−p)\langle Q^2\rangle=4p(1-p). After selection both vanish exactly, while the last column still differs from μ\mu.

    Penalty suppresses sampled gauge leakage, while postselected bit-flip outcomes retain a nonzero observable bias.

    Left: the explicit two-site register with ϵ=0.1\epsilon=0.1, sampled at t=0,0.1,…,4t=0,0.1,\ldots,4. Right: the four-matter-qubit final-channel example at t=2t=2. These are distinct declared imperfections; the curves do not describe a particular device.

    If MM attempts yield KK accepted shots, then K∼Binomial(M,s)K\sim\mathrm{Binomial}(M,s). Conditional on K>0K>0, the variance of the accepted Z0Z_0 sample mean is

    Var⁡(μ^post∣K>0)=(1−μpost2)E ⁣[1K | K>0].\operatorname{Var}(\widehat\mu_{\mathrm{post}}\mid K>0) =(1-\mu_{\mathrm{post}}^2) \mathbb E\!\left[\frac1K\,\middle|\,K>0\right].

    Replacing KK by MsMs is a useful large-sample approximation, not the exact formula. The probability of no accepted shot is (1−s)M(1-s)^M. Symmetry-inspired postselection and the fact that symmetry preservation need not imply smaller observable error are also discussed in Nguyen et al., Sec. II.C, PDF pp. 5–6.

    The executable example retains exact channel probabilities and exact binomial uncertainty; it does not invent a sampled device dataset. The source companions gauge_register.py and digital_dynamics.py in examples/lattice-hamiltonian/quantum-simulation/ reproduce these tables; digital_checks.py checks the independent matrix and channel identities.

    Summary

    A gauge encoding must specify both its code subspace and its physical constraints. Squared Gauss operators detect violations that their means miss. Exact constraint-preserving blocks, finite penalties and postselection have different effects: none alone establishes the accuracy of the intended dynamics or removes errors inside the physical sector.

    Exercises

    1. A truncated shift that still respects Gauss's law

    For the three retained fluxes, compute U†UU^\dagger U, UU†UU^\dagger and [U,U†][U,U^\dagger]. Verify the raising commutator and derive the physical two-state Hamiltonian. Explain why unitarity of the shift is unnecessary for this finite model's gauge invariance.

    Solution

    On the valid link subspace,

    U†U=∣−1⟩⟨−1∣+∣0⟩⟨0∣,UU†=∣0⟩⟨0∣+∣1⟩⟨1∣,U^\dagger U=\vert-1\rangle\langle-1\vert+\vert0\rangle\langle0\vert, \qquad UU^\dagger=\vert0\rangle\langle0\vert+\vert1\rangle\langle1\vert,

    so

    [U,U†]=∣1⟩⟨1∣−∣−1⟩⟨−1∣.[U,U^\dagger]=\vert1\rangle\langle1\vert- \vert-1\rangle\langle-1\vert.

    For each retained nonzero matrix element, the output flux exceeds the input by one, giving [ℓ,U]=U[\ell,U]=U. The top state is annihilated, so the same relation holds there.

    Let A=χ0†Uχ1A=\chi_0^\dagger U\chi_1. Then [ℓ,A]=A[\ell,A]=A, [n0,A]=A[n_0,A]=A and [n1,A]=−A[n_1,A]=-A. Consequently both [G0,A][G_0,A] and [G1,A][G_1,A] vanish; the adjoint has the same property. The mass and electric terms are diagonal and commute with the constraints.

    Gauss's law fixes ℓ=n0=1−n1\ell=n_0=1-n_1. The two configurations therefore have diagonal energies −m-m and m+ag2/2m+ag^2/2, with hopping element 1/(2a)1/(2a). Substituting the stated parameters gives the displayed matrix. Gauge invariance follows from the raising relation and matter charge balance, although the cutoff changes the shift algebra at its edges. The unused binary code is excluded separately.

    2. Bias after an apparently perfect charge check

    Starting with any neutral four-qubit density matrix, derive the bit-flip acceptance probability and show that, if its initial Z0Z_0 mean is μ\mu,

    μpost=μ(1−p)4−p4(1−p)4+4p2(1−p)2+p4.\mu_{\mathrm{post}}= \mu\frac{(1-p)^4-p^4}{(1-p)^4+4p^2(1-p)^2+p^4}.

    Why does postselection not restore the original state?

    Solution

    Every computational configuration in the input has two occupied and two empty sites. Returning to that number requires equal numbers of flips of occupied and empty sites. The possibilities are zero flips, four flips, or one of 2×2=42\times2=4 occupied–empty pairs. Their probabilities give ss.

    For a fixed input configuration, the no-flip event contributes its original Z0Z_0 value times (1−p)4(1-p)^4. The four-flip event contributes its negative times p4p^4. Among the four accepted two-flip events, two flip site 00 and two do not, so their Z0Z_0 contributions cancel. These are diagonal expectation values; coherences in the input do not alter the counting. Averaging over input configurations and dividing by ss proves the formula.

    The accepted pair and four-flip events generally change physical configurations and coherences. They satisfy the same charge constraint as the target, so the check cannot distinguish them. At small pp,

    s=1−4p+10p2+O(p3),μpost=μ[1−4p2+O(p3)].s=1-4p+10p^2+O(p^3), \qquad \mu_{\mathrm{post}}=\mu\left[1-4p^2+O(p^3)\right].

    The leading conditional bias is reduced from order pp to order p2p^2 in this particular model, at the cost of discarded shots. It is not eliminated.

    References

    • C. Muschik et al., “U(1) Wilson lattice gauge theories in digital quantum simulators,” New Journal of Physics 19, 103020 (2017), arXiv:1612.08653v1 (PDF). Section 2.1, PDF pp. 6–7, gives the gauge elimination and spin Hamiltonian; conventions are translated above.
    • N. H. Nguyen et al., “Digital Quantum Simulation of the Schwinger Model and Symmetry Protection with Trapped Ions,” PRX Quantum 3, 020324 (2022), arXiv:2112.14262v2 (PDF). Section II.C, PDF pp. 5–6, compares symmetry-preserving orderings, symmetry protection and postselection. The finite-register calculations on this page are separate teaching examples.

    Scrollable formula. Use Left and Right arrow keys to reveal hidden content.

    Scrollable table. Use Left and Right arrow keys to reveal hidden columns.

    Scrollable figure. Use Left and Right arrow keys to reveal hidden content.