Skip to main content

Simulating \(Z_{2}\) lattice gauge theory with the variational quantum thermalizer


The properties of strongly-coupled lattice gauge theories at finite density as well as in real time have largely eluded first-principles studies on the lattice. This is due to the failure of importance sampling for systems with a complex action. An alternative to evade the sign problem is quantum simulation. Although still in its infancy, a lot of progress has been made in devising algorithms to address these problems. In particular, recent efforts have addressed the question of how to produce thermal Gibbs states on a quantum computer. In this study, we apply a variational quantum algorithm to a low-dimensional model which has a local abelian gauge symmetry. We demonstrate how this approach can be applied to obtain information regarding the phase diagram as well as unequal-time correlation functions at non-zero temperature.

1 Introduction

Much interest has been generated recently regarding the potential of quantum computing and quantum simulation to address long-standing problems in high-energy physics [1, 2]. Traditionally, lattice gauge theory has been applied in the Euclidean formulation, where advances in computing power have led to great success in studying properties of strongly-interacting matter in thermal equilibrium. However, due to the notorious sign problem, there has been a growing interest in the Hamiltonian formulation and its application to address non-zero chemical potential and real-time dynamics. For digital quantum computers in the medium term, one problem that has arisen is how to produce thermal states.

In recent years, there has already been an explosion of progress in tackling this problem. Each approach to producing a thermal state has had to address the issue of how to produce a mixed state. This can typically be done by enlarging the system size and then entangling the ancillary system with the original system. One idea which takes this approach to create a Gibbs state via purification is the so-called thermofield double states method [3]. Another interesting method is known as active cooling [4]. This takes a general initial state, couples it to a thermal heat bath, and uses the concept of the “Maxwell demon” to obtain a thermal state at the desired temperature. Alternatively, as the Boltzmann operator is non-unitary, one can also attempt to directly approximate its action on quantum states. Using judiciously chosen initial states produced by Haar-random circuits, one can use this approximation of the Boltzmann operator to obtain Gibbs states for spin models [5] as well as gauge theories [6].

One can also study the problem of producing thermal states using variational methods. One such method, the variational quantum thermalizer (VQT), introduced in [7], serves as a natural extension of the variational quantum eigensolver (VQE) [8, 9] to the case of non-zero temperature. The latter uses the variational principle at \(T = 0\) to approximate the ground-state of a Hamiltonian Ĥ by a parametrized ansatz \(|\psi _{\boldsymbol{\xi}}\rangle \), subject to

$$\begin{aligned} E_{0} \leq \langle \psi _{{\boldsymbol{\xi}}}| \hat{H} |\psi _{{\boldsymbol{\xi}}}\rangle . \end{aligned}$$

Similarily, for the case of \(T\neq 0\), VQT addresses the problem of finding a variational approximation \(\hat{\rho}_{var}\) to the thermal state, \(\hat{\rho}_{Gibbs} \sim e^{-\beta \hat{H}}\) for inverse temperature \(\beta = 1/T\). Similar to its zero temperature analogue in Eq. (1), this problem can also be reformulated as an optimization problem for the free energy with respect to variational parameters ξ, such that

$$\begin{aligned} F \equiv \min_{{\boldsymbol{\xi}}} F({\boldsymbol{\xi}}) = \min _{{\boldsymbol{\xi}}} \bigl( \mathrm{tr}(\hat{H}\hat{\rho}_{ \boldsymbol{\xi}}) + T \mathrm{tr}(\hat{\rho}_{\boldsymbol{\xi}} \log{ \hat{\rho}_{\boldsymbol{\xi}}}) \bigr) , \end{aligned}$$

where the second term on the right-hand side involves the von Neumann entropy \(S = -\mathrm{tr}(\hat{\rho}\log{\hat{\rho}})\). As the density operator appears non-linearly in the expression for the entropy and thus is not simply determined by a quantum-mechanical expectation value, several avenues have been taken in the literature: The original formulation of VQT [7] employs classical sampling of the distribution corresponding to \(\rho _{\boldsymbol{\xi}}\) which necessitates a model ansatz. Through this ansatz, the entropy is then given classically by a closed-form expression. To prepare the latent distribution corresponding to \(\rho _{var}\) in a quantum circuit, the noise-assisted variational quantum thermalizer [10] (NAVQT) uses (simulated) parameterized depolarization gates that allow for the preparation of a mixed state, again with a closed-form, approximate expression for the entropy in terms of the noise level λ, which thus becomes a variational parameter. Of particular interest to us, due to both its simplicity and versatility, is a variant of the VQT introduced in [11], see Fig. 1. While the first two examples used a classical sampling of input states [7] or stochastic mixtures of unitary circuits [10], respectively, to create mixed quantum states, the approach in [11] utilizes intermediate projective measurements. As measurements are non-unitary operations, they act as a source of entropy, ultimately leading to a variational approximation of the thermal state.Footnote 1

Figure 1
figure 1

Schematic depiction of the hybrid approach used in the VQT algorithm. The action of the variational circuits \(VQC_{1}\) and \(VQC_{2}\) and the measurements are performed on the quantum device. The results of the measurements are then sent to the classical device, which is depicted in grey. This information allows one to construct the cost function and propose a new value for the variational parameters using one’s optimizer of choice

The subject of our study is the Hamiltonian formulation of the \(\mathbb{Z}_{2}\) lattice gauge theory (LGT) in \(1+1d\) (\(\mathbb{Z}_{2}^{1+1}\)), in which we investigate the application of the VQT to this theory. This is performed in its formulation with a gauge-redundant Hilbert space [13] and its recent, resource-efficient form derived systematically in [14, 15]. In addition, we investigate several observables of interest at both non-zero temperature T and non-zero chemical potential μ.

2 Background

2.1 Variational quantum thermalizer

As displayed in Fig. 1, starting from an \(n_{q}\)-qubit initial state \(|\psi _{0}\rangle \) with density matrix \(\rho _{0} = |\psi _{0}\rangle \langle \psi _{0} |\), we set up a concatenation of two separate variational circuits \(\mathrm{VQC}_{1}\) and \(\mathrm{VQC}_{2}\). The first variational circuit, \(\mathrm{VQC}_{1}\), creates the state \(|\psi _{\mathrm{VQC}_{1}}\rangle \), which is given by

$$\begin{aligned} |\psi _{\mathrm{VQC}_{1}}\rangle \equiv U_{1}(\boldsymbol{\theta}) |\psi _{0}\rangle = \sum_{i=0}^{2^{n_{q}} - 1} a_{i}( \boldsymbol{\theta})|i\rangle . \end{aligned}$$

An intermediate measurement in the computational basis collapses this state and statistically yields the latent density matrix

$$\begin{aligned} \rho _{1}(\boldsymbol{\theta}) = \sum_{i=0}^{2^{n_{q}} - 1} \bigl\vert a_{i}( \boldsymbol{\theta}) \bigr\vert ^{2} |i\rangle \langle i| . \end{aligned}$$

The subsequent application of the variational circuit \(\mathrm{VQC}_{2}\) transforms this into

$$\begin{aligned} \rho _{2}(\boldsymbol{\theta}, \boldsymbol{\phi}) =& U_{2}( \boldsymbol{\phi}) \rho _{1}(\boldsymbol{\theta})U^{\dagger}_{2}( \boldsymbol{\phi}) = \sum _{i=0}^{2^{n_{q}} - 1} \bigl\vert a_{i}( \boldsymbol {\theta}) \bigr\vert ^{2} U_{2}(\boldsymbol{\phi})|i\rangle \langle i|U^{ \dagger}_{2}(\boldsymbol{\phi}) \\ \equiv & \sum_{i=0}^{2^{n_{q}} - 1} p_{i}(\boldsymbol{\theta}) |\psi _{i}(\boldsymbol{\phi})\rangle \langle \psi _{i}(\boldsymbol{\phi})|, \end{aligned}$$

after which a measurement of the energy is performed. Here we defined the probabilities \(p_{i}(\boldsymbol{\theta}) \equiv |a_{i}(\boldsymbol{\theta})|^{2}\) and the states \(|\psi _{i}(\boldsymbol{\phi})\rangle \equiv U_{2}(\boldsymbol{\phi}) |i\rangle \). The von Neumann entropy is then calculated as \(S = -\sum_{i} p_{i} \log{p_{i}}\), with \(p_{i} = p_{i}(\boldsymbol{\theta}) \approx n_{i}/n_{s}\), where \(n_{i}\) represents the counts for state i in the computational basis (c.f. Equation (4)) and \(n_{s}\) represents the number of shots. By varying the parameter set \(\boldsymbol{\xi}= (\boldsymbol{\theta}, \boldsymbol{\phi})\) in an optimal way, i.e. by minimizing the free energy \(F({\boldsymbol{\xi}})\), Eq. (2), one obtains a variational approximation to the Gibbs state \(\hat{\rho}_{Gibbs} \sim e^{-\beta \hat{H}}\). The fact that the circuit is broken up into two parts is intended for noisy intermediate-scale quantum (NISQ) devices, as the depth of each variational circuit can be kept relatively shallow. This approach, however, will naturally lead to a limitation in the number of states in Eq. (5), as both the number of shots, \(n_{s}\), and the memory necessary to store the histogram describing the counts scales with the dimension of the Hilbert space of the underlying problem. We pursue this discussion in further detail in Sect. 3.2.4. In [11], the algorithm was demonstrated to reach convergence for the transverse field Heisenberg-Model in \(d = 1,2\). Applying qVQT to gauge theories will introduce the need for a gauge-invariant algorithm implementation. We show below for the case of \(\mathbb{Z}_{2}^{1+1}\) how this can be achieved.

2.2 \(\mathbb{Z}_{2}\) LGT in \(1+1d\)

This section briefly outlines our two approaches to \(\mathbb{Z}_{2}\) lattice gauge theory in the Hamiltonian formulation. In the first approach, introduced in [13] and referred to as the gauge-redundant formulation, local gauge invariance must be enforced on the states to define the physical Hilbert space. This can be achieved, for example, by introducing a penalty term as in [6]. In the second approach, used in [14] and referred to as the resource-efficient formulation, the matter states are decoupled, and the constraint imposed by Gauss’ law is built into the Hamiltonian.

2.2.1 Gauge-redundant formulation

In the so-called group basis, \(\mathbb{Z}_{2}^{1+1}\) LGT with a single flavour of staggered fermion is formally given by the Hamiltonian \(H = H_{E} + H_{GM} + H_{M} + H_{\mu}\) with

$$\begin{aligned}& H_{E} = -\epsilon \sum_{n=0}^{L-2} X_{n}, \end{aligned}$$
$$\begin{aligned}& H_{GM} = \frac{J}{2}\sum_{n}^{L-2} \bigl(\sigma ^{x}_{n} Z_{n} \sigma ^{x}_{n+1} + \sigma ^{y}_{n} Z_{n} \sigma ^{y}_{n+1} \bigr), \end{aligned}$$
$$\begin{aligned}& H_{M} = \frac{m}{2} \sum_{n=0}^{L-1} (-1)^{n} \sigma _{n}^{z}, \end{aligned}$$
$$\begin{aligned}& H_{\mu } = -\frac{\mu}{2}\sum_{n=0}^{L-1} \sigma _{n}^{z} . \end{aligned}$$

In the above equations, the fermionic creation and annihilation operators have been replaced by Pauli matrices living at the sites of the lattice via the usual Jordan-Wigner transformation. Here we have adopted the familiar convention of denoting Pauli operators acting on the link Hilbert space of the gauge bosons by \(\{X,Y,Z\}\), and those acting on the fermionic matter space by \(\{\sigma ^{x}, \sigma ^{y}, \sigma ^{z}\}\). The occurrence of both gauge-bosonic and fermionic degrees of freedom implies a gauge redundant Hilbert space. With our choice of basis, a gauge transformation at site n is defined by [16]

$$\begin{aligned} {\Theta}_{g}(n) =& X_{n}X_{n-1} e^{i\pi [\psi ^{\dagger}_{n} \psi _{n} + \frac{1}{2}((-1)^{n}-1) ]}, \\ =& (-1)^{n+1}X_{n}X_{n-1} \sigma _{n}^{z} . \end{aligned}$$

We illustrate a gauge-invariant state \(|\psi \rangle \) of the lattice system in Fig. 2, where the fermionic states are in the computational basis, and the gauge bosons are in the X-eigenbasis, \(X|\pm\rangle = \pm |\pm\rangle \). This subspace of the total Hilbert space is needed to compute physical observables. The particular state shown is known as the strong coupling vacuum state of the theory for \(m >0\) and \(\mu = 0\).

Figure 2
figure 2

Depiction of a gauge-invariant state for \(Z_{2}^{1+1}\) LGT with staggered fermions on a lattice with linear extent L. The links are all in the eigenstate of X with eigenvalue +1, the even sites are empty (fermions) or in state \(|1\rangle =|\mathrm{down}\rangle \) in our convention, and the odd sites are filled (anti-fermions), denoted by the state \(|0\rangle = |\mathrm{up}\rangle \). We note here that the links at the boundary are set to unity

2.2.2 Resource-efficient formulation

It turns out that one can eliminate the fermionic matter fields while simultaneously removing the Hilbert space redundancy of the theory. This is accomplished in a two-step process whereby the fermions are first mapped to hard-core bosons by a unitary transformation and are then decoupled from the gauge bosons by a second unitary transformation [14, 15]. This method is, in fact, a very powerful formalism which can also be applied in arbitrary dimensions to continuous gauge groups such as \(SU(N)\) and \(U(N)\) [17]. For \(\mathbb{Z}_{2}\) LGT in \(1+1\) dimensions, the Hamiltonian in this formulation is as follows

$$\begin{aligned}& H^{(2)}_{E} = - \sum _{n=0}^{L-2} \biggl( \epsilon Z_{n} + \frac{J}{2}Y_{n} \biggr), \end{aligned}$$
$$\begin{aligned}& \begin{aligned}[b] H^{(2)}_{GM} &= -\frac{J}{2}\sum _{n = 1}^{L-3} Z_{n-1} Y_{n} Z_{n+1} \\ &\quad {} -\frac{J}{2} (Y_{0} Z_{1} + Z_{L-3}Y_{L-2} ), \end{aligned} \end{aligned}$$
$$\begin{aligned}& H^{(2)}_{M} = -\frac{m}{2} \sum _{n=1}^{L-1} Z_{n-1}Z_{n} - \frac{m}{2} (Z_{0} + Z_{L-2} ), \end{aligned}$$
$$\begin{aligned}& \begin{aligned}[b] H^{(2)}_{\mu } &= \frac{\mu}{2}\sum _{n=1}^{L-2} \varepsilon _{n} Z_{n-1}Z_{n} \\ &\quad {} +\frac{\mu}{2} (Z_{0} +\varepsilon _{L-1} Z_{L-2} ) . \end{aligned} \end{aligned}$$

One notices that the Hamiltonian obtained by performing the above-mentioned transformations only vaguely resembles the original \(1+1\)-dimensional Kogut-Susskind Hamiltonian.Footnote 2 For example, the gauge-matter interaction in Eq. (12) couples sets of three adjacent links. Similarly, for the term originating from the staggered mass in Eq. (13), one obtains a coupling between two adjacent links. With this resource-efficient formulation, one can simulate larger systems without worrying about the elements of the variational circuit preserving gauge invariance.

3 Implementation and results

The \(\mathbb{Z}_{2}\) lattice gauge theory has a discrete chiral symmetry in the massless limit [18] which can break spontaneously at low T. At large temperatures as well as at large values of the chemical potential, this symmetry is restored. To benchmark our approximation to the Gibbs state, we calculate the chiral condensate, \(\langle \bar{\psi }\psi \rangle \), which is sensitive to restoring chiral symmetry. As this is a local, time-independent observable, one would like a second, time-dependent observable that measures correlations in the system. We chose to study the unequal-time density-density correlator, which provides information about charge dynamics in the system.

3.1 Gauge redundant formulation

In this formulation of the theory, gauge invariance has to be considered explicitly. Apart from the gauge-invariant initial state (c.f. Figure 2), this not only applies to the variational circuits \(\mathrm{VQC_{1/2}}\) but also to the intermediate measurement during which qubits representing gauge bosons will be measured in the X-eigenbasis, whereas fermionic qubits are measured in the computational basis. A schematic depiction of the circuit illustrating the above-mentioned components is shown in Fig. 1. For \(\mathrm{VQC_{1/2}}\), a gauge-invariant gate set can be constructed by following the general considerations laid out in [19]. This consists of simply taking the Pauli strings in our Hamiltonian Eq. (6) as elementary building blocks. Due to the simplicity of the model, the gate set will hence decompose into parameter-dependent single qubit \(R_{x}\) and \(R_{z}\) gates, together with a 3-qubit gate \(\sim e^{i\sigma ^{x} Z \sigma ^{x} + i\sigma ^{y}Z\sigma ^{y}}\) stemming from the hopping term in Eq. (6). Following the procedure presented in [20], the latter can be easily decomposed into single-qubit and entangling gates.Footnote 3 In Fig. 3, one observes the resulting circuit layer consisting of a sublayer of single-qubit gates along with a sublayer of the decomposed multi-qubit gate for a three-qubit system where the \(\Delta _{i}\) represent generic variational parameters. A schematic of the variational circuit layer is also shown in Fig. 4 (left). Several such layers then yield the \(\mathrm{VQC}_{i}\), with parameter sets θ and ϕ for \(i =1,2\), respectively (Eq. (5)). In practice, we find that using \(N/2\) layers per variational circuit \(\mathrm{VQC}_{i}\) yields a good variational approximation for a theory with N matter sites.

Figure 3
figure 3

Depiction of a single-layer of a variational quantum circuit in the gauge-redundant formulation. The layer is composed of one sublayer of single-qubit rotation gates and a sublayer containing the decomposed three-qubit gate which is formed from the gauge-matter term in the gauge-redundant formulation. All relevant gates contain variational parameters \(\Delta _{i}\)

Figure 4
figure 4

Schematic of the variational ansatz circuit for the gauge-redundant formulation (left) and the resource efficient formulation (right). Shown are the single qubit sublayer as well as sublayers resulting from staggering of gates based on gauge-matter (GM) and mass terms (M) of the respective Hamiltonians. Note that while in the gauge-redundant formulation (left) alternating qubits encode fermions and gauge-boson, respectively, qubits in the resource efficient formulation (right) are purely “bosonic”

With the composition of the variational quantum circuits at hand, we still need to define the figures of merit quantifying the quality of the optimization step depicted in the classical block of Fig. 1. In addition to the relative difference in free energy, \(\Delta F = F_{\rho _{var}}/F_{\rho _{\text{Gibbs}}}-1\), we take the fidelity [22]

$$\begin{aligned} F_{2}(\rho _{1},\rho _{2}) = ( \operatorname{Tr}\sqrt{\sqrt{\rho _{1}} \rho _{2} \sqrt{\rho _{2}}} )^{2}, \end{aligned}$$

as a distance measure between two quantum states represented by \(\rho _{1}\) and \(\rho _{2}\), respectively. In Fig. 5, one sees the results of the classically simulated variational optimization process for our gauge-redundant theory for \(N = 4\) matter sites corresponding to \(n_{q} = 7\) qubits using open boundary conditions with a two-layer ansatz in the \(\mathrm{VQC}_{i}\). Simulating at \(a\epsilon = a m = 0.5\), \(a\mu = 0\) and a number of shots \(n_{s} = 10^{4}\) for varying \(T/m\), chiral symmetry is explicitly broken in our model. On the left, we plot the performance measures defined above, where each point corresponds to the minimum in free energy over up to 102 samples, resulting in optimal parameter sets \((\boldsymbol{\theta}^{*},\boldsymbol{\phi}^{*})\). The quality of the approximation by the variational ansatz decreases slightly in the crossover region until, with increasing \(T/m\), the entropic term in Eq. (2) becomes dominant, yielding a high-fidelity solution. On the right, the chiral condensate \(\langle \bar{\psi}\psi \rangle \) evaluated using \(\rho _{2}(\boldsymbol{\theta}^{*},\boldsymbol{\phi}^{*})\) is shown as a function of \(T/m\). The displayed errors were obtained from the variation of the observable over solutions corresponding to the 20th percentile of the free energy distribution for each set of samples.

Figure 5
figure 5

(Left) The fidelity of the approximation to the Gibbs state produced by VQT on the classical simulator (\(n_{s} = 10^{4}\)) and ΔF as a function of \(T/m\) at \(\mu =0\) on a system with \(N=4\) matter sites, corresponding to \(n_{q} = 7\) qubits in the gauge-redundant formulation. (Right) The chiral condensate \(\langle \bar{\psi}\psi \rangle \) calculated on the same data sets where for clarity the exact result has also been included

3.2 Resource efficient formulation

Turning now to the Hamiltonian Eqs. (11) with matter degrees of freedom eliminated and gauge invariance built-in, the choice of variational ansatz circuits for the \(\mathrm{VQC}_{i}\) is in principle unrestricted, leaving us with the freedom to use, e.g. hardware efficient circuits such as EfficientSU2 from qiskit’s standard circuit library [23]. As for the set of physical gates, by inspecting the Hamiltonian one sees that the single and multi-qubit terms can be employed as elementary ansätze. As an example, the decomposed three-qubit term is depicted in Fig. 6. An alternation of a single-qubit sublayer containing \(R_{x}\) and \(R_{y}\) gates, followed by a staggered multi-qubit sublayer, will hence serve as our variational ansatz for both \(\mathrm{VQC}_{1/2}\), where the circuit schematic is shown in Fig. 4 (right). Using the resource-efficient formulation, for the system size studied in this work (\(N=8\) matter sites), we found that already one such alternation per \(\mathrm{VQC}_{i}\) yielded acceptable results in terms of the above defined figures of merit, Eq. (15).

Figure 6
figure 6

The decomposed three-qubit gate corresponding to the three boson coupling in Eq. (11)

This should be contrasted by a comparison of the gate depths of our variational ansätze for both, the gauge-redundant formulation and the resource efficient formulation. In Table 1 we list the gate depth of the corresponding sublayers displayed in Fig. 4. Even though our choice of ansatz for the resource efficient formulation leads to a higher gate depth, we expect this to be compensated by the higher number of layers per \({\mathrm{VQC}}_{i}\) required by the gauge-redundant formulation.

Table 1 Gate depth per sublayer in terms of maximal number of operations on a single qubit, subject to the unitaries whose schematic is given in Fig. 4. Note that the multi-qubit sublayers contain staggered multi-qubit gates of the types given in Fig. 3 and Fig. 6

3.2.1 Observables at \(T,\mu > 0\)

As was done in the gauge-redundant formulation, we quantitatively investigate the quality of our variational approximation to the Gibbs state and calculate the chiral condensate. This has been done as a function of temperature \(T/m\) and varying chemical potential \(\mu /m\) at \(\epsilon /m = 0.5\) with \(n_{s} = 10^{4}\). Owing to the resource efficiency of the formulation, \(n_{q} = 7\) classically simulated qubits now correspond to twice the system size (\(N = 8\)) when compared to the gauge-redundant formulation. While simulations for varying \(T/m\) across the cross-over region, Fig. 7, show good agreement between exact and simulated results, entering the transition region for fixed temperature and increasing \(\mu /m\), we see that our algorithm has difficulty to match the exact result. One notes that as we lower the temperature, the transition becomes more and more discontinuous. In Fig. 8 and Fig. 9, this observation is confirmed by our estimation of the statistical error which measures the variation of \(\langle \bar{\psi}\psi \rangle \) over the top 20th percentile of variational solutions. We expect an increase in performance can be achieved here by changing from the gradient-free optimization algorithm (COBYLA) used in this study to gradient-based methods. This is an approach which we have not pursued further.

Figure 7
figure 7

(Left) The fidelity of the approximation to the Gibbs state produced by VQT on the classical simulator (\(n_{s} = 10^{4}\)) and Δf as a function of \(T/m\) for \(\mu = 0\) on a system with \(N=8\) matter sites, corresponding to \(n_{q} = 7\) qubits in the resource-efficient formulation. (Right) The chiral condensate \(\langle \bar{\psi}\psi \rangle \) calculated on the same data sets

Figure 8
figure 8

(Left) The fidelity of the approximation to the Gibbs state produced by VQT on the classical simulator (\(n_{s} = 10^{4}\)) and Δf as a function of \(\mu /m\) for \(T/m = 0.8\) on a system with \(N=8\) matter sites, corresponding to \(n_{q} = 7\) qubits in the resource-efficient formulation.(Right) The chiral condensate \(\langle \bar{\psi}\psi \rangle \) calculated on the same data sets

Figure 9
figure 9

(Left) The fidelity of the approximation to the Gibbs state produced by VQT on the classical simulator (\(n_{s} = 10^{4}\)) and Δf as a function of \(\mu /m\) for \(T/m = 0.4\) on a system with \(N=8\) matter sites, corresponding to \(n_{q} = 7\) qubits in the resource-efficient formulation. (Right) The chiral condensate \(\langle \bar{\psi}\psi \rangle \) calculated on the same data sets

3.2.2 Thermal unequal-time correlators

In addition to the study of quantum systems at finite fermion density, quantum simulation in the NISQ era and beyond will allow the investigation of real-time observables. These include thermal unequal-time correlation functions. In general, an unequal-time correlator of two operators takes the form

$$\begin{aligned} C_{AB}(t) \equiv \bigl\langle e^{iHt}Ae^{-iHt}B \bigr\rangle = \bigl\langle A(t)B \bigr\rangle , \end{aligned}$$

where H is the Hamiltonian of the system and \(A(t)\) is the operator in the Heisenberg picture. In this study, the expectation value in (16) will be taken with respect to our variational density matrix, \(\rho _{2}(\boldsymbol{\theta}^{*},\boldsymbol{\phi}^{*})\).

The question of how one measures such a correlation function naturally arises when studying lattice gauge theories. Fortunately, a general procedure has already been devised to measure the correlation function of two arbitrary unitary operators A and B on a universal quantum computer [24, 25]. This procedure is commonly referred to as Ramsey interferometry and only involves adding a single ancillary qubit entangled with our system’s original \(n_{q}\) qubits. The time evolution can be performed with a Trotterization of the time evolution operator whose circuit depth increases linearly with the number of steps. A variational approach also exists to obtain the time evolution of an arbitrary quantum state with a fixed circuit depth [15]. In this work, a simple Trotterization has been used.

In Fig. 10 we show the unequal-time thermal density-density correlation function \(\langle O_{0}(0) O_{i}(t)\rangle \) at \(T/m = 1\) for \(N = 8\), where \(O_{i} \equiv \varepsilon _{i}Z_{i-1}\otimes Z_{i}\). The different data sets represent different spatial separations \(i = 1,\ldots ,5\) of the density operator on the lattice plotted as a function of time with a remarkable agreement between simulated and exact results for the time range displayed. In these classical simulations of our variational quantum circuit, both \(\mathrm{VQC}_{1}\) and \(\mathrm{VQC}_{2}\) contain two layers of alternating single and multi-qubit sublayers. For simplicity’s sake, we have assumed infinite statistics in the computation of \(\rho _{2}(\boldsymbol{\theta}^{*},\boldsymbol{\phi}^{*})\), hence excluding shot noise. One is ultimately interested in obtaining transport coefficients from real-time dynamics. As the latter involves time integrals of unequal-time correlators, it remains to be seen if such simulations yield sufficient accuracy.

Figure 10
figure 10

The unequal-time thermal correlation function \(\langle O_{0}(0) O_{i}(t)\rangle \) for varying distance \(i = 1,\ldots ,5\) (shifted in magnitude for displaying purposes) at \(T/m = 1\) for \(N = 8\), where \(O_{i} = \varepsilon _{i}Z_{i-1}\otimes Z_{i}\), i.e. the relevant term of the number operator. The solid lines are the exact solutions while the crosses represent the values calculated with the Trotterized time-evolution operator (\(a\delta _{t} = 0.2\)) for the variatonal Gibbs state \(\rho _{var}\) produced with infinite statistics

3.2.3 q̄q meson screening

It is useful to check that our algorithm correctly reproduces physical observables, which are more easily accessible by standard Euclidean methods. As an example, we consider the thermal expectation value of a gauge-invariant q̄q meson operator, i.e. a quark anti-quark pair connected by a flux tube [14, 26],

$$\begin{aligned} M_{i} \equiv \psi ^{\dagger}_{0} \Biggl( \prod^{i-1}_{k=0} U_{k} \Biggr) \psi _{i}, \end{aligned}$$

where the links \(U_{k}\) are taken in the electric basis, \(U_{k} = X_{k}\), used to derive the resource-efficient expression of the observable [14]. As demonstrated recently with the help of DMRG [27], at \(T=0\), this equal-time two-point function shows an exponential decay for any \(\epsilon > 0\) (see also [28, 29] for recent theoretical work on confinement in \(\mathbb{Z}_{2}\) and [30] for its investigation on quantum hardware). The exponents of a spatial decay are screening masses, which in this case give the energy of the flux tube and its excitations, whose linear increase with separation indicates confinement. We expect this behaviour to persist for small temperatures until the onset of string breaking, when the flux gets increasingly screened and its energy no longer grows with separation.

Using the same variational setup as described in Sect. 3.2.2, Fig. 11 shows \(|\langle M_{i}\rangle |\) at \(T/m = 0.5\) (left) and \(T/m = 1.25\) (right), respectively. Whereas the low-temperature correlator exhibits marked similarities to the zero-temperature decay (c.f. [27]), which is accurately captured by the variational Gibbs state, at higher temperatures, the algorithm fails to reproduce the exact correlator accurately, possibly due to the low complexity of the ansatz circuits in our simulations (two layers of variational gates for the \(\mathrm{VQC}_{i}\)). While this precludes a detailed picture of the long distance behavior with increasing temperature, our variational calculation does exhibit two qualitative features known from other techniques: i) the screening masses generally grow with temperature as expected (faster decay); ii) the difference between high and low temperature is small at short distances, but pronounced at large distances, because of the flux screening.

Figure 11
figure 11

The absolute value of the meson string operator as a function of the string length (lattice units) for \(N = 8\). The results for two temperatures, \(T/m = 0.5\) (left) and \(T/m = 1.25\) (right) are plotted using both the variational Gibbs state (with infinite statistics) and the exact density matrix. One notices that at larger temperatures the current variational ansätze give states which deviate from the exact result

3.2.4 Resources and entropy estimation

We now turn to the question of resources in runtime and classical memory. Considering the limited system sizes currently studied in the NISQ era, estimating the von Neumann entropy \(S = -\sum_{i} p_{i} \log{p_{i}}\) from the intermediate measurements via \(p_{i} \approx n_{i}/n_{s}\) is a viable approach. Applying the algorithm with the information flow depicted in Fig. 1 for realistic system sizes will necessarily involve a certain level of approximation. This stems from the fact that the number of \(p_{i}\)’s grows with the dimension of the Hilbert space, \(2^{n_{q}}\). One possible way proposed in [11], is the partitioning of the full \(n_{q}\) qubit system into \(n_{q}/n_{ss}\) independent subsystems of size \(n_{ss}\) in the entropic part of the algorithm (\(\mathrm{VQC}_{1}\)) that prepares the latent distribution \(\rho _{1}(\boldsymbol{\theta})\). In the version of the algorithm which employs a classical estimation of the entropy [7] this corresponds to a particular choice of the latent distribution known as factorized latent space models. It remains to be seen if such an approximation is a valid approach for gauge theories where thermalization and subsystem entanglement are non-trivially connected [31].

There are, however, alternative methods that can be used to estimate the entropy efficiently. For example, it turns out that an evaluation of the Taylor series approximation to the entropy can be useful [32], i.e.

$$ S_{K}(\rho _{1}) = \sum _{n=0}^{K} C_{n}\mathrm{tr}\bigl(\rho ^{n+1}_{1}( \theta )\bigr) , $$


$$ C_{0}=\sum_{k=1}^{K} \frac{1}{k},\qquad C_{j}=\sum_{k=j}^{K} \binom{k}{j} \frac{(-1)^{j}}{k},\qquad C_{K}=\frac{(-1)^{K}}{K} . $$

Using the e.g. qubit-efficient, repeated SWAP-test to estimate the trace of various powers of the latent density matrix, \(\mathrm{tr}(\rho ^{n+1}_{1}(\theta ))\), this method requires the addition of N qubits in the resource efficient formulation. It should be noted that the corresponding circuit depth for the largest order \(\mathrm{tr}(\rho ^{K+1}_{1}(\theta ))\) is then given by \(K(\frac{N}{2} d_{L} + N)\), not counting the reset, and thus still scales polynomially in N for a system size of N matter sites, assuming conservatively \(N/2\) layers for \(\mathrm{VQC}_{1}\) with layer depth \(d_{L}\), given in Table 1. The results of this approach for the simple gauge theory used in this study are displayed in Fig. 12. For temperatures up to \(T/m\sim 1\), only a few orders are needed to give reasonable values of the fidelity and we attribute the change in ordering in the limit \(T \rightarrow 0\) to the accuracy of the minimum found by the gradient-free optimization algorithm.

Figure 12
figure 12

The fidelity of the Gibbs state produced using the Taylor-series approximated von Neumann entropy as a function of \(T/m\) at \(a\mu = 0\) for various truncation orders K on a system with \(N = 8\) matter sites. One sees that for low temperatures this approximation works well

4 Conclusion

We have explored the use of variational quantum algorithms in producing thermal states. These approaches were applied to \(\mathbb{Z}_{2}\) lattice gauge theory in \(1+1\) dimensions using two independent formulations, and several observables of interest were computed. We find this variant of the VQT a suitable algorithm to approximate the thermal states of quantum systems in the NISQ era as estimating the entropy of larger systems will necessarily lead to larger approximation errors due to limited statistics. A particular aspect we have left for future work is the performance of intermediate measurements for mixed-state creation on actual quantum devices compared to the usual approach of entangling ancillary systems followed by a terminal measurement.

A further possible extension of our work is the formulation of the VQT to study non-Abelian gauge theories at finite temperatures. As the latter will generally come with a gauge-redundant Hilbert space, even after reformulating in a resource-efficient manner, this amounts to respecting gauge invariance or equivalent local constraints throughout the variational quantum circuit.

Data availability

Simulation data are available from the corresponding author upon reasonable request.


  1. For a version of this algorithm using entanglement of the system with \(n_{q}\) ancillary qubits followed by a projective measurement on the latter, see [12].

  2. With the additional note that the starting point to derive the above Hamiltonian in ref. [14] is actually a Kogut-Susskind Hamiltonian in the electric basis of \(\mathbb{Z}_{2}\) LGT.

  3. We would also like to point to ref. [21] which introduces a shearing approach for gauge-invariant Trotterization of abelian LGTs.



Quantum Chromodynamics


Quantum Electrodynamics


  1. Bañuls MC et al.. Simulating lattice gauge theories within quantum technologies. Eur Phys J D. 2020;74(8):165. arXiv:1911.00003.

    Article  ADS  CAS  Google Scholar 

  2. Bauer CW et al.. Quantum simulation for high-energy physics. PRX Quantum. 2023;4(2):027001. arXiv:2204.03381.

    Article  ADS  Google Scholar 

  3. Wu J, Hsieh TH. Variational thermal quantum simulation via thermofield double states. Phys Rev Lett. 2019;123(22):220502. arXiv:1811.11756.

    Article  ADS  CAS  PubMed  Google Scholar 

  4. Ball C, Cohen TD. Boltzmann distributions on a quantum computer via active cooling. 2022. arXiv:2212.06730.

    Book  Google Scholar 

  5. Powers C, Oftelie LB, Camps D, de Jong WA. Exploring finite temperature properties of materials with quantum computers. 2021. arXiv:2109.01619.

    Google Scholar 

  6. Davoudi Z, Mueller N, Powers C. Toward quantum computing phase diagrams of gauge theories with thermal pure quantum states. 2022. arXiv:2208.13112.

  7. Verdon G, Marks J, Nanda S, Leichenauer S, Hidary J. Quantum Hamiltonian-based models and the variational quantum thermalizer algorithm. 2019. arXiv:1910.02071.

  8. Peruzzo A, McClean J, Shadbolt P, Yung M-H, Zhou X-Q, Love PJ, Aspuru-Guzik A, O’Brien JL. A variational eigenvalue solver on a photonic quantum processor. Nat Commun 2014;5(1):4213.

    Article  ADS  CAS  PubMed  Google Scholar 

  9. McClean JR, Romero J, Babbush R, Aspuru-Guzik A. The theory of variational hybrid quantum-classical algorithms. New J Phys. 2016;18:023023. arXiv:1509.04279.

    Article  CAS  Google Scholar 

  10. Foldager J, Pesah A, Hansen LK. Noise-assisted variational quantum thermalization. 2021. arXiv:2111.03935.

  11. Selisko J, Amsler M, Hammerschmidt T, Drautz R, Eckl T. Extending the variational quantum eigensolver to finite temperatures. 2022. arXiv:2208.07621.

  12. Consiglio M, Settino J, Giordano A, Mastroianni C, Plastina F, Lorenzo S, Maniscalco S, Goold J, Apollaro TJG. Variational Gibbs state preparation on nisq devices. 2023. arXiv:2303.11276.

  13. Horn D, Weinstein M, Yankielowicz S. Hamiltonian approach to \(z(n)\) lattice gauge theories. Phys Rev D. 1979;19(12):3715–31.

    Article  ADS  Google Scholar 

  14. Greenberg T, Pardo G, Fortinsky A, Zohar E. Resource-efficient quantum simulation of lattice gauge theories in arbitrary dimensions: solving for gauss’ law and fermion elimination. 2022. arXiv:2206.00685.

  15. Irmejs R, Banuls MC, Cirac JI. Quantum simulation of z2 lattice gauge theory with minimal requirements. 2022. arXiv:2206.08909.

  16. Zohar E, Burrello M. A formulation of lattice gauge theories for quantum simulations. Phys Rev D. 2015;91:054506. arXiv:1409.3085.

    Article  ADS  MathSciNet  CAS  Google Scholar 

  17. Zohar E, Cirac JI. Eliminating fermionic matter fields in lattice gauge theories. Phys Rev B. 2018;98:075119. arXiv:1805.05347.

    Article  ADS  CAS  Google Scholar 

  18. Frank J, Huffman E, Chandrasekharan S. Emergence of Gauss’ law in a \(z_{2}\) lattice gauge theory. Phys Lett B. 2020;806(10):135484. arXiv:1904.05414.

    Article  MathSciNet  CAS  Google Scholar 

  19. Mazzola G, Mathis SV, Mazzola G, Tavernelli I. Gauge invariant quantum circuits for \(u(1)\) and Yang-Mills lattice gauge theories. Phys Rev Res 2021;3:043209. arXiv:2105.05870.

    Article  CAS  Google Scholar 

  20. Murairi EM, Cervia MJ, Kumar H, Bedaque PF, Alexandru A. How many quantum gates do gauge theories require? 2022. arXiv:2208.11789.

  21. Stryker JR. Shearing approach to gauge invariant trotterization. 2021. arXiv:2105.11548.

  22. Nielsen MA, Chuang IL. Quantum computation and quantum information. 2010.

  23. Qiskit contributors. Qiskit: an open-source framework for quantum computing. 2023.

  24. Ortiz G, Gubernatis JE, Knill E, Laflamme R. Quantum algorithms for fermionic simulations. Phys Rev A. 2001;64(2):022319. arXiv:cond-mat/0012334.

    Article  ADS  Google Scholar 

  25. Somma R, Ortiz G, Gubernatis JE, Knill E, Laflamme R. Simulating physical phenomena by quantum networks. Phys Rev A. 2002;65:042323.

    Article  ADS  CAS  Google Scholar 

  26. Zohar E. Local manipulation and measurement of nonlocal many-body operators in lattice gauge theory quantum simulators. Phys Rev D. 2020;101(3):034518. arXiv:1911.11156.

    Article  ADS  CAS  Google Scholar 

  27. Borla U, Verresen R, Grusdt F, Moroz S. Confined phases of one-dimensional spinless fermions coupled to \(z_{2}\) gauge theory. Phys Rev Lett. 2020;124(12):120503. arXiv:1909.07399.

    Article  ADS  MathSciNet  CAS  PubMed  Google Scholar 

  28. Kebrič M, Barbiero L, Reinmoser C, Schollwöck U, Grusdt F. Confinement and Mott transitions of dynamical charges in one-dimensional lattice gauge theories. Phys Rev Lett. 2021;127(16):167203.

    Article  ADS  CAS  PubMed  Google Scholar 

  29. Kebrič M, Borla U, Schollwöck U, Moroz S, Barbiero L, Grusdt F. Confinement induced frustration in a one-dimensional z2 lattice gauge theory. New J Phys. 2023;25(1):013035.

    Article  Google Scholar 

  30. Mildenberger J, Mruczkiewicz W, Halimeh JC, Jiang Z, Hauke P. Probing confinement in a \(\mathbb{Z}_{2}\) lattice gauge theory on a quantum computer. 2022. arXiv:2203.08905.

  31. Mueller N, Zache TV, Ott R. Thermalization of gauge theories from their entanglement spectrum. Phys Rev Lett. 2022;129(1):011601.

    Article  ADS  MathSciNet  CAS  PubMed  Google Scholar 

  32. Wang Y, Li G, Wang X. Variational quantum Gibbs state preparation with a truncated Taylor series. Phys Rev Appl. 2021;16:054035.

    Article  ADS  CAS  Google Scholar 

Download references


Open Access funding enabled and organized by Projekt DEAL. The work is supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) through the grant CRC-TR 211 “Strong-interaction matter under extreme conditions” – project number 315477589 – TRR 211 and by the State of Hesse within the Research Cluster ELEMENTS (Project ID 500/10.006). M.S. and M.F. acknowledge support by the Munich Institute for Astro-, Particle and BioPhysics (MIAPbP) which is funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy – EXC-2094 – 390783311.

Author information

Authors and Affiliations



All authors contributed equally in the conception phase, C.W., M.F. and M.S. carried out the computations and simulations. All authors jointly drafted and reviewed the manuscript and approved the submission.

Corresponding author

Correspondence to Michael Fromm.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Fromm, M., Philipsen, O., Spannowsky, M. et al. Simulating \(Z_{2}\) lattice gauge theory with the variational quantum thermalizer. EPJ Quantum Technol. 11, 20 (2024).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: