Quantum Multi-Round Resonant Transition Algorithm

Solving the eigenproblems of Hermitian matrices is a significant problem in many fields. The quantum resonant transition (QRT) algorithm has been proposed and demonstrated to solve this problem using quantum devices. To better realize the capabilities of the QRT with recent quantum devices, we improve this algorithm and develop a new procedure to reduce the time complexity. Compared with the original algorithm, it saves one qubit and reduces the complexity with error ϵ from O(1/ϵ2) to O(1/ϵ). Thanks to these optimizations, we can obtain the energy spectrum and ground state of the effective Hamiltonian of the water molecule more accurately and in only 20 percent of the time in a four-qubit processor compared to previous work. More generally, for non-Hermitian matrices, a singular-value decomposition has essential applications in more areas, such as recommendation systems and principal component analysis. The QRT has also been used to prepare singular vectors corresponding to the largest singular values, demonstrating its potential for applications in quantum machine learning.


Introduction
Calculating the eigenvalues and eigenstates of a Hamiltonian is a fundamental problem in quantum physics and chemistry. Furthermore, the singular-value decomposition (SVD) for non-Hermitian matrices plays a vital role in more fields. Fundamentally, one can solve the eigenequations of the matrices to get this information. However, calculating this problem is ineffective because the computational cost grows exponentially if the dimension of a matrix grows exponentially with the size of the systems, such as a molecular Hamiltonian [1].
Several quantum algorithms have come up to effectively obtain the energy spectrum in a quantum computer. The quantum phase estimation algorithm (PEA) [2,3] is one of the most famous quantum algorithms, which can obtain the eigenvalues of a Hamiltonian with a quantum advantage over classical algorithms. Nevertheless, before using the PEA, we should usually prepare an eigenstate as the initial state. For a complicated system, giving an appropriate guess state before the PEA is difficult. The adiabatic state preparation [4] is another quantum algorithm for preparing an eigenstate of a system, but the efficiency of the ASP algorithm depends on the minimum energy gap between the ground state and the first excited state of the adiabatic evolution Hamiltonian along the evolution path between the initial Hamiltonian and the system Hamiltonian, which is difficult to estimate in practice [5,6]. Many quantum algorithms aim to solve the ground state and energy for a given Hamiltonian. The quantum eigenvalue transformation of unitary matrices with real polynomials (QTE-U) is a useful tool that uses a single ancilla qubit and no multi-qubit gate to estimate the ground-state energy and prepare the ground state [7]. The quantum eigenvalue estimation algorithm can estimate the eigenvalues of a Hamiltonian from the expectation values of the evolution operator for various times [8]. Universal quantum cooling algorithms are another way to prepare the ground state by utilizing a dual-phase representation of decaying functions to universally and deterministically realize a general cooling procedure with shallow quantum circuits [9]. A variational quantum eigensolver [10] is one way that can provide a quantum over-classical advantage to accomplish this task by using a classical computer and a noisy intermediate-scale quantum device with a low coherence time. Almost all algorithms based on the variational principle need many samples to obtain the estimated values of the different items. A full quantum eigensolver [11] based on a linear combination of unitary operators [12][13][14][15][16] has obtained rapid theoretical development [17,18] and some state-of-the-art experimental demonstrations [18,19].
The quantum resonant transition (QRT) algorithm is one way to obtain eigenvalues and eigenvectors based on a Hamiltonian simulation. It just needs one ancilla qubit and one Hamiltonian evolution operator, which may be implemented on existing devices. In addition, it can obtain the energy spectrum of a Hamiltonian and each eigenstate directly rather than just the ground-state energy. The previous work in Refs. [20][21][22][23][24] determined the energy spectrum and ground state of a two-qubit low-energy effective Hamiltonian of the water molecule. We design new multi-round processing to improve the efficiency of the QRT algorithm that reduces the complexity from O(∆E/ 2 ) to O(R/ ), with an eigenvalues range ∆E, the number of eigenvalues R and the accuracy . We utilize a nuclear magnetic resonance (NMR) four-qubit quantum simulator to solve the eigenproblem of a three-qubit effective water molecule Hamiltonian in a given energy range. Non-Hermitian matrices are more common in a broader range of fields, such as data compression and principal component analysis. Therefore, we also show its ability to determine the singular vectors of a simple non-Hermitian matrix as an example.
In this paper, we introduce the QRT-based algorithm and our improvement in Section 2, show the details and results of the experiments in Section 3, and analyze some details of this work in Section 4.

Materials and Methods
QRT is a common quantum phenomenon in which energy will transit from one system to another. It often happens in two systems with close eigenenergies, such as photons and atoms. In order to make the QRT algorithm easier to understand, we first introduce the algorithm of determining eigenstates of H s with known eigenvalues and then explain how to obtain eigenvalues in a given range through QRT.
The Hamiltonian of the QRT algorithm is constructed as where I is the identity operator and σ x,z are the Pauli matrices. The first term in the above equation is the Hamiltonian of the probe qubit where ω is its frequency. The second term H T is the Hamiltonian of the work qubits in subspace |1 of probe qubit, and the third term describes the interaction between probe qubit and work qubits with coupling strength c and interaction matrix A. The Hamiltonian H T is given by where ω 0 is a parameter set as a reference point to the energy E i of H s . In the algorithm, we firstly set the probe qubit in |0 and the work qubits in a reference state |Φ , which means the initial state of the circuit is an eigenstate of H T with eigenvalue ω 0 . Considering the example of solving the ground state of the H s , we set ω + ω 0 ≈ E 0 . Simulating the Hamiltonian in Equation (1) with evolution time τ, we apply the first-order perturbation theory with small c |E 0 |, and the state of all qubits can be formulated as where |Ψ 0 is the ground state of H s and Ω 0 = 2c| Ψ 0 |A|Φ |. Here, φ 1 and φ 0 are phases that are inessential in this algorithm. By measuring the probe qubit, we can easily affirm the state of work qubits. If the evolution time τ = π 2c| Ψ 0 |A|Φ | , the final state will be |1 ⊗ |Ψ 0 determinately. The procedure to prepare the eigenstates by QRT is shown as follows.
(i) Initialize the state to |0 ⊗ |Φ . It should be noted that a better guess state |Φ obtained from preprocessing, such as the tensor-network method, will shorten the evolution time τ to improve the efficiency.
(ii) Dynamical evolution. The Hamiltonian is shown in Equations (1) and (2). Appropriate evolution time will increase the probability of success in the next step.
(iii) Measure the probe qubit. If ω + ω 0 ≈ E i , the measurement result will be |1 with a certain probability, and the state of work qubits would be the corresponding eigenstate |Ψ i . When the measuring result is |0 , the state of all qubits is |0 ⊗ |Φ , then we should return to step (ii) and run again until the measurement result is |1 .
Compared with the original work, it saves one qubit to do the same things [20]. Usually, we just have an approximate eigenenergy but not an exact one, then the off-resonance will happen, and the amplitude of Rabi oscillation will be In other words, it is also accessible to |Ψ 0 with a high probability when ∆E ≤ Ω 0 .
In the above example, we have assumed that the energy spectrum of H s is almost known. In the following, we show how to obtain the energy spectrum in a given range of energy. In the previous algorithm, the probability of probe qubit in |1 will depend on evolution time τ if ω + ω 0 approximates any eigenvalue E i . Assuming that the energy range is from E min to E max , we pick N equally spaced points ω k (k = 1, 2, . . . N) in this range with step ∆ω = E max −E min N and set ω + ω 0 = ω k , respectively, then run the previous algorithm. By measuring the probability P k of probe qubit in |1 for each ω k , it is obvious that QRT will happen if ω k ≈ E i , and the probability of |1 will increase in these points. As mentioned above, off-resonance will happen, and the amplitude of Rabi oscillation will be bigger when ω k gets closer to E i . We can find ω k corresponding to the points of peaks (the approximate valueẼ i of eigenvalue E i ) with a higher P k , and reset ω + ω 0 near these pointsẼ i with smaller step ∆ω and c to reduce the error of off-resonance. The process that updatesẼ i will repeat many times until the precision is sufficient, and theẼ i in the final process are the eigenvalues with limited error. It can be summarized by Algorithm 1. The original QRT method just set ω k = E min + k where k = 0, 1, 2, . . . E max −E min . It will directly scan the interesting range of eigenvalues at regular intervals. By this loop program, the efficiency of the QRT-based eigenvalues search algorithm is improved due to ignoring non-resonance points.
It is worth mentioning that a better initial state |Φ with an appropriate transition operator A will also shorten evolution time τ. For example, if we have an approximate guess state |Φ about the target eigenstate (such as ground state), then we set A = I, and the evolution time would be greatly reduced to improve the efficiency.

Results
We demonstrate the algorithm in a four-qubit liquid nuclear magnetic resonance (NMR) system. In these experiments, the four-qubit sample used is 13 C-labeled transcrotonic acid dissolved in d6-acetone with the 1 H decoupled throughout the entire process. In this letter, the energies and time are recorded in units of Hartree and Hartree −1 . The structure and parameters of this molecule are illustrated in Figure 1. Here, C1 is chosen as the probe qubit and C2-C4 are the work qubits. The internal Hamiltonian under a weak coupling approximation is where v i is the chemical shift and J ij is the J-coupling strength between the ith and jth nuclei. All experiments are carried out on the Bruker DRX 600-MHz spectrometer at room temperature (298 K).

Eigenvalues and Eigenstates of Water Molecule Hamiltonian
In this subsection, we demonstrate how to obtain the eigenvalues and determine the eigenstates by the QRT algorithm in a four-qubit NMR system. The schematic diagram and quantum circuit are shown in Figure 2. The first step of the NMR experiments is preparing the Pseudopure State (PPS). We use the spatial averaging technique method [25][26][27] to obtain it by several gradient fields and unitary operators. The density matrix of a four-qubit PPS is |ρ 0000 = 1 − 16 where the polarization ≈ 10 −5 . The identity matrix will not show any signal so the second term is the effective density matrix. In this algorithm, the initial state |0 ⊗ |000 is the same with the effective density matrix of the PPS so we are actually done initializing the state after preparing the PPS. The density matrix of the PPS is constructed by using the quantum state tomography technology [28][29][30][31][32] and obtaining a fidelity of 99.51% between the experiment result and |0000 0000|. The fidelity of the initial state is high enough that we can proceed to the next step.
The Hamiltonian simulation is the vital step in this algorithm. As mentioned above, the Hamiltonian we simulate is shown in Equations (1) and (2), where the quantum circuit to implement the evolution operator U = e −iHt using the Trotter formula is shown in Figure 2b. The state |Φ is |000 here, and H s is the effective Hamiltonian of the water molecule in an eight-dimensional Hilbert space. The transition operator where H d is the Hadamard operator. Here, we set ω = 1, and the details of the water molecule Hamiltonian H s are shown in Appendix A. Assuming that the interesting range of eigenvalues is from −84.30 (E min ) to −80.70 (E max ), we firstly set sixty points where ω + ω 0 is changed from E min to E max at regular intervals and c = 0.05. To detect the energy spectrum of the Hamiltonian, we need to obtain the possibility of C1 (probe qubit) in |0 , i.e., Tr(ρ|0 0|I I I). By applying the readout pulse YI I I, where Y denotes a rotation of π/2 along the y axis, Tr(ρ|0 0|I I I) = Tr(ρ(I I I I + σ z I I I)/2) can be extracted from the fitting of the experiment's data.
The results of these experiments are shown in Figure 3a, which has some peaks in different coordinates. From the position of these peaks, we deduce eight peaks roughly When we obtain the energy spectrum of the Hamiltonian H s by our method or other methods, we can prepare the eigenstates of this Hamiltonian. Here, we assume that the accurate energy of the ground state is known and set ω + ω 0 = −83.9558, which is the lowest energy level of H s . After repeating the previous three steps, the final quantum state is |1 ⊗ |Ψ 0 , with |Ψ 0 as the ground state of H s . Usually, it is an entangled state with an arbitrary evolution time τ, and we need to measure the probe qubit until the measurement result is |1 .
For the other eigenstates, if the measurement result of the probe qubit is |1 , the state of the work qubits is the target state |Ψ i corresponding to the energy level E i ≈ ω + ω 0 similarly.
As an efficient demonstration of the algorithm, we reconstruct the density matrix of the ground state corresponding to the first peak E a in Figure 3b. We can obtain the ground state in the subspace of the probe qubit being in the state |1 . To determine the eigenstates, we use quantum state tomography to rebuild the density matrix or quantum state with a series of readout pulses [28][29][30][31][32]. The ground state is represented in Figure 4a, and the fidelity is up to 98.66%.

Singular-Value Decompositions
The matrices are often non-Hermitian or non-square in many fields, where the singularvalue decomposition is more important in a matrix analysis. For a matrix M, the SVD can be represented as this equation: N is the rank of matrix M, u i and v i are the ith left and right singular vectors corresponding to the singular value s i > 0. M is a non-Hermitian matrix, and we can construct a new Hermitian matrix B [33]: It should be noted that the eigenvalues of B are {s 0 , s 1 · · · s N , −s N , · · · , −s 1 , −s 0 }. For the eigenvalue −s i , the eigenvector is [ u i −v i ] T , which is the same except a minus. So, we do not need to set our parameter ω + ω 0 < 0 because of their same singular vectors.
Here, we use a non-Hermitian matrix M and construct a new Hermitian matrix B by Equation (7). We often pay more attention to the singular vectors corresponding to the larger singular values, such as in recommendation systems. The experiment details of solving singular-value problems are similar to Section 3.1, which are omitted here.

Discussion
The results of the original algorithm are similar to Figure 3a. It sets ω from E min − ω 0 to E max − ω 0 with the same stepsize ; thus, the accuracy of the eigenvalues is obviously. The evolution time is t = 1/c = O(1/ ) in each point, so the total complexity about the accuracy is O(∆E/ 2 ) where ∆E = E max − E min . For our multi-round procedure, Equation (3) and the previous works [6,21] show that the widths of the resonant peaks are proportional to c. Therefore, the number of points near each eigenvalue is independent of c l . It is the width/stepsize ∝ c l /∆ω l = O(1). If we set c l+1 = 0.5 × c l , the total complexity with is O(1/ ) because ∑ l=L l=1 1/c l ≤ 2/c L = O(1/ ). Here, we ignore the first round because 1/ 0 1/ L . The complexity of this multi-round QRT algorithm is O(R/ ). If we focus only on a small number of eigenvalues with a high accuracy, such as the ground-state energy, the total time of the experiment will be greatly reduced. Compared with the other quantum algorithms, our improved QRT algorithm can obtain the arbitrary eigenstate of a Hamiltonian by a time evolution operator. Using the QSP, we can obtain the j-th eigenvalue and prepare the eigenstate with a query complexity O( −1 ). It just needs an evolution operator e −iH/c and measures one ancilla qubit, which may be friendly to the quantum device. More details can be found in Appendix B.
In this experimental work, here is a simple comparison of the resource required by the two methods. Assuming that we can implement the evolution operator e −iH , we roughly calculate the number of times that different methods need to use this unitary operator. The repeating times of each point to obtain P |1 is the same for the two methods in the experiments so we ignore this factor in this computing. For the original QRT, we set c = 0.01 for each point. The number of points is ∆E/c = 350. For each point, it needs the 1/c unitary operator e −iH to implement the Hamiltonian evolution e −iHt where t = 1/c. So, the total number of the used operator e −iH is 35,000. For our multi-round method, c = 0.05, so the total number of e −iH is 3.5/0.05 × 1/0.05 = 1400 where c 1 = 0.05. For the second round, it is 72 × 1/c 2 = 6000. So, the total number of two rounds is 7400. Compared with the original QRT, our method just uses about 20% of the number of the operator e −iH to obtain the eigenvalues with the same accuracy. This method is not limited to two rounds, and the ratio can be further improved with more rounds.
The total running time of each experiment is about 20 ms, where T2 is about 1s for 13 C so that we can ignore its influence. There are two factors resulting in the deviations of the final experimental states from the expected eigenstates: the fluctuations of the strength of the NMR signal and the error from the gradient ascent pulse engineering (GRAPE) pulses. The first part of the error is due to the difference between the ideal and experimental electromagnetic field strength, which includes the uncontrollable fluctuation of the experimental instruments and some systematic errors, such as the error generated by measuring the π pulse. For the second part, all the operators are optimized by GRAPE [28,34] in this four-qubit experiment, which is theoretically not perfect. The fidelities of the single-qubit gates and two-qubit gates that we set here are 99.99%, and the fidelities of the time evolution operators in the second step are 99.5%. Comparing the fidelity of the final states with PPS, our experiments confirm the validity of this quantum algorithm in the range of the errors permitted. In these experiments, two factors influence the scaling of the algorithm: the uncertainty of the eigenvalues and the evolution time of the Hamiltonian simulation. For the second part, some alternative methods such as the Trotter formula [35,36], sparse matrix [14,37] and quantum signal processing (QSP) [38] can be used to simulate a Hamiltonian efficiently. Although we cannot give specific scaling laws for simulating a realistic system, the computational resources required scale polynomially with the system size, giving a quantum speedup compared to classical computers [20,39].
This quantum algorithm needs to measure the probability of the state of one qubit. Recently, some quantum systems like the superconducting quantum circuits and nitrogen vacancy (NV) center have been promising to achieve practical computations beyond the classical computer. It is convenient and fast to achieve an ensemble measurement of one qubit in these quantum systems, making it more efficient to obtain the eigenvalues of a Hamiltonian by this algorithm.

Conclusions
To summarize, we demonstrated the optimized algorithm based on QRT to solve the eigenproblem of the three-qubit effective Hamiltonian of the water molecule without having a good initial state. This Hamiltonian's energy and ground state are obtained in a four-qubit NMR quantum simulator with high fidelity. Using the multi-round method, we reduce the complexity from O(∆E/ 2 ) to O(R/ ). It is suitable for searching a small number of eigenvalues with high precision over a large range. Our algorithm can achieve a quadratic speedup over the phase estimation algorithm [22] and may perform better than adiabatic quantum computing in some problems [6]. Meanwhile, we also prepared singular vectors of a simple non-Hermitian matrix, showing the ability to solve singular-value decomposition problems. Our improved QRT algorithm reduces the quantum resource requirement for solving eigenproblems and provides an alternative for exploring the potential of quantum computers for matrix problems.  Institutional Review Board Statement: Not applicable.

Data Availability Statement:
The data presented in this study are available on request from the corresponding author.

Conflicts of Interest:
The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations
The following abbreviations are used in this manuscript:

Appendix A. Hamiltonian of Water Molecule
The electronic Hamiltonian of the water molecule in the form of second quantization [40] is p| q|V e |r |s a + p a + q a r a s where |p , |q , |r , |s denote the one-particle states, a + p is its fermionic creation operator and operators T, V N and V e are the one-particle kinetic energy operator, nuclear attraction operator and two-particle electron repulsion operator, respectively. The Hartree-Fock wave function for the electronic structure of the water molecule is (1a The number of qubits required to represent water molecules on a quantum simulator can be optimized according to the state mapping technique proposed in Ref. [41]. Considering the 1 A 1 symmetries, using the STO-3G basis set and freezing the first two a 1 orbital and the first b 2 orbital, the b 1 orbital and the first b 2 orbital, we construct a model space that includes the 3a 1 , 4a 1 , 1b 1 and the 2b 2 orbitals for the low-energy Hamiltonian H S of water molecule and perform configuration interaction (CI) calculations [42]. Accordingly, the multi-reference configuration interaction (MRCI) space is composed of eight configuration state functions which require two qubits to represent the state of the water molecule. The Hamiltonian matrix is given by: |Ē j is the state orthogonal to |E j and |E QRT j is j-th eigenstate prepared by QRT. The QRT can obtain the eigenvalues from the probabilities of different points that set a different parameter ω. Here, we analyze the complexity of obtaining the ground-state energy. In the first round, the number of points is (E max − E min )/c 1 , where c 1 is the stepsize of ω. The QRT can find the eigenvalue with accuracy c 1 in the first round. For the last l-th round, the half-width of the resonant peak is: So, the number of points around this peak 2c l |d j |/c l = 2|d j | is independent with c for l-round and obtain the j-th peak with accuracy c l . The query complexity of l-th round is O(s|H|τ) × 2|d j | =O(s|H|(c l |d j |) −1 × |d j |) =O(s|H|c −1 l ). (A8) Here, we use the QSP to implement the Hamiltonian evolution operator. Assuming that c l+1 = 0.5c l , the total query complexity besides the first round is O(s|H| ∑ L l=2 c −1 l ) ≤ O(s|H|c L ) = O(s|H| −1 ∆ −1 min ), where s is the sparsity of H and = c L is the final accuracy of j-th eigenvalue. We ignore the first round because 1/c L 1/c 0 in the most time. The previous works in Refs. [20,21] use (E max − E min )/ points to estimate the eigenvalue, and each eigenvalue needs O(s|H|τ) times query. So, the total query complexity of the original method is O(s|H|∆E −2 γ −1 ). For the accuracy , our method achieves a quadratic speedup compared to the original QRT.