18
Quantum Heaviside Eigen Solver Zheng-Zhi Sun School of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China Gang Su * Kavli Institute for Theoretical Sciences, and CAS Center for Excellence in Topological Quantum Computation, University of Chinese Academy of Sciences, Beijing 100190, China and School of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China Solving Hamiltonian matrix is a central task in quantum many-body physics and quantum chemistry. Here we propose a novel quantum algorithm named as a quantum Heaviside eigen solver to calculate both the eigen values and eigen states of the general Hamiltonian for quantum computers. A quantum judge is suggested to determine whether all the eigen values of a given Hamiltonian is larger than a certain threshold, and the lowest eigen value with an error smaller than ε can be obtained by dichotomy in O ( log 1 ε ) iterations of shifting Hamil- tonian and performing quantum judge. A quantum selector is proposed to calculate the corresponding eigen states. Both quantum judge and quantum selector achieve quadratic speedup from amplitude amplification over classical diagonalization methods. The present algorithm is a universal quantum eigen solver for Hamiltonian in quantum many-body systems and quantum chemistry. We test this algorithm on the quantum simulator for a physical model to show its good feasibility. INTRODUCTION Quantum computer is a computing machine based on the principles of quantum mechanics, which preforms unitary evolutions on qubits [1, 2]. It promises algorithms to solve important problems with exponential or polynomial speedup for many algebraic, number theoretic and oracular algorithms [39], etc. Among them, solving eigen states and eigen val- ues of a quantum many-body system is one of central tasks in condensed matter physics and quantum chemistry [1013]. Many classical numerical methods were suggested to study many-body systems such as density functional theory [14], quantum Monte Carlo [15], and tensor network approach [16], etc. However, those methods are tied up in strongly correlated systems, where representing the quantum state is classically inaccessible due to the exponential dimension of the underly- ing Hilbert space when the size of system is very large. This issue can be naturally avoided in a quantum computer since one can store the quantum states in a number of qubits that scale linearly with the size of the physical system. The accel- eration of solving such eigen problem of Hamiltonian matrix by quantum algorithms will make great contributions to study strongly correlated electron systems [17] and to develop new materials [18], good catalysts [19] and even more effective medicines [20]. At present, there are several quantum algorithms that pur- pose to tackle this issue. Quantum phase estimation (QPE) [21] was proposed to estimate the eigen value of an eigen vec- tor for a Hamiltonian matrix. This approach requires that the eigen vector [21, 22] or a good approximation [23] is known. A more feasible solution is to combine a re-configurable quantum processor for the expectation estimation and a con- ventional or quantum computer for variational optimization [12, 2431]. This variational quantum eigen solver (VQE) designs a parameterized quantum circuit as the ground state ansatz and optimizes it according to the results from the quan- tum processor. A good approximation or ansatz of the ground state is necessary for QPE and VQE to find the corresponding eigen value, which confines their applications to the systems with a good understanding. Besides, adiabatic algorithms can obtain a state close to the ground state of a given Hamiltonian for sufficiently long runtimes [32]. However, the runtimes of these algorithms are extremely difficult to calculate or bound in practice, which makes adiabatic algorithms used as heuris- tic methods in most cases [3234]. Solving the eigen problem of Hamiltonian matrix includes the calculation of eigen values and eigen states. Once either eigen values or eigen states is given, there are quantum algo- rithms that can calculate another one [21, 22, 34, 35]. How- ever, no digital quantum algorithm can solve both the eigen values and eigen vectors for the general form of Hamiltonian [36]. An essential path to design such a quantum algorithm is to judge the difference between correct results and the trial values. More specifically, it is better to design a quantum eigen solver to judge whether all the eigen values of the given Hamiltonian are higher than a trial eigen value. Then all eigen values can be calculated with dichotomy one by one starting from the ground state energy. In this work we present a quantum algorithm called quan- tum Heaviside eigen solver (QHES) to calculate both the eigen values and eigen states of the given Hamiltonian ma- trix. It consists of a quantum judge to calculate the eigen values by dichotomy and a quantum selector to calculate the corresponding eigen states. The Hamiltonian is defined on the space of N qubits which can be written as H = N l H l , where each H l can act on qubits [37]. The QHES can solve any Hamiltonian in quantum many-body systems. Gener- ally, solving the ground state energy of this common form of Hamiltonian has been proved to be QMA-complete [38], where QMA stands for quantum Merlin Arthur and is the quantum analog of NP. It is generally believed that it can- arXiv:2111.08288v1 [quant-ph] 16 Nov 2021

Quantum Heaviside Eigen Solver

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Quantum Heaviside Eigen Solver

Quantum Heaviside Eigen Solver

Zheng-Zhi SunSchool of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China

Gang Su∗Kavli Institute for Theoretical Sciences, and CAS Center for Excellence in Topological Quantum Computation,

University of Chinese Academy of Sciences, Beijing 100190, China andSchool of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China

Solving Hamiltonian matrix is a central task in quantum many-body physics and quantum chemistry. Herewe propose a novel quantum algorithm named as a quantum Heaviside eigen solver to calculate both the eigenvalues and eigen states of the general Hamiltonian for quantum computers. A quantum judge is suggested todetermine whether all the eigen values of a given Hamiltonian is larger than a certain threshold, and the lowesteigen value with an error smaller than ε can be obtained by dichotomy inO

(log 1

ε

)iterations of shifting Hamil-

tonian and performing quantum judge. A quantum selector is proposed to calculate the corresponding eigenstates. Both quantum judge and quantum selector achieve quadratic speedup from amplitude amplification overclassical diagonalization methods. The present algorithm is a universal quantum eigen solver for Hamiltonianin quantum many-body systems and quantum chemistry. We test this algorithm on the quantum simulator for aphysical model to show its good feasibility.

INTRODUCTION

Quantum computer is a computing machine based on theprinciples of quantum mechanics, which preforms unitaryevolutions on qubits [1, 2]. It promises algorithms to solveimportant problems with exponential or polynomial speedupfor many algebraic, number theoretic and oracular algorithms[3–9], etc. Among them, solving eigen states and eigen val-ues of a quantum many-body system is one of central tasksin condensed matter physics and quantum chemistry [10–13].Many classical numerical methods were suggested to studymany-body systems such as density functional theory [14],quantum Monte Carlo [15], and tensor network approach [16],etc. However, those methods are tied up in strongly correlatedsystems, where representing the quantum state is classicallyinaccessible due to the exponential dimension of the underly-ing Hilbert space when the size of system is very large. Thisissue can be naturally avoided in a quantum computer sinceone can store the quantum states in a number of qubits thatscale linearly with the size of the physical system. The accel-eration of solving such eigen problem of Hamiltonian matrixby quantum algorithms will make great contributions to studystrongly correlated electron systems [17] and to develop newmaterials [18], good catalysts [19] and even more effectivemedicines [20].

At present, there are several quantum algorithms that pur-pose to tackle this issue. Quantum phase estimation (QPE)[21] was proposed to estimate the eigen value of an eigen vec-tor for a Hamiltonian matrix. This approach requires that theeigen vector [21, 22] or a good approximation [23] is known.A more feasible solution is to combine a re-configurablequantum processor for the expectation estimation and a con-ventional or quantum computer for variational optimization[12, 24–31]. This variational quantum eigen solver (VQE)designs a parameterized quantum circuit as the ground stateansatz and optimizes it according to the results from the quan-

tum processor. A good approximation or ansatz of the groundstate is necessary for QPE and VQE to find the correspondingeigen value, which confines their applications to the systemswith a good understanding. Besides, adiabatic algorithms canobtain a state close to the ground state of a given Hamiltonianfor sufficiently long runtimes [32]. However, the runtimes ofthese algorithms are extremely difficult to calculate or boundin practice, which makes adiabatic algorithms used as heuris-tic methods in most cases [32–34].

Solving the eigen problem of Hamiltonian matrix includesthe calculation of eigen values and eigen states. Once eithereigen values or eigen states is given, there are quantum algo-rithms that can calculate another one [21, 22, 34, 35]. How-ever, no digital quantum algorithm can solve both the eigenvalues and eigen vectors for the general form of Hamiltonian[36]. An essential path to design such a quantum algorithm isto judge the difference between correct results and the trialvalues. More specifically, it is better to design a quantumeigen solver to judge whether all the eigen values of the givenHamiltonian are higher than a trial eigen value. Then all eigenvalues can be calculated with dichotomy one by one startingfrom the ground state energy.

In this work we present a quantum algorithm called quan-tum Heaviside eigen solver (QHES) to calculate both theeigen values and eigen states of the given Hamiltonian ma-trix. It consists of a quantum judge to calculate the eigenvalues by dichotomy and a quantum selector to calculate thecorresponding eigen states. The Hamiltonian is defined on

the space of N qubits which can be written as H =N∑l

Hl,

where each Hl can act on qubits [37]. The QHES can solveany Hamiltonian in quantum many-body systems. Gener-ally, solving the ground state energy of this common formof Hamiltonian has been proved to be QMA-complete [38],where QMA stands for quantum Merlin Arthur and is thequantum analog of NP. It is generally believed that it can-

arX

iv:2

111.

0828

8v1

[qu

ant-

ph]

16

Nov

202

1

Page 2: Quantum Heaviside Eigen Solver

2

Trial

thresholdHamiltonian

Are all eigen values larger

than the trial threshold?

Yes or No

Adjust by

dichotomy

Amplify the amplitude of target

eigen states and filter out others

Ground state energy

Randomly

initialized state

quantum

selectorGround state

quantum

judge

Trial eigen

value/threshold

Hamiltonian

Shift

FM

construct

Quantum Dirac/Heaviside circuit

Amplitude amplification

V

O

L

Control the number

of iterations

Step 1

Step 2

Step 3

Step 6

Step 5

Step 4

Once amplitude amplification based on

Random

initialization circuit

Step 7ry

Output the

target state

receive

0NÄ

Once amplitude amplification based on

Quantum Dirac/Heaviside circuit

(a) (b)

FIG. 1. Sketch of quantum Heaviside eigen solver. (a) The illustration to solve the eigen problem of the Hamiltonian with the quantum judgeand quantum selector. Note that the excited state energies and the corresponding eigen states can be figured out one by one starting fromthe ground state energy. (b) The detailed flow-chart to design the quantum selector/judge and solve the given Hamiltonian. This processis vividly shown as a quantum radio that receives the signal (Hamiltonian) and output the contents (eigen states) according to the signaland trial frequency (eigen value/threshold). The amplitude amplification algorithm within the dash box can amplify the amplitude of statescorresponding to the trial eigen value, or all eigen values lower than the given threshold, and filter out other states, which is the core of quantumHeaviside eigen solver.

not be solved in polynomial time even on quantum computer.Solving a χ-dimensional Hamiltonian matrix usually requiresthe classical bits scaling as O (χ) and its running time scalesas Ω (χ) [39]. By contrast, the amplitude amplification al-gorithm [40, 41] with an exquisite design of oracle circuit inthis work can solve this problem using the qubits that scale asO (logχ) and its running time scales as O

(√χ).

The quantum judge is an amplitude amplification algorithmthat evolves the initial state into a state belonging to the “goodsubspace”, which is spanned by the eigen states with eigenvalues lower than the trial threshold. By detecting the pres-ence of states in the good subspace from the output of quan-tum judge, one can judge whether all eigen values of the givenHamiltonian H are higher than the trial threshold. The lowesteigen value of H with an error lower than ε can be obtainedby O

(log 1

ε

)times of binary searches of the trial threshold.

Similarly, the quantum selector is an amplitude amplificationalgorithm where the good subspace is spanned by eigen statescorresponding to the given eigen value. It can directly evolvethe initial state to the target eigen states. The process of thatuses QHES to solve the eigen values and eigen states is shownin Fig. 1(a). The core kernel in this process is the quantumcircuit to achieve the identification of eigen states in quan-tum judge and quantum selector. In this paper, we accomplishthis task for the general form of Hamiltonian with a quantumHeaviside circuit (QHC) and a quantum Dirac circuit (QDC).

RESULTS

A sketch of quantum Heaviside eigen solver

The QHES is like a quantum radio in the way as shownin Fig. 1(b). This quantum radio receives the signal and out-puts contents corresponding to the frequency, where the signalrepresents the Hamiltonian matrix, frequency represents thetrial eigen value or all eigen values lower than the trial thresh-old, and the output contents represent the corresponding eigenstates that are called qualified states. When the frequency isset at a trial threshold and QHC is adopted in the green boxes,this quantum radio judges whether there is any eigen statethat corresponds to an eigen value lower than the trial thresh-old. Combined with the dichotomy, one can obtain the lowesteigen value with an error lower than ε in O

(log 1

ε

)iterations

of performing quantum judge and adjusting trial threshold.This eigen value is then taken as the trial eigen value and thequantum radio can output the corresponding eigen states whenQDC is adopted in the green boxes. These two processes areboth achieved by the amplitude amplification based on QHCand QDC, respectively, which amplifies the amplitude of qual-ified states and filters out others from the randomly initializedstate |ψr〉.

Now we explain the steps to construct the quantum selectoror the quantum judge shown in Fig. 1(b).

step 1: Select a trial eigen value for QDC, or a trial thresholdfor QHC by dichotomy.

step 2: Shift the Hamiltonian to fix the trial eigen value to

Page 3: Quantum Heaviside Eigen Solver

3

0, or to fix the threshold to 12 . This step is to avoid

redesigning the whole circuit, where only the Hamilto-nian evolution circuit needs to be changed.

step 3: Construct the QDC or QHC according to the shiftedHamiltonian, where the trial eigen value and trialthreshold is fixed. This is the most difficult and im-portant part in QHES.

step 4: Construct the amplitude amplification algorithmbased on QDC or QHC, which is used to mark the qual-ified states.

step 5: Determine the number of iterations in amplitude am-plification. This step is evaded since we use the fixed-point quantum search [42] as the amplitude amplifica-tion algorithm.

step 6: Initialize the input state |ψr〉, which is a superpositionof all eigen states. A random circuit is usually compe-tent.

step 7: Amplify the amplitude of qualified states and filter outothers using the circuit within the dash box.

Steps 1, 2 and 7 are classical routine operations which areintroduced in the Supplemental Material. Step 3 is to designthe quantum circuit of QHC and QDC with the given Hamil-tonian, which is the core of QHES. Step 4 can be achievedby the standard flow to construct the amplitude amplificationalgorithm whose oracle circuit is QHC or QDC. Step 5 is todetermine how many iterations in amplitude amplification al-gorithm are needed to amplify the amplitude of target statesufficiently. Using the fixed-point search, the number of it-erations is O

(√χ)

on the assumption that the overlap be-

tween |ψr〉 and target states is no less than O(

). Step 6

is to initialize the initial state satisfying the above assumption,which can be done by a random circuit with high probability.Next, we will introduce the central idea to construct QDC andQHC. The mathematical analysis and detailed instructions forall steps are presented in the Supplemental Material.

Constructing quantum Heaviside circuit

The purposes of QHC and QDC are to mark the quali-fied eigen states for the amplitude amplification. These twoquantum circuits are unitary operators working on N physicalqubits, K auxiliary qubits and one mark qubit. They outputthe results on the mark qubit while do not change the inputson physical qubits at all time. The states on auxiliary qubitschange in the process of quantum circuit while they are dis-regarded. We define the qualified states |Eq〉 for these twocircuits as the states on N physical qubits whose output onthe mark qubit is |0〉. For QHC, the qualified states are eigenstates whose corresponding eigen values are smaller than agiven threshold θ.

The QHC is designed to filter out the eigen states with eigenvalues larger than the given threshold θ and to preserve asmuch proportion of the eigen states with eigen values smallerthan θ. This process consists of two parts. The first part isto identify the eigen values of all eigen states, and the sec-ond part is a simple filter circuit based on the eigen values.The QPE is proposed to entangle the eigen states with the bi-nary representation of their corresponding eigen values on theauxiliary qubits [21]. However, QPE is not capable for thistask due to its uncertainty, which is also called heavy tail [35].Here we use three strategies on the original QPE algorithm toconstruct the quantum Heaviside circuit. The first is a multi-ple filtering scheme to ensure the quantum Heaviside circuitcan definitely filter out the unqualified states. The second is afine-tuning scheme to ensure the qualified states is definitelypreserved. The last is a recycling scheme using a freezing op-erator to reduce the number of auxiliary qubits. To the best ofour knowledge, this is the first filtering method for a generalHamiltonian.

The quantum phase estimation is proposed to calculate theeigen values of a given Hermite matrix, where the correspond-ing eigen state is given. The QPE works on the physical qubitsinitialized to the corresponding eigen state and R extra qubitsinitialized to |0〉⊗R, which are called representation qubits.This algorithm does not influence the eigen state on physi-cal qubits and changes the state on representation qubits to anapproximation of the binary representation of the correspond-ing eigen value. The success probability of QPE to outputthe right (nearest) binary representation of the correspondingeigen value on representation qubits is no less than 4

π2 [21].This indicates the filter on representation qubits after singleQPE can filter out at least 4

π2 of the unqualified states.To make sure that all unqualified states are filtered well

out, we adopt Q = O (N) QPE circuits at the same time,which is the first strategy. Here all Q QPE circuits act onthe same physical qubits and different representation qubits,which means the total number of representation qubits isQ × R. This multiple filtering scheme can reduce the am-plitude of unqualified states to exponentially small, that is,lower than

(1− 4

π2

)Q. Unfortunately, this method may filter

out the qualified states when the gap between the eigen valuesand their nearest binary representations is large.

The strength of this filtering effect is determined by the ac-curacy of QPE circuit, which is related to the accuracy of bi-nary representation of eigen values. Since the QPE circuituses R representation qubits, the maximum error to expressthe eigen values is π

2R, and the corresponding accuracy of

QPE circuit is 4π2 . In the worst case, the eigen states with

eigen values higher than the given threshold are retained up to(1− 4

π2

)2Q. Meanwhile, we can only guarantee that at least(

4π2

)2Qof the eigen states with eigen values lower than the

given threshold are preserved.To solve this issue, we perform a batch of filtration for W

different Hamiltonian matrices in sequence, which are shiftedfrom the given normalized Hamiltonian matrix recorded as

Page 4: Quantum Heaviside Eigen Solver

4

H0. This set of Hamiltonian matrices can be expressed as

Hw : Hw = H0 +w

W

π

2R−1. (1)

When we filter all these Hamiltonian, the error to express theeigen value using R representation qubits is reduced to nomore than π

W2π at least once. In this case, it is proved in

the Supplemental Material that at least(

1− π2

2W 2

)2Qof the

qualified states are preserved, which can be written as O (1)

when W = O(√

N)

. This is the second strategy to makesure that all qualified states are not filtered out at least once.

With these two strategies, the changed QPE circuit can effi-ciently filter out the unqualified states while preserve qualifiedstates. The number of auxiliary qubits is Q × R, which canalso be written as O

(N log 1

ε

). Here the term of O

(log 1

ε

)

is unavoidable since it is used for the binary representation ofthe eigen values, where ε is the error bound of the quantumjudge. However, its multiplication with N makes this methodimpractical on the near term quantum hardware. For example,if we want to solve the eigen problem of a Hamiltonian matrixwith the size of 250 × 250, it needs 50 physical qubits to rep-resent the physical system and about 50 × log2

(106)

qubitsto obtain the results with an error lower than 10−6. Next weintroduce the freezing operator as the last strategy that can re-duce the number of auxiliary qubits from O

(N log 1

ε

)to

O

(logN + log

1

ε

). (2)

The third strategy can be described as performing QPE Qtimes on R representation qubits instead of performing QPEonce on Q× R representation qubits. This strategy is similarto the iterative quantum phase estimation (iQPE) [43] that in-volves measurement and reuse of qubits, which means that itcannot be used as the subroutine of the QHES. So we designthe unitary freezing operator to “reset” the auxiliary qubits af-ter each QPE circuit instead of resetting the auxiliary qubitswith measurement.

Constructing quantum Dirac circuit with quantum coin toss

The task of QDC is to qualify the eigen states correspond-ing to a given eigen value, which can be done by a quantumcoin toss. We define the flipping operator to achieve

Uc |Ej〉 |0〉 = cos (Ej) |Ej〉 |0〉+ i sin (Ej) |Ej〉 |1〉 , (3)

whose design is given in the Supplemental Material. Herewe call the qubit to express states |0〉 and |1〉 as quantumcoin. The Uc is designed to flip the state on the quantumcoin according to the state on physical qubits. If we use Mquantum coins at the same time, the amplitude of all quantumcoins remain |0〉⊗M is cosM (Ej). When M is large enough,cosM (Ej) can be seen as an analog of the Dirac function ofEj .

To meet the requirements of being the oracle circuit of thequantum selector, the quantum coin toss should distinguishthe eigen states with the given eigen value Eg and the stateswith the closest eigen value. Without losing generality, herewe suppose the given eigen value Eg is zero and the gap be-tweenEg and its closest eigen value is ∆. Detailed analysis inSupplemental Material shows that to obtain the ε-close eigenstate corresponding to the given eigen valueEg , one needs theminimum number of quantum coins as

M = O

(1

∆2

(N + log

1

ε

)), (4)

and the error bound of Eg is ε0 = O (∆). Under this con-dition, the QDC outputs |0〉⊗M with an amplitude of O (1)when the states on physical qubits correspond to an eigenvalue ε0-close to Eg , and outputs |0〉⊗M with an exponen-tially small amplitude in other cases. Using this QDC as theoracle circuit of amplitude amplification algorithm, the quan-tum selector can obtain the eigen states of the eigen valuessolved by quantum judge. Similar to the case of QHC, thenumber of quantum coins is far beyond the capabilities of cur-rent quantum hardware. Fortunately, this number can be ex-ponentially reduced to O (logM) by the freezing operator.

Freezing operator

To reduce the number of quantum coins, we replace the sin-gle toss of M quantum coins to M tosses of one quantumcoin. A simple idea of designing such circuit is to perform Uc

when the quantum coin is in the state of |0〉, and to perform anidentity operator when the quantum coin is in the state of |1〉.However, the operation to complete this process is not unitary,which is forbidden by the quantum computer. We extend thisnon-unitary operator to a unitary operator by introducing thefreezing operator and extra K counting qubits. The freezingoperator UF acts on the quantum coin andK counting qubits.The state on the counting qubits is regarded as a binary num-ber x. For example, we record |0110〉 as |x = 6〉. Then UF isdesigned to achieve

UF |x〉 |0〉 = |x〉 |0〉 , (5a)

UF |x〉 |1〉 = |x+ 1〉 |1〉 . (5b)

This can be easily done by a unitary Uadd =∑x|x+ 1〉 〈x|

controlled by the quantum coin. The Uadd is an elementaryarithmetic operation which can be efficiently performed [44].If we initialize the state on counting qubits to |1〉⊗K and applyUF , we note that the first counting qubit, which is the highestorder in the binary representation, will not be |1〉 for 2K−1

times of performing UF once the quantum coin is changed to|1〉.

This freezing operator can exponentially reduce the numberof auxiliary qubits by controlling Uc with the first counting

Page 5: Quantum Heaviside Eigen Solver

5

qubit. More specifically, the quantum coin toss can be per-formed on one quantum coin and K = O (logM) countingqubits instead of M quantum coins. In M times of perform-ing Uc and UF , once the quantum coin is changed to |1〉, thestate on the first counting qubit will not be |1〉 based on Eq.(5). No Uc will be applied to the quantum coin since it is con-trolled by the first counting qubit, which means the quantumcoin is frozen in |1〉 once it is changed to |1〉. If the quantumcoin is |0〉 after M quantum coin tosses, it must remain |0〉in each quantum coin toss, which means the amplitude of thequantum coin being |0〉 in the end is also cosM (Ej).

( ) ( )cos 0 sin 1M

j jE i E

Äé ù+ë û

possible results

0=

1=

2M

frozen!

0x =

1x =

2x =

3x =

0x =

2x =

0x =

1x =0x =

the first toss

the second toss

the third toss

1M +

quantum coins quantum coin toss

( )cosjE

( )sinj

i E

x

1x +

quantum coin toss controlled by counting qubits

0x =0x ¹

frozen!

state on counting qubits

x

1x +

Toss three quantum

coins once

Toss one quantum coin three times

controlled by counting qubits

( )cosjE

( )sinj

i E

1x =( )sin

ji E

( )sinj

i E

( )sinj

i E

( )cosjE

( )cosjE

( )cosjE

frozen! frozen!!

(a)

(b)

(c)

FIG. 2. Example of reducing number of quantum coins using thefreezing operator. (a) Graphic representations of quantum coins,quantum coin toss, state on counting qubits and quantum coin tosscontrolled by counting qubits. Only coin toss processes that are usedin the quantum selector are indicated. (b) All 2M possible results oftossing M quantum coins once. We need M auxiliary qubits (quan-tum coins) to record the results. (c) The process of tossing one quan-tum coin M times controlled by counting qubits. There are M + 1possible results, which is exponentially less than the case of quan-tum coin toss without the control of counting qubits. We only needO (logM) auxiliary qubits (counting qubits) and one quantum cointo express the results. Note that there are some simplifications com-pared with practical design to explain this process more intuitively.

The nature of this exponential reduction of auxiliary qubitsis the reduction of the dimension of the state space as shown inFig. 2. In the quantum coin toss scheme, the quantum circuitmust have the ability to express all possible results of tossingM quantum coins. The number of possible results of tossingM quantum coins once is 2M , which is the same as that oftossing one quantum coin M times. Since we are only inter-ested in the result of all quantum coins being |0〉, we chooseto ignore the state with one or more quantum coins being |1〉.Note that we cannot decide the result of each quantum cointoss, we can only stop the quantum coin toss by the freezingoperator when the result of |1〉 appears. The result of toss-ing one quantum coin M times may be that all quantum cointosses end up with |0〉 or one of the M quantum coin tossesend up with |1〉. In this situation, the dimension of result spaceisM+1, which means that we only needO (logM) auxiliaryqubits to record the results.

In the quantum coin toss, the freezing operator guaranteesthat all flipping operators are performed on the |0〉 of the quan-tum coin. We define |0〉 as the target state of this freezing op-erator, where all other states is frozen. Similarly, the freezingoperator can be used to reduce the number of auxiliary qubitsof QHC fromO

(N log 1

ε

)toO

(logN + log 1

ε

). In this case,

we need two freezing operators whose target states are |0〉 onthe first (the highest order) representation qubit and |0〉⊗R onall representation qubits, respectively. Note that the first rep-resentation qubit being |0〉 represents the eigen value beinglower than 1

2 , and |0〉⊗R is the initial state of QPE algorithm.Each iteration of the filtering process starts with a QPE circuitcontrolled by the counting qubits, then the first freezing op-erator prevents the states filtered out by the QPE circuit fromthe following process. An inverse of the QPE circuit resetsthe representation qubits to an approximation of |0〉⊗R, andthe second freezing operator makes sure that the next iterationexactly starts from |0〉⊗R.

With these three strategies, the QHC can effectively filterout unqualified state and preserve qualified states with onlyO(logN + log 1

ε

)auxiliary qubits. Using this circuit as the

oracle circuit of the amplitude amplification algorithm, thequantum judge can identify the eigen states with eigen val-ues lower than 1

2 from the initial states. Since the input quan-tum state is randomly initialized to a superposition of all eigenstates, the quantum judge can judge whether there is any eigenvalue of the given Hamiltonian which is lower than 1

2 . Bychanging the trial threshold with dichotomy, or equivalentlyshifting and zooming the Hamiltonian matrix, the lowest eigenvalue with an error lower than ε can be obtained in O

(log 1

ε

)

iterations. The higher eigen values can also be calculated oneby one with a quantum judge that only identifies states witheigen values between two trial thresholds. After the eigen val-ues are calculated by the quantum judge, the correspondingeigen states can be given by the quantum selector that takesquantum coin toss as the oracle circuit of the amplitude ampli-fication algorithm. Detailed description and complexity anal-ysis are given in the Supplemental Material.

Page 6: Quantum Heaviside Eigen Solver

6

Simulation results of quantum judge and quantum selector

Here we apply an open-source quantum simulator [45] toproduce the numerical results to solve the ground state en-

ergy of the given Hamiltonian H = − 1N−1

N−1∑n=1

σznσzn+1 with

quantum judge. The calculation of the lowest eigen valuestarts with a trial eigen value, and then judges whether alleigen values are larger than the trial eigen value using quan-tum judge. Following the standard process of dichotomy, wecan obtain the lowest eigen value whose precision is confinedby the precision of quantum judge. Here we define the errorεv to solve the ground state energy of the given Hamiltonianas

εv = |Ec − Eg| , (6)

where Ec is the result of dichotomy using quantum judge andEg = −1 is the ground state energy of the given Hamiltonian.

5 6 7 8 9 10 112

3

4

5

6

7

8

log(

1/v)

R

N=2 N=3 N=4 N=5

FIG. 3. Numerical results by using quantum judge to solvethe ground state energy of the given Hamiltonian H =

− 1N−1

N−1∑n=1

σznσ

zn+1. Here N is the number of physical qubits to

represent the physical system and R is the number of the represen-tation qubits in the QPE circuit. It can be seen that the error of cal-culated eigen value decreases exponentially with the increase of R.There is no result where N = 5 and R > 7 because of the limitationof our computation resource.

According to Eq. (2) and the relationship of εv = O (ε),the number of representing qubits R scales linearly to log 1

εv,

which is consistent with the numerical result in Fig. 3. Dueto the limitation of the depth of quantum circuits in the quan-tum simulator, we construct the quantum judge with an extraclassical process to generate Hamiltonian set Hw to makethe judgment. This compromise on numerical simulation is tochange the quantum search of O

(√N)

Hamiltonian matri-ces contained in the QHC to a classical search attached to theQHC, which does not affect the verification of Eq. (2) from

Fig. 3. There is no result when N = 5 and R > 7 even withthe above compromise because of the high basic cost of QPEcircuit owing to the limitation of the present quantum simula-tor.

We also performed the numerical simulations to checkthe feasibility of quantum selector, which is used tosolve the ground state of the given Hamiltonian H =

− 1N−1

N−1∑n=1

σznσzn+1. The ground state of this Hamiltonian is

a superposition of |ψ0〉 = |0〉⊗N and |ψ1〉 = |1〉⊗N . Herewe define the error εs to solve the ground state of the givenHamiltonian using quantum selector as

εs = 1− |〈ψc | ψ0〉|2 − |〈ψc | ψ1〉|2, (7)

where |ψc〉 is the eigen state calculated by the quantum selec-tor. The coefficient matrix of |ψc〉 can be obtained by quantumtomography experimentally, or directly be outputted from thequantum simulator.

1210

se

-=

FIG. 4. Numerical results by using quantum selector to solve the

ground state of the given Hamiltonian H = − 1N−1

N−1∑n=1

σznσ

zn+1.

Here N is the number of physical qubits to represent the physicalsystem and K is the number of counting qubits. The vertical axisstarts from zero where ε equals approximately to 0.4. The resultswith larger error are meaningless where the quantum selector doesnot function properly because of the lack of counting qubits. Thegray dash line represents the standard line where εs = 10−12.

According to Eq. (4) and the relationship of εs = O(ε2),

the number of counting qubits K scales linearly to log log 1εs

,which is consistent with the numerical result in Fig. 4. Itcan be seen that the error of the quantum selector as quantumeigen state solver drops below 10−12 quickly. Note that wechoose the simple Hamiltonian matrix to reduce the compu-tational source required for the simulations. The eigen valuesand the corresponding eigen states of any k-local Hamilto-nian [37] can be calculated using QHES. More specifically,what we only require here is the controlled time evolution ofthe given Hamiltonian can be efficiently implemented for unit

Page 7: Quantum Heaviside Eigen Solver

7

time, which is a trivial task for any k-local Hamiltonian [46–49]. The k-local Hamiltonian describes more general quantumsystems than quantum many-body systems, where the formerincludes not only short-range interactions but also long-rangeinteractions.

DISCUSSION

In this work we presented a quantum Heaviside eigen solverto solve both the eigen values and eigen states for the generalHamiltonian matrix using quantum computers. The QHEScan solve the eigen values of given Hamiltonian with an er-ror smaller than ε in O

(log 1

ε

)binary searches using quan-

tum judge, which can judge whether all eigen values of thegiven Hamiltonian are higher than a trial threshold. Then thequantum selector in QHES outputs eigen states correspond-ing to the solved eigen values. In designing the oracle circuitof quantum judge, the parallel identification of eigen valuesis based on QPE, where three strategies are adopted to avoidits heavy tail. Besides QPE, we only use elementary quantumarithmetic operations, which is distinct from those based onnon-trivial tasks such as block-encoding of the target Hamil-tonian. This eigen solver was also tested on a physical model,showing its better feasibility.

We would like to mention that the QHC and the freezingoperator proposed here may contribute to other quantum algo-rithms. To name but a few, the QHC may be used as an activa-tion function in quantum (deep) neural networks [50, 51]. Fur-thermore, the freezing operator can exponentially reduce thedimension of freedom space (coin space) [52] and the numberof auxiliary qubits, which is very useful when a quantum cir-cuit contains several parts, such as the quantum principal com-ponent analysis [53] and the quantum random walks [54, 55].

METHODS

Here we give the definition of QHC and QDC. As the or-acle circuit of quantum judge, QHC should identify all eigenstates whose corresponding eigen values are higher than thetrial threshold θ. It can be expressed as

UH |Ej〉 |0〉⊗K |0〉 = αj |Ej〉 |0〉⊗K |0〉+ βj |Ej〉 |ϕj〉 |1〉 ,(8)

where |αj |2 + |βj |2 = 1 and |ϕj〉 represents the state thatvaries with different designs of QHC on K auxiliary qubits.The state |ϕj〉 on auxiliary qubits is not concerned since itdoes not influence the qualification of eigen states. The resultsof this qualification are obtained from |0〉 and |1〉 on the markqubit. More specifically, |0〉 on the mark qubit is entangledwith the eigen states with eigen values lower than θ and |1〉is entangled with other states. To achieve this purpose, αjshould be an approximation to a Heaviside function as αj =u (θ − Ej), where u is the classical unit step function.

Similarly, the QDC should identify eigen states whose cor-responding eigen value is |Eg〉, which is defined as

UD |Ej〉 |0〉⊗K |0〉 = γj |Ej〉 |0〉⊗K |0〉+ ηj |Ej〉 |φj〉 |1〉 ,(9)

where |γj |2 + |ηj |2 = 1 and |φj〉 is also the unconcernedauxiliary state. Here γj should be much higher whenEj = Egthan when Ej 6= Eg , which is an analog to the Dirac function.

Detailed analysis in the Supplemental Material shows therequirements for αj and γj to obtain the eigen values andeigen states with an error lower than ε are

|αj |

= O (1) Ej < θ − ε,≤ O

(1χ

)Ej > θ,

(10)

and

|γj |

= O (1) Ej = Eg,

≤ O(

ε√χ

)Ej 6= Eg,

(11)

respectively.

ACKNOWLEDGMENTS

We thank Zi-Yong Ge for inspiring discussions. Fund-ing: This work is supported in part by the National Natu-ral Science Foundation of China (11834014), the StrategicPriority Research Program of the Chinese Academy of Sci-ences (XDB28000000), the National Key R&D Program ofChina (2018YFA0305800), and Beijing Municipal Scienceand Technology Commission (Grant No. Z190011). Authorcontributions: Zheng-Zhi Sun performed all the work pre-sented in this manuscript under the full guidance and supervi-sion of Gang Su. Competing interests: We declare no com-peting interests. Data availability: All data needed to evalu-ate the conclusions in the paper are present in the paper. Thecode to generate the results in this paper can be obtained byreasonable request to the authors.

∗ Corresponding author. Email: [email protected][1] R. P. Feynman, Simulating physics with computers, Interna-

tional Journal of Theoretical Physics 21, 467 (1982).[2] J. Preskill, Quantum computing in the NISQ era and beyond,

Quantum 2, 79 (2018).[3] L. K. Grover, A fast quantum mechanical algorithm for

database search, in Proceedings of the Twenty-Eighth AnnualACM Symposium on Theory of Computing (ACM Press, 1996).

[4] P. W. Shor, Polynomial-time algorithms for prime factorizationand discrete logarithms on a quantum computer, SIAM Journalon Computing 26, 1484 (1997).

[5] L. K. Grover, Quantum mechanics helps in searching for a nee-dle in a haystack, Physical Review Letters 79, 325 (1997).

Page 8: Quantum Heaviside Eigen Solver

8

[6] C. H. Bennett, E. Bernstein, G. Brassard, and U. Vazirani,Strengths and weaknesses of quantum computing, SIAM Jour-nal on Computing 26, 1510 (1997).

[7] M. Szegedy, Quantum speed-up of markov chain based algo-rithms, in 45th Annual IEEE Symposium on Foundations ofComputer Science (IEEE, 2004).

[8] A. W. Harrow, A. Hassidim, and S. Lloyd, Quantum algorithmfor linear systems of equations, Physical Review Letters 103,150502 (2009).

[9] A. Montanaro, Quantum algorithms: an overview, npj QuantumInformation 2, 15023 (2016).

[10] J. Z. Imbrie, On many-body localization for quantum spinchains, Journal of Statistical Physics 163, 998 (2016).

[11] T. Shiozaki, An efficient solver for large structured eigenvalueproblems in relativistic quantum chemistry, Molecular Physics115, 5 (2016).

[12] A. Kandala, A. Mezzacapo, K. Temme, M. Takita, M. Brink,J. M. Chow, and J. M. Gambetta, Hardware-efficient variationalquantum eigensolver for small molecules and quantum mag-nets, Nature 549, 242 (2017).

[13] C. Jia, Y. Wang, C. Mendl, B. Moritz, and T. Devereaux, Pa-radeisos: A perfect hashing algorithm for many-body eigen-value problems, Computer Physics Communications 224, 81(2018).

[14] W. Koch and M. C. Holthausen, A Chemist’s Guide to DensityFunctional Theory (Wiley, New York, 2001).

[15] W. M. C. Foulkes, L. Mitas, R. J. Needs, and G. Rajagopal,Quantum monte carlo simulations of solids, Reviews of ModernPhysics 73, 33 (2001).

[16] S.-J. Ran, E. Tirrito, C. Peng, X. Chen, L. Tagliacozzo, G. Su,and M. Lewenstein, Tensor Network Contractions (Springer In-ternational Publishing, Berlin, 2020).

[17] Y.-L. Liu, Universal description of strongly correlated systems,International Journal of Modern Physics B 16, 773 (2002).

[18] R. Babbush, C. Gidney, D. W. Berry, N. Wiebe, J. McClean,A. Paler, A. Fowler, and H. Neven, Encoding electronic spectrain quantum circuits with linear t complexity, Physical ReviewX 8, 041015 (2018).

[19] M. Reiher, N. Wiebe, K. M. Svore, D. Wecker, and M. Troyer,Elucidating reaction mechanisms on quantum computers, Pro-ceedings of the National Academy of Sciences 114, 7555(2017).

[20] A. Aspuru-Guzik, R. Lindh, and M. Reiher, The matter simula-tion (r)evolution, ACS Central Science 4, 144 (2018).

[21] R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, Quantumalgorithms revisited, Proceedings of the Royal Society of Lon-don. Series A: Mathematical, Physical and Engineering Sci-ences 454, 339 (1998).

[22] X.-Q. Zhou, P. Kalasuwan, T. C. Ralph, and J. L. O‘Brien, Cal-culating unknown eigenvalues with a quantum algorithm, Na-ture Photonics 7, 223 (2013).

[23] D. S. Abrams and S. Lloyd, Quantum algorithm providing ex-ponential speed increase for finding eigenvalues and eigenvec-tors, Physical Review Letters 83, 5162 (1999).

[24] A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou,P. J. Love, A. Aspuru-Guzik, and J. L. O’Brien, A variationaleigenvalue solver on a photonic quantum processor, NatureCommunications 5, 4213 (2014).

[25] J.-G. Liu, Y.-H. Zhang, Y. Wan, and L. Wang, Variational quan-tum eigensolver with fewer qubits, Physical Review Research1, 023025 (2019).

[26] D. Wang, O. Higgott, and S. Brierley, Accelerated variationalquantum eigensolver, Physical Review Letters 122, 140504(2019).

[27] R. M. Parrish, E. G. Hohenstein, P. L. McMahon, and T. J.Martınez, Quantum computation of electronic transitions us-ing a variational quantum eigensolver, Physical Review Letters122, 230401 (2019).

[28] A. F. Izmaylov, T.-C. Yen, R. A. Lang, and V. Verteletskyi, Uni-tary partitioning approach to the measurement problem in thevariational quantum eigensolver method, Journal of ChemicalTheory and Computation 16, 190 (2019).

[29] R. LaRose, A. Tikku, E. O’Neel-Judy, L. Cincio, and P. J. Coles,Variational quantum state diagonalization, npj Quantum Infor-mation 5, 57 (2019).

[30] O. Higgott, D. Wang, and S. Brierley, Variational quantum com-putation of excited states, Quantum 3, 156 (2019).

[31] K. Mitarai, Y. O. Nakagawa, and W. Mizukami, Theory of an-alytical energy derivatives for the variational quantum eigen-solver, Physical Review Research 2, 013129 (2020).

[32] E. Farhi, J. Goldstone, S. Gutmann, and M. Sipser, Quan-tum computation by adiabatic evolution, (2000), arXiv:quant-ph/0001106 [quant-ph].

[33] S. Jansen, M.-B. Ruskai, and R. Seiler, Bounds for the adiabaticapproximation with applications to quantum computation, Jour-nal of Mathematical Physics 48, 102111 (2007).

[34] Y. Ge, J. Tura, and J. I. Cirac, Faster ground state preparationand high-precision ground energy estimation with fewer qubits,Journal of Mathematical Physics 60, 022202 (2019).

[35] D. Poulin and P. Wocjan, Preparing ground states of quantummany-body systems on a quantum computer, Physical ReviewLetters 102, 130503 (2009).

[36] L. Lin and Y. Tong, Near-optimal ground state preparation,Quantum 4, 372 (2020).

[37] T. Cubitt and A. Montanaro, Complexity classification of localhamiltonian problems, SIAM Journal on Computing 45, 268(2016).

[38] J. Kempe, A. Kitaev, and O. Regev, The complexity of the localhamiltonian problem, SIAM Journal on Computing 35, 1070(2006).

[39] G. H. Golub and H. A. van der Vorst, Eigenvalue computation inthe 20th century, Journal of Computational and Applied Math-ematics 123, 35 (2000).

[40] G. Brassard and P. Hoyer, An exact quantum polynomial-timealgorithm for simon's problem, in Proceedings of the Fifth Is-raeli Symposium on Theory of Computing and Systems (IEEEComput. Soc, 1997).

[41] L. K. Grover, Quantum computers can search rapidly by usingalmost any transformation, Physical Review Letters 80, 4329(1998).

[42] T. J. Yoder, G. H. Low, and I. L. Chuang, Fixed-point quantumsearch with an optimal number of queries, Physical Review Let-ters 113, 210501 (2014).

[43] M. Dobsıcek, G. Johansson, V. Shumeiko, and G. Wendin, Ar-bitrary accuracy iterative quantum phase estimation algorithmusing a single ancillary qubit: A two-qubit benchmark, PhysicalReview A 76, 030306 (2007).

[44] V. Vedral, A. Barenco, and A. Ekert, Quantum networks forelementary arithmetic operations, Physical Review A 54, 147(1996).

[45] G. Garcıa-Perez, M. A. C. Rossi, and S. Maniscalco, IBM q ex-perience as a versatile experimental testbed for simulating openquantum systems, npj Quantum Information 6, 1 (2020).

[46] D. W. Berry, A. M. Childs, R. Cleve, R. Kothari, and R. D.Somma, Simulating hamiltonian dynamics with a truncated tay-lor series, Physical Review Letters 114, 090502 (2015).

[47] D. W. Berry, A. M. Childs, and R. Kothari, Hamiltonian sim-ulation with nearly optimal dependence on all parameters, in

Page 9: Quantum Heaviside Eigen Solver

9

2015 IEEE 56th Annual Symposium on Foundations of Com-puter Science (IEEE, 2015).

[48] G. H. Low and I. L. Chuang, Optimal hamiltonian simulationby quantum signal processing, Physical Review Letters 118,010501 (2017).

[49] G. H. Low and I. L. Chuang, Hamiltonian simulation by qubiti-zation, Quantum 3, 163 (2019).

[50] N. Killoran, T. R. Bromley, J. M. Arrazola, M. Schuld, N. Que-sada, and S. Lloyd, Continuous-variable quantum neural net-works, Physical Review Research 1, 033063 (2019).

[51] C. Zhao and X.-S. Gao, QDNN: deep neural networks withquantum layers, Quantum Machine Intelligence 3, 15 (2021).

[52] S. Panahiyan and S. Fritzsche, Controlling quantum randomwalk with a step-dependent coin, New Journal of Physics 20,083028 (2018).

[53] S. Lloyd, M. Mohseni, and P. Rebentrost, Quantum principalcomponent analysis, Nature Physics 10, 631 (2014).

[54] Y. Aharonov, L. Davidovich, and N. Zagury, Quantum randomwalks, Physical Review A 48, 1687 (1993).

[55] S. E. Venegas-Andraca, Quantum walks: a comprehensive re-view, Quantum Information Processing 11, 1015 (2012).

Page 10: Quantum Heaviside Eigen Solver

Supplemental Material of “Quantum Heaviside Eigen Solver”

Zheng-Zhi SunSchool of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China

Gang Su∗Kavli Institute for Theoretical Sciences, and CAS Center for Excellence in Topological Quantum Computation,

University of Chinese Academy of Sciences, Beijing 100190, China andSchool of Physical Sciences, University of Chinese Academy of Sciences, P. O. Box 4588, Beijing 100049, China

I. QUANTUM HEAVISIDE EIGEN SOLVER

A. Quantum Heaviside and Dirac circuit

Here we introduce the general form of QHC and QDC. Toconstruct the circuit that can filter out all eigen states witheigen values larger than the trial threshold and preserve therest states, the ideal QHC should satisfy

UHeaviside |Ej < θ〉 |0〉⊗K |0〉 = |Ej〉 |0〉⊗K |0〉 , (S1a)

UHeaviside |Ej > θ〉 |0〉⊗K |0〉 = |Ej〉 |ϕj〉 |1〉 . (S1b)

where |ϕj〉 represents the state that varies with different de-signs of QHC on K auxiliary qubits. We do not care about|ϕj〉 as it does not influence the qualification of the states onphysical qubits. The |0〉 and |1〉 in Eq. (S1) are the states onthe mark qubit, where |0〉 is entangled with the qualified stateson physical qubits and |1〉 is entangled with other states.

However, this ideal QHC cannot be trivially realized inpractice. So we define an approximation for the ideal QHCas

UH |Ej〉 |0〉⊗K |0〉 = αj |Ej〉 |0〉⊗K |0〉+ βj |Ej〉 |ϕj〉 |1〉 ,(S2)

where |αj |2 + |βj |2 = 1. This definition is the same asEq. (S1) when αj is a Heaviside function such that αj =u (θ − Ej), where u is the classical unit step function.

Similarly, the qualified states for the QDC are the states|Eg〉 corresponding to a given eigen value Eg . To achieve thequalification of the state |Eg〉, the ideal QDC should satisfythe following conditions

UDirac |Eg〉 |0〉⊗K |0〉 = |Eg〉 |0〉⊗K |0〉 , (S3a)

UDirac |Ej 6=g〉 |0〉⊗K |0〉 = |Ej 6=g〉 |φj〉 |1〉 , (S3b)

This ideal QDC cannot be trivially realized in practice. So wedefine an approximation for the ideal QDC as

UD |Ej〉 |0〉⊗K |0〉 = γj |Ej〉 |0〉⊗K |0〉+ ηj |Ej〉 |φj〉 |1〉 ,(S4)

where |γj |2 + |ηj |2 = 1. This definition is the same as Eq.(S3) when γj equals to 1 instead of 0 only if Ej = Eg , whichis an analog to the Dirac function.

∗ Corresponding author. Email: [email protected]

B. Preliminaries of amplitude amplification algorithm

Now we introduce the amplitude amplification algorithmused to solve the Hamiltonian matrix. Suppose that we havean initialization operator UI on N qubits which achieves|ψr〉=UI |0〉⊗N and a projector P = |Eq〉 〈Eq| to the quali-fied state |Eq〉. Grover search algorithm [2] can project |ψr〉onto the image of P with a small correction by perform-ing O

(1√p

)iterations of I − 2P and I − 2 |ψr〉 〈ψr|, where

‖P |ψr〉‖2 = p. The amplitude amplification algorithm per-forms a similar process in the case of multiple qualified states.To achieve the quadratic speedup, the initialization operatorUI should satisfy that the fidelity between qualified state andinitialized state is no less than O

(1χ

), which is a trivial task

since even for a random initialization operator it has a highprobability of feasibility [3]. The main difficulty to solve theeigen problem of Hamiltonian is to design the projector to thequalified state, in particular when we do not have prior knowl-edge of the eigen values and eigen states.

After the construction of this projector using the QDC orQHC, the unitary Grover search circuit is recorded as

G (UI ,P) = [(I− 2P) (I− 2 |ψr〉 〈ψr|)]O(

1√p

). (S5)

This circuit can amplify the amplitude of |Eq〉 to O (1) start-ing with the randomly initialized state |ψr〉, which is givenby

|PG (UI ,P) |ψr〉| = O (1) . (S6)

When solving the eigen problem using the amplitude ampli-fication algorithm, the value of p is generally not known inadvance. This causes the souffle problem where the Groversearch algorithm is seen as a “quantum oven” [4]. The souffleproblem is that the amplitude of the qualified state drops tozeros if you open the oven too early and the amplitude startsshrinking if using too many iterations. Luckily we can useeither the full-blown quantum counting [5, 6] or a trial-and-error scheme where iterates are applied by an exponentiallyincreasing number of times [5, 7] without losing the quadraticspeedup from quantum search algorithm. A more elegantmethod is the fixed-point search [1], which is an improvedversion of the amplitude amplification algorithm to avoid the“over cooking” problem. We adopt this fixed-point searchas the amplitude amplification method here and record it asF (UI ,P).

arX

iv:2

111.

0828

8v1

[qu

ant-

ph]

16

Nov

202

1

Page 11: Quantum Heaviside Eigen Solver

2

C. Constructing projectors to qualified states

We can construct the projector of QDC by combining UD

and a projector to |0〉⊗K |0〉 on the K auxiliary qubits and themark qubit as

PD =[I⊗N ⊗ (|0〉 〈0|)⊗K+1

]UD. (S7)

Here UD is the practical quantum Dirac circuit, I⊗N is theidentity operator on the physical qubits, and (|0〉 〈0|)⊗K+1

is the projector to |0〉⊗K |0〉 on the K auxiliary qubits andthe mark qubit. When the state is in the subspace where theauxiliary qubits and the mark qubit are fixed to |0〉⊗K |0〉, theprojector PD achieves the result of the projector |Eg〉 〈Eg| onphysical qubits. This can be expressed as

PD |Ej〉 |0〉⊗K |0〉 = γj |Ej〉 |0〉⊗K |0〉 . (S8)

The projector can be described as firstly entangling the targetstate |Eg〉 on the physical qubits with |0〉 on the mark qubitand then projecting the mark qubit with |0〉 〈0|.

Similarly, the corresponding projector PH of QHC can beconstructed by combining UH with a projector to |0〉⊗K |0〉on the K auxiliary qubits and the mark qubit, which gives

PH =[I⊗N ⊗ (|0〉 〈0|)⊗K+1

]UH . (S9)

D. Quantum selector and quantum judge for eigen problem

After constructing the projector in amplitude amplificationalgorithm using the quantum Heaviside circuit as given in Eq.(S9), a quantum judge can be obtained. The quantum judgeprojects a randomly initialized state onto the image of stateswhose energies are lower than the given threshold θ with highprobability. Then an extra quantum Heaviside circuit is per-formed to mark the qualified states with exponentially smallerror. Measuring the mark qubit one can obtain whether thereis any qualified state to the quantum Heaviside circuit of thegiven Hamiltonian matrix and threshold. More specifically, ifthe probability of the measurement result of the mark qubit be-ing |0〉 is exponentially small, all eigen values of given Hamil-tonian matrix are larger than θ. The minimum eigen value ofH with an error smaller than ε can be obtained by performingO(log 1

ε

)times of quantum judge according to dichotomy.

The number of calling quantum circuit to obtain the groundstate energy of H is exponentially smaller than those in Ref.[3] and Ref. [8], while the cost of quantum circuits is sim-ilar. These two works use analogs of quantum Dirac circuitfor sweeping or quantum sweeping the ground state energy

for O(

)and O

(√1ε

)times, respectively, in the absence of

quantum Heaviside circuit.As the eigen values can be calculated by combining quan-

tum judge with dichotomy, the quantum Dirac circuit can beused to find the eigen state of a given eigen value. The am-plitude amplification algorithm whose projector is constructed

by quantum Dirac circuit can be regarded as a quantum selec-tor. Similar to quantum judge, the quantum selector projects arandomly initialized state onto the image of states correspond-ing to the given eigen value. Then an extra quantum Diraccircuit is performed to mark the qualified states with expo-nentially small error. When this process is done, the state |0〉on the mark qubit is entangled with the qualified states on thephysical qubits. A joint measurement of the mark qubit andphysical qubits can be performed to make tomography or ob-tain the observations of qualified states. The quantum selec-tor does not distinguish the degenerate states since it changesthe mark qubit based on the eigen values of input states onthe physical qubits. When the qualified states are degener-ate (multiple), the state on the physical qubits entangled with|0〉 on the mark qubit is a linear superposition of all qualifiedstates. The superposition coefficients depend on the propor-tion of different qualified states in the initial state |ψr〉, whichare usually unknown.

II. SOLVE EIGEN STATES WITH QUANTUM SELECTOR

A. Restrictions on quantum Dirac circuit

Now we give the restrictions on the quantum Dirac to solvea χ-dimensional Hamiltonian matrix on N physical qubits. Inthe case of quantum Dirac circuit, the quantum selector is anamplitude amplification circuit whose projector to the goodsubspace is PD. The output state of this quantum selector onphysical qubits where the mark qubit is measured to be |0〉 is

PD |ψr〉‖PD |ψr〉‖

=

∑j

λjγj |Ej〉∥∥∥∥∥∑j

λjγj |Ej〉∥∥∥∥∥

, (S10)

where λj are the expansion coefficients of initial state underenergy representations. These coefficients are given by theinitialization circuit

|ψr〉 = UI |0〉⊗N =∑

j

λj |Ej〉. (S11)

Without losing generality, we assume that the qualified stateis |Eg〉. And we also suppose that a suitable initialization op-

erator is constructed to satisfy that λg = O(

1√χ

). The eigen

state corresponding toEg is assumed to be non-degenerate forthe convenience of explanation. This algorithm can be triv-ially generalized to the degenerate case. The successful imple-mentation of using quantum selector to obtain an ε-close stateto |Eg〉 has two requirements that come from the amplitudeamplification algorithm [9]. The first requirement is that theamplitude amplification circuit can be constructed by no morethan O

(1√χ

)initialization circuits UI and projector circuits

PD, which is equivalent to that ‖PD |ψr〉‖ ≥ O(

1√χ

). The

second requirement is that the error between the output state

Page 12: Quantum Heaviside Eigen Solver

3

of this quantum selector and |Eg〉 should be less than O (ε),

which can be expressed as∥∥∥ PD|ψr〉‖PD|ψr〉‖ − |Eg〉

∥∥∥ ≤ O (ε).To meet these two requirements, we restrain that γj in

Eq. (S4) satisfy

|γj |≥ 1

2 j = g,

≤ O(

ε√χ

)j 6= g,

(S12)

which is a sufficient condition for these two requirementswhen designing the practical quantum Dirac circuit of Eq.(S4). The proof of sufficiency for the first requirement is that

‖PD |ψr〉‖ ≥ ‖λgγg |Eg〉‖ = |λgγg| = O

(1√χ

). (S13)

Meanwhile, we notice that∑

j

|λjγj |2 ≥ |λgγg|2 = O

(1

χ

), (S14a)

i 6=g|λjγj |2 ≤ O

(ε2

χ

)∑

i 6=g|λj |2 = O

(ε2

χ

). (S14b)

The proof of sufficiency for the second requirement is that

|〈Eg|PD |ψr〉|‖PD |ψr〉‖

=|λgγg|√∑j

|λjγj |2(S15)

=

√√√√√√1−

∑i6=g|λjγj |2

∑j

|λjγj |2

≥√

1−O (ε2),

and∥∥∥ PD|ψr〉‖PD|ψr〉‖ − |Eq〉

∥∥∥ ≤ O (ε) can be directly derived.

B. Realization of quantum coin toss

Here we give the quantum circuit to flip one quantum coinwith the amplitude of cos (Ej − Eg) when the state on thephysical qubits is |Ej〉, where Eg is the given eigen value.Since we can shift and zoom the Hamiltonian matrix H, weassume that Eg = 0 and all eigen values of H are in the rangeof(−π2 , π2

)without losing generality. This flipping operator

of quantum coin is designed as

Uc = BUeB, (S16)

where B is the quantum Hadamard gate which maps basisstate |0〉 to |0〉+|1〉√

2and maps |1〉 to |0〉−|1〉√

2[10], and Ue is a

time evolution operator controlled by the quantum coin

Ue = eiH |0〉 〈0|+ e−iH |1〉 〈1| . (S17)

e−iH is the unit time evolution of Hamiltonian matrix H andeiH is the inverse of it. The illustration of this design is shownin Fig. S1(c).

C. Using multiple quantum coins to design quantum Diraccircuit

Here we consider the operator UC that flips M quantumcoins

UC |Ej〉|0〉⊗M =

(M∏

m

Umc

)|Ej〉 |0〉⊗M

= |Ej〉 [cos (Ej) |0〉+ i sin (Ej) |1〉]⊗M . (S18)

Umc is an operator on N physical qubits and M quantum

coins, which is constructed by flipping operator Uc of the m-th quantum coin and an identity operator on the rest M − 1quantum coins, as shown in Fig. S1(b). We call this kind ofoperator composed by the direct product of a unitary opera-tor U and an identity operator on the rest qubits of the wholecircuit as the extension of U below. The probability of allquantum coins being flipped is cos2M (Ej), which is a goodapproximation to the analog of Dirac function δ (Ej) for largeM . The practical quantum Dirac circuit in the form of Eq.(S4) can be constructed by

U′D =[I⊗N ⊗UMCX

(|0〉⊗M

)](UC ⊗ I)

(I⊗N+M ⊗X

),

(S19)

which is shown in Fig. S1(a). UMCX

(|0〉⊗M

)is a multi-

controlled NOT gate that performs NOT gate on the markqubit when the state on M quantum coins is |0〉⊗M as shownin Fig. S1(d). The operator UC is the combination of M flip-ping operator acting on the physical qubits and M quantumcoins separately as shown in Fig. S1(b). X represents for thequantum NOT gate.

D. Mathematical analysis on the number of quantum coins

With the practical design of Eq. (S19), we can obtain fromEq. (S4) that γj = cosM (Ej). The restraint of γj in Eq.(S12) becomes the restraint of M and the error bound ε0 ofthe given energy Eg

cosM (ε0) ≥ 1

2, (S20a)

cosM (|∆− ε0|) < O

(ε√χ

), (S20b)

where ε is the error bound of the output state, χ is the dimen-sion of Hamiltonian matrix H, and ∆ is the gap between Egand its closest eigen value. Then we can derive that to obtainthe ε-close eigen state corresponding to the given eigen valueEg , the minimum number of quantum coins is

M = O

(1

∆2

(N + log

1

ε

)), (S21)

and the error bound of Eg is ε0 = O (∆).

Page 13: Quantum Heaviside Eigen Solver

4

M quantum coins

one mark qubit

N physical qubits

( )0M

MCX

ÄU

D¢U =

( )0M

MCX

ÄU =

cU =

B B

CU

CU = 1

cU

2

cU

M=2

M=2

X

XX

X

X

X

ie- H i

eH

(a)

(b)

(c)

(d)

X

X

FIG. S1. (a) guide to construct the primary quantum Dirac circuit ofEq. (S19). (a) The primary design of the quantum Dirac circuit ofEq. (S19). (b) The circuit that flips M quantum coins respectively asgiven in Eq. (S18). Here we record the top quantum coin as the firstquantum coin. (c) The flipping operator of one quantum coin in Eq.(S16). (d) The multi-controlled NOT gate that performs NOT gateon the mark qubit when the state on M quantum coins is |0〉⊗M .

E. Quantum Dirac circuit improved by the freezing operator

The new design of practical quantum Dirac circuit is shownin Fig. S2 and can be written as

U′′D =[(I⊗N ⊗UF

)CUc

]M (I⊗N+1 ⊗X⊗K

), (S22)

where CUc is the flipping operator controlled by the markqubit and combined with an identity operator on the restK − 1 qubits. This method shows how to construct the prac-tical quantum Dirac circuit in the form of Eq. (S4) withK = O (logM) auxiliary qubits (counting qubits).

F. Construction and gate complexity of quantum selector

Using Eq. (S22) as the practical quantum Dirac circuit, thequantum selector can be expressed as

S = P′′DF [UI ,P′′D] , (S23)

where P′′D is the projector to the good subspace constructedby Eq. (S22) and Eq. (S7), which reads

P′′D =[I⊗N+K ⊗ (|0〉 〈0|)

]U′′D. (S24)

K counting qubits

one mark qubit

N physical qubits

=D¢¢U

repeat M times

=

cU

FU

FU

K=3

K=4

cU

FU

X

X

X

X

X

X

X

(a)

(b)

FIG. S2. (a) guide to construct the quantum Dirac circuit of Eq.(S22). (a) The design of quantum Dirac circuit of Eq. (S22) usedfor the quantum selector. Here we record the top counting qubit asthe first (the highest) qubit and so do the following circuits. (b) Thecircuit of freezing operator.

Note that this projector is not a unitary operator as it contains|0〉 〈0| which is achieved by measurements. This quantum se-lector can output an ε-close eigen state corresponding to thegiven eigen value Eg . Since the quantum selector is a quan-

tum amplitude amplification algorithm, it requires O(

1√χ

)

iterations of the initialization operator UI and the projectorP′′D.

Now we analyze the gate complexity of the quantum se-lector. The basic ingredients of the quantum selector in-clude the initialization operator UI defined by Eq. (S11),the controlled Hamiltonian evolution operator Ue defined byEq. (S17), the multi-controlled NOT gate, and some basicquantum gates. There are several methods for the controlledHamiltonian evolution whose gate complexities scale differ-ently with the evolution time, the error bound and the proper-ties of the given Hamiltonian matrix [11–14]. Here we recordthe gate complexity for Hamiltonian simulation in unit timeas Λ instead of analyzing the difference of gate complexitiesresulted from different Hamiltonian simulation methods. Sim-ilarly, we record the gate complexity of initialization circuit asΦ from which one can obtain the state whose fidelity with thequalified state is no less than O

(1χ

).

From Fig. S1(c) we can see that the gate complexity ofUc is O (Λ). The gate complexity of UF is O [poly (K)]as shown in Fig. S2(b), and the gate complexity of multi-controlled NOT gate on K + 1 qubits is also O [poly (K)][10]. Then the gate complexity of the quantum Dirac circuitof Eq. (S22) is O (M [Λ + poly (K)]). We use O to denotethe complexity up to poly logarithmic factors in N , 1

∆ , log 1ε ,

and Λ. The gate complexity of the quantum Dirac circuit ofEq. (S22) can thus be rewritten as O

(ΛN+log 1

ε

∆2

). Since the

quantum selector is the Grove search of Eq. (S5) (or the fixed-point search with the same complexity under big-O notation)

Page 14: Quantum Heaviside Eigen Solver

5

using UI and PD of Eq. (S24), its gate complexity is

O

(ΛN + log 1

ε√χ∆2

+Φ√χ

). (S25)

III. SOLVE EIGEN VALUES WITH QUANTUM JUDGE

A. Restrictions on quantum Heaviside circuit

The quantum judge is an amplitude amplification circuitwhose projector to the good subspace is PH . Then the out-put state of this quantum judge on physical qubits where themark qubit is measured to be |0〉 is

PH |ψr〉‖PH |ψr〉‖

=

∑j

λjαj |Ej〉∥∥∥∥∥∑j

λjαj |Ej〉∥∥∥∥∥

. (S26)

The task of this quantum judge is to judge whether all eigenvalues of the given Hamiltonian H is larger than the thresholdθ. More specifically, the quantum judge should output the dif-ferentiable states for two different cases. The first case is thatall eigen values of the given Hamiltonian H is larger than θand the second case is that there are states whose correspond-ing eigen values are smaller than θ − ε. For convenience ofpresentation, we define an index h that satisfies

Ej

≤ θ − ε j ≤ h,≥ θ j > h.

(S27)

We also assume that the initialization circuit UI is designedto satisfy that in the second case

∑j≤h|λj |2 ≥ O

(1χ

). This is

a trivial task since a random circuit can meet this requirementwith high probability.

To meet the requirement of output differentiable states inthese two cases, we restrain that αj in Eq. (S2) satisfies

|αj |≥ 1

2 j ≤ h,≤ O

(1χ

)j > h,

(S28)

which is a sufficient condition for this requirement when de-signing the practical quantum Dirac circuit of Eq. (S2). Nowwe prove that with the restraint of Eq. (S28), the quantumjudge output |0〉 on the mark qubit with probability no morethan O

(1χ

)in the first case and the output |0〉 with probabil-

ity of O (1) in the second case. Here the quantum judge iscomposed by O

(1√χ

)initialization circuits UI and projector

circuits PH .In the first case, the probability of measuring |0〉 on the

mark qubit from the state UH |ψr〉 |0〉⊗K |0〉 is∑j

|λjαj |2 ac-

cording to the definition of UH and |ψr〉 from Eq. (S2) and

Eq. (S11) respectively. Based on Eq. (S28), this probabilitysatisfies

j

|λjαj |2 ≤ O(

1

χ2

)∑

j

|λj |2 = O

(1

χ2

). (S29)

Since we use O(

1√χ

)repetitions of UI and PH , the proba-

bility of measuring |0〉 on the mark qubit in the output state isno more than

O (χ)∑

j

|λjαj |2 ≤ O(

1

χ

), (S30)

which is exponentially small. In the second case, we have

j

|λjαj |2 ≥1

4

j≤h|λj |2 = O

(1

χ

). (S31)

Thus, the amplitude amplification algorithm can amplify theamplitude of |0〉 on the mark qubit to O (1).

B. Preliminaries of quantum phase estimation

The QPE of an eigen state |Ej〉 is exactly given as [17]

UQPE |Ej〉 |0〉⊗R=1

2R

2R−1∑

x=0

2R−1∑

k=0

eikEj−2πik x

2R |Ej〉 |x〉,

(S32)

where UQPE is the QPE circuit and x is a binary number. TheQPE circuit is achieved by three parts

UQPE =(I⊗N ⊗U−1

Fourier

)UCH

(I⊗N ⊗B⊗R

), (S33)

which is shown in Fig. S3(a).

=R=3

QPEU B

B

B

CHU

1

Fourier

-U R representation qubits

N physical qubits

CHU =

R=3

02ei H12ei H

22ei H

(a)

(b)

FIG. S3. Sketch of quantum phase estimation circuit. (a) The quan-tum phase estimation circuit of Eq. (S33). (b) The circuit of con-trolled Hamiltonian evolution which achieves Eq. (S34b).

Here B is the quantum Hadamard gate, UCH is a controlledHamiltonian evolution operator (Fig. S3(b)) and U−1

Fourier is

Page 15: Quantum Heaviside Eigen Solver

6

the inverse quantum Fourier transform. The three circuits canachieve, respectively,

B⊗R|0〉⊗R =

( |0〉+ |1〉√2

)⊗R=

√1

2R

2R−1∑

k=0

|k〉, (S34a)

UCH

√1

2R

2R−1∑

k=0

|Ej〉 |k〉 =

√1

2R

2R−1∑

x=0

eikEj |Ej〉 |k〉,

(S34b)

U−1Fourier |k〉 =

√1

2R

2R−1∑

x=0

e−2πik x

2R |x〉. (S34c)

For convenience, we record the amplitude of |Ej〉 |x〉 in Eq.(S32) as κ (Ej , x), which is

κ (Ej , x) =1

2R

2R−1∑

k=0

eikEj−2πik x

2R . (S35)

This is a sum of geometric progression, so when x is not ex-actly equal to 2R−1Ej

π , κ (Ej , x) can be written as

κ (Ej , x) =1

2R1− ei2REj−2πix

1− eiEj−2πi x

2R. (S36)

When∣∣∣Ej

2π − x2R

∣∣∣ ≤ 12R+1 , it can be proved that the modulus

of κ (Ej , x) satisfies

|κ (Ej , x)| =

∣∣∣∣∣∣sin(2R−1Ej − πx

)

2R sin(Ej

2 − π x2R

)

∣∣∣∣∣∣

≥ 1

2R

∣∣sin(2R−1Ej − πx

)∣∣

π∣∣∣Ej

2π − x2R

∣∣∣

≥ 1

2R

2R+1∣∣∣Ej

2π − x2R

∣∣∣

π∣∣∣Ej

2π − x2R

∣∣∣

=2

π. (S37)

We can define a classical function n (y) to output the nearestbinary number on R digits of 2Ry, where y is in the range of[0, 1− 1

2R

]. It can be easily seen that

∣∣∣∣n (y)

2R− y∣∣∣∣ ≤

1

2R+1. (S38)

Without losing the generality, we assume Ej is in the range of[0, 2π − 2π

2R

], and then Eq. (S37) becomes

∣∣∣∣κ(Ej , n

(Ej2π

))∣∣∣∣ ≥2

π. (S39)

Eq. (S39) shows that the QPE method can output a binaryrepresentation of n

(Ej

)with the amplitude larger than 2

π .

Thus, we can obtain the value of Ej

2π with an error lower thanO(

12R

).

For the convenience of our later proofs on quantum Heav-iside circuit, here we give a lower bound of the modulus ofκ (Ej , x). When

∣∣∣Ej

2π − x2R

∣∣∣ ≤ 1S2R+1 and S ≥ 2 [3], the

lower bound of the modulus of κ (Ej , x) is

|κ (Ej , x)| = 1

2R

∣∣∣∣∣∣

2R−1∑

k=0

eikEj−2πik x

2R

∣∣∣∣∣∣

≥ 1

2R

∣∣∣∣∣∣

2R−1∑

k=0

cos

[2πk

(Ej2π− x

2R

)]∣∣∣∣∣∣

≥ 1

2R

2R−1∑

k=0

cos(πS

)

= cos(πS

)

≥ 1− π2

2S2. (S40)

C. The first strategy in the quantum Heaviside circuit

As we have shown in Eq. (S32), the implementation of QPEcircuit requiresN physical qubits andR representation qubits.The first strategy in QHC is to implement Q QPE circuits onthe same physical qubits and Q × R different representationqubits. This circuit is defined as

UQ =

Q∏

q

UqQPE , (S41)

where UqQPE is the extension of QPE circuit on the q-th part

of representation qubits, as shown in Fig. S4(b). Withoutlosing the generality, we assume that all eigen values are inthe range of

[0, 2π − 2π

2R

]and the given threshold θ equals π.

Ignoring the huge amount of qubits it needs, we now givethe primary design of quantum Heaviside circuit

U′H = UqMCX

(|0〉⊗Q

)(UQ ⊗ I)

(I⊗N+QR ⊗X

),

(S42)

where UqMCX is a NOT gate on the mark qubit controlled by

Q first (the highest) qubits of Q parts of representation qubits.This primary design of quantum Heaviside circuit is shown inFig. S4. The effect of this circuit can be shown as

U′H |Ej〉 |0〉⊗QR+1= |Ej〉

2R−1−1∑

x=0

κ (Ej , x) |x〉

⊗Q

|0〉

+ |Ej〉 |rest〉 |1〉 . (S43)

Page 16: Quantum Heaviside Eigen Solver

7

Q×R representation qubits

one mark qubit

N physical qubits

=QU

QU =

Q=2

R representation qubits

R representation qubits

q

MCXU

Q=2

R=3=

1

QPEU

X

X

H¢U

2

QPEU

( )0Qq

MCX

ÄU

(a)

(b)

(c)

FIG. S4. (a) guide to construct the primary quantum Heaviside cir-cuit of Eq. (S42). (a) The primary design of quantum Heavisidecircuit of Eq. (S42). This circuit can successfully filter out the statesin the bad subspace, but it requires huge amount of qubits and cannotpreserve the good states. (b) The circuit to apply the quantum phaseestimation to Q parts of representation qubits as given in Eq. (S41).(c) The circuit to apply NOT gate to the mark qubit controlled by allfirst qubits of all Q parts of representation qubits.

This quantum Heaviside circuit can successfully filter outthe states in the bad subspace while it cannot ensure to pre-serve the good states. This is equivalent to satisfying the sec-ond requirement of Eq. (S28) and ignoring the first require-ment. It can be proved below when

ε ≥ 2π

2R−1, (S44a)

Q = O (N) . (S44b)

From Eq. (S44a) and Eq. (S27), we can obtain that n(Ej

)>

2R−1 for j > h. This means that the qubit with the highestorder in the binary representation of n

(Ej

)is |1〉. Based on

Eq. (S39) and Eq. (S43), the amplitude of the mark qubitbeing |0〉 satisfies

|αj |2 =

2R−1−1∑

x=0

|κ (Ej , x)|2Q

≤(

1−∣∣∣∣κ(Ej , n

(Ej2π

))∣∣∣∣2)Q

≤(

1− 4

π2

)Q(S45)

Since N = O (logχ), we can easily find that Q satisfies Eq.(S44b) and meets the second requirement of Eq. (S28), whichis |αj | ≤ O

(1χ

).

D. The second strategy in the quantum Heaviside circuit

Quantum Heaviside circuit using only the first strategy mayunfortunately filter out the good states, and the second strategyis to implement a batch of QPE circuits UQ for W differentHamiltonian matrices, which are expressed as Hw : Hw =H0 + w

2R−1 . Now we prove that the good states of H0

can survive at least once in the W quantum Heaviside circuit.Suppose that the eigen value of a good state of H0 is Eq , thenthere is a set of Eq corresponding to the set of Hw recordedas

Eq,w : Eq,w = Eq +w

W

π

2R−1. (S46)

Note that Eq is the eigen value of a good state which meansthat all Es,w satisfy

n

(Eq,w2π

)< 2R−1. (S47)

Since the interval of Es,w is 1W2R−1π

, there will be at leastone w0 that satisfies

∣∣∣∣Eq,w0

2π− 1

2Rn

(Eq,w0

)∣∣∣∣ ≤1

W2R+1. (S48)

Substituting this equation into Eq. (S40), we can get the am-plitude immediately

∣∣∣∣κ(Eq,w0

, n

(Eq,w0

))∣∣∣∣ ≥ 1− π2

2W 2. (S49)

Note that the amplitude of the mark qubit being |0〉 after thequantum Heaviside circuit satisfies

|αq|2=

2R−1−1∑

x=0

|κ (Eq, x)|2Q

≥[∣∣∣∣κ

(Eq, n

(Eq2π

))∣∣∣∣2]Q.

(S50)

To meet the first requirement in Eq. (S28), we obtain

W = O(√

Q)

= O(√

N). (S51)

Since the condition for the establishment of Eq. (S45) stillholds, which is n

(Es,w

)> 2R−1, all W quantum Heaviside

circuits can filter out the bad states, whose eigen values arelarger than π.

The classical part of this method can be replaced by a quan-tum search algorithm of w0 that satisfies Eq. (S48). It canspeed up this method by O

(√W)

= O(N

14

). Now we de-

fine a shifted QPE circuit withD extra division qubits that canachieve

UsQPE |Ej〉 |0〉⊗R|0〉⊗D=

1

2R

2R−1∑

x=0

2R−1∑

k=0

2D−1∑

w=0

eikEj+2πi kw

2R+D−2πik x

2R |Ej〉 |x〉 |w〉 .

(S52)

Page 17: Quantum Heaviside Eigen Solver

8

The operator UsQPE can be easily constructed by combiningthe QPE circuit shown in Eq. (S33) with a controlled Hamilto-nian evolution operator. To distinguish it from the controlledHamiltonian evolution operator in Eq. (S33), we record thetwo operators as UCH (k) and UCH (k,w) which can achieverespectively

UCH (k) |Ej〉 |k〉 = eikEj |Ej〉 |k〉 , (S53a)

UCH (k,w) |Ej〉 |k〉 |w〉 = eikEj+2πi kw

2R+D |Ej〉 |k〉 |w〉 ,(S53b)

where UCH (k) is the controlled Hamiltonian evolution usedin Eq. (S33). The quantum circuit UCH (k,w) is representedin Fig. S5.

=D=2

R=2

CHU

R representation qubits

D division qubits

N physical qubits0 0

1

2

2R D

i

e

p+

+ -

H0 1

1

2

2R D

i

e

p+

+ -

H1 0

1

2

2R D

i

e

p+

+ -

H1 1

1

2

2R D

i

e

p+

+ -

H

( ),CHk wU

FIG. S5. The circuit to achieve the result of Eq. (S53b). This circuitcontains D×R controlled Hamiltonian evolution operator in additionto the UCH .

The construction of shifted QPE is to replace the con-trolled Hamiltonian evolution operator in Eq. (S33) withUCH (k,w), where the division qubits are initialized to2D−1∑w=0|w〉. The shifted QPE operator is shown as

UsQPE =(I⊗N ⊗U−1

Fourier ⊗ I⊗D)UCH (k,w)

(I⊗N ⊗B⊗R ⊗ I⊗D

). (S54)

Note that the quantum Fourier transform still works on the Rrepresentation qubits.

The simple replacement of UCH (k) with UCH (k,w) re-duces the lower bound on probability of outputting qualifiedstates from O (1) to O

(1W

). This process can be seen as to

perform U′H forW different Hw’s in parallel, compared withserial performing U′H without the division qubits. The paral-lel quantum Heaviside circuit is recorded as

U′p−H = UqMCX (UsQ ⊗ I) , (S55)

where UqMCX is a NOT gate on the mark qubit controlled by

Q first qubits of Q parts of representation qubits. The UsQ isdefined as

UsQ =

Q∏

q

UqsQPE , (S56)

which is similar to Eq. (S41).For the consistency of the definition of quantum Heaviside

circuit, the probability of outputting qualified states should beincreased to O (1) by the fixed-point search. This version ofquantum Heaviside circuit is defined as

U′′H = F[U′p−H , I

⊗N+QR+D ⊗ (|0〉 〈0|)], (S57)

where |0〉 〈0| is a projector to |0〉 on the mark qubit. Comparedwith the previous method with classical search, this method ismore elegant in the sense that it is a complete quantum algo-rithm and has a quadratic speedup in the search of Hamilto-nian set Hw. But in practice, we still adopt the previousdesign of quantum Heaviside circuit of Eq. (S42) combin-ing with the classical search of Hw. The reason is that thespeedup scale is only O

(√W)

= O(N

14

)according to Eq.

(S51). Furthermore, this quantum search greatly increases thedifficulty of designing and simulating the quantum judge.

E. The third strategy in quantum Heaviside circuit

We have introduced the freezing operator to reduce thenumber of required auxiliary qubits in the construction ofquantum Dirac circuit. One should note that the initial stateand the target state are both |0〉 on the mark qubit in quantumDirac circuit, where only one freezing operator is needed tofreeze |1〉 on the mark qubit. In quantum Heaviside circuitof Eq. (S42), the initial state is |0〉⊗R on the representationqubits, while the target state is |0〉 on the first (the highestorder) qubit of the representation qubits. Now we need twofreezing operators to freeze the states orthogonal to |0〉⊗R onthe representation qubits and the state |0〉 on the mark staterespectively. The first freezing operator is to extract the targetstate on the mark qubits and the second one guarantees thatthe QPE circuit always starts on the right state.

The primary design of quantum Heaviside circuit of Eq.(S42) requires Q × R representation qubits. Combining withthe freezing circuit, we can perform Q times of QPE on Rrepresentation qubits and O (logQ) counting qubits insteadof Q×R representation qubits. This new circuit is

U′′′H = UmarkCX

[(UQPE−F )

Q ⊗ I] (

I⊗N+R ⊗X⊗C+1).

(S58)

UmarkCX is a NOT gate on the mark qubit controlled by the first

(the highest order) qubit of the C counting qubits. UQPE−Fis expressed as

UQPE−F =(I⊗N ⊗UF2

)CU−1

QPE

(I⊗N ⊗UF1

)CUQPE ,

(S59)

where CUQPE and CU−1QPE are the QPE circuit and its in-

verse controlled by the counting qubits, respectively. UF1and

UF2are freezing operators with target states of |0〉 on the first

qubit of the representation qubits and |0〉⊗R on the represen-tation qubits, respectively. The sketch of this construction isdepicted in Fig. S6.

F. Construction and gate complexity of quantum judge

The quantum judge can be constructed by the quantumHeaviside circuit as

J =[I⊗N+R+C ⊗ (|0〉 〈0|)

]F[U′′′H , I

⊗N+R+C ⊗ (|0〉 〈0|)].

(S60)

Page 18: Quantum Heaviside Eigen Solver

9

R representation qubits

one mark qubit

N physical qubits

=

=

C=3

R=3

X

H¢¢¢U

C counting qubits

QPE F-U⋯ QPE F-U

QPE F-U

QPEU1

QPE

-U

( )0R

F

ÄU

repeat Q times

X XFU=

=R=3 X

mark

CXU

X

( )0FU

( )0FU

(a)

(b)

(c)

(d)

mark

CXU

FIG. S6. (a) guide to construct the quantum Heaviside circuit of Eq.(S58). (a) The design of quantum Heaviside circuit of Eq. (S58)used for the quantum judge. (b) The repeating units to perform thequantum phase estimation and its inverse Q times. (c) The freezingoperator whose target state is |0〉 on the first qubit of the representa-tion qubits. (d) The NOT gate on the mark qubit controlled by thefirst counting qubit.

One must note that the quantum judge is not a unitary oper-ator as it contains a projector that is achieved by measure-ments. The process using this quantum judge to solve thelowest eigen value of the given Hamiltonian matrix H con-tains three steps. The first step is to normalize the Hamilto-nian matrix to make sure that all eigen values are in the rangeof[0, 2M−1

2M−1 π]. Then the second step is to use the quantum

judge to decide whether all Hamiltonian in the set of Hw donot output |0〉 on the mark qubit with a probability of O (1),which indicates that no eigen value of the given Hamiltonianis lower than the given threshold θ. The third step is to use di-chotomy to obtain the lowest eigen value with an error lowerthan ε in O

(log 1

ε

)iterations.

The complexity analysis can be easily done from the sketchof quantum Heaviside circuit in Fig. S6. The numberof auxiliary qubits is R + C + 1, which is rewritten asO(logN + log 1

ε

)based on C = O (logQ). The analysis

of gate complexity is similar to the case of quantum Diraccircuit. The only new circuit is the QPE circuit, whose gatecomplexity is O

(Λε

)[17]. Here we stress that the (inverse)

Hamiltonian evolution(eiH)t

is achieved by repeating eiH ttimes instead of simulating the Hamiltonian for time t, whichcan avoid the error accumulation from the imperfect Hamilto-nian simulation [3]. As no other new circuit is introduced inquantum Heaviside circuit of Eq. (S58), the gate complexityof the quantum judge is

O

ε√χ

+Φ√χ

). (S61)

[1] T. J. Yoder, G. H. Low, and I. L. Chuang, Fixed-point quantumsearch with an optimal number of queries, Physical Review Let-ters 113, 210501 (2014).

[2] L. K. Grover, Quantum mechanics helps in searching for a nee-dle in a haystack, Physical Review Letters 79, 325 (1997).

[3] D. Poulin and P. Wocjan, Preparing ground states of quantummany-body systems on a quantum computer, Physical ReviewLetters 102, 130503 (2009).

[4] G. Brassard, Searching a quantum phone book, Science 275,627 (1997).

[5] M. Boyer, G. Brassard, P. Høyer, and A. Tapp, Tight bounds onquantum searching, Fortschritte der Physik 46, 493 (1998).

[6] G. Brassard, P. Høyer, and A. Tapp, Quantum counting, in Au-tomata, Languages and Programming (Springer Berlin Heidel-berg, 1998) pp. 820–831.

[7] G. Brassard, P. Høyer, M. Mosca, and A. Tapp, Quantum ampli-tude amplification and estimation, Quantum Computation andInformation , 53–74 (2002).

[8] Y. Ge, J. Tura, and J. I. Cirac, Faster ground state preparationand high-precision ground energy estimation with fewer qubits,Journal of Mathematical Physics 60, 022202 (2019).

[9] L. K. Grover, Quantum computers can search rapidly by usingalmost any transformation, Physical Review Letters 80, 4329(1998).

[10] M. A. Nielsen and I. L. Chuang, Quantum Computation

and Quantum Information (Cambridge University Press, Cam-bridge, 2009).

[11] D. W. Berry, A. M. Childs, R. Cleve, R. Kothari, and R. D.Somma, Simulating hamiltonian dynamics with a truncated tay-lor series, Physical Review Letters 114, 090502 (2015).

[12] D. W. Berry, A. M. Childs, and R. Kothari, Hamiltonian sim-ulation with nearly optimal dependence on all parameters, in2015 IEEE 56th Annual Symposium on Foundations of Com-puter Science (IEEE, 2015).

[13] G. H. Low and I. L. Chuang, Optimal hamiltonian simulationby quantum signal processing, Physical Review Letters 118,010501 (2017).

[14] G. H. Low and I. L. Chuang, Hamiltonian simulation by qubiti-zation, Quantum 3, 163 (2019).

[15] G. Garcıa-Perez, M. A. C. Rossi, and S. Maniscalco, IBM q ex-perience as a versatile experimental testbed for simulating openquantum systems, npj Quantum Information 6, 1 (2020).

[16] T. Cubitt and A. Montanaro, Complexity classification of localhamiltonian problems, SIAM Journal on Computing 45, 268(2016).

[17] R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, Quantumalgorithms revisited, Proceedings of the Royal Society of Lon-don. Series A: Mathematical, Physical and Engineering Sci-ences 454, 339 (1998).