A probabilistic spin annihilation method for quantum chemical calculations on quantum computers †

A probabilistic spin annihilation method based on the quantum phase estimation algorithm is presented for quantum chemical calculations on quantum computers. This approach can eliminate more than one spin component from the spin contaminated wave functions by single operation. Comparison with the spin annihilation operation on classical computers is given.

One of the most anticipated applications of quantum computers is electronic structure simulations of atoms and molecules. [1][2][3][4][5][6][7][8][9][10] Quantum computers are capable of calculating the full-CI energy in polynomial time against the size of a molecule by utilizing a quantum phase estimation (QPE) algorithm, 1 while it requires an exponentially longer time when executed on classical computers. A quantum-classical hybrid algorithm known as a variational quantum eigensolver (VQE) 2,3 has also been well studied for nearfuture applications in noisy intermediate-scale quantum (NISQ) devices. 11 Quantum chemical calculations on quantum computers form an interdisciplinary field including chemistry, physics, mathematics, biology and information science. The quantum devices that are currently available are noisy and do not have an enough number of qubits to implement quantum error correction codes and thus it is difficult to perform quantum chemical calculations on quantum computers of a size that is impossible for classical computers. However, recent runtime estimation revealed that the full-CI with more than 50 spatial orbitals can be executed on fault-tolerant quantum computers with B2000 logical qubits within a few days. 12 From the viewpoint of chemistry, the calculation of correct spin states is a crucial task because molecular properties such as magnetic parameters and reactivities depend on the relevant spin states. In the VQE-based electronic structure calculations, a constrained VQE was proposed to capture the desired spin state by adding a penalty term m[S 2 À S(S + 1)] to a Hamiltonian of the system. [13][14][15] Here, S 2 denotes a spin operator and S a spin quantum number. Spin symmetry preserving quantum circuits for wave function preparation 16,17 and application of spin projection operators 18,19 have been discussed. Simple symmetry verification quantum circuits with ancilla qubit measurement have also been reported and demonstrated for one-body operators like a number operator of electrons and an S z operator. [20][21][22] For QPE-based quantum chemical calculations, quantum circuits to construct spin symmetry-adapted configuration state functions (CSFs) 23,24 and multi-configurational wave functions 25 on quantum computers have been proposed; these can be used to prepare initial guess wave functions having larger overlap with the exact ground state than the Hartree-Fock wave function. Development of compact wave function encoding methods by utilising spatial and spin symmetries is also the topic of ongoing interests. [26][27][28] An approach for the calculation of the spin quantum number S of arbitrary wave functions on quantum computers has also appeared recently. 29 These approaches enable us to compute the wave functions of desired spin states and to check whether quantum simulations terminate with the desired spin state or not. Now, the simple and fundamental question arises: can we purify the spin contaminated wave functions obtained from quantum simulations by eliminating unwanted spin components? In the quantum chemical calculations on real quantum computers, hardware errors, arising from qubit decoherence and incomplete quantum gate operations, and mathematical errors, such as those due to a Trotter decomposition, can be the sources of the spin contamination. The hardware errors can be alleviated via various error mitigation techniques 30 and overcome if quantum error correction 31 is implemented, but the mathematical errors cannot be circumvented even if fault tolerant quantum computations become available. The QPE-based quantum chemical calculation requires the simulation of the time evolution of the wave function exp(ÀiHt)|Ci with large t, and the mathematical errors can be prominent. It should be noted that symmetry verification using the S z operator is not able to eliminate spin contaminants and thus the use of the S 2 operator is essential. A general symmetry adaptation approach by utilising Wigner projection operators, which is applicable to spin symmetry, was discussed by Whitfield, 32 but here we focus on another approach that is based on QPE. We propose a probabilistic spin annihilation (PSA) method based on the QPE algorithm to eliminate the spin contaminants.
Before discussing the spin annihilations on quantum computers, we briefly review the spin annihilations and spin projections of wave functions on classical computers. In quantum chemical calculations on classical computers, a spin annihilation operator A s+1 given in eqn (1) is often applied to spin contaminated wave functions. 33-37 where s denotes the spin quantum number of a desired spin state and s + 1 the next higher spin state to be annihilated. Note that A s+1 is a non-unitary operator and therefore the A s+1 operation does not conserve the norm of the wave function. In the spinunrestricted formalism, the largest spin contaminant is generally the S = s + 1 state, and the application of A s+1 can efficiently take away the spin contaminations. It should be noted, however, that if the spin contaminations from the S = s + 2 and higher spin states are comparable in weight to the S = s + 1 state, the application of A s+1 increases the hS 2 i value. 38 This is because the weight of the spin states changes in direct proportion to their S 2 eigenvalues as given in eqn (2), and the relative weight of the spin state with the higher spin quantum number increases.
To eliminate more than one spin contaminant, corresponding spin annihilation operators should be applied consecutively. A Löwdin's projection operator P s in eqn (3) can eliminate all spin components except for the S = s state. 39 Because both the spin annihilation operator A s+1 and the spin projection operator P s are not unitary, the execution of spin annihilations and spin projections on quantum computers requires at least one non-unitary operation, namely the measurement of the quantum state, and the relevant operation becomes probabilistic. We have achieved this non-unitary operation by means of one-qubit QPE.
QPE is a method to find the eigenvalues and eigenvectors of unitary operators on quantum computers exponentially faster than on their classical counterparts. 40 In the QPE-based full-CI calculations the time evolution of the wave function is simulated on quantum computers and the relative phase difference before and after the time evolution is read out by means of inverse quantum Fourier transformation. For the calculations of the spin quantum number S, the time evolution operator of electron spin exp(ÀiS 2 t) is used instead of exp(ÀiHt), where H is a Hamiltonian of the system. In this setting, we can compute the eigenvalue of the S 2 operator, S(S + 1), of the wave function being used. 29 Note that H and S 2 have simultaneous eigenfunctions because H and S 2 commute. An additional quantum gate Z Z defined in eqn (4) is introduced to efficiently calculate the spin quantum number of odd-electron systems.
The introduction of the Z Z gate corresponds to the use of an (S 2 À Zp1/t) operator instead of the S 2 in time evolution. By utilising the Z Z gate, the time evolution of the wave function of a particular spin state can be cancelled, which enables us to discriminate the spin-doublet state (S = 1/2) from the spinquartet (S = 3/2) state in the one-qubit QPE. 29 To achieve the PSA on a quantum computer, a quantum circuit depicted in Fig. 1 is constructed. In Fig. 1, |C Cont i and |C Anni i stand for spin contaminated and spin annihilated wave functions, respectively. This quantum circuit corresponds to the one-qubit QPE for the spin quantum number determination with t = p/2(s + 1) and Z = s(s + 1)t/p = s/2. Under this quantum circuit, the wave function of the spin quantum number S = k evolves as in eqn (5) and (6).
From these equations, the measurement of the top qubit in Fig. 1 always gives the |0i state for k = s, and returns the |1i state for k = s + 1. Thus, if the measurement outcome is the |0i state the S = s + 1 spin components can be projected out. The success probability of PSA is given as [1 + cos(K)]/2. Importantly, the PSA can scavenge more than one spin component by a single operation. Let us assume the spin singlet (S = 0) wave function contaminated by the spin-triplet (S = 1) and spin-quintet (S = 2) states, as in eqn (7).
Applying the PSA, the quantum state before the measurement is described as in eqn (8). Clearly, not only the spin-triplet but also spin-quintet components are removed simultaneously if the measurement gives the |0i state. For general spin contaminated wave functions, the quantum state before the measurement can be written as in eqn (9).
Here, c k denotes the coefficient of the component of the spin quantum number S = k in |C Cont i and d k,t,Z,u is a coefficient depending on the spin quantum number k, the evolution time t, the rotation angle Z, and the measurement outcome u. Although the spin annihilation on a quantum computer is probabilistic, it can eliminate more than one spin contaminant, in contrast to the spin annihilation using A s+1 .
To demonstrate the PSA, the numerical simulations of the quantum circuit given in Fig. 1 were carried out by using the python program developed with OpenFermion 41 and Cirq 42 libraries. In the time evolution of the wave function under the S 2 operator, we used a generalised spin coordinate mapping (GSCM) proposed before 29 in conjunction with the secondorder Trotter decomposition as given in eqn (10) and N = 2. The GSCM was designed to perform spin operations on quantum computers equipped with a smaller number of quantum gates than conventional approaches like Jordan-Wigner transformation (JWT) 1,43 and Bravyi-Kitaev transformation (BKT). 44 In the GSCM, the occupancy of a molecular orbital is mapped onto two qubits, the same as JWT and BKT. In the GSCM, the first qubit represents whether the molecular orbital is openshell (|1i) or not (|0i), and the second one denotes the occupation number of the b-spin orbital. Thus, the doubly occupied, singly occupied by spin-a electron, singly occupied by spin-b electron, and unoccupied orbitals are represented as |01i, |10i, |11i, and |00i, respectively. In the GSCM, the number operator for unpaired electrons becomes a one-qubit operation, while it requires a two-qubit operation in JWT. By adopting the GSCM, the number of quantum gates required for the time evolution simulations under the S 2 operator is greatly reduced. In addition, we checked Trotter decomposition errors of the time evolution with six electrons in a twelve spin-orbital model with randomly prepared initial states with M S = 0, the findings indicated that GSCM is very robust against the Trotter decomposition, although JWT brings large Trotter decomposition errors (see ESI † for details). These facts mitigate the requirement for the number of quantum gates. To calculate the success probability of the PSA we have carried out 1000 simulations and counted the number to get the |0i state in the measurement.
We have carried out the PSA of the spin-singlet wave function contaminated by spin-triplet states, by changing the amount of spin contaminants from 0 (pure spin-singlet) to 1 (pure spintriplet). The starting wave function is given in eqn (11), where 2, u, d, and 0 stand for doubly occupied, singly occupied by spin-a electron, singly occupied by spin-b electron, and unoccupied, respectively.
|C Cont i = c ud |2ud0i + c du |2du0i (11) In eqn (11), the |C Cont i is a spin eigenfunction of S = 0 when c ud = Àc du . In the case of c ud = c du the |C Cont i is an S = 1 spin eigenfunction. A quantum circuit for the preparation of the |C Cont i state is given in Fig. 2a. By changing y from Àp/2 to p/2 in radian to increase the spin-triplet contaminant, the success probability of PSA decreases from 1 to 0 as illustrated in Fig. 2b (see ESI † for details). If the PSA succeeds, the quantum state after the PSA is given in eqn (12) regardless of the amount of spin contaminations.
To study the system comprising more than one spin contaminant, numerical simulations of PSA with the spincontaminated wave functions given in eqn (13) and (14) were executed.
Note that these single determinant wave functions are representatives in which the application of A s+1 increases the hS 2 i value. The spin annihilated wave functions of eqn (13) and (14) after normalization are given in eqn (15) and (16), respectively.
Theoretically PSA can generate the S = 0 spin eigenfunction given in eqn (17) when it is applied to the |ududi state. The hS 2 i value of |C Anni i is 0.0045 and the square overlap between the wave function obtained from numerical simulation and that given in eqn (17) is 0.9970. The explicit expansion of |C Anni i is provided in the ESI. † The Trotter decomposition error is responsible for the deviation from the spin eigenfunction. In fact, by increasing the Trotter slice N in eqn (10), the hS 2 i value of |C Anni i becomes smaller, giving hS 2 i o 0.0001 for N = 7 (see ESI †). The success probability of the PSA with the |ududi wave function is 0.340 in our numerical simulations, which is very close to the theoretical value 1/3.
For the |ududui wave function the theoretical success probability of PSA is 0.525 and hS 2 i of |C Anni i is 1.131. In this case, the spin-sextet (S = 5/2) spin component cannot be removed completely by applying the single PSA. Our numerical simulations gave the |0i state 511 times out of 1000 trials, and hS 2 i after the PSA is 1.132. Applying another PSA with s = 3/2 to |C Anni i can eliminate the remaining spin-sextet components and give hS 2 i = 0.753.
We emphasise that the hS 2 i value of |C Anni i is smaller than that of |C Cont i, in contrast with the A s+1 operation in eqn (15) and (16). The PSA on a quantum computer is more powerful than the A s+1 on a classical computer with respect to the scavenging ability of spin contaminants.
In conclusion, we have developed a PSA method based on one-qubit QPE to remove spin contaminants of wave functions stored on quantum computers. The PSA has the ability to eliminate more than one spin contaminant by the single operation, and the hS 2 i value after the PSA is always smaller than that obtained from the conventional spin annihilation operation A s+1 . Another possible approach to obtain spin annihilated wave functions from the spin contaminated ones is to combine an adiabatic quantum algorithm known as an adiabatic state preparation (ASP) 1,5,45,46 with the S 2 operator. The study of spin purification using ASP is underway and will be discussed in the forthcoming paper.

Conflicts of interest
There are no conflicts to declare.