Main

Computing today relies almost exclusively on binary information encoding. This holds true for classical computers operating with bits, as well as for the emerging area of quantum computing that uses qubits to exploit quantum superposition and entanglement for information processing. However, the quantum systems underpinning today’s quantum computers offer the possibility of processing information in several energy levels1,2,3,4,5,6,7, so-called qudits. A key to unlocking the potential of this approach and to realizing qudit algorithms8 in practice is the availability of programmable, high-fidelity qudit entangling gates. We realize this capability in a linear ion-trap quantum processor with all-to-all connectivity9 by extending qubit entangling gates10,11,12 to mixed-dimensional qudit systems. These resources open up exciting avenues for native quantum simulation of d-level systems (for example, in chemistry13,14,15 or condensed matter physics16,17) with smaller registers and reduced gate depth compared to a qubit approach.

A natural application for qudit quantum hardware is calculations for lattice gauge theory (LGT), in which qudits naturally represent high-dimensional gauge fields. Gauge theories are the backbone of the standard model of particle physics. Studying them on a lattice through computer simulations has been key in the quest for a more complete understanding of the phenomenology within the standard model and for discovering physics beyond it. Yet, despite the tremendous success of LGT classical simulations18, this endeavour is increasingly hindered because important problem classes, such as real-time evolution and problems involving high matter densities, are plagued by sign problems19,20,21, which are believed to be classically intractable22,23. Quantum computations are by design not affected by sign problems and, thus, offer a unique scientific opportunity for advancing the frontier of gauge theory simulations (see refs. 24,25,26,27,28,29,30 for in-depth discussions and Supplementary Note I for key points). Although LGT quantum simulations for particle physics have seen impressive advances, experimental demonstrations have been limited to either one spatial dimension (1D) or targeted theories beyond 1D where either gauge fields or matter are trivial31,32,33,34,35,36,37,38.

Here we address two major challenges in quantum computing for gauge theory calculations: (1) performing LGT quantum computations beyond 1D including both gauge fields and matter and (2) controlling the gauge-field dimension. Both of these essential ingredients demand the efficient representation of the formally infinite-dimensional gauge fields on quantum computers, which requires discretization and truncation to a finite number of levels32,39,40,41,42,43,44. Crucially, truncated gauge fields must remain sufficiently high dimensional to capture the relevant physics, which is most naturally achieved by encoding them into qudits45,46,47,48.

Specifically, we consider quantum electrodynamics in two spatial dimensions (2D-QED) and simulate the basic building block of the lattice—a single plaquette—on a qudit quantum computer9. We observe the ground-state plaquette expectation value19, which is a central quantity in LGT calculations related to magnetic fields. The latter are a defining feature of 2D physics and physics in three spatial dimensions (3D) and have no analogue in 1D. The plaquette expectation value is also relevant for the so-called running coupling49,50 in gauge theories, which is absent in 1D-QED. Notably, our approach is directly adaptable to digital quantum simulations of real-time dynamics and offers an intriguing perspective for the quantum simulations of LGT dynamics. In all demonstrated cases, our qudit encodings with high-fidelity entangling gates natively allow for gate sequences with smaller register sizes and fewer entangling gates. By providing an order of magnitude improvement in circuit complexity for the simplest instance, our work establishes a new approach for highly efficient quantum simulations of gauge theories and beyond and sets the stage for addressing open problems in the study of these systems.

LGT simulations with qudits

We simulated lattice QED on a two-dimensional discretization of space, where matter (electrons and positrons) resides on the sites of the lattice and gauge bosons (photons) on the links (Fig. 1a). For the fermionic matter fields, we used a staggered formulation51 where lattice sites host electrons (even sites) or positrons (odd sites), as depicted in Extended Data Fig. 1. The gauge fields residing on the links between each pair of sites are each described by electric field operators \(\hat{E}\) that have an infinite, but discrete, spectrum \(\hat{E}\left\vert E\,\right\rangle =E\left\vert E\,\right\rangle\), where E = 0, ±1, ±2, … The total Hamiltonian is then given by the sum51

$$\hat{H}={g}^{2}{\hat{H}}_\mathrm{E}+\frac{1}{{g}^{2}}{\hat{H}}_\mathrm{B}+m{\hat{H}}_\mathrm{m}+\varOmega {\hat{H}}_\mathrm{k},$$
(1)

which describes the free electric (E), magnetic (B) and matter (m) field energies and the kinetic energy term (k) responsible for pair-creation processes. See equation (4) in Methods for the definition of the Hamiltonian terms.

Fig. 1: Simulating two-dimensional lattice QED with matter fields.
figure 1

a, The lattice for 2D-QED comprises vertices containing matter particles (blue) connected by links carrying the gauge field (red). b, The gauge field at each link has an infinite discrete spectrum, simulated using a truncated representation using a d-level qudit. c, Qudits (red) are encoded in different Zeeman levels of the S1/2 ground state and the D5/2 excited state of trapped 40Ca+ ions. Matter particles are faithfully represented by qubits (blue). d, By employing Gauss’s law on a plaquette with open boundary conditions, three of the four gauge fields can be eliminated. The remaining field is truncated to at most one energy quantum. Our variational ansatz is a mixed-dimensional circuit in which the quantum register contains one qutrit (red) and four qubits (blue). A fanning out of the qudit circuit line illustrates the action of the qudit entangling gates (‘Variational circuit’ in Methods). A classical optimizer varies the gate angles θj to minimize the energy of the quantum state. e, An exemplary optimization run for Ω = 5, m = 0.1 and g−2 = 102. The red line highlights the current lowest energy found by the algorithm. The initial evaluations explore the variational landscape. Subsequent blocks of evaluations ((1), (2), …) optimize for decreasing values of the coupling (‘A VQE for qudits’ in Methods). Shaded regions correspond to one standard deviation of statistical uncertainty from Monte Carlo resampling around the measured value, averaged over 150 repetitions. f, Expectation value of the plaquette operator \(\langle \hat{\square }\rangle\). The triangular data points were measured for VQE-optimized states, with error bars representing one standard deviation of statistical uncertainty from Monte Carlo resampling around the measured value, averaged over 150 repetitions. The squares are from a simulation of an ideal VQE, with an experimentally motivated noise model applied to the final state (Supplementary Note V). The line shows the ground state from exact diagonalization. The dashed line was obtained from the pure gauge model \({g}^{2}{\hat{H}}_\mathrm{E}+(1/g^{2}){\hat{H}}_\mathrm{B}\): the presence of dynamical matter noticeably affects the slope of \(\langle \hat{\square }\rangle\) when varying g−2.

The bare coupling strength g is determined by the charge of the elementary particles with bare mass m. Both parameters enter into the energy cost associated with the creation of an electron–positron pair and the associated electromagnetic field. The rate of these pair- and field-creation processes is characterized by Ω. We employed the Kogut–Susskind Hamiltonian formulation51 in natural units  = c = 1 and with lattice spacing a = 1.

Importantly, not all quantum states in the considered Hilbert space are physical. In particular, the gauge field and charge configurations of physical states |Ψphys〉 have to fulfil Gauss’s law at each site. The familiar law from classical electrodynamics E(r) − ρ(r) = 0, where ρ(r) is the charge density at point r, takes the form \({\hat{G}}_{\mathbf{n}}\left\vert {\varPsi }_{{\rm{phys}}}\right\rangle =0\), with the Gauss operator \({\hat{G}}_{\mathbf{n}}\) at lattice site n given in equation (6) in Methods.

To observe 2D effects in this model, we study the local plaquette operator \(\hat{\square }=-(1/V\,){\hat{H}}_\mathrm{B}\), where V is the number of plaquettes. The plaquette operator involves four gauge fields forming a closed loop along a single plaquette (equation (5) and Extended Data Fig. 1b). As this observable is related to the curl of the vector potential, it is defined in at least two spatial dimensions and has no analogue in 1D-QED. The dependence of the plaquette ground-state expectation value \(\langle \hat{\square }\rangle\) on g−2 can be related to the running of the coupling52, which is a fundamental feature of gauge theories in particle physics and captures the dependence of the charge on the distance (energy scale) on which it is probed.

Quantum simulations of 2D-LGTs face the difficulty of finding an adequate representation for the gauge-field operators \(\hat{E}\). Although the fermionic field can be mapped straightforwardly to qubits53, whose states represent either the presence or absence of a particle (‘Encoded Hamiltonian’ in Methods and Extended Data Fig. 1c), the gauge field requires a truncation of its spectrum and a description containing at least three quantum states representing positive, zero and negative flux values.

In principle, such a representation could be constructed from qubits. However, in practice, using qubits drastically increases the quantum register size and immediately results in complex many-body interactions54 (see Supplementary Note II for details). For example, encoding d-level gauge fields requires at least log2(d) qubits, and even the application of local gauge-field operators involves \({\mathcal{O}}({d}^{\,2})\) two-qubit gates17. Gauss’s law requires that the creation or annihilation of particles occurs with the corresponding change in flux, which necessitates the application of gauge-field rising or lowering operators that are controlled by the state of the matter configuration. Implementing such controlled gauge-field operations requires an even higher qubit gate count than the local gauge-field operators. We circumvented this issue by representing each gauge field with a qudit system that contains exactly as many levels as required for the chosen truncation. This ensured that local operations on the gauge fields remained local in the quantum computer, and the coupling between a matter site and a gauge field was realized as a two-body qubit–qudit interaction. We achieved an efficient implementation of these interactions through explicit entanglement between the internal state of an ion and the common motional mode in the spirit of the Cirac–Zoller gate10. Conditional on the state of one ion (regardless of qudit dimension), a phonon was injected into the motional mode. A local operation was performed on the second ion only when the phonon was present. The phonon was, therefore deterministically, removed from the motional mode, and the internal states of the two ions were left entangled. See ‘Realizing controlled rotations in qudits’ in Methods and Extended Data Fig. 2 for details. We realized the qubits for the matter fields and qudits for the gauge fields within the 4S1/2 ground state and the 3D5/2 excited state manifolds of trapped 40Ca+ ions9, and thereby, we demonstrated quantum computations with tailored mixed-dimensional quantum systems. As shown in Fig. 1d and ‘A VQE for qudits’ in Methods, we performed a variational ground-state search55,56,57,58,59 using a suitable ansatz in the form of a quantum circuit with gates that were parameterized by a set θ (see ‘Simulating gauge fields and matter’ below). A classical optimizer then varied the gate parameters to minimize the energy \(\langle \hat{H}\rangle\) of the prepared states, which served as a cost function and was measured by the quantum computer. This optimization loop was repeated until the energy was minimized, resulting in a parameter set θ* to achieve an approximate ground state of \(\hat{H}\).

Simulating gauge fields and matter

In our first experiment, we studied 2D-QED on a lattice with open boundary conditions and including both matter and gauge fields. Unlike previous experiments (simulating LGTs in 1D or without matter), we observed the effects of virtual pair creation, electromagnetic fields and their interplay54 by studying the ground-state expectation value of the plaquette operator \(\langle \hat{\square }\rangle =-(1/V\,)\langle {\hat{H}}_\mathrm{B}\rangle\). We considered the basic building block of the two-dimensional lattice, that is a single plaquette with open boundary conditions and consisting of four matter sites and four gauge fields (inset in Fig. 1f). The gauge and matter degrees of freedom were constrained by Gauss’s law in equation (6) at each vertex. These constraints were encoded explicitly into the Hamiltonian by eliminating redundant gauge degrees of freedom, as shown in ‘Encoded Hamiltonian’ in Methods. This reduced the resource requirements while ensuring that the simulated states obeyed Gauss’s law. The resulting Hamiltonian per plaquette involves only one gauge field. Employing the minimal gauge-field truncation using three levels (d = 3), our ansatz for the variational quantum eigensolver (VQE) is given by a hybrid qudit–qubit approach with one qutrit representing the gauge degree of freedom and four qubits representing electrons and positrons residing on the four vertices (Fig. 1d). Note that these requirements for 2D connectivity and two different constituents are most easily satisfied in an all-to-all connected mixed-dimensional digital quantum processor rather than analogue Ising-type simulators60.

Our VQE ansatz is based on the Hamiltonian given in equation (9) and reflects the underlying physics of pair-creation processes: the qubit states |↓〉/|↑〉 represent vacuum/electrons on even lattice sites and positrons/vacuum on odd lattice sites, as shown in Extended Data Fig. 1. The qutrit states {|−1〉, |0〉, |+1〉} represent the electric field eigenstates of the gauge field. The circuit was initialized in the qudit–qubit state |↓↑↓↑, 0〉, representing the bare vacuum |vvvv, 0〉, where no particles (first four entries) or gauge-field excitations (last entry) are present. As shown in Fig. 1d, the two-qubit gates on the matter qubits (blue) first populated the plaquette with electrons and positrons. When the two lattice sites directly next to the remaining gauge field were populated (see inset of Fig. 1f), Gauss’s law requires the gauge-field excitation to change, which was achieved by the qubit–qutrit controlled-rotation gates (red). In the final part of the circuit, four two-qubit gates (blue) adjusted the matter state without modifying the qutrit, as the matter fields can have gauge-field-independent dynamics. This Hamiltonian-based VQE circuit design is extendable to larger lattices, as explained in ref. 54.

Figure 1e shows the results of a typical experimental run of the variational circuit. The resulting measured plaquette expectation values as a function of the parameter g−2 are shown in Fig. 1f for Ω = 5 and m = 0.1 (see ‘2D-QED with matter’ in Methods for details of the parameter choice). The experimental data match the ideal result well and agree with theoretical predictions using a simple error model, as explained in Supplementary Note V. In the large-coupling regime (g−2 1), the electric field energy term \({\hat{H}}_\mathrm{E}\) dominates the Hamiltonian of equation (1), thus favouring the ground state |vvvv, 0〉 with \(\langle \hat{\square }\rangle =0\). In the weak-coupling regime, on the other hand, the magnetic field energy term \({\hat{H}}_\mathrm{B}\) dominates the Hamiltonian, thus favouring a positive vacuum plaquette expectation value (\(\langle \hat{\square }\rangle =1/\sqrt{2}\approx 0.707\) for the chosen truncation). In the intermediate regime where g−2 ≈ 1, there is competition between the field energy terms and \({\hat{H}}_\mathrm{k}\). The ground state of the kinetic term has a positive plaquette expectation value. The presence of dynamical matter and the pair-creation effect described by \({\hat{H}}_\mathrm{k}\) leads, therefore, to an increase of \(\langle \hat{\square }\rangle\) in the intermediate-coupling regime, as shown in Fig. 1f. This effect results in a change to the slope of the plaquette expectation value as a function of g−2. An alternative lattice QED model41,52,61,62,63,64 is studied in Supplementary Note VI. In both cases, the relevant physics is captured for the minimal truncation of d = 3. In general, however, realizing LGT quantum computations beyond 1D will require the ability to control the gauge-field dimension, which we will study in the next section.

Towards refining the gauge-field discretization

The hardware-efficient representation of gauge fields allowed us to experimentally address a second prerequisite on the path towards simulating Nature through LGT quantum computations: controlling the number of gauge-field levels. We demonstrated how our qudit platform allows the seamless improvement of the gauge-field discretization from qutrits (d = 3) to ququints (d = 5). As a concrete example, we studied the dependence of the plaquette expectation value on the bare coupling at different discretizations, as a first step towards quantum computations of the running of the coupling. To this end, we considered QED on a 2D lattice with periodic boundary conditions (torus) (Fig. 2a).

Fig. 2: Refining the gauge-field discretization.
figure 2

a, We consider pure gauge QED in two spatial dimensions with periodic boundary conditions, that is on a lattice on the surface of a torus. As before, the gauge field resides on the links of the lattice, although the vertices remain empty. b, We consider the smallest instance of such a torus. It has four empty sites and eight gauge-field links. The ground state of this particular system can be described with three separate circulation paths of the gauge field, which are called rotators, as discussed in ‘Pure gauge 2D-QED’ in Methods. Each rotator satisfies an eigenvalue equation equivalent to a single-link gauge field and can, thus, be subject to the same truncation rules as discussed in the main text by employing a d-level qudit. Here, we demonstrate the difference between a realization employing qutrits and ququints. c, The variational circuit in the electric representation (see main text) for the qutrit truncation (solid lines) and the ququint truncation (all, except shaded box marked with qutrit symbol). The explicit form of the gates employed is given in ‘Variational circuit’ in Methods. d, Experimentally measured expectation values of the plaquette operator \(\hat{\square }\) in the VQE-optimized ground states using qutrits (light blue and orange triangles) compared to ququints (dark blue and red pentagons). The error bars indicate one standard deviation of statistical uncertainty from Monte Carlo resampling around the measured value, averaged over 150 (300) repetitions for qutrits (ququints). The black line represents numerical results obtained for d = 21 using the electric (magnetic) representation for small (large) values of g−2. The dashed lines are exact numerical results for qutrits and ququints. e, The duality between the electric representations (orange bars) and the magnetic representations (blue bars) is clearly seen in the experimentally measured populations of the eigenvectors of the yellow rotator from b for the qutrit VQE experiment and ququint experiment. The grey bars were obtained with exact diagonalization. In the regime dominated by the electric Hamiltonian (small g−2), a qutrit representation (light orange) is enough to approximate the correct ground state, whereas for larger g−2, truncation errors become more relevant and a ququint representation (dark orange) becomes advantageous. A complementary argument applies to the magnetic qutrit (light blue) and ququint (dark blue) representations.

For our proof-of-concept demonstration, we considered a pure gauge theory \(\hat{H}={g}^{2}{\hat{H}}_\mathrm{E}+(1/{g}^{2}){\hat{H}}_\mathrm{B}\) (equation (4)). Figure 2b shows the minimal system consisting of four vertices and eight gauge fields (one per link). Using Gauss’s law, we reduced the number of independent gauge fields to five. It can be shown that three of these are sufficient to describe the ground-state properties41. Instead of individual link fields, we described the gauge degrees of freedom using ‘rotators’. As explained in ref. 41, each of the three rotators in our simulation can be visualized as loops around a different plaquette (Fig. 2b).

We previously truncated the gauge field in the electric field eigenbasis. That is, in our first experiment, we included eigenstates |E〉 of the electric field operator \(\hat{E}\) with \(\hat{E}\left\vert E\,\right\rangle =E\left\vert E\,\right\rangle\) and E = 0, ±1. To efficiently determine the plaquette expectation value across all couplings, we now employ the better truncation scheme introduced in ref. 41. Our method is based on a Fourier transformation: for large couplings (g−2 1), the Hamiltonian is dominated by the electric field contribution \({\hat{H}}_\mathrm{E}\), and a gauge-field truncation in the electric (E) field basis is suitable, which we refer to as the electric representation. For small couplings (g−2 1), the magnetic field term dominates, and accordingly, a magnetic (B) field basis (using B-field eigenstates) is more efficient. The VQE circuits for the E and B representations are shown in Fig. 2c and Supplementary Note III, respectively. As explained in more detail in Supplementary Note III, their construction was inspired by the form of the Hamiltonian.

Figure 2d shows the ground-state plaquette expectation values versus g−2, along with our theoretical predictions that include a simple noise model, as described in Supplementary Note V. For qutrits and ququints, we performed the full VQE as in Fig. 1. Note that we show the results for both representations across all values of the coupling g−2, even though the validity of the electric (magnetic) representation was restricted to the large (small) coupling regime where g−2 1 (g−2 1). The gap between the curves in the intermediate region g−2 ≈ 1, where the electric and magnetic representations performed equally well, stemmed from the truncation of the gauge fields41. As the truncation was increased, the two curves rapidly approached each other and eventually agreed for some intermediate value of g−2, as indicated by the experimental data and confirmed by a numerical simulation at d = 21 (Fig. 2d). The value of g−2 where the curves are closest indicates the point at which the representation should be switched.

This effect can also be observed in Fig. 2e, where we depict the measured populations of the gauge fields in the ground state. In the large-coupling regime (g−2 1), the distribution of electric field states is narrow, making truncation in the E-basis efficient. By contrast, this distribution becomes very broad in the small-coupling regime, where it tends to an equally weighted superposition of infinitely many E-field levels in the limit g−2 1. As a result, the accurate approximation of the ground state in the E-basis implies exploding resource costs without a basis change41. The behaviour of the B representation is complementary. The aforementioned closing gap between the plaquette expectation values in the E representation (red) and the B representation (blue) in Fig. 2d thus corresponds to a better representation of the ground state in Fig. 2e. The closing gap for intermediate g−2 values provides an indication of how well finite-d computations approximate the untruncated results41.

Similarly, the so-called freezing of the truncated plaquette expectation value in the weak-coupling regime g−2 1 indicates how well the ground state is approximated. Freezing occurs in both classical and quantum computations if the number of levels d is too small to accurately reflect the spread of the ground-state wavefunction. As there are too few ‘bins’ for the population of the gauge field, the truncated state cannot capture the changes in the ground state, which is visible as a premature flattening of the plaquette expectation value versus g−2 (the dashed blue lines for d = 3 or 5 in Fig. 2d flatten out earlier than the solid black line for d = 21). A detailed analysis is provided in ref. 41, showing fast convergence of the plaquette expectation value to the true value already for d ≤ 10. In general, different problems will permit different degrees of truncation. Yet, the moderate values of d available in typical atomic systems are expected to be sufficient for addressing a range of interesting problems, particularly those involving local observables for the ground-state sector of the theory28,29. Notably, improving the gauge-field discretization was achieved in our set-up with only minor modifications that involved the same number of ions and entangling gates (Supplementary Note III).

Towards real-time dynamics

We complete our study of qudit LGT quantum computations by investigating the prospect of simulating real-time evolutions. We took a first step in this direction by using mixed-dimensional entangling gates for a digital quantum simulation (in the form of a Trotter protocol65) for the model used in ‘Simulating gauge fields and matter’, that is a plaquette with open boundary conditions including gauge fields and dynamical matter.

As in the VQE demonstration in Fig. 1, we studied this model with a hybrid qubit–qutrit system. Starting from the bare vacuum vvvv, 0〉 as the initial state, we studied the dynamics of the system under the Hamiltonian in equation (9) using a single Trotter step of various lengths. See ‘Real-time evolution’ in Methods and Extended Data Fig. 3 for details. This time evolution can be interpreted as a quench from the strong-coupling regime (g−2 1), where the bare vacuum is the ground state, to an intermediate-coupling value. In the latter regime, the kinetic term of the Hamiltonian drives particle–antiparticle pair creation and annihilation, first increasing the mean particle number density ν followed by oscillatory behaviour. Because of Gauss’s law, the creation of charged particles affected the electromagnetic fields in the system, which we observed as the corresponding dynamics of the plaquette expectation value in Fig. 3b.

Fig. 3: Time evolution for 2D-QED with matter.
figure 3

Expectation values of the particle number density ν and plaquette operator \(\langle \hat{\square }\rangle\) for Ω = 5, m = 0.1 and g−2 = 10−1.4 as a function of time t expressed in units of Ω. We show the numerical values for NT = 1 (dotted) and NT = 10 (dashed) Trotter steps, with the solid line representing the exact evolution. Experimental data for NT = 1 (squares) are presented with error bars indicating one standard deviation of statistical uncertainty from Monte Carlo resampling around the measured value, averaged over 150 repetitions. The data were obtained by post-selection on the zero magnetization subsector on the matter sites. Insets, examples of the dominant states at different times of the evolution.

Outlook

Qudits provide a hardware-efficient approach for quantum-simulating gauge theories. Using a universal trapped-ion qudit quantum computer with all-to-all connectivity enabled us to simulate arbitrary geometries, thus enabling quantum simulations of 2D-LGTs. Unlike 1D models, gauge fields must be included explicitly, and unlike condensed matter models, the gauge fields in particle physics are described by more complicated gauge groups and must have more than two states. In particular, we simulated a basic building block of 2D-QED with both dynamical matter and gauge fields (Fig. 1), and we studied different gauge-field discretizations (Fig. 2). These complex computations were rendered possible by high-fidelity qudit control combined with VQE circuits that are much shallower than comparable qubit-based implementations of gauge theory calculations. Although we exploited native qudit circuits to study the equilibrium properties, the techniques we developed are directly adaptable to digital quantum simulations of real-time dynamics (Fig. 3).

The ultimate goal is LGT quantum simulations in 3D. Importantly, the simulation requirements shift dramatically in going from 1D to 2D but require minimal changes from 2D to 3D66,67. Although the high-dimensional gauge fields can be integrated out in 1D models, they are dynamic degrees of freedom in 2D and 3D and must be simulated explicitly. Our results for QED simulations beyond 1D thus represent a major step towards simulating 3D LGTs. In particular, our protocol based on eliminating redundant gauge degrees of freedom employed here can be directly extended to 3D (for QED, see ref. 66). Our qudit techniques can be applied to virtually all other quantum computing architectures and hardware platforms. For all of these, the main remaining task is scaling up the system sizes, which makes an efficient gauge-field representation even more important. Beyond just programmable local dimensions, qudit-based systems have more freedom for designing interactions that optimally match the target problem. Notably, quantum error correction schemes, which are making great progress in conventional qubit systems68,69,70, are compatible71 with our hardware-efficient qudit approach. Our demonstration of a qudit-based quantum simulation of high-energy physics phenomena thus paves the way to a new generation of qudit-based applications in all areas of quantum technology.

Methods

Realizing controlled rotations in qudits

We encoded each qudit in Zeeman states of trapped 40Ca+ ions and manipulated their quantum state by sequences of laser pulses. Doppler cooling and state detection were performed by driving the short-lived S1/2 ↔ P1/2 transition and monitoring the fluorescence of the individual ions on a CCD camera. A simplified level scheme of the relevant states is shown in Extended Data Fig. 2a. Quantum gate operations were implemented by selectively addressing single—or arbitrary pairs of—ions with a high numerical aperture objective, which coupled the D5/2 manifold with the S1/2 ground states72. Owing to the geometry of our ion trap, the beam was aligned at an angle of 22.5° with respect to the trap axis, leading to a Lamb–Dicke factor of η = 0.041 for an axial trap frequency of ωz = 0.77 MHz. We measured a heating rate of 2.7(2) phonons per second and a motional coherence time τ = 27.4(4) ms.

Qudits with dimension d = 2 (qubits) were encoded, such that |0〉 = S1/2(m = −1/2) and |1〉 = D5/2(m = −1/2), as shown in Extended Data Fig. 2a. For d > 2, only the D5/2 manifold of 40Ca+ was used to encode the qudit, whereas the S1/2 ground states acted as auxiliary levels |g〉, which were populated only during gate operations and read-out.

Mixed-dimensional qudit–qudit interactions were engineered by controllably coupling qudits to a single phonon mode. Thus, we effectively used an anti-Jaynes–Cummings Hamiltonian described by

$${\hat{H}}_{j}=i\eta {\varOmega }_{j}{\left({\hat{a}}^{\dagger }{\hat{\sigma }}_{j}^{+}+\hat{a}{\hat{\sigma }}_{j}^{-}\right)}^{\left\vert g\right\rangle \leftrightarrow \left\vert k\right\rangle },$$
(2)

on the jth ion with Rabi frequency Ωj. Here, † indicates the conjugate transpose of an operator so that \({\hat{a}}^{\dagger }{\hat{\sigma }}_{j}^{+}\) excites the qudit from the (auxiliary) ground state |g〉 from the S1/2 manifold to a state |k〉 in the D5/2 manifold, simultaneously injecting a phonon into the motional mode; \(\hat{a}{\hat{\sigma }}_{j}^{-}\) has the opposite effect. In our set-up, we realized this interaction by driving controlled laser pulses B(θ, ϕ) tuned to the first blue sideband (BSB) of the axial centre-of-mass motional mode, where θ defines the rotation angle, and ϕ the phase. This mode was favourable because of the parameters for all qudits.

Envisioned to realize the Cirac–Zoller controlled-NOT quantum gate in trapped ions10, sequences of local B(θ, ϕ) pulses are well suited for implementing mixed-dimensional controlled rotations in qudits, as shown in Extended Data Fig. 2b. We considered a two-level subspace of a qudit, described by the states |0〉 and |1〉, which can be coupled to the motional mode |n〉 through the auxiliary ground state |g〉. Conditioned on the control state—here |1〉–the control qudit was entangled with the motion by the interaction in equation (2) to create a phonon, as indicated by the upward-pointing triangle in Extended Data Fig. 2b. To test the control state, a resonant π pulse transferred the population in |1〉 to |g〉 before a second π pulse was applied on the blue sideband. It is evident that this operation had no effect if the control qudit was initially not in the state |1〉. On the target qudit, we applied a sequence of three sideband pulses (blue boxes), namely

$$B{(\uppi ,0)}^{\left\vert g\right\rangle \to \left\vert 1\right\rangle }B{(\theta ,\phi )}^{\left\vert g\right\rangle \leftrightarrow \left\vert 0\right\rangle }B{(-\uppi ,0)}^{\left\vert 1\right\rangle \to \left\vert g\right\rangle },$$

where the superscripts indicate the respective coupling between the state |g〉 and the states |0〉 and |1〉. Crucially, these operations affected the target qudit only when the phonon mode was excited. In the final step, the operations on the control qudit were applied in reverse order to disentangle the control qudit from the centre-of-mass mode, thus annihilating the phonon depicted by the downward-pointing triangle.

We extended the well-established circuit representation of quantum gates in qubits by introducing a way to draw interactions in qudits in a similar manner. As shown in the inset in Extended Data Fig. 2b, we expanded the line representing each qudit into d individual rails, which allowed us to draw gates acting on subspaces of the qudit unambiguously. We contracted the rails back to a single line after the subspace gate. For controlled rotations, the control state is indicated in the usual fashion.

As the sideband Rabi frequency is proportional to the Lamb–Dicke factor η, driving the blue sideband required substantially more laser power than carrier transitions do. Each B(θ, ϕ), thus, introduced unwanted AC Stark shifts ΔAC of the order of a few kilohertz9, which must be carefully taken into account to achieve high-fidelity controlled-rotation gates. We compensated for these shifts using a twofold approach: (1) shifts on the actively driven transition were compensated for by an off-resonant second-beam technique12,73, whereas (2) other shifts on spectator carrier transitions |l ≠ k〉 were measured and compensated for in software by frame updates on subsequent operations. An example of shifted spectator states is shown in Extended Data Fig. 2c for B(θ, ϕ) on the blue sideband of the transition S−1/2 ↔ D−1/2 with a Rabi frequency 2π × 4 kHz. For each state, ΔAC was obtained by a Ramsey measurement.

2D-QED Hamiltonian

The models we simulated are instances of lattice QED and are defined on a two-dimensional discretization of space. Matter (electrons and positrons) and gauge bosons (photons) are defined on the sites and on the links of this lattice respectively, as shown in Fig. 1a.

Here, matter is described by fermionic field operators \({\hat{\phi }}_{\mathbf{n}}\) with spatial label \(\mathbf{n}=({n}_{x},{n}_{y})\). We employed the staggered formulation51 in which lattice sites can either be in the vacuum state or host electrons (positrons) residing on even (odd) lattice sites, carrying a +1 (−1) charge. The charge in terms of the fermionic field is given by \({\hat{q}}_{\mathbf{n}}={\hat{\phi }}_{\mathbf{n}}^{\dagger }{\hat{\phi }}_{\mathbf{n}}-({1-{(-1)}^{{n}_{x}+{n}_{y}}})/{2}\).

The gauge field residing on the links between each pair of sites is described by an electric field operator \({\hat{E}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\) (eμ indicates the unit vector in the direction μ {x, y}) that possesses an infinite but discrete spectrum \(\scriptstyle{\hat{E}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\left\vert {E}_{\mathbf{n},{\mathbf{e}}_{\mu }}\right\rangle =\scriptstyle{E}_{\mathbf{n},{\mathbf{e}}_{\mu }}\left\vert {E}_{\mathbf{n},{\mathbf{e}}_{\mu }}\right\rangle\), where \({E}_{\mathbf{n},{\mathbf{e}}_{\mu }}=0,\pm 1,\pm 2,\ldots\). The link operator \({\hat{U}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\) acts as a lowering operator for the electric field:

$${\hat{U}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\left\vert {E}_{\mathbf{n},{\mathbf{e}}_{\mu }}\right\rangle =\left\vert {E}_{\mathbf{n},{\mathbf{e}}_{\mu }}-1\right\rangle .$$
(3)

The total Hamiltonian

$$\hat{H}={g}^{2}{\hat{H}}_\mathrm{E}+\frac{1}{{g}^{2}}{\hat{H}}_\mathrm{B}+m{\hat{H}}_\mathrm{m}+\varOmega {\hat{H}}_\mathrm{k}$$

is then given by a sum of four parts as shown in equation (1). Note that compared to the convention used in refs. 41,54, we opted to redefine the four Hamiltonians such that they are independent of the mass and coupling constant. Moreover, we consider here another formulation of lattice QED74,75, in which the signs in the kinetic term are different from those used in refs. 41,54. For a discussion of the experimental results for the model employed in refs. 41,54, see Supplementary Note IV. By employing the Kogut–Susskind formulation in natural units  = c = 1 and with lattice spacing a = 1, the terms in the Hamiltonian read75

$${\hat{H}}_\mathrm{E}=\frac{1}{2}\sum _{\mathbf{n}}\left({\hat{E}}_{\mathbf{n},{\mathbf{e}}_{x}}^{2}+{\hat{E}}_{\mathbf{n},{\mathbf{e}}_{y}}^{2}\right),$$
(4a)
$${\hat{H}}_\mathrm{B}=-\frac{1}{2}\sum _{\mathbf{n}}\left({\hat{P}}_{\mathbf{n}}+{\hat{P}}_{\mathbf{n}}^{\dagger }\right),$$
(4b)
$${\hat{H}}_\mathrm{m}=\sum _{\mathbf{n}}{(-1)}^{{n}_{x}+{n}_{y}}{\hat{\phi }}_{\mathbf{n}}^{\dagger }{\hat{\phi }}_{\mathbf{n}},$$
(4c)
$$\begin{aligned}{\hat{H}}_\mathrm{k}&=\sum _{\mathbf{n}}\left(i{\hat{\phi }}_{\mathbf{n}}^{\dagger }{\hat{U}}_{\mathbf{n},{\mathbf{e}}_{x}}^{\dagger }{\hat{\phi }}_{\mathbf{n}+{\mathbf{e}}_{x}}+\right.\\ &\left.\,\,\quad {(-1)}^{{n}_{x}+{n}_{y}+1}{\hat{\phi }}_{\mathbf{n}}^{\dagger }{\hat{U}}_{\mathbf{n},{\mathbf{e}}_{y}}^{\dagger }{\hat{\phi }}_{\mathbf{n}+{\mathbf{e}}_{y}}+{\rm{H.c.}}\right).\end{aligned}$$
(4d)

\({\hat{H}}_\mathrm{E}\) and \({\hat{H}}_\mathrm{B}\) represent the free electric and magnetic fields, whereas \({\hat{H}}_\mathrm{m}\) and \({\hat{H}}_\mathrm{k}\) describe the free matter field and its interaction with the gauge field. The operator \({\hat{P}}_{\mathbf{n}}\) is defined on an anticlockwise closed loop around the plaquette with origin n (Extended Data Fig. 1b) as

$${\hat{P}}_{\mathbf{n}}={\hat{U}}_{\mathbf{n},{\mathbf{e}}_{x}}{\hat{U}}_{\mathbf{n}+{\mathbf{e}}_{x},{\mathbf{e}}_{y}}{\hat{U}}_{\mathbf{n}+{\mathbf{e}}_{y},{\mathbf{e}}_{x}}^{\dagger }{\hat{U}}_{\mathbf{n},{\mathbf{e}}_{y}}^{\dagger }.$$
(5)

Noting that the link operator \({\hat{U}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\) is expressed in terms of the vector potential of the gauge fields \({\hat{A}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\), that is \({\hat{U}}_{\mathbf{n},{\mathbf{e}}_{\mu }} \approx\exp \{\mathrm{i}g{\hat{A}}_{\mathbf{n},{\mathbf{e}}_{\mu }}\}\), the exponent of \({\hat{P}}_{\mathbf{n}}\) forms a discrete lattice curl of the vector potential. The plaquette operator \(\hat{\square }=(1/2V)\scriptstyle\sum_{\mathbf{n}}\left({\hat{P}}_{\mathbf{n}}+{\hat{P}}_{\mathbf{n}}^{\dagger }\right)\), where V is the number of plaquettes, is, therefore, proportional to the magnetic field energy. It is a true multi-dimensional quantity that has no analogue in 1D-QED. In quantum field theories, the spontaneous creation of particle–antiparticle pairs in vacuo means that, when measuring the strength of a charge, the result can depend on the distance and energy scale at which it is probed. As the coupling is proportional to the charge76, the physical coupling, which is an important parameter in phenomenological high-energy physics models, also depends on the energy scale. This phenomenon is known as the running of the coupling. The dependence of the ground-state plaquette expectation value \(\langle \hat{\square }\rangle\) on g−2, where g is the bare coupling, can be related to the running of the coupling, which is discussed in more detail in ref. 52.

Importantly, not all quantum states in the considered Hilbert space are physical. The gauge field and charge configurations of physical states |Ψphys〉 have to fulfil Gauss’s law at every site. Here, the familiar law from classical electrodynamics E(r) − ρ(r) = 0, where ρ(r) is the charge density at point r, takes the form

$${\hat{G}}_{\mathbf{n}}\left\vert {\varPsi }_{{\rm{phys}}}\right\rangle =0,$$
(6)

where the Gauss operator is defined as

$${\hat{G}}_{\mathbf{n}}=\sum _{\mu }\left({\hat{E}}_{\mathbf{n},{\mathbf{e}}_{\mu }}-{\hat{E}}_{\mathbf{n}-{\mathbf{e}}_{\mu },{\mathbf{e}}_{\mu }}\right)-{\hat{q}}_{\mathbf{n}}.$$
(7)

In general, Gauss’s law requires physical states to be eigenvectors of the Gauss operator. For equation (6), we chose to consider the eigenvalues to be zero, which describes a model with no external charges. The total charge \({\sum }_{\mathbf{n}}{\hat{q}}_{\mathbf{n}}\) can also be shown to be a symmetry of the Hamiltonian. In this work, we chose to study states that have zero total charge.

Encoded Hamiltonian

In the following, we provide the Hamiltonians studied with the VQE circuits given in Figs. 1d and 2c.

2D-QED with matter

Let us consider a single plaquette with open boundary conditions with origin in n = (0, 0) and extending in the positive directions, as shown in the inset of Fig. 1f. As was discussed in ref. 54, Gauss’s law, as given in equation (6), can be used to eliminate three gauge fields, resulting in an Hamiltonian that contains four fermionic fields and one gauge field, which we chose to be the one between sites (0, 0) and (0, 1). We encode the fermions i, …, iv (conventionally ordered clockwise around the plaquette starting from (0, 0)) into a chain of qubits indexed by 1, …, 4, respectively, by applying the following Jordan–Wigner transformation:

$${\hat{\phi }}_{i}=\prod _{j < i}\left(\operatorname{e}^{\mathrm{i}{\alpha }_{j}}{\hat{\sigma }}_{j}^{z}\right){\hat{\sigma }}_{i}^{-},\quad {\hat{\phi }}_{i}^{\dagger }=\prod _{j < i}\left(\operatorname{e}^{-\mathrm{i}{\alpha }_{j}}{\hat{\sigma }}_{j}^{z}\right){\hat{\sigma }}_{i}^{+},$$
(8)

with α1 = α3 = 0 and α2 = π/2. Note that this choice of phases generates a qubit Hamiltonian with only real coefficients.

In particular, the charge associated with each site is now given by \({\hat{q}}_{i}=({{\hat{\sigma }}_{i}^{z}+{(-1)}^{i+1}})/{2}\). A table summarizing how the spin states are related to the fermionic states is given in Extended Data Fig. 1c. The Hamiltonian

$$\hat{H}={g}^{2}{\hat{H}}_\mathrm{E}+\frac{1}{{g}^{2}}{\hat{H}}_\mathrm{B}+m{\hat{H}}_\mathrm{m}+\varOmega {\hat{H}}_\mathrm{k},$$

after the Jordan–Wigner transformation reads

$$\begin{aligned}{\hat{H}}_\mathrm{E}&=\frac{1}{4}\left(8{\hat{E}}^{2}+2\hat{E}\left(-2{\hat{\sigma }}_{1}^{z}+{\hat{\sigma }}_{2}^{z}-{\hat{\sigma }}_{4}^{z}-2\right)\right.\\&\left.\qquad+{\hat{\sigma }}_{1}^{z}-{\hat{\sigma }}_{2}^{z}+{\hat{\sigma }}_{1}^{z}{\hat{\sigma }}_{4}^{z}+3\right),\end{aligned}$$
(9a)
$${\hat{H}}_\mathrm{B}=-\frac{1}{2}\left(\hat{U}+{\hat{U}}^{\dagger }\right),$$
(9b)
$${\hat{H}}_\mathrm{m}=\frac{1}{2}\left({\hat{\sigma }}_{1}^{z}-{\hat{\sigma }}_{2}^{z}+{\hat{\sigma }}_{3}^{z}-{\hat{\sigma }}_{4}^{z}\right),$$
(9c)
$${\hat{H}}_\mathrm{k}={\hat{\sigma }}_{1}^{+}{\hat{U}}^{\dagger }{\hat{\sigma }}_{2}^{-}+{\hat{\sigma }}_{2}^{+}{\hat{\sigma }}_{3}^{-}-{\hat{\sigma }}_{4}^{+}{\hat{\sigma }}_{3}^{-}-{\hat{\sigma }}_{1}^{+}{\hat{\sigma }}_{4}^{-}+\,\text{H.c.},$$
(9d)

where we have simplified terms in the kinetic Hamiltonian because we consider only states with zero total charge (and, therefore, zero total magnetization for the qubits), as discussed below equation (6). The gauge degree of freedom is encoded in a qutrit, and following ref. 54, we truncate the gauge-field operators as

$$\hat{E}=\left(\begin{array}{rcl}1&0&0\\ 0&0&0\\ 0&0&-1\end{array}\right),\qquad \hat{U}=\left(\begin{array}{rcl}0&0&0\\ 1&0&0\\ 0&1&0\end{array}\right).$$
(10)

For the experiment illustrated in Fig. 1, we chose the parameter values m = 0.1 and Ω = 5. This choice positions our demonstration in the non-perturbative regime where pair creation has a substantial effect. The definition of the different prefactors of the individual terms in the Hamiltonian can be found in Appendix A in ref. 41.

Pure gauge 2D-QED

The second simulated model is based on pure gauge theory with periodic boundary conditions, as shown in Fig. 2a. We consider here the minimal instance consisting of four vertices, as depicted in Fig. 2b. As discussed in ref. 41, Gauss’s law can be used to reduce the system to three independent degrees of freedom. These are described by three operators \({\hat{P}}_{i}\) (i = 1, 2, 3), which are defined in equation (5) and are each associated with the magnetic energy of a plaquette depicted in the lower part of Fig. 2b. For each plaquette, we define the corresponding rotator operator as the circulation of the gauge field going anticlockwise. It can be shown that the rotators have integer spectrum:

$${\hat{R}}_{i}\left\vert {r}_{i}\right\rangle =\left\vert {r}_{i}\right\rangle ,\qquad{r}_{i}\in {\mathbb{Z}},$$
(11)

and that the operators \({\hat{P}}_{i}\) act as lowering operators on these states, that is \({\hat{P}}_{i}\left\vert {r}_{i}\right\rangle =\left\vert {r}_{i}-1\right\rangle\).

To study this model on a quantum computer, the infinite-dimensional Hilbert spaces of the rotators need to be truncated with a strategy that allows one to systematically increase the truncation size and approach the continuum limit, as discussed in detail in ref. 41. We summarize here the essential points of the derivation. As a first step, the gauge group U(1) is substituted by the discrete group \({{\mathbb{Z}}}_{2L+1}\), and the Hilbert space is then truncated for each rotator to the 2l + 1 eigenstates |−l〉, …, |l〉, for some l ≤ L. The action of the truncated \({\hat{P}}_{i}\) operator is then given by

$${\hat{P}}_{i}\left\vert {r}_{i}\right\rangle =\begin{cases}{l}\left\vert {r}_{i}-1\right\rangle ,&\text{if}\;{r}_{j} > -l,\quad \\ {\delta }_{lL}\left\vert l\right\rangle ,&\text{if}\;{r}_{j}=-l.\quad \end{cases}$$
(12)

The Hamiltonian in terms of the rotators reads

$${\hat{H}}^{{\rm{(e)}}}={g}^{2}{\hat{H}}_\mathrm{E}^{\text{(e)}}+\frac{1}{{g}^{2}}{\hat{H}}_\mathrm{B}^{\text{(e)}},$$
(13a)
$${\hat{H}}_\mathrm{E}^{\text{(e)}}=2\left[{\hat{R}}_{1}^{2}+{\hat{R}}_{2}^{2}+{\hat{R}}_{3}^{2}-{\hat{R}}_{2}\left({\hat{R}}_{1}+{\hat{R}}_{3}\right)\right],$$
(13b)
$${\hat{H}}_\mathrm{B}^{\text{(e)}}=-\frac{1}{2}\left({\hat{P}}_{1}+{\hat{P}}_{2}+{\hat{P}}_{3}+{\hat{P}}_{1}{\hat{P}}_{2}{\hat{P}}_{3}+\,\text{H.c.}\right),$$
(13c)

where we have used the superscript (e) to indicate that we are using the so-called electric representation, in which the electric Hamiltonian \({\hat{H}}_{E}^{\text{(e)}}\) is diagonal. The parameter g is the bare coupling and is proportional to the bare electric charge76.

In the regime where g 1, it is more convenient to apply a discrete Fourier transform to the Hamiltonian, which leads to a magnetic representation where \({\hat{H}}_\mathrm{B}^{\text{(b)}}\) is diagonal. For the calculations, let us define the following coefficients, defined in terms of the polygamma functions ψν(x):

$${f}_{\nu }^{\,\mathrm{s}}=\frac{{(-1)}^{\nu +1}}{2\uppi }\left[{\psi }_{0}\left(\frac{2+L1+\nu }{2(2L+1)}\right)-{\psi }_{0}\left(\frac{\nu }{2(2L+1)}\right)\right],$$
(14a)
$${f}_{\nu }^{\,\mathrm{c}}=\frac{{(-1)}^{\nu }}{4{\uppi }^{2}}\left[{\psi }_{1}\left(\frac{\nu }{2(2L+1)}\right)-{\psi }_{1}\left(\frac{2L+1+\nu }{2(2L+1)}\right)\right],$$
(14b)

and introduce the notation |r〉 = |r1〉|r2〉|r3〉. The Hamiltonian in the magnetic representation is then given by

$${\hat{H}}^{{\rm{(b)}}}={g}^{2}{\hat{H}}_\mathrm{E}^{\text{(b)}}+\frac{1}{{g}^{2}}{\hat{H}}_\mathrm{B}^{\text{(b)}},$$
(15a)
$$\begin{array}{l}{\hat{H}}_\mathrm{E}^{\,\text{(b)}\,}=\sum_{\nu =1}^{2L}\bigg[{f}_{\nu }^{\,\mathrm{c}}\left({\hat{P}}_{1}^{\nu }+{\hat{P}}_{2}^{\nu }+{\hat{P}}_{3}^{\nu }\right)\\\qquad\quad\,+\frac{{f}_{\nu }}{2}\left({\hat{P}}_{2}^{\nu }-{\left({\hat{P}}_{2}^{\dagger }\right)}^{\nu }\right)\sum _{\mu =1}^{2L}{f}_{\mu }^{\,\mathrm{s}}\left({\hat{P}}_{1}^{\,\mu }+{\hat{P}}_{3}^{\,\mu }\right)\bigg]+\text{H.c.},\end{array}$$
(15b)
$$\begin{aligned}{\hat{H}}_\mathrm{B}^{\text{(b)}}&=-\sum_{{\mathbf{r}}=-{\mathbf{L}}}^{{\mathbf{L}}}\left[\cos \left(\frac{2\uppi {r}_{1}}{2L+1}\right)+\cos \left(\frac{2\uppi {r}_{2}}{2L+1}\right)\right.\\ &\,\,\quad\left.+\cos \left(\frac{2\uppi {r}_{3}}{2L+1}\right)+\cos \left(\frac{2\uppi ({r}_{1}+{r}_{2}+{r}_{3})}{2L+1}\right)\right]\left\vert {\mathbf{r}}\right\rangle \left\langle {\mathbf{r}}\right\vert .\end{aligned}$$
(15c)

For our quantum calculations shown in Fig. 2 we chose (L, l) = (2, 1) for the qutrit experiment and (L, l) = (3, 2) for the ququint experiment. Throughout the paper, we use L = l + 1.

A VQE for qudits

Variational circuit

As explained in the main text, the variational circuit shown in Fig. 1d was based on the form of the target Hamiltonian given in equation (9). As all the coefficients of the Hamiltonian are real, it was convenient to use gates in the variational circuit that rotate between states with real coefficients only. This approach also allowed us to formulate a circuit that is more efficient in terms of the number of variational parameters. In particular, the square blue gates between the qubits in Fig. 1d are the magnetization-conserving gates studied in ref. 77, which are defined as

$$\hat{A}(\theta ,\phi )=\left(\begin{array}{cccc}1&0&0&0\\ 0&\cos \theta &\operatorname{e}^{\mathrm{i}\phi }\sin \theta &0\\ 0&\operatorname{e}^{-\mathrm{i}\phi }\sin \theta &-\cos \theta &0\\ 0&0&0&1\\ \end{array}\right).$$
(16)

We chose ϕ = 0 for all gates, which resulted in a transformation with real coefficients. The qubits on which \(\hat{A}\) acts were ordered by decreasing index.

The entangling gates in Figs. 1d and 2c and Supplementary Figs. 1 and 2 marked by the rounded box are controlled rotations. When the control is active, the rotation on the target qudit is given by

$${\hat{R}}_{y}^{i,\,j}(\theta )=\exp \left(-\mathrm{i}\theta {\hat{\sigma }}_{y}^{i,\,j}/2\right),$$
(17)

where i and j are the levels addressed in the target qudit and \({\hat{\sigma }}_{y}^{i,\,j}\) is the corresponding Pauli y matrix. This choice ensures that the rotation has real coefficients. In the qubit–qudit configuration, the rotation is active when the control qubit is in the |↓〉 state, whereas for the qudit–qudit gate, the control state is explicitly marked in the corresponding circuits. The experimental implementation of these gates is discussed in more detail in ‘Realizing controlled rotations in qudits’. The last type of gate used in our variational circuit is the qudit-internal rotation shown in Fig. 2c and Supplementary Fig. 2 as square boxes. They are given by the x rotation between the addressed states i and j:

$${\hat{R}}_{x}^{i,\,j}(\theta )=\exp \left(-\mathrm{i}\theta {\hat{\sigma }}_{x}^{i,\,j}\right).$$
(18)

Optimization algorithm

For our VQE experiments, we employed two optimization strategies, which are both based on Bayesian optimization (BO)78. Here, the algorithm collects evaluations of the cost function \(\langle \hat{H}({\bf{\uptheta }})\rangle\) for proposed sets of n input parameters \({\bf{\uptheta }}={\{{\theta}_{i}\}}_{i = 1,\ldots,n}\) and constructs a surrogate model by a Gaussian process to represent the cost function. This allowed us to quantify how likely further evaluations of the cost function are to achieve an improvement over the best-found value so far and, hence, reduced the overall number of evaluations to be performed. Importantly, the method does not require gradient evaluations and can tolerate noisy input data.

For the system with periodic boundary conditions in Fig. 2, our BO strategy is very close to the one described in ref. 78. We initialized the optimizer by evaluating \(\langle \hat{H}\,\rangle\) at the corners of the parameter space to create an n × n grid. Next, the algorithm mapped out the energy landscape by tuning θ for up to 100 evaluations (in the qutrit case). Treating the input parameters as vectors \(\mathbf{v}({\bf{\uptheta }})\), convergence was achieved when the norm \(\left\vert \mathbf{v}({\bf{\uptheta }})-\mathbf{v}({{\bf{\uptheta }}}^{{\prime} })\right\vert\) between five consecutive runs did not exceed a threshold of 0.01.

The variational optimization for the case involving matter and gauge fields is more complex. From equation (1) it is evident that g−2 acts as a scaling factor only for the individual terms contributing to the expectation value \(\langle \hat{H}({\bf{\uptheta }})\rangle\). Hence, the cost function could be evaluated simultaneously for all values of g−2 after each measurement. This allowed us to generate a data storage system and pair it with the BO algorithm. We allowed the algorithm to initialize the storage by taking 130 measurements, before sampling up to 300 times or until convergence. During the optimization of the parameters for a single value of \({g}_{i}^{-2}\), the outcomes were processed and saved for successive searches. After successful optimization for \({g}_{i}^{-2}\), this process was repeated for \({g}_{i+1}^{-2}\), considering all previous outcomes. With the assumption that the optimal solutions change smoothly for small variations in the bare coupling, the already-found minimum for \({g}_{i}^{-2}\) is a good candidate for an initial guess for \({g}_{i+1}^{-2}\). Consequently, the algorithm no longer needed to sample the whole parameter space but could invest in refining the search around promising solutions. When the bare coupling is changed, the available knowledge increases, yielding faster convergence.

We also modified a recently proposed trust region BO approach79 to accept noisy cost function evaluations. We coupled it to the data storage and performed two sweeps in the coupling ranging from g−2 = 0.01 to 100. The best values were obtained after the last run.

VQE measurements for qudits

In the following, we explain the qudit measurements and basis decompositions used in our VQE experiments. Unlike qubits, where one naturally chooses the Pauli product basis, there is no clear indication for the best possible basis to decompose a given qudit (possibly mixed-dimensional) Hamiltonian. This is because the Pauli operators allow for an efficient classical determination of a circuit that diagonalizes a group of commuting Pauli operators so they can be measured simultaneously80.

For qudits, we represented the Hamiltonian in terms of the so-called clock and shift operators, which are normalized by the generalized Clifford group comprising the d-dimensional SUM (generalized controlled NOT), Hadamard and S gates80,81. More precisely, the clock and shift operators are respectively defined as \(\hat{Z}=\operatorname{diag}{\{\exp(({2\uppi\mathrm{i}}/{d})k)\}}_{k = 0}^{d-1}\) and \({(\hat{X}\,)}_{kl}={\delta }_{k,\,l-1}+{\delta }_{k,d}{\delta }_{l,1}\). By expressing the matter and gauge fields and the operators \({\hat{P}}_{\mathbf{n}}\) as linear combinations of tensor products of \({\hat{X}}^{\alpha }{\hat{Z}}^{\,\beta }\) (α, β {0, …, d − 1}), we could, therefore, write the Hamiltonian \(\hat{H}\) with contributions from equations (13) and (15) in terms of the clock and shift operators only, \(\hat{H}=\sum_{i}{c}_{i}{\hat{O}}_{i}\) (ref. 80). Here, \({c}_{i}\in {\mathbb{C}}\) and \({\hat{O}}_{i}={\otimes }_{j = 1}^{m}{\hat{X}}^{{\alpha }_{j}^{i}}{\hat{Z}}^{\,{\beta }_{j}^{i}}\) for m qudits and coefficients \({\alpha }_{j}^{i}\) and \({\beta }_{j}^{i}\) determined by the decomposition of \(\hat{H}\).

Normalizing these operators with gates from the generalized Clifford group then mapped a subset of the \({\hat{O}}_{i}\) operators to clock operators \({\hat{Z}}^{\,{\gamma }_{i}}\) (with all γi not necessarily identical), which could subsequently be measured simultaneously.

Real-time evolution

In this section, we show how we used the qudit tools that we developed in the context of equilibrium problems (Figs. 1 and 2) to study time evolutions in LGTs, an area that is inaccessible to Markov chain Monte Carlo methods due to sign problems20,22. As a proof-of-concept demonstration, we consider here a single plaquette with open boundary conditions, as in ‘Simulating gauge fields and matter’ of the main text. As with the VQE demonstration, we studied this model with a hybrid qubit–qutrit system, which can be realized within the same trapped-ion chain. As the initial state of the time evolution, we chose the bare vacuum of the system vvvv, 0〉, where no particles (first four entries) or gauge-field excitations (last entry) are present. We study its time evolution under the Hamiltonian given in equation (9). As depicted in Extended Data Fig. 1, the initial state in qubit–qudit form is given by |↓↑↓↑, 0〉. This time evolution can be interpreted as a quench from the strong-coupling regime (g−2 1), where the bare vacuum is the ground state, to a weaker coupling. To simulate this time evolution on our quantum hardware, we performed a Trotter protocol65,82. We decomposed the Hamiltonian into a sum \(\hat{H}=\sum_{i}{\hat{h}}_{i}\). Then the state at time t calculated with NT Trotter steps is given by

$$\underbrace{\prod _{i = 1}\exp \left(-\mathrm{i}\frac{t}{{N}_\mathrm{T}}{\hat{h}}_{i}\right)\ldots \prod _{i = 1}\exp \left(-\mathrm{i}\frac{t}{{N}_\mathrm{T}}{\hat{h}}_{i}\right)}_{{N}_\mathrm{T}\text{times}}\left\vert \downarrow \uparrow \downarrow \uparrow ,0\right\rangle .$$
(19)

We chose the following decomposition into Trotter steps for the Hamiltonian given in equation (9):

$${\hat{h}}_{1}=\varOmega \left({\hat{\sigma }}_{1}^{+}{\hat{U}}^{\dagger }{\hat{\sigma }}_{2}^{-}-{\hat{\sigma }}_{4}^{+}{\hat{\sigma }}_{3}^{-}+\text{H.c.}\right),$$
(20a)
$${\hat{h}}_{2}=\varOmega \left({\hat{\sigma }}_{2}^{+}{\hat{\sigma }}_{3}^{-}-{\hat{\sigma }}_{1}^{+}{\hat{\sigma }}_{4}^{-}+\text{H.c.}\right),$$
(20b)
$${\hat{h}}_{3}=\frac{{g}^{2}}{4}\left({\hat{\sigma }}_{1}^{z}{\hat{\sigma }}_{4}^{z}-4\hat{E}{\hat{\sigma }}_{1}^{z}+2\hat{E}{\hat{\sigma }}_{2}^{z}-2\hat{E}{\hat{\sigma }}_{4}^{z}\right),$$
(20c)
$$\begin{array}{c}{\hat{h}}_{4}=\frac{m}{2}\left({\hat{\sigma }}_{1}^{z}-{\hat{\sigma }}_{2}^{z}+{\hat{\sigma }}_{3}^{z}-{\hat{\sigma }}_{4}^{z}\right)\\\qquad\qquad\quad\quad+\frac{{g}^{2}}{4}\left(8{\hat{E}}^{2}-4\hat{E}+{\hat{\sigma }}_{1}^{z}-{\hat{\sigma }}_{2}^{z}+3\right),\end{array}$$
(20d)
$${\hat{h}}_{5}=-\frac{1}{{g}^{2}}\left(\hat{U}+{\hat{U}}^{\dagger }\right).$$
(20e)

We experimentally realized the above Trotter protocol for a single Trotter step NT = 1. The gates in the Trotter circuit (Extended Data Fig. 3a) were experimentally implemented as follows. All local gates, including \({\hat{\sigma }}^{z}\), \(\hat{U}\) and \({\hat{E}}^{(2)}\), were realized as in the main text. Terms of the form \(\hat{E}{\hat{\sigma }}^{z}\) are (for qutrits) effectively equivalent to \({\hat{\sigma }}^{z}{\hat{\sigma }}^{z}\) and were realized by a standard Mølmer–Sørensen (MS) gate83 that was locally rotated using (subspace) Hadamard gates on all involved ions. Gates of the form \({\hat{\sigma }}^{+}{\hat{\sigma }}^{-}+\text{H.c.}\) were realized as \({\hat{\sigma }}^{x}{\hat{\sigma }}^{x}+{\hat{\sigma }}^{\,y}{\hat{\sigma }}^{\,y}\), which corresponds to a sequence of two locally rotated MS gates. This leaves only the term \({\hat{\sigma }}_{1}^{+}{\hat{U}}^{\dagger }{\hat{\sigma }}_{2}^{-}+\text{H.c.}\) Extending the decomposition given in ref. 84, this three-body coupling can be realized using 24 two-body MS gates:

$$\begin{aligned}\operatorname{e}^{\mathrm{i}\theta\left({\hat{\sigma}}_{i}^{+}{\hat{U}}_{j}^{\dagger}{\hat{\sigma}}_{k}^{-}+\text{H.c.}\right)}&=\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{z}_{01}}}\operatorname{e}^{\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{x}_{01}}{\hat{\sigma}}_{k}^{\,x}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{z}_{01}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{\,y}_{01}}}\operatorname{e}^{\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{01}}{\hat{\sigma}}_{k}^{\,y}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{\,y}_{01}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,y}_{01}}}\operatorname{e}^{-\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{01}}{\hat{\sigma}}_{k}^{\,x}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,y}_{01}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,x}_{01}}}\operatorname{e}^{-\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{01}}{\hat{\sigma}}_{k}^{\,y}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,x}_{01}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{z}_{12}}}\operatorname{e}^{\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{\,x}_{12}}{\hat{\sigma}}_{k}^{\,x}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{{z}_{12}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{\,{y}_{12}}}\operatorname{e}^{\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{12}}{\hat{\sigma}}_{k}^{\,y}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,y}{\hat{\sigma}}_{j}^{\,{y}_{12}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,y}_{12}}}\operatorname{e}^{-\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{12}}{\hat{\sigma}}_{k}^{\,x}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,y}_{12}}}\\ & \quad\operatorname{e}^{-\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,x}_{12}}}\operatorname{e}^{-\frac{\mathrm{i}\theta}{4}{\hat{\sigma}}_{j}^{{z}_{12}}{\hat{\sigma}}_{k}^{\,y}}\operatorname{e}^{\frac{\mathrm{i}\uppi}{4}{\hat{\sigma}}_{i}^{\,x}{\hat{\sigma}}_{j}^{{\,x}_{12}}},\end{aligned}$$
(21)

where \({\hat{\sigma }}^{x,y,z}\) are the standard qubit Pauli operators, whereas \({\hat{\sigma }}^{{z}_{ij}}\) refers to the Pauli Z operator acting on the subspace spanned by the states {|i〉, |j〉} for the qutrit. In our simple proof-of-principle experiment, for a given initial state, it was not necessary to implement the full coupling term. Instead, we implemented only the non-trivial component for the given initial state, which required just six MS gates. Notably, all required interactions for the mixed-dimensional time evolution of 2D-QED are already part of our toolbox described in the main text.

The minimal realization using one Trotter step allowed us already to observe the dynamics of the mean particle number density \(\nu ={\langle {\hat{H}}_{m}\rangle }/{4}+{1}/{2}\), as shown in Extended Data Fig. 3. Note that ν = 0 for the bare vacuum, and ν = 1 for a completely filled system. We can see that, immediately after the quench, the kinetic part of the Hamiltonian brings pair-creation processes into play, which, therefore increases the particle density of the state. After some particles and antiparticles are created, however, pairs can be annihilated, leading to a decrease in the average particle density. Figure 3 shows how the dynamics of the particle number density ν and the plaquette expectation value \(\hat{\square }\) is approximated by the Trotter time evolution, with NT = 1, NT = 10 and NT →  (exact result).