1. 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
to
, with an eigenvalues range
, 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.
2. 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 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
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
is the Hamiltonian of the work qubits in subspace
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
is given by
where
is a parameter set as a reference point to the energy
of
. In the algorithm, we firstly set the probe qubit in
and the work qubits in a reference state
, which means the initial state of the circuit is an eigenstate of
with eigenvalue
. Considering the example of solving the ground state of the
, we set
. Simulating the Hamiltonian in Equation (
1) with evolution time
, we apply the first-order perturbation theory with small
, and the state of all qubits can be formulated as
where
is the ground state of
and
. Here,
and
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
, the final state will be
determinately. The procedure to prepare the eigenstates by QRT is shown as follows.
(i) Initialize the state to . 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 , the measurement result will be with a certain probability, and the state of work qubits would be the corresponding eigenstate . When the measuring result is , the state of all qubits is , then we should return to step (ii) and run again until the measurement result is .
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
where
. In other words, it is also accessible to
with a high probability when
.
In the above example, we have assumed that the energy spectrum of
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
will depend on evolution time
if
approximates any eigenvalue
. Assuming that the energy range is from
to
, we pick
N equally spaced points
in this range with step
and set
, respectively, then run the previous algorithm. By measuring the probability
of probe qubit in
for each
, it is obvious that QRT will happen if
, and the probability of
will increase in these points. As mentioned above, off-resonance will happen, and the amplitude of Rabi oscillation will be bigger when
gets closer to
. We can find
corresponding to the points of peaks (the approximate value
of eigenvalue
) with a higher
, and reset
near these points
with smaller step
and
c to reduce the error of off-resonance. The process that updates
will repeat many times until the precision is sufficient, and the
in the final process are the eigenvalues with limited error. It can be summarized by Algorithm 1. The original QRT method just set
where
. 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.
Algorithm 1: Eigenvalues search by QRT |
Inputs:, , , . step 1: Set and . Repeat the following steps: step 2: Set . step 3: Run eigenstate search algorithm for each k with stepsize . step 4: Obtain for each k. step 5: Update . step 6: Set from to , smaller and . Outputs:. |
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 , and the evolution time would be greatly reduced to improve the efficiency.
3. Results
We demonstrate the algorithm in a four-qubit liquid nuclear magnetic resonance (NMR) system. In these experiments, the four-qubit sample used is
13C-labeled transcrotonic acid dissolved in d6-acetone with the
1H decoupled throughout the entire process. In this letter, the energies and time are recorded in units of Hartree and Hartree
. 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
is the chemical shift and
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).
3.1. 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
where the polarization
. The identity matrix will not show any signal so the second term is the effective density matrix. In this algorithm, the initial state
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
between the experiment result and
. 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
using the Trotter formula is shown in
Figure 2b. The state
is
here, and
is the effective Hamiltonian of the water molecule in an eight-dimensional Hilbert space. The transition operator
, where
is the Hadamard operator. Here, we set
, and the details of the water molecule Hamiltonian
are shown in
Appendix A. Assuming that the interesting range of eigenvalues is from
to
, we firstly set sixty points where
is changed from
to
at regular intervals and
. To detect the energy spectrum of the Hamiltonian, we need to obtain the possibility of C1 (probe qubit) in
, i.e.,
. By applying the readout pulse
, where
Y denotes a rotation of
along the
y axis,
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 corresponding to the eight eigenvalues of
: {−81.07 −81.98 −82.41 −82.65 −82.77 −83.02 −83.38 −83.93}. To improve the accuracy, we reset
and rerun the algorithm with setting
near the eight peaks. The results are shown in
Figure 3b. They help us update the previous eight eigenvalues: {−81.04 −81.98 −82.44 −82.64 −82.75 −83.00 −83.38 −83.96}. Compared with the results of the numerical calculation, {−81.0447 −81.9802 −82.4325 −82.6418 −82.7594 −82.9918 −83.3756 −83.9558}, the difference values between the experimental and theoretical values are smaller than step length
.
When we obtain the energy spectrum of the Hamiltonian 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 , which is the lowest energy level of . After repeating the previous three steps, the final quantum state is , with as the ground state of . Usually, it is an entangled state with an arbitrary evolution time , and we need to measure the probe qubit until the measurement result is .
For the other eigenstates, if the measurement result of the probe qubit is , the state of the work qubits is the target state corresponding to the energy level similarly.
As an efficient demonstration of the algorithm, we reconstruct the density matrix of the ground state corresponding to the first peak
in
Figure 3b. We can obtain the ground state in the subspace of the probe qubit being in the state
. 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%.
3.2. Singular-Value Decompositions
The matrices are often non-Hermitian or non-square in many fields, where the singular-value 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, and are the ith left and right singular vectors corresponding to the singular value .
M is a non-Hermitian matrix, and we can construct a new Hermitian matrix
B [
33]:
is the zero matrix.
B has the full information of matrix
M, and we can obtain singular values and vectors by solving the eigenproblem of Hermitian matrix
B. The
ith eigenvalue and eigenvector of
B are
and
. That is to say, if
, by our algorithm, the final state in the work qubits is:
It should be noted that the eigenvalues of
B are
. For the eigenvalue
, the eigenvector is
, which is the same except a minus. So, we do not need to set our parameter
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.
Figure 5 shows the reconstructed density matrix of the left and right singular vectors
of the maximum singular value, and the fidelity is 98.44%.
4. Discussion
The results of the original algorithm are similar to
Figure 3a. It sets
from
to
with the same stepsize
; thus, the accuracy of the eigenvalues is
obviously. The evolution time is
in each point, so the total complexity about the accuracy is
where
. 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
. It is the width/stepsize
. If we set
, the total complexity with
is
because
. Here, we ignore the first round because
. The complexity of this multi-round QRT algorithm is
. 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
. It just needs an evolution operator
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 , we roughly calculate the number of times that different methods need to use this unitary operator. The repeating times of each point to obtain is the same for the two methods in the experiments so we ignore this factor in this computing. For the original QRT, we set for each point. The number of points is . For each point, it needs the unitary operator to implement the Hamiltonian evolution where . So, the total number of the used operator is 35,000. For our multi-round method, , so the total number of is where . For the second round, it is . 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 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
13C 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.