Low-cost error mitigation by symmetry verification
X. Bonet-Monroig R. Sagastizabal M. Singh T. E. O'Brien

figures_resub/



Instituut-Lorentz, Universiteit Leiden, P.O. Box 9506, 2300 RA Leiden, The Netherlands

QuTech, Delft University of Technology, P.O. Box 5046, 2600 GA Delft, The Netherlands
Kavli Institute of Nanoscience, Delft University of Technology, P.O. Box 5046, 2600 GA Delft, The Netherlands

QuTech, Delft University of Technology, P.O. Box 5046, 2600 GA Delft, The Netherlands
Kavli Institute of Nanoscience, Delft University of Technology, P.O. Box 5046, 2600 GA Delft, The Netherlands

Instituut-Lorentz, Universiteit Leiden, P.O. Box 9506, 2300 RA Leiden, The Netherlands


We investigate the performance of error mitigation via measurement of conserved symmetries on near-term devices.
We present two protocols to measure conserved symmetries during the bulk of an experiment, and develop a third, zero-cost, post-processing protocol which is equivalent to a variant of the quantum subspace expansion.
We develop methods for inserting global and local symmetries into quantum algorithms, and for adjusting natural symmetries of the problem to boost the mitigation of errors produced by different noise channels.
We demonstrate these techniques on two- and four-qubit simulations of the hydrogen molecule (using a classical density-matrix simulator), finding up to an order of magnitude reduction of the error in obtaining the ground-state dissociation curve.

Low-cost error mitigation by symmetry verification
    T.E. O'Brien
    December 30, 2023
==================================================





§ INTRODUCTION

Noisy, intermediate scale quantum (NISQ) devices have begun to appear in laboratories around the world.
These devices have performance rates around or just below the quantum error correction threshold <cit.>, but are lacking the number of qubits required for full fault-tolerant quantum computing.
This raises the open question of whether the upcoming generation of quantum computers will provide a quantum advantage over classical computers, and in which fields this might be achieved <cit.>.
In particular, for the area of digital quantum simulation, it has been suggested that variational quantum eigensolvers <cit.> may be sufficiently low-cost to be performed on ∼ 50 qubits <cit.>.
Around this point, solving the many-body problem exactly becomes too challenging for classical computers, and a slight quantum edge might be available above current approximations.

In lieu of full error correction techniques, much attention is being turned to error mitigation techniques, which, although unscalable, promise modest improvements at low cost.
Previous work has focused on active error minimization, whereby data is obtained at artificially increased error rates and then extrapolated to zero <cit.>, and on probabilistic error cancellation, where an ensemble of noisy circuits is applied such that they average to the target error-free circuit <cit.>.
More specific techniques have been developed for quantum simulation, and in particular for variational quantum eigensolvers.
A technique developed for exploring the low-energy excited subspace of a quantum system, the quantum subspace expansion, has been shown to have error mitigation as a side-effect <cit.>.

In this work we investigate error mitigation via verification of symmetries found in quantum circuits, in particular those in physical systems.
This is a low-cost version of the stabilizer parity checks ubiquitous in quantum error correction <cit.>.
We develop multiple protocols to perform symmetry verification, both repeatedly throughout a quantum circuit and as a single post-processing step.
The latter can be related to a variant of the quantum subspace expansion <cit.>.
We study the sensitivity of symmetry verification to different noise channels, and demonstrate how it can be optimized by adding new symmetries and rotating existing symmetries to be more sensitive to local noise.



§ DEFINITIONS

In this section we cover some basic definitions to be used throughout this paper, and some details of quantum computing that may be skipped by the experienced reader.
We use the Pauli group on N qubits ^N={,X,Y,Z}^⊗ N throughout this work.
These operators form a basis for operators Ô∈^2^N,

    Ô=∑_P̂∈^NO_P̂P̂,

with coefficients O_P̂ in .
If we choose O_P̂∈, this is then a basis for the 2^N× 2^N Hermitian matrices.
We call such a basis decomposition of an operator Ô a Pauli decomposition.
Such a basis is orthogonal in the Frobenius norm:

    ||Ô||_F=√([Ô^†Ô]).

Elements P̂∈^N have two eigenvalues p=± 1, with corresponding eigenspaces of dimension 2^N-1, and projectors M̂_p=1/2(1 + pP) onto said eigenspaces.
The Pauli group has an additional property; if P̂≠^⊗ N∈^N, P̂ commutes with half of the elements of ^N ([P̂,Q̂]=0), and anticommutes with the other elements ({P̂,R̂}=0).
This property can be extended to a general operator Ô - [P̂,Ô]=0 ({P̂,Ô}=0) if and only if P̂ commutes (anticommutes) with each element of the Pauli decomposition of Ô (Eq. <ref>).

A quantum computation consists of multiple experiments, each of which can be split into preparations, transformations, and measurements.
In the ideal case, a preparation generates a quantum state on a register of N qubits, which is represented as a vector |ϕ in the complex vector space ^2^N.
Transformation consists of evolving this state to a new state |ψ∈^2^N, which may be represented via a unitary operator |ψ=U|ϕ (with U∈ U(^2^N), i.e. UU^†=U^†U=).
Measurement consists of observing the quantum state |ψ along some degree of freedom.
The degree of freedom is represented by a projector-valued measurement {M̂_i} for each possible observed value i, where ∑_iM̂_i=, M̂_i^2=M̂_i^†=M̂_i.
The observation records one such value i at random with probability p_i following the Born rule,

    p_i=|ψ|M̂|ψ|^2,

and the state of the system collapses into M̂_i|ψ/p_i.

In the presence of noise, the state of a qubit is instead given by a density matrix ρ∈^N, where ^N is the set of 2^N× 2^N postive, trace 1 matrices.
These are a generalized form of pure quantum states |ψ, which allow for statistical ensembles of pure states (the well-known adage being that preparing 1/√(2)(|0+|1) is strictly not the same as preparing |0 or |1 with 50% probability).
For every pure state |ψ, the corresponding density matrix is the outer product |ψψ|, and the expectation value of an operator Ô may be calculated as

    ψ|Ô|ψ=[Ô|ψψ|].

We will use the latter notation throughout this paper, to be consistent with calculating expectation values on mixed states ρ (where the standard bra-ket expectation value is no longer possible).
We will distinguish between operators Ô and density matrices ρ by the use of hats.
Note that the trace of products of density matrices is also well defined, and has an obvious interpretation as the overlap between the density matrices, as for pure states

    [|ψψ||ϕϕ|]=ψ|ϕϕ|ψ=|ϕ|ψ|^2.

Transformations and measurements of density matrices behave differently to those of pure states <cit.>, but we will not need details of this in this work.

A quantum algorithm incurs a cost based on the number of qubits and coherence time required for quantum hardware to execute it.
This cost is usually increased by error mitigation protocols that require additional gates or ancilla qubits.
However, these are in general low cost compared to the overhead required for full quantum error correction.
Indeed, some error mitigation protocols require no additional quantum hardware or circuitry, hence we define them as `zero-cost'.
Such protocols may require repetition of the algorithm in order to estimate expectation values [Ôρ], but this may be offset by parallelizing across multiple quantum devices.
This cost metric is then similar to the quantum volume <cit.> often used to characterize quantum hardware.



§ SYMMETRY VERIFICATION

Our study is motivated by the presence of symmetries in quantum mechanical systems.
In such systems, one has a Hamiltonian Ĥ, and is usually interested in studying the properties of ground or low-lying eigenstates of the system.
A (unitary) symmetry of a system is a unitary operator Ŝ that commutes with the Hamiltonian - [Ĥ,Ŝ]=0.
When this is true, Ĥ may be block diagonalized within the eigenspaces of Ŝ.
Then, if one were to study eigenstates of Ĥ on a quantum computer, one may perform such a study entirely within a single target eigenspace  of Ŝ.
In real-world quantum computers, noise may shift the state of the computer outside of the target eigenspace .
By verifying during or at the end of a calculation that the system remains in , and throwing away results where this is not the case, it is thus possible to make our quantum computation less sensitive to these types of noise.

Verification of a symmetry is performed by measurement and post-selection which is typically performed in the computational basis (the eigenstates |0 and |1 of a single qubit).
The Pauli operators ^N may be rotated into this basis relatively easily (see Sec. <ref>), and as such are a good class from which to draw symmetry operators.
If Ŝ∉^N, but the target eigenspace  lies within the eigenspace of a Pauli operator P̂, then measuring P̂ presents a low-cost alternative to measuring Ŝ, though this may provide less error mitigation in the case where the eigenspace of P̂ is strictly larger than .
In general, symmetry verification will work with any construction of a projector valued measurement {M̂_i} where one projector M̂_S projects onto the target eigenspace .
We note that phase estimation <cit.> provides a generic construction for such a measurement, although this is a rather high cost circuit (in particular requiring the ability to apply the symmetry Û on the quantum computer).
This requirement for measurement implies that symmetry verification cannot be extended to antiunitary symmetries (nor to symmetries that anticommute with the Hamiltonian), as these do not lead to eigenspaces that can be projected into.

The projector valued measurement {M̂_i} is the more general object for symmetry verification than the symmetry Ŝ.
In an arbitrary quantum circuit at an arbitrary time, if we know by any means that the state |ψ in the absence of error satisfies M̂_s|ψ=|ψ, measuring {M̂_i} on the noisy state ρ and post-selecting will project to the state

    ρ_s=M̂_sρM̂_s/[M̂_sρ].

Then, we have

    [ρ_s|ψψ|]=[ρ|ψψ|]/[M̂_sρ]≥[ρ|ψψ|],

and our new state ρ_s has strictly greater overlap with the target |ψ than the pre-selection ρ (unless M̂_sρM̂_s=ρ, in which case ρ_s=ρ).
Such a procedure can be immediately extended to multiple operators Ŝ_1,Ŝ_2,…, as long as [Ŝ_i,Ŝ_j]=0. (If this is not the case, sequential symmetry verification projects between different eigenspaces, which is inefficient and greatly increases the number of experiments that must be thrown away.)
Symmetry verification may also be repeated at multiple points during a quantum circuit, by inserting measurement of Ŝ in between gates, as long as we expect the state |ψ(t) to be an eigenstate of Ŝ at time t during the circuit.
We call such protocols `bulk' symmetry verification, as opposed to `final' symmetry verification at the end of the an experiment.



§ ANCILLA AND IN-LINE SYMMETRY VERIFICATION

The simplest form of the symmetry verification involves the use of an ancilla qubit to measure the Pauli symmetry Ŝ.
Let us write Ŝ∈^n in terms of its tensor factors; Ŝ=⊗_iŜ_i, and let N_S be the number of nontrivial Ŝ_i={X,Y,Z}.
To each such Ŝ_i, we can associate a corresponding rotation R̂_i={exp(iπ/2Y),exp(-iπ/2X),1} (such that R̂_i|Ŝ_i=1=|0).
The verification circuit is then shown in Fig. <ref>(a).
For each non-trivial Ŝ_i, the corresponding qubit is rotated by R̂_i, then performs a controlled-NOT gate on the ancilla qubit, and finally is rotated by R̂_i^-1.
This requires that the ancilla qubit be coupled to each qubit in the system register that it measures, which is in general not possible in a quantum circuit.
As a low-cost alternative (Fig. <ref>(b)), the ancilla qubit may be shuffled along the system register via SWAP gates as it performs the controlled phase gate.
In either case, as the ancilla qubit must interact with each register qubit individually, the circuit depth must be O(N_S)

It is possible to forego the ancilla qubit in symmetry verification, by instead encrypting the symmetry Ŝ onto the computational degree of freedom of a qubit within the system itself, which is then read out.
In Fig. <ref>(a) we give an example circuit for this in-line symmetry verification, with circuit depth only O(log(N_S)).
This logarithmic depth requires qubits to be coupled as a binary tree, which is not possible in systems which allow only local couplings.
In general, for such a d-dimensional local coupling, the depth of the circuit must be at least O(N_S^1/d), being the minimum depth of a light-cone encompassing N_S qubits.
In Fig. <ref>(b) we give such a circuit for a system with linear connectivity.
Even when all-to-all coupling is available, the O(log(N_S))-depth circuit (Fig. <ref>(a)) may not be preferable, as the duty cycle for each qubit (i.e. the period of time between the first and last gate each qubit is involved in) is length O(log(N_S)).
By contrast, the duty cycle of an individual qubit during the circuit in Fig. <ref>(b) is O(1).
A short duty cycle implies that qubits can be used to perform other operations while the symmetry verification is ongoing, reducing the time cost when this circuit is performed as a small block of a larger computation.







§ VARIATIONAL QUANTUM EIGENSOLVERS

As an example target algorithm for symmetry verification, we consider ground state preparation for a Hamiltonian Ĥ via a variational quantum eigensolver <cit.>.
An (ideal) variational quantum eigensolver consists of a unitary circuit U(θ⃗), parametrized by a vector of free angles θ⃗ that control individual gates within the circuit.
This circuit acts on a starting state, which we take to be the computational basis state |0,…,0, to produce a variational final state |ψ(θ⃗)=U(θ⃗)|0,…, 0.
These angles are controlled classically to minimize the energy E(θ⃗)=ψ(θ⃗)|Ĥ|ψ(θ⃗).
This expectation value is calculated in an experiment by taking the Pauli decomposition of Ĥ (Eq. <ref>), preparing |ψ(θ⃗) and measuring each P̂_i repeatedly to accumulate statistics on ψ|P̂_i|ψ.

Variational quantum eigensolvers (VQE) are natural candidates for final symmetry verification, and common classes of VQEs are also natural candidates for bulk symmetry verification.
In particular, for fermionic systems (such as the electronic structure problem), global fermion parity is conserved, making it a prime target for symmetry verification.
(At low energy, for non-superconducting systems, the particle number is often conserved as well, but this is not a Pauli operator, and is much more difficult to measure.)
Using the Jordan-Wigner transformation on an N-fermion Hamiltonian, this symmetry takes the form Z^⊗ N.
Most VQEs consist of creating an approximate starting state (such as the Hartree-Fock state) that respects this symmetry, and then performing multiple local rotations that continue to respect this symmetry.
This is true of both the unitary coupled cluster (UCC) ansatz <cit.>, and the quantum approximate optimization algorithm (QAOA) <cit.>.
In the former, the ansatz is taken as the expansion of the cluster operator e^T̂-T̂^†

    T̂   =∑_nT̂^(n),
    T̂^(n)   =∑_i_1,…,i_n;j_1,…,j_nθ^i_1,…,i_n_j_1,…,j_n(∏_m=1^n_i_m)(∏_m=1^n_j_m)

where the θ parameters are taken as the free parameters to be optimized, and the sum is a sum over empty molecular orbitals to the left of the semi-colon, and filled molecular orbitals to the right.
This exponentiation is typically performed by the Trotter-Suzuki expansion, leaving a series of unitaries

    ∏_i;je^θ^i_j(_i_j-_j_i)∏_i,j;k,le^θ^i,j_k,l(_i_j_k_l-_l_k_j_i)…

each of which respects fermion parity.
QAOA for the electronic structure problem consists of performing steps of time evolution alternating between the Hartree-Fock Hamiltonian and the electronic-structure Hamiltonian, both of which respect fermion parity.
Thus, for both ansatz, bulk symmetry verification could be performed between individual steps of the time evolution.

Although symmetry verification promises a final state with greater overlap with the ground state, it does not promise a necessarily lower energy.
Let us write the (un-normalized) symmetry-accepted state ρ_s, and the symmetry-rejected state ρ_r. If our measurement was perfect, we would have

    ρ_s=M̂_sρM̂_s,ρ_r=(-M̂_s)ρ(-M̂_s).

Then, [Ĥρ]=[Ĥρ_r]+[Ĥρ_s].
Now, suppose the rejected state ρ_r has lower energy than the accepted state ρ_s;

    [Ĥρ_r]/[ρ_r]<[Ĥρ_s]/[ρ_s].

We can calculate

    [Ĥρ]=[ρ_r][Ĥρ_r]/[ρ_r]+[ρ_s][Ĥρ_s]/[ρ_s]
       <([ρ_r]+[ρ_s])[Ĥρ_s]/[ρ_s]=[Ĥρ_s]/[ρ_s],

and our symmetry-verified state would be higher in energy than the initial state as well.
As the energy of ρ_r lies strictly above the ground state, failure of symmetry verification must imply ρ_s has sufficiently large overlap with high-energy states.
As such, we would suggest that such a failure implies the energy of ρ itself is not to be trusted.



§ POST-SELECTED SYMMETRY VERIFICATION AND S-QSE

Conveniently, when a quantum computation requires calculating the expectation values of a set of Pauli operators, symmetry verification may be performed via post-processing of the expectation values themselves (with possibly some additional measurements), rather than requiring additional quantum circuitry.
Suppose we want to calculate the expectation value of P̂∈^N on our state ρ following projection onto the Ŝ=s(=± 1) subspace of our symmetry Ŝ∈^N.
The projector onto this subspace may be written M̂_s=1/2(1+sŜ).
Then, the expectation value of P̂ on the state ρ_s targeted by the symmetry verification can be expanded using Eq. <ref>

    [P̂ρ_s]    = [P̂M̂_s ρM̂_s/[M̂_s ρ]] 
       = [P̂ρ] + s[P̂Ŝρ]/1 + s[Ŝρ],

where we have used the cyclic property of the trace and the fact that [P̂,M̂_s]=0 to write [P̂M̂_sρM̂_s]=[P̂M̂_sρ], and expanded our definition of M̂_s.
The expectation values [Ŝρ], [P̂ρ], and [P̂Ŝρ] may be then calculated using the unverified state ρ, and substituted into Eq. <ref> to obtain the verified result.
By avoiding additional quantum circuitry, we expect this method to outperform both ancilla and in-line symmetry verification.
However, we note that post-selection cannot be used for bulk symmetry verification (as we cannot measure these expectation values during the circuit).
Furthermore, it cannot be used in algorithms where the output is not an expectation value [P̂ρ].

Post-selected symmetry verification can be observed to be identical to a form of the quantum subspace expansion (QSE) <cit.>.
Originally designed to investigate the low-energy excited states around the ground space found by a variational quantum eigensolver, QSE works by taking a set of excitation operators {Ê_i}, which can be applied to the approximated ground state |ψ(θ⃗) to obtain a set of states |ϕ_i=Ê_i|ψ(θ⃗).
The spectrum of the Hamiltonian within the manifold spanned by these states can be calculated as the solution to the generalized eigenvalue problem

    Ĥ_QSE|ξ=λB̂_QSE|ξ.

Here, Ĥ_QSE is the Hamiltonian matrix projected into the spanned manifold

    [Ĥ_QSE]_i,j=[Ĥ|ϕ_iϕ_j|],

and B̂_QSE is the overlap matrix,

    [B̂_QSE]_i,j=[|ϕ_iϕ_j|],

to account for the fact that |ϕ_i and |ϕ_j are in general not orthogonal.
In the presence of noise, although the state |ϕ_i is not well defined (as our noisy state ρ is not a pure state), the operators |ϕ_iϕ_j|=Ê_iρÊ_j^† remain well-defined, and the expectation values in Eqs. <ref> and <ref> are still able to be measured in an experiment.

The set {Ê_i} is usually taken to be the set of low-order polynomials in qubit or fermion operators <cit.>.
However, if the set {,Ŝ} is chosen as excitation operators, the solution to the generalized eigenvalue problem is the same as that obtained by post-selection.
To show this, we expand

    [Ĥρ_s]   =∑_ih_i[P̂_iρ_s]
       =∑_i[h_iP̂_̂îρ] + s[h_iP̂_̂îŜρ]/1 + s[Ŝρ]
       =[Ĥρ]+s[ĤŜρ]/1+s[Ŝρ].

Next, we calculate the QSE matrices (using the commutation of Ĥ and Ŝ)

    Ĥ_QSE   =[[  [Ĥρ] [ĤŜρ]; [ĤŜρ]  [Ĥρ] ]],
    B̂_QSE   =[[    1 [Ŝρ]; [Ŝρ]    1 ]].

Assuming that [Ŝρ]≠ 1, B̂_QSE is invertible, the problem reduces to finding the (regular) eigenvalues of

    B̂_QSE^-1Ĥ_QSE=1/1-[Ŝρ]^2[[ α β; β α ]],

where

    α   = [Ĥρ]-[Ŝρ][ĤŜρ],
    β   = [ĤŜρ]-[Ĥρ][Ŝρ].

The eigenvalues of this matrix take the form

    λ   =1/1-[Ŝρ]^2(α±β)
       =[Ĥρ]±[ĤŜρ]/1±[Ŝρ],

which can be seen to be equal to those found in Eq. <ref>.
We call this version of the quantum subspace expansion symmetry-QSE, or S-QSE for short.

This result is not surprising; it was suggested in <cit.> to account for symmetries during QSE by projecting Ĥ_QSE and B̂_QSE into the symmetry subspace, which achieves the same result as in the above.
However, this demonstrates that one may account for symmetries via a version of QSE without calculating the full linear response.
Moreover, this implies that S-QSE corrects for both coherent and incoherent errors that project out of the Ŝ=s subspace.
By contrast, QSE with an operator that anticommutes with the Hamiltonian can only correct coherent errors (see appendix).
S-QSE may be immediately combined with other forms of QSE, for example linear response QSE, by including both sets of operators as excitations.



§ SIMULATION OF SYMMETRY VERIFICATION ON THE HYDROGEN MOLECULE

To first investigate symmetry verification in a simple setting, we use a VQE to find the ground-state energy of H_2 on two qubits.
This follows previous experimental demonstrations <cit.>.
We take the STO-3G basis for H_2, which has four spin-orbitals, and convert this into a qubit Hamiltonian via the Bravyi-Kitaev transformation.
The four spin-orbitals require four qubits to represent them on, but in this representation the Hamiltonian is diagonal on two of the qubits, which may be removed.
The remaining two-qubit Hamiltonian takes the form

    Ĥ=h_0+h_1 Z+h_2 Z + h_3XX + h_4YY + h_5ZZ,

where h_i are sums of integrated two and four-body terms from the original electronic structure problem.
The calculation of these terms, and the Bravyi-Kitaev transformation itself, were performed using the psi4 <cit.> and OpenFermion <cit.> packages.
The Hamiltonian can be seen to commute with the symmetry Ŝ=ZZ.
Our ground state wavefunction has non-trivial overlap with the Hartree-Fock wavefunction, which is in the ZZ=-1 subspace; this is then our target subspace. 
We follow the unitary coupled cluster ansatz of <cit.>, which consists of exciting our system to the |01 state, and performing the unitary rotation

    Û(θ)=e^-iθ X_0Y_1.

This unitary rotation may be decomposed using standard methods <cit.>.
As described previously, the VQE procedure consists of fixing θ, repeatedly preparing |ψ(θ) and measuring collections of terms in the Pauli decomposition of Ĥ until a good estimate of the energy E(θ) is found.
This is then repeated at varying θ as demanded by a classical optimizer until a minimum E(θ) is found <cit.>.

We compare the performance of the three symmetry verification protocols described previously as a final symmetry verification step.
The ancilla symmetry verification is performed in the same manner as Fig. <ref>(a).
The in-line symmetry verification is performed in a manner similar to Fig. <ref>(a), but as this is final symmetry verification, we have no need to undo the symmetry measurement.
Instead, to measure the expectation value of a Pauli operator [ρP̂], we can propagate P̂ through the symmetry verification circuit <cit.> and measure the corresponding Pauli term.
It is then sufficient to rotate the control qubit to recover the expectation values Z and XX.
From this we may calculate all other expectation values in Eq. <ref> using the fact that ZZ=-1.
For this problem, S-QSE not only requires no additional circuitry, but also no additional measurements (all required terms are in the Pauli decomposition of the Hamiltonian).

To test symmetry verification in the presence of realistic noise, we simulate our chosen experiment using the quantumsim density matrix simulator <cit.>.
We take gate error models and parameters similar to previous simulation work based on experimental data of state-of-the-art superconducting transmon qubits <cit.>.
Errors in transmon qubits are dominated by decoherence times, which we take at a base level to be T_1=T_2=20 μs.
This should be compared to single and two-qubit gate times of 20 ns (giving a total circuit length without symmetry verification of 220 ns).
Single and two-qubit gates suffer from additional dephasing noise of 0.01% and 1% respectively.
We assume that single-shot measurement (for verification purposes) has a read-out error of 1%, and that error in tomographic measurements and pre-rotations (used to calculate the expectation values themselves) can be cancelled by linear inversion tomography <cit.>.

Using the above error model, we observe (Fig. <ref>) that the un-mitigated VQE (blue points) achieves an error in the energy of approximately 0.01-0.04 hartree across the bond dissociation curve.
This error is improved upon by all symmetry verification techniques.
S-QSE (red diamonds) provides the largest improvement of all symmetry verification protocols, as no additional errors are introduced.
The S-QSE circuit is observed to give approximately a five-fold improvement over the unmitigated circuit, while ancilla (orange crosses) and in-line (green squares) symmetry verification show an approximately two-fold and three-fold improvement respectively.
The differences between S-QSE and other forms of symmetry verification emphasize the importance of minimizing the verification cost in bulk symmetry verification (where S-QSE is no longer available).



We now investigate the effect of different noise channels on the performance of symmetry verification.
Any noise channel that commutes with the symmetry operators evolves the system state within the target subspace, which symmetry verification explicitly does not mitigate.
The analysis of which channels have this property can be reduced to an analysis over ^N, as if we mitigate Pauli errors P̂_i∈^N, we also mitigate any linear combination of them <cit.>.
In the above circuit, the ZZ symmetry commutes with any single-qubit Z errors, making the protocol prone to the T_ϕ (pure dephasing) channel, but it anticommutes with single-qubit X-errors, making the protocol resilient against the T_1 (amplitude decay) channel.
To investigate this, in Fig. <ref> we calculate the error in determining the ground state energy near the minima of the bond dissociation curve (0.75Å bond distance) using S-QSE, as we vary T_1 and T_ϕ.
We turn all other error sources off, and vary T_1 (T_ϕ) with T_ϕ=20 μs (T_1=20 μs) fixed.
In the absence of error mitigation, the two decoherence sources have almost identical effect (deviation approximately 10^-2 hartree).
However, in the presence of error mitigation, the susceptibility of the VQE to T_1 noise is noticeably smaller than to T_ϕ noise - up to a factor of two over the range of decoherence times plotted.
We note that S-QSE does not make our circuit second-order sensitive to T_1 noise.
This can be understood as X-errors at some points during our VQE circuit are rotated to Z-errors by later gates in the circuit, preventing their mitigation.






§ INSERTING AND ROTATING SYMMETRIES


As observed in the previous section, verifying single symmetries has a marked effect on the performance of a quantum circuit, but will not catch and remove all sources of noise.
In this section we suggest how one may improve upon this by adding additional symmetries to the quantum algorithm, and by rotating existing symmetries to make them more sensitive to errors on the underlying quantum hardware.
In the language of quantum error correction, this is a low-cost attempt to increase the distance of the detection code.

We first suggest a method to extend an N-qubit Hamiltonian Ĥ, given a Pauli operator P̂∈^N, to an N+1-qubit Hamiltonian Ĥ_ext

    Ĥ_ext=[[     Ĥ     0;     0 P̂ĤP̂ ]].

Both blocks of Ĥ_ext can be seen to have the same eigenspectrum (as this is unaffected by the unitary rotation of P̂), and Ĥ_ext commutes with the operator

    [[  0 P̂; P̂  0 ]]=XP̂,

which is then the new symmetry operator.
This mapping corresponds to mapping Pauli operators Q̂∈^N in the original problem to

    Q̂_ext=Q̂   if  [Q̂,P̂]=0
    
    XQ̂   if {Q̂,P̂}=0.

To implement this in the algorithm itself, we note that every circuit can be decomposed into a product of unitary rotations

    ∏_je^iθ_jQ̂_j,Q̂_j∈^N,

where a single Q̂∈^N may be repeated in the product.
Adding the symmetry then consists of replacing these rotations by rotations around the transformed operator Q̂_ext (as per Eq. <ref>), and re-decomposing the operations into a circuit (using e.g. the methods of <cit.>).
If Ĥ had a previous set of symmetries Ŝ_i, these are transformed to a new set Ŝ_i,ext (following Eq. <ref>), that commute with both Ĥ_ext and the additional symmetry XP̂.
This extension method is particularly suitable for digital quantum simulation, as circuits are often generated in the form of Eq. <ref>.
This is the case for traditional Hamiltonian simulation <cit.>, quantum phase estimation <cit.>, and the UCC QSE discussed previously, all of which require exponentiating an operator via the Suzuki-Trotter expansion <cit.>.

Beyond choosing the number of symmetries in a problem, one may wish to choose how these symmetries appear in the problem.
In particular, sets of symmetries may be found that anticommute with all local operators, which should increase the mitigation power of the verification protocol against local sources of noise.
(For example, the N-qubit operators X^⊗ N and Z^⊗ N with even N.)
Any two groups of M Pauli operators are unitarily equivalent as long as they satisfy the same commutation and multiplication rules (e.g. Z, Z, and ZZ are equivalent to XX, YY and ZZ, but not to X, Y and Z).
To find such unitary transformations, we suggest decomposing them into rotations of the form R̂=e^iπ/2Q̂ for Q̂∈, which transforms

    P̂∈→R̂^†P̂R̂=P̂   if [P̂,Q̂]=0
    iP̂Q̂   if {P̂,Q̂}=0 .

Rotations of this form have a few desirable properties.
Their effect is easy to calculate classically, and they transform Pauli operators to Pauli operators.
Furthermore, each R̂ leaves half of the Pauli group unchanged.
This allows for some choice of rotations to leave desired symmetries (or other operators) already present in the problem invariant, while other terms are rotated.



§ EXTENDING THE SYMMETRY VERIFICATION OF THE HYDROGEN MOLECULE


We now demonstrate the verification of multiple symmetries by extending the previous VQE simulation of H_2.
We transform the electronic structure Hamiltonian onto a qubit representation this time via the Jordan-Wigner transformation.
This gives the four-qubit Hamiltonian

    Ĥ=   h_I +∑_ih_iZ_i +1/2∑_i≠ jh_i,jZ_iZ_j
       +h_s(X_0Y_1Y_2X_3+Y_0X_1X_2Y_3
       -X_0X_1Y_2Y_3-Y_0Y_1X_2X_3),

which has symmetries Ŝ_0=Z_0Z_1, Ŝ_1=Z_0Z_2, and Ŝ_2=Z_0Z_1Z_2Z_3.
In the Bravyi-Kitaev transformation these symmetries were the additional qubits that were thrown away.
We choose again the unitary coupled cluster ansatz for the VQE, which can be reduced to the operator[The cluster operator for this system is a sum of 8 four-qubit terms, however the action of each term on the Hartree-Fock starting state is identical, so only one is needed.]

    Û(θ)=e^iθ Y_0X_1X_2X_3.

As in the two-qubit case, the VQE circuit consists of preparing the system in the Hartree-Fock state |1100, applying U(θ) and measuring the variational energy, for a total circuit time of 400 ns.

The above set of symmetries still commute with all single-qubit Z errors, so we rotate our problem to increase the mitigation power of symmetry verification.
We choose the rotation

    R̂=e^iπ/2Y_0X_2e^iπ/2Y_1X_3.

This transforms the symmetry Ŝ_0→ X_0X_1X_2X_3, whilst leaving Ŝ_1 and Ŝ_2 unchanged.
The resulting set of symmetries do not commute with any single-qubit X or Z operator, as required.
To create the transformed circuit, we need to transform both our starting state |1100→R̂|1100, and the UCC unitary ansatz 

    Û(θ)→R̂ÛR̂^†=e^iθ Y_0Z_1X_2.

The transformed circuit incurs an additional cost from this initial application of R̂, but this is balanced by the reduced weight of the transformed cluster operator, resulting in a total circuit time of 440 ns.

In Fig. <ref>, we compare the performance of the two different circuits above to the two-qubit circuit of Fig. <ref>, with and without the addition of S-QSE.
At small bond distance (≲ 0.75Å), the target ground state (in the absence of rotation by R̂) is roughly a computational basis state, which is immune to dephasing errors.
At this point, all three verification protocols perform roughly similarly, despite the unmitigated four-qubit simulations performing significantly worse than the unmitigated two-qubit simulation.
At large bond distance (≳ 0.75Å), the ground state is prone to T_2 noise, at which point we see the rotated 4-qubit S-QSE simulation significantly outperforming its counterparts.
At the largest distance studied, this simulation achieves a two-fold reduction in error compared to the two-qubit S-QSE simulation, despite using twice as many qubits and a twice as long circuit.
By comparison, unrotated S-QSE on four qubits cannot protect against the T_2 noise accumulated over the simulation, and performs a factor of two worse than the two-qubit S-QSE simulation.
This clearly demonstrates the need to optimize symmetry verification protocols to account for errors present in the system as this technique is scaled up to larger computations.
Over the entire bond-dissociation curve, the rotated four-qubit S-QSE simulation outperforms its unmitigated counterpart by over an order of magnitude.





§ CONCLUSION


In this paper we have presented a new low-cost strategy for error mitigation, which we call symmetry verification. We have discussed various ways in which it can be applied to different algorithms, and various methods to optimize the mitigation power against common sources of error. We have demonstrated these protocols on a simulated VQE experiment of H_2, and observed that they outperform the unmitigated result over the entire bond-dissociation curve by around an order of magnitude.

Although the above techniques are very promising for small experiments, much work needs to be done optimizing symmetry verification for mid-range experiments in the NISQ era.
The addition and choice of symmetries needs to be investigated further to minimize the resulting circuit depth.
Further study is also needed on the optimal number of symmetry verifications to be added to a circuit, both to maximise mitigation and minimize run-time (which increases exponentially in the number of verifications made).
Finally, given the obvious connection between symmetry verification and the stabilizer formalism of quantum error correction, it is natural to ask whether one can mix the two to transform slowly between mid-size NISQ circuits and large-scale fault-tolerant ones.

While this paper was in production, a related work by McArdle et al. <cit.> appeared on the ArXiv.
They simulate the performance of ancilla symmetry verification for a VQE, and its combination with other error mitigation strategies to further improve robustness against noise.
Their results are consistent with and complementary to our own, and they provide useful techniques for measuring non-Pauli operators not considered in this work.

The authors wish to thank Carlo Beenakker, Leonardo DiCarlo, Brian Tarasinski, Barbara Terhal, Detlef Hohl, Luuk Visscher, Francesco Buda, Yaroslav Herasymenko, and Adriaan Rol for feedback, advice and support in this project. This research was supported by the Netherlands Organization for Scientific Research (NWO/OCW) and by an ERC Synergy Grant.



§ APPENDIX: ERROR MITIGATION OF QSE WITH ANTICOMMUTING OPERATORS

In this appendix we repeat the analysis of QSE from the text, but with an operator Â that anti-commutes with the Hamiltonian Ĥ.
Let us assume to begin that Â is unitary.
Such an operator cannot be simultaneously diagonalized with Ĥ, and so we have no result from symmetry verification to compare with.
Given an eigenstate Ĥ|ψ=E|ψ, we have that ĤÂ|ψ=-ÂĤ|ψ=-EÂ|ψ, and so the presence of an anticommuting operator splits the eigenstates of Ĥ into pairs of equal magnitude but opposite sign energies (known as eigenstates of different chirality).
If Â=Â^†, the eigenstates of Â itself are the equal superpositions 

    |±=1/√(2)(|ψ±Â|ψ).


For QSE, we must calculate the operators Ĥ_QSE and B̂_QSE.

    B̂_QSE   =[[      1   [Âρ]; [Â^†ρ]      1 ]].
    Ĥ_QSE   =[[     [Ĥρ]    [ĤÂρ]; [-ĤÂ^†ρ]    -[Ĥρ] ]].

Again assuming |[Âρ]|^2≠ 1, we can invert B̂_QSE and calculate

    B̂_QSE^-1Ĥ_QSE=1/1-|[Âρ]|^2[[    α    β; -β^* -α^* ]],

where

    α   = [Ĥρ]+[Âρ][ĤÂρ]
    β   = [ĤÂρ]+[Ĥρ][Âρ].

The solution to the equation is

    E_QSE^2   =|α|^2+|β|^2/(1-|[Âρ]|^2)^2
       =[Ĥρ]^2+|[ĤÂρ]|^2/1-|[Âρ]|^2.

To understand the gain in energy, |[ĤÂρ]|^2, let us first consider a single set of opposite chirality states |ψ and Â|ψ (with energy ± E).
We first note that if ρ is an incoherent superposition of the eigenstates,

    ρ=|a|^2|ψψ|+|b|^2Â|ψψ|Â,

[ĤÂρ]=[Âρ]=0 (as ψ|A|ψ=0), and QSE strictly does not improve on the estimate of the ground state energy.
We next consider the opposite situation, where ρ is a coherent superposition of eigenstates:

    ρ=   (cos(θ)|ψ+sin(θ)e^iϕÂ|ψ)
       ×(cos(θ)ψ|+sin(θ)e^-iϕψ|Â^†).

We can calculate

    [Ĥρ]=Ecos(2θ),
       [Âρ]=sin(2θ)(1+Ae^iϕ),
       [ĤÂρ]=Esin(2θ)(Ae^iϕ-1),

where A=ψ|Â^2|ψ (so |A|≤ 1, and for Â∈^N, A=1).
This gives

    E_QSE^2   =E^2cos^2(2θ)+sin^2(2θ)χ_+/1-sin^2(2θ)χ_-,
    χ_±   =(1± Ae^iϕ)(1± Ae^-iϕ).

We see that if A=1,ϕ=π/2, QSE corrects the coherent error entirely, whilst if A=1,ϕ=0 it has no effect.
This implies that QSE cannot correct coherent rotations of ρ from |ψ towards an eigenstate of Â.
This is in keeping with the general observations in <cit.> for the performance of QSE as an error mitigation strategy.

If Â is not unitary, then Â^†Â is a Hermitian operator that commutes with Ĥ.
Importantly, if {Â,Ĥ}=0, {ÂĤ,Ĥ}=0 as well, giving a second anticommuting operator that is in general non-unitary.
This could be used directly in QSE, although the analysis of Sec. <ref> no longer holds unless Â^†Â∈^2.
For symmetry verification, we require the form of the projector M̂_a onto the correct Â^†Â|ψ=a|ψ subspace.
This is a difficult task in general to construct (for ÂĤ, it is equivalent to diagonalizing the Hamiltonian).
We have been unable to construct any further bounds on the performance of QSE as an error mitigation strategy for a general Hermitian operator, nor for an operator which neither commutes nor anti-commutes with Ĥ. This is, however, an interesting direction for future research.

apsrev4-1


