Non-Boolean Quantum Amplitude Ampification and Quantum Mean Estimation Systems and Methods

Information

  • Patent Application
  • 20220414508
  • Publication Number
    20220414508
  • Date Filed
    June 28, 2021
    3 years ago
  • Date Published
    December 29, 2022
    2 years ago
Abstract
Generalizations of quantum amplitude amplification and amplitude estimation algorithms work with non-boolean oracles (by way of definition, the action of a non-boolean oracle Uφ on an eigenstate |x is to apply a state-dependent phase-shift φ(x); unlike boolean oracles, the eigenvalues exp(iφ(x)) of a non-boolean oracle are not restricted to be ±1). The non-boolean amplitude amplification algorithm preferentially amplifies the amplitudes of the eigenstates based on the value of φ(x). Starting from a given initial superposition state |ψ0, the basis states with lower values of cos(φ) are amplified at the expense of the basis states with higher values of cos(φ). The non-boolean quantum mean estimation algorithm uses quantum phase estimation to estimate the expectation ψ0|Uφ|ψ0 (i.e., the expected value of exp(iφ(x)) for a random x sampled by making a measurement on |ψ0). The quantum mean estimation algorithm offers a quadratic speedup over its counterpart boolean algorithm known in the art.
Description
FIELD OF THE INVENTION

The present invention relates generally to quantum computing technology. More particularly, this invention pertains to devices, systems, and associated methods for achieving computational speed increases in quantum algorithms.


BACKGROUND OF THE INVENTION

Grover's algorithm is a quantum search algorithm for finding the unique input xgood that satisfies Equation (1), as follows:





ƒbool(xgood)=1,  (1)


for a given boolean function ƒbool: {0, 1, . . . , N−1} →{0,1}. Such an input xgood satisfying this boolean function is referred to as the “winning” input of ƒbool. Grover's algorithm has also been adapted to work with boolean functions with multiple winning inputs, where the goal is to find any one of the winning inputs.


An important generalization of Grover's algorithm is the amplitude amplification algorithm in which the function ƒbool is accessed through a boolean quantum oracle Ûƒbool that acts on the orthonormal basis states |0custom-character, . . . , |N−1custom-character as follows (Equation (2)):













U
^


f
bool






"\[LeftBracketingBar]"

x




=

{






-



"\[LeftBracketingBar]"

x




,






if




f
bool

(
x
)


=
1

,








+



"\[LeftBracketingBar]"

x




,





if




f
bool

(
x
)


=
0.









(
2
)







In this way, the oracle marks the winning states by flipping their phase (that is, shifting the phase by π). Given a superposition state |ψ0custom-character, the goal of the amplitude amplification algorithm is to amplify the amplitudes (in the superposition state) of the winning states. The algorithm accomplishes this iteratively by initializing a quantum system in the state |ψ0custom-character and performing the operation Sψ0 Ûƒbool on the system during each iteration, where






S
ψ

0
≡2|ψ0custom-charactercustom-characterψ0|−I.  (3)


As shown in Equation (3), I is the identity operator. Performing a measurement on the system after the iterative amplification process results in one of winning states with high probability. Grover's original algorithm is a special case of the amplitude amplification algorithm, where a) the uniform superposition state |scustom-character given by Equation (4):














"\[LeftBracketingBar]"

s



=


1

N







x
=
0


N
-
1





"\[LeftBracketingBar]"

x









(
4
)







is used as the initial state |ψ0custom-character of the system, and b) the number of winning inputs is exactly one.


Closely related to the amplitude amplification algorithm is the amplitude estimation algorithm, which combines features from the amplitude amplification algorithm and a quantum phase estimation (QPE) algorithm to estimate the probability that making a measurement on the initial state |ψ0custom-character will yield a winning input. If the uniform superposition state |scustom-character is used as |ψ0custom-character, the amplitude estimation algorithm can help estimate the number of winning inputs of ƒbool (Note: This special case is also referred to as the quantum counting algorithm).


The amplitude amplification algorithm and the amplitude estimation algorithm have a wide range of applications and are important primitives that feature as subroutines employed by other quantum algorithms. The amplitude amplification algorithm can be used to find a winning input to ƒbool with custom-character(√{square root over (N)}) queries of the quantum oracle, regardless of whether the number of winning states is a priori known or unknown (Note: The custom-character(√{square root over (N)}) and custom-character(N) scalings for the quantum and classical algorithms, respectively, hold assuming that the number of winning states does not scale with N). This represents a quadratic speedup over classical algorithms, which typically require custom-character(N) evaluations of the function ƒbool. Similarly, the amplitude estimation algorithm also offers a quadratic speedup over the corresponding classical approaches. The quadratic speedup due to the amplitude amplification algorithm has been shown to be optimal for oracular quantum search algorithms.


A limitation of known amplitude amplification and estimation algorithms is that they work only with boolean oracles, which classify the basis states as good and bad. In situations where one is interested in using these algorithms in the context of a non-boolean function of the input x, a typical approach is to create a boolean oracle from the non-boolean function by using a threshold value of the function as a decision boundary. That is, the winning states are the ones for which the value of the function is, say, less than the chosen threshold value. In this way, the problem at hand may be adapted to work with the standard amplitude amplification and estimation algorithms.


Accordingly, a need exists for a solution to at least one of the aforementioned challenges in increasing the computation speed of widely applicable quantum algorithms. For instance, an established need exists for adaptation of certain primitive quantum algorithms to work directly with non-boolean functions.


This background information is provided to reveal information believed by the applicant to be of possible relevance to the present invention. No admission is necessarily intended, nor should be construed, that any of the preceding information constitutes prior art against the present invention.


SUMMARY OF THE INVENTION

With the above in mind, embodiments of the present invention are related to quantum amplitude amplification and amplitude estimation algorithms to work with non-boolean oracles. By way of definition, the action of a non-boolean oracle Uφ on an eigenstate |xcustom-character is apply a state-dependent, real-valued phase-shift φ(x). Unlike boolean oracles, the eigenvalues exp(iφ(x)) of a non-boolean oracle are not restricted to be ±1.


In one embodiment of the present invention, a non-boolean amplitude amplification algorithm, starting from an initial superposition state |ψ0custom-character, preferentially amplifies the amplitudes of the basis states based on the value of cos(φ). An objective of the algorithm is to preferentially amplify the states with lower values of cos(φ(x)). The algorithm is iterative in nature such that, after K iterations, the probability for a measurement of the system to yield x (namely pK(x)) differs from the original probability p0(x) by a factor that is linear in cos(φ(x)). The coefficient −λK of this linear dependence controls the degree (and direction) of the preferential amplification.


More specifically, embodiments of the present invention (in one or more of method, system, and/or device form) may include the following steps:


(1) Initialize a two-register system in the |Ψ0custom-character state:


(2) Perform K iterations: During odd iterations, act on an input basis state using a selective phase-flip unitary operator circuit SΨ0 and a controlled unitary operator circuit Uφ. During even iterations, act on an input basis state using the selective phase-flip unitary operator circuit SΨ0 and a controlled inverse unitary operator circuit Uφ; and


(3) After the K iterations, measure the ancilla in the 0/1 basis.


Up to a certain number of iterations, the iterative steps may be designed to amplify the amplitude of the basis states |0,xcustom-character and |1,xcustom-character with lower values of cos(φ(x)). The measurement of the ancilla at the end of the iterations may be performed simply to ensure that the two registers are not entangled in the final state.


In another embodiment of the present invention, a quantum mean estimation algorithm uses QPE as a subroutine in order to estimate the expectation of Uφ under |ψ0custom-character (i.e., custom-characterψ0φ0custom-character). The algorithm offers a quadratic speedup over the classical approach of estimating the expectation, as a sample mean over randomly sampled inputs.


More specifically, embodiments of the present invention (in one or more of method, system, and/or device form) may include the following steps:


(1) Perform the QPE algorithm with a) the two-register unitary operator under consideration, and b) the superposition state |Ψ0custom-character in place of the eigenstate required by the QPE algorithm as input. Let the output of this step, appropriately scaled to be an estimate of the phase angle in the range [0,2π), be {circumflex over (ω)}.


(2) Return cos({circumflex over (ω)}) as the estimate for cos(θ) (i.e., the real part of Eψ0[e]).


These and other objects, features, and advantages of the present invention will become more readily apparent from the attached drawings and the detailed description of the preferred embodiments, which follow.





BRIEF DESCRIPTION OF THE DRAWINGS

The preferred embodiments of the invention will hereinafter be described in conjunction with the appended drawings provided to illustrate and not to limit the invention, where like designations denote like elements, and in which:



FIG. 1 is a schematic diagram depicting an exemplary quantum circuit implementing a selective phase-flip unitary operator for non-boolean amplitude amplification according to an embodiment of the present invention;



FIG. 2 is a schematic diagram depicting an exemplary quantum circuit implementing a first conditional oracle call unitary operator for a non-boolean amplitude amplification algorithm according to an embodiment of the present invention;



FIG. 3 is a schematic diagram depicting an exemplary quantum circuit implementing a second conditional oracle call unitary operator for a non-boolean amplitude amplification algorithm according to an embodiment of the present invention;



FIG. 4 is schematic diagram depicting a quantum circuit for a first exemplary non-boolean amplification algorithm according to an embodiment of the present invention;



FIG. 5 is pseudocode for a non-boolean amplification algorithm according to FIG. 4;



FIG. 6 is a state diagram depicting stage evolution of a two-register system through iterations of the non-boolean amplitude amplification algorithm of FIG. 5;



FIG. 7 is schematic diagram depicting a quantum circuit for a second exemplary non-boolean amplification algorithm according to an embodiment of the present invention;



FIG. 8 is a non-boolean amplification algorithm according to FIG. 7;



FIG. 9 is a schematic diagram depicting a quantum circuit for a non-boolean mean estimation algorithm according to an embodiment of the present invention;



FIG. 10 depicts a graph of oracle function and initial state of a toy example for quantum simulation;



FIG. 11 depicts a graph of quantum simulation results from application of the non-boolean amplitude amplification algorithm of FIG. 4 to the toy example of FIG. 10; and



FIG. 12 depicts graphs of quantum simulation results from application of the non-boolean mean estimation algorithm of FIG. 9 to the toy example of FIG. 10.





Like reference numerals refer to like parts throughout the several views of the drawings.


DETAILED DESCRIPTION OF THE INVENTION

The present invention will now be described more fully hereinafter with reference to the accompanying drawings, in which preferred embodiments of the invention are shown. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.


Although the following detailed description contains many specifics for the purposes of illustration, anyone of ordinary skill in the art will appreciate that many variations and alterations to the following details are within the scope of the invention. Accordingly, the following embodiments of the invention are set forth without any loss of generality to, and without imposing limitations upon, the claimed invention.


As used herein, the word “exemplary” or “illustrative” means “serving as an example, instance, or illustration.” Any implementation described herein as “exemplary” or “illustrative” is not necessarily to be construed as preferred or advantageous over other implementations. All of the implementations described below are exemplary implementations provided to enable persons skilled in the art to make or use the embodiments of the disclosure and are not intended to limit the scope of the disclosure, which is defined by the claims.


Furthermore, in this detailed description, a person skilled in the art should note that quantitative qualifying terms such as “generally,” “substantially,” “mostly,” and other terms are used, in general, to mean that the referred to object, characteristic, or quality constitutes a majority of the subject of the reference. The meaning of any of these terms is dependent upon the context within which it is used, and the meaning may be expressly modified.


Referring initially to FIGS. 1-9, a non-boolean quantum amplitude amplification algorithm, as also a quantum mean estimation algorithm based in the non-boolean quantum amplitude amplification algorithm, both according to embodiments of the present invention are now described in detail. Throughout this disclosure, the present invention may be referred to as a family of non-boolean quantum amplitude amplification algorithms, a family of non-boolean quantum algorithms, a non-boolean quantum algorithm, a non-boolean quantum method, a non-boolean quantum oracle, a non-boolean quantum system, a method, an oracle, and/or a system. Those skilled in the art will appreciate that this terminology is only illustrative and does not affect the scope of the invention. For instance, the present invention may just as easily relate to an instantiation of an object from a library of non-boolean quantum oracles.


Generally speaking, the present invention is a generalization of amplitude amplification and estimation algorithms to work with quantum oracles for non-boolean functions. Hereinafter, the qualifiers “boolean” and “non-boolean” will be used to distinguish embodiments of the present invention from known boolean versions of the amplitude amplification algorithm and their related applications.


Oracle for a Non-Boolean Function:


The behavior of the boolean quantum oracle Ûƒbool of Equation (2) may be generalized to non-boolean functions by allowing the oracle to perform arbitrary phase-shifts on the different basis states. More concretely, let φ: {0, 1, . . . , N−1} →custom-character be a real-valued function, and let Uφ be a quantum oracle given by Equation (5), as follows:












U
φ






x
=
0


N
-
1




e

i


φ

(
x
)










"\[LeftBracketingBar]"

x






x









"\[RightBracketingBar]"



.




(
5
)







The actions of the oracle Uφ and its inverse Uφ on the basis states |0custom-character, . . . , |N−1custom-character may be given by Equations (6) and (7), as follows:






U
φ
|x)=e+iφ(x)|xcustom-character=[cos(φ(x))+i sin(φ(x))]|xcustom-character,  (6)






U
φ

|x)=e−iφ(x)|xcustom-character=[cos(φ(x))−i sin(φ(x))]|xcustom-character.  (7)


Goal of the Non-Boolean Amplitude Amplification Algorithm:


Given an oracle Uφ and an initial state |ψ0custom-character, a goal of the non-boolean amplitude amplification algorithm of the present invention may be to preferentially amplify the amplitudes of the basis states |xcustom-character with lower values of cos(φ(x)), at the expense of the amplitude of states with higher values of cos(φ(x)). Depending on the context in which the algorithm is to be used, a different function of interest ƒ (which is intended to guide the amplification) may be appropriately mapped onto the function cp. For example, and without limitation, if the range of ƒ is [0,1] and one intends to amplify the states with higher values of ƒ, then options for formulating the problem in terms of co include the following:





φ(x)=πƒ(x) or φ(x)=arccos(1−2ƒ(x)).  (8)


In both cases of Equations (8), cos(φ) is monotonically decreasing in ƒ.


The connection between the boolean and non-boolean amplitude amplification algorithms may be seen as follows: If either of the two options in Equations (8) is used to map a boolean function ƒbool onto φbool, then











φ
bool

(
x
)

=

{




π
,






if



f
bool



(
x
)


=
1

,






0
,





if




f
bool

(
x
)


=
0.









(
9
)







In the case of Equation (9), the oracle Uφ and its inverse Uφ both reduce to a boolean oracle as follows (Equation 10):






U
φ

bool

=U
φ

bool



ƒ

bool
.  (10)


Congruently, the task of amplifying (the amplitude of) the states with lower values of cos(φ) may align with the task of amplifying the winning states |xcustom-character with ƒbool(x)=1.


Goal of the Quantum Mean Estimation Algorithm:


Given a generic unitary operator U and a state |ψ0custom-character, a goal of the quantum mean estimation algorithm may be to estimate the quantity of Equation (11):






custom-characterψ0|U|ψ0custom-character.  (11)


The task of estimating the quantity of Equation (11) may be phrased in terms of the oracle Uφ, as estimating the expectation of the eigenvalue eiφ(x) for a state |xcustom-character chosen randomly by making a measurement on the superposition state |ψ0custom-character. The connection between the two tasks may be seen in Equation (12), as follows:

















ψ
0





"\[LeftBracketingBar]"


U
φ



"\[RightBracketingBar]"




ψ
0




=





x
=
0


N
-
1







ψ
0





"\[LeftBracketingBar]"


e

i


φ

(
x
)





"\[RightBracketingBar]"



x







x




"\[LeftBracketingBar]"


ψ
0







=




x
=
0


N
-
1






"\[LeftBracketingBar]"



x



"\[RightBracketingBar]"




ψ
0










"\[LeftBracketingBar]"

2


e

i


φ

(
x
)




,





(
12
)







wherein |custom-characterx|ψ0custom-character|2 is the probability for a measurement on |ψ0custom-character to yield x.


The only difference between (a) estimating custom-characterψ0|Uφ0custom-character for an oracle Uφ, and (b) estimating custom-characterψ0|U|ψ0custom-character for a generic unitary operator U is that {|ψ0|Uφ0custom-character, . . . , |N−1)} is known beforehand to be an eigenbasis of Uφ. On the other hand, the eigenstates of a generic unitary operator U may be a priori unknown. However, as described in detail hereinbelow, the mean estimation algorithm does not use the knowledge of the eigenstates and, therefore, may be applicable for generic unitary operators U as well.


As described hereinabove, the mean estimation algorithm of the present invention is a generalization of known boolean amplitude estimation algorithm(s). Regarding the connection between the respective tasks of these algorithms, note that the eigenvalues of a boolean oracle may be either +1 or −1, and the expectation of the eigenvalue under |ψ0custom-character is directly related to the probability of a measurement yielding a winning state with eigenvalue −1. This probability is precisely the quantity estimated by the non-boolean amplitude estimation algorithm of the present invention.


Non-Boolean Amplitude Amplification Algorithm:


Setup and Notation: Various embodiments of a non-boolean amplitude amplification algorithm as described herein may include not only a quantum system, or qubit(s), as input to a quantum oracle, but also may employ one extra ancilla qubit. For example, and without limitation, let a quantum system used in certain embodiments of the present algorithm comprise two quantum registers. The first register may contain the lone ancilla qubit, and the second register (input qubit) may be acted upon by the quantum oracle.


The notations |acustom-character⊗|bcustom-character and |a,bcustom-character may both refer to a state where the two registers are unentangled, with the first register in state |acustom-character and the second register in state |bcustom-character. The tensor product notation ⊗ may also be used to combine operators that act on the individual registers into operators that simultaneously act on both registers. Such two-register operators may be represented by boldface symbols (e.g., SΨ0, Uφ, I). Likewise, boldface symbols may be used to represent the states of the two-register system in the bra-ket notation (e.g., |Ψ0custom-character). As used herein, any state written in the bra-ket notation (e.g., |ψcustom-character) will be unit normalized (i.e., normalized to 1). The dagger notation (†) may be used to denote the Hermitian conjugate of an operator, which is also the inverse for a unitary operator.


Unless otherwise specified herein, {|0custom-character, |1custom-character, . . . , |N−1custom-character} may be used as the basis for (that is, as the state space of) the second register. Any measurement of the second register may refer to measurement in this basis. Likewise, unless otherwise specified,





{|0,0custom-character,|0,1custom-character, . . . ,|0,N−1custom-character}∪{|1,0custom-character,|1,1custom-character, . . . ,|1,N−1custom-character}  (13)


may be used as the basis for the two-register system.


In Equation (14) below, let |ψ0custom-character be the initial state of the second register from which the amplification process is to begin, and let A0 be the unitary operator that changes the state of the second register from |0custom-character to |ψ0custom-character (Note: Assumed here, only for notational convenience, is that there exists a state |0custom-character| which is simultaneously an eigenstate of Uφ, as well as a special, easy-to-prepare state of the second register; a person of skill in the art will immediately recognize the algorithms described herein may be modified to work even without this assumption):

















|

ψ
0






A
0




"\[RightBracketingBar]"



0








x
=
0


N
-
1





a
0

(
x
)





"\[LeftBracketingBar]"

x






,




(
14
)









such


that











x
=
0


N
-
1



|


a
0

(
x
)


|
2



=
1

,




where a0(x) is the initial amplitude of the basis state |xcustom-character.


The algorithm introduced hereinbelow may initialize the ancilla (i.e., first register) in the |+custom-character state given by Equation (15), as follows:













"\[LeftBracketingBar]"

+



=











"\[LeftBracketingBar]"

0



+



"\[RightBracketingBar]"



1




2


.






(
15
)







Anticipating this initialization, let the two-register state |Ψ0custom-character be defined as in Equation (16), as follows:



















"\[RightBracketingBar]"


Ψ
0









"\[LeftBracketingBar]"


+

,

ψ
0







=











"\[RightBracketingBar]"

0

,

ψ
0




+



"\[RightBracketingBar]"



1

,

ψ
0





2












=



1

2







x
=
0


N
-
1





a
0

(
x
)

[



"\[LeftBracketingBar]"


0
,
x








+



"\[LeftBracketingBar]"


1
,
x





]




.




(
16
)







Required Unitary Operations: The following unitary operations may be used in certain embodiments of a generalized amplitude amplification algorithm of the present invention:


Selective Phase-Flip Operator. Let the two-register unitary operator SΨ0 be defined as in Equation (17):
















S

Ψ
0





2




"\[LeftBracketingBar]"


Ψ
0











Ψ
0





"\[LeftBracketingBar]"


-
I












=


2




"\[LeftBracketingBar]"


+

,

ψ
0












+

,


ψ
0





"\[LeftBracketingBar]"


-
I










,




(
17
)







where I is the two-register identity operator. SΨ0 may leave the state |Ψ0custom-character unchanged and may flip the phase of any state orthogonal to |Ψ0custom-character. SΨ0 may be the two-register generalization of Sψ0 used in counterpart boolean amplitude amplification algorithm(s). From Equations (14) and (16), it follows (in Equation (18)) that





0custom-character=[H⊗A0]|0,0custom-character,  (18)


where H is the Hadamard transform. Thus, SΨ0 may be expressed as in Equation (19):






S
Ψ

0
=[H⊗A0][2|0,0custom-charactercustom-character0,0|−I][H⊗A0].  (19)


Referring initially to FIG. 1, an exemplary quantum circuit 100 implementing non-boolean amplitude amplification according to an embodiment of the present invention will now be described in detail. A quantum system of circuit 100 may comprise a first register (ancilla qubit) 110 and a second register (input qubit) 120. The second register 120 may be configured to be acted upon by a quantum oracle 130. As illustrated, Equation (19) is used to drive an implementation of circuit 130 for SΨ0, provided one has access to the quantum circuits that implement A0 (unitary operator 142) and A0 (inverse unitary operator 144). Hadamard transforms 150 are denoted as H.


Conditional Oracle Calls: Let the two-register unitary operator U be defined as in Equation (20):






U
φ≡|0custom-charactercustom-character|⊗Uφ+|1custom-charactercustom-character1|⊗Uφ.  (20)


This operator's action on the basis states of the two-register system is given by Equations (21) and (22):






U
φ|0,x)=e+iφ(x)|0,xcustom-character,  (21)






U
φ|1,x)=e−iφ(x)|1,xcustom-character.  (22)


If the ancilla is in state |0custom-character, Uφ acts Uφ on the second register. On the other hand, if the ancilla is in state |1custom-character, Uφ acts Uφ on the second register. The inverse of Uφ is given by Equation (23):






U
φ
=|0custom-charactercustom-character0|⊗Uφ+|1custom-charactercustom-character1|⊗Uφ,  (23)


and the action of Uφ on the basis states is given by Equations (24) and (25):






U
φ
|0,xcustom-character=e−iφ(x)|0,xcustom-character,  (24)






U
φ
|1,xcustom-character=e+iφ(x)|1,xcustom-character.  (25)


The amplitude amplification algorithm for non-boolean functions may involve calls to both Uφ and Uφ.


Referring now to FIGS. 2 and 3, exemplary quantum circuits 200 and 300 each implementing non-boolean amplitude amplification according to an embodiment of the present invention will now be described in detail. FIG. 2 depicts a circuit implementation 200 of Uφ using a) ancilla 210 serving as a control qubit, b) bit-flip (or Pauli-X) gates 240 denoted as X, and c) second register 220 acted upon by controlled Uφ and Uφ operations (i.e., oracles) 232, 234, respectively. FIG. 3 depicts a circuit implementation 330 of Uφ using a) ancilla 310 serving as a control qubit, b) bit-flip (or Pauli-X) gates 340 denoted as X, and c) second register 320 acted upon by controlled Uφ and Uφ operations 332, 334, respectively.


Algorithm Description:


Referring now to FIGS. 4 and 5, an exemplary quantum circuit 400 and pseudocode 500 implementing a non-boolean amplitude amplification quantum algorithm according to an embodiment of the present invention will now be described in detail. For example, and without limitation, the amplitude amplification algorithm for non-boolean functions is iterative and may comprise the following steps:


(1) Initialize a two-register system in the |Ψ0custom-character state;


(2) Perform K iterations: During odd iterations 402, apply operations 430, 432 denoted SΨ0 Uφ on the system. During even iterations 404, apply operations 430, 434 denoted SΨ0 Uφ on the system; and


(3) After the K iterations, measure 440 the ancilla (first register 410) in the 0/1 basis.


Up to a certain number of iterations, the iterative steps 402, 404 may be designed to amplify the amplitude of the basis states |0,xcustom-character and |1,xcustom-character with lower values of cos(φ(x)). The measurement 440 of the ancilla 410 at the end of the algorithm may be performed simply to ensure that the two registers 410, 420 are not entangled in the final state 450 of the system. The specification of K (i.e., the number of iterations to perform) is included in an analysis of the present algorithm described hereinbelow.


Connection to Known Boolean Amplitude Amplification Algorithm:


From Equations (20) and (23), a person of skill in the art will immediately recognize that for the boolean oracle case given by φ(x)=πƒbool(x), Uφ and Uφ both reduce to I⊗Ûƒbool, where Ûƒbool is the oracle used in known boolean amplitude amplification algorithm(s). Furthermore, if a first register is in the |+custom-character state, from Equations (3) and (17), the action of SΨ0 is given by Equation (26):






S
Ψ

0
[|+custom-character⊗|ψcustom-character]=|+custom-character⊗[Sψ0custom-character].  (26)


Note that the first register is unaffected here. Thus, for the boolean oracle case, the algorithm 400, 500 of FIGS. 4 and 5 may reduce to simply acting Sψ0 Ûƒbool on the second register 420 during each iteration 402, 404; the ancilla qubit 410 remains untouched and unentangled from the second register 420. In this way, algorithm 400, 500 is a generalization of known boolean amplitude amplification algorithm(s) described hereinabove.


The two key differences of the generalized algorithm from the boolean algorithm, apart from the usage of a non-boolean oracle, may be as follows:


(1) The addition of the ancilla 410, which doubles the dimension of the state space of the system, and


(2) Alternating between using Uφ and Uφ (operations 432 and 434, respectively) during the odd iterations 402 and even iterations 404.


Analysis of the Non-Boolean Amplitude Amplification Algorithm:


Still referring to FIGS. 4 and 5, let |Ψkcustom-character be the state of the two-register system after k=0, 1, . . . , K iterations of the amplitude amplification algorithm 400 (but before the measurement 440 of the ancilla 410). For k>0, |Ψkcustom-character may be recursively written as in Equation (27):













"\[LeftBracketingBar]"


Ψ
k






{








S

Ψ
0




U
φ





"\[LeftBracketingBar]"


Ψ

k
-
1






,





if


k


is


odd

,









S

Ψ
0




U
φ






"\[LeftBracketingBar]"


Ψ

k
-
1






,




if


k


is


even




.






(
27
)







Let ãk (0,x) and ãk(1,x) be the normalized amplitudes of the basis states |0,xcustom-character and |1,xcustom-character, respectively, in the superposition |Ψkcustom-character.


















"\[LeftBracketingBar]"


Ψ
k









x
=
0

N


[




a
~

k

(

0
,
x

)





"\[LeftBracketingBar]"


0
,
x








+




a
~

k

(

1
,
x

)





"\[LeftBracketingBar]"


1
,
x






]

.




(
28
)







In the initial state |Ψ0custom-character, the amplitudes ã0(0,x) and ã0(1,x) are both given, from Equation (16), by the following (Equation (29)):












a
~

0

(

0
,
x

)

=




a
~

0

(

1
,
x

)

=




a
0

(
x
)


2


.






(
29
)







Let the parameter θ∈[0,π] be implicitly defined by Equation (30):










cos

(
θ
)






x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2




cos

(

φ

(
x
)

)

.







(
30
)







cos(θ) is the expected value of cos(φ(x)) over bitstrings x sampled by measuring the state |ψ0custom-character.


Let the two-register states |αcustom-characterand |βcustom-character be defined as follows (Equations (31) and (32)):





custom-characterUφ0custom-character,  (31)





custom-characterUφ0custom-character.  (32)


These register states may be used to track the evolution of the system through the iterative steps 402, 404 of algorithm 400, 500. Using Equations (16), (20), and (23), |αcustom-character and |0custom-character may be written as follows (Equations (33) and (34)):


















"\[LeftBracketingBar]"

α



=


1

2







x
=
0


N
-
1





a
0

(
x
)

[


e

i


φ

(
x
)







"\[LeftBracketingBar]"


0
,
x









+


e


-
i



φ

(
x
)







"\[LeftBracketingBar]"


1
,
x






]

,




(
33
)





















"\[LeftBracketingBar]"

β



=


1

2







x
=
0


N
-
1





a
0

(
x
)

[


e


-
i



φ

(
x
)







"\[LeftBracketingBar]"


0
,
x









+


e

i


φ

(
x
)







"\[LeftBracketingBar]"


1
,
x






]

.




(
34
)







Note that θ, |αcustom-character, and |βcustom-character are all implicitly dependent on the function φ and the initial state |ψ0custom-character. For notational convenience, these dependencies are not explicitly indicated.


The First Iteration:


After one iterative step, the system may be in state |Ψ1custom-character given by Equation (35):





1custom-character=SΨ0Uφ0custom-character.  (35)


Using Equations (17) and (31), this state may be written as follows (Equation (36)):





1custom-character=SΨ0custom-character=2custom-characterΨ0custom-characterΨ0custom-character−|αcustom-character.  (36)


From Equations (16), (30), and (33), it follows that

















Ψ
0





"\[LeftBracketingBar]"

α




=



1
2






x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2

[



e

i


φ

(
x
)







0
,

x




"\[LeftBracketingBar]"


0
,
x







+


e


-
i



φ

(
x
)







1
,

x




"\[LeftBracketingBar]"


1
,
x








]









=



1
2






x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2

[


e

i


φ

(
x
)



+

e


-
i



φ

(
x
)




]









=




1
2






x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2


2


cos

(

φ

(
x
)

)




=

cos

(
θ
)






.




(
37
)







Note from Equation (37) that custom-characterΨ0custom-character is real-valued. Key to the functioning of the algorithm 400, 500, the motivation behind adding an ancilla qubit 410 (effectively doubling the number of basis states) is precisely to make custom-characterΨ0custom-character real-valued.


From Equations (36) and (37), |Ψ1custom-character may be written as follows (Equation (38)):





1custom-character=2 cos(θ)|Ψ0custom-character−|αcustom-character.  (38)


From Equations (16) and (33), the amplitude ã1(0,x) of the basis state |0,xcustom-character in the superposition |Ψ1custom-character may be written as follows (Equation (39)):












a
~

1

(

0
,
x

)

=




0
,

x




"\[LeftBracketingBar]"


Ψ
1






=





a
0

(
x
)


2


[


2


cos

(
θ
)


-

e

i


φ

(
x
)




]

.






(
39
)







Likewise, the amplitude ã1(1,x) of the basis state |1,xcustom-character may be written as follows (Equation (40)):












a
~

1

(

1
,
x

)

=




1
,

x




"\[LeftBracketingBar]"


Ψ
1






=





a
0

(
x
)


2


[


2


cos

(
θ
)


-

e


-
i



φ

(
x
)




]

.






(
40
)







Equations (39) and (40) show that, after one iterative step, the amplitudes of |0,xcustom-character and |1,xcustom-character have acquired factors of [2 cos(θ)−eiφ(x)] and [2 cos(θ)−e−iφ(x)], respectively. Now, Equation (41) shows that, if cos(θ) is positive, the magnitude of the “amplitude amplification factor” after one iteration is monotonically decreasing in cos(φ):














"\[LeftBracketingBar]"




a
~

1

(

0
,
x

)



"\[RightBracketingBar]"


2





"\[LeftBracketingBar]"




a
~

0

(

0
,
x

)



"\[RightBracketingBar]"


2


=






"\[LeftBracketingBar]"




a
~

1

(

1
,
x

)



"\[RightBracketingBar]"


2





"\[LeftBracketingBar]"




a
~

0

(

1
,
x

)



"\[RightBracketingBar]"


2


=


4



cos
2

(
θ
)


+
1
-

4


cos

(
θ
)




cos

(

φ

(
x
)

)

.








(
41
)







Such preferential amplification of states with lower values of cos(φ) is precisely what the algorithm 400, 500 set out to do.


Note that this monotonicity property relies on custom-characterΨ0custom-character being real valued in Equation (36). If custom-characterΨ0custom-character is complex, with a phase δ∉{0,π}, then the amplification will be monotonic in cos(φ−δ), which does not meet the present goal of the algorithm 400, 500. The case where custom-characterΨ0custom-character is not real-valued is explored further hereinbelow.


Identities to Track the Subsequent Iterations:


Equations (16), (17), (20), (23), (31), and (32) may be used to derive the identities of Equations (42), which capture the actions of the operators SΨ0, Uφ, and Uφ on the states IWO), |αcustom-character, and |βcustom-character:














S

Ψ
0






"\[LeftBracketingBar]"


Ψ
0





=



"\[LeftBracketingBar]"


Ψ
0





,




(
42
)
















S

Ψ
0






"\[LeftBracketingBar]"

α




=

2


cos

(
θ
)





"\[LeftBracketingBar]"


Ψ
0






-



"\[LeftBracketingBar]"

α




,













S

Ψ
0






"\[LeftBracketingBar]"

β




=

2


cos

(
θ
)





"\[LeftBracketingBar]"


Ψ
0






-



"\[LeftBracketingBar]"

β




,











U
φ





"\[LeftBracketingBar]"


Ψ
0





=



"\[LeftBracketingBar]"

α




,














U
φ





"\[LeftBracketingBar]"

α




=


1

2







x
=
0


N
-
1





a
0

(
x
)

[


e

2

i


φ

(
x
)







"\[LeftBracketingBar]"


0
,
x









+


e


-
2


i


φ

(
x
)







"\[LeftBracketingBar]"


1
,
x






]

,











U
φ





"\[LeftBracketingBar]"

β




=



"\[LeftBracketingBar]"


Ψ
0





,











U
φ






"\[LeftBracketingBar]"


Ψ
0





=



"\[LeftBracketingBar]"

β




,











U
φ






"\[LeftBracketingBar]"

α




=



"\[LeftBracketingBar]"


Ψ
0





,














U
φ






"\[LeftBracketingBar]"

β




=


1

2







x
=
0


N
-
1





a
0

(
x
)

[


e


-
2


i


φ

(
x
)







"\[LeftBracketingBar]"


0
,
x









+


e

2

i


φ

(
x
)







"\[LeftBracketingBar]"


1
,
x






]

.




A person of skill in the art will immediately recognize that the subspace spanned by the states |Ψ0custom-character, |αcustom-character, and |βcustom-character is almost stable under the action of SΨ0, Uφ, and Uφ. Only the actions of Uφ on |αcustom-character and |βcustom-character may take the state of the system out of this subspace. Continuing to refer to FIGS. 4 and 5, the motivation behind alternating between using Uφ, and Uφ during the odd iterations 402 and the even iterations 404 is to keep the state of the system within the subspace spanned by |Ψ0custom-character, |αcustom-character, and |βcustom-character.


From the identities above, the expressions of Equations (43) may be written capturing the relevant actions of the odd iteration operator 430, 432 denoted SΨ0 Uφ and the even iteration operator 430, 434 denoted SΨ0 Uφ:






S
Ψ

0

U
φ0)=2 cos(θ)|Ψ0custom-character−|αcustom-character,






S
Ψ

0

U
φ|β)=|Ψ0custom-character,






S
Ψ

0

U
φ
0)=2 cos(θ)|Ψ0custom-character−|βcustom-character,






S
Ψ

0

U
φ
|α)=|Ψ0custom-character.  (43)


Referring now to FIG. 6, and continuing to refer to FIGS. 4 and 5, state diagram 600 illustrates how, from the expressions of Equation (43), the odd iteration operator 430, 432 denoted SΨ0 Uφ may map any (first) state 610 in the space spanned by |Ψ0custom-character and |βcustom-character to a (second) state 620 in the space spanned by |Ψ0custom-character and |αcustom-character. Conversely, the even iteration operator 430, 434 denoted SΨ0 Uφ may map any state 620 in the space spanned by |Ψ0custom-character and |αcustom-character to a state 610 in the space spanned by |Ψ0custom-character and |βcustom-character. Because the algorithm 400, 500 begins with the system initialized in the state |Ψ0custom-character, the state of the system may oscillate between the two subspaces 610, 620 during the odd and even iterations 402, 404.


State After k Iterations:


Using Equations (27) and (43), the state |Ψkcustom-character of the two-register system after k≥0 iterations may be written, in matrix multiplication notation, as shown in Equation (44):













"\[LeftBracketingBar]"


Ψ
k




=

{













[



"\[LeftBracketingBar]"


Ψ
0









"\[LeftBracketingBar]"

α




]

[




2


cos

(
θ
)




1





-
1



0



]

k

[



1




0



]

,





if


k


is


odd

,














[



"\[LeftBracketingBar]"


Ψ
0









"\[LeftBracketingBar]"

β




]

[




2


cos

(
θ
)




1





-
1



0



]

k

[



1




0



]

,




if


k


is


even




.






(
44
)







To simplify Equation (44), let the matrix Mθ be defined as follows (Equation (45)):










M
θ




[




2


cos

(
θ
)




1





-
1



0



]

.





(
45
)







Substituting Equation (45) into Equation (44) yields Equation (46), as follows:













"\[LeftBracketingBar]"


Ψ
k




=

{








[







"\[LeftBracketingBar]"


Ψ
0












"\[LeftBracketingBar]"

α






]

T




M
θ
k

[



1




0



]


,





if


k


is


odd

,









[







"\[LeftBracketingBar]"


Ψ
0












"\[LeftBracketingBar]"

β






]

T




M
θ
k

[



1




0



]


,




if


k


is


even




.






(
46
)







where the superscript T denotes transposition. Mθ may be diagonalized as











M
θ

=



S
θ

[




e


-
i


θ




0




0



e

i

θ





]



S
θ

-
1




,




(
47
)







and where the matrix Sθ and its inverse Sθ1 may be given by















S
θ

=



-
i


2


sin



(
θ
)



[




e




i

θ






e

i

θ







-
1




-
1




]


,





S
θ

-
1


=


[




-
1




-

e

i

θ







1



e


-
i


θ





]

.










(
48
)







Now, Mθk may be written as follows (Equation (49)):










M
θ
k

=




S
θ

[




e


-
i


θ




0




0



e

i

θ





]



S
θ

-
1



=



S
θ

[




e


-
i


k

θ




0




0



e

i

k

θ





]




S
θ

-
1


.







(
49
)







From Equation (48) and Equation (49), it follows that















M
θ
k

[



1




0



]

=




S
θ

[




e


-
i


k

θ




0




0



e

i

k

θ





]

[




-
1





1



]







=




S
θ

[




-

e


-
ik


θ








e

i

k

θ





]

=


1

sin



(
θ
)



[




sin



(


(

k
+
1

)


θ









-
s


in



(

k

θ

)





]






.




(
50
)







Plugging (50) back into (46) leads to the following (Equation (51)):













"\[LeftBracketingBar]"


Ψ
k




=

{










1

sin



(
θ
)



[

sin



(


(

k
+
1

)


θ

)





"\[LeftBracketingBar]"


Ψ
0






-

sin



(

k

θ

)





"\[LeftBracketingBar]"

α





]

,





if


k


is


odd

,












1

sin



(
θ
)



[

sin



(


(

k
+
1

)


θ

)





"\[LeftBracketingBar]"


Ψ
0






-

sin



(

k

θ

)





"\[LeftBracketingBar]"

β





]

,




if


k


is



even
.










(
51
)







Basis State Amplitudes after k Iterations:


From Equations (16), (33), (34), and (51), the amplitudes ãk(0,x) of the basis states |0,xcustom-character after k≥0 iterations may be written as follows (Equation (52)):












a
~

k



(

0
,
x

)


=




0
,

x




"\[LeftBracketingBar]"


Ψ
k






=

{








a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e

i


φ

(
x
)





]

,





if


k


is


odd

,










a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e


-
i



φ

(
x
)





]

,




if


k


is



even
.











(
52
)







Similarly, the amplitudes ãk(1,x) of the basis states |1,xcustom-character may be written as follows (Equation (53)):












a
~

k

(

1
,
x

)

=




1
,

x




"\[LeftBracketingBar]"


Ψ
k






=

{








a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e

i


φ

(
x
)





]

,





if


k


is


odd

,










a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e


-
i



φ

(
x
)





]

,




if


k


is



even
.











(
53
)







These expressions may be summarized, for b∈{0,1}, as follows (Equation (54)):












a
~

k

(

b
,
x

)

=

{








a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e

i


φ

(
x
)





]

,






if


k

+

b


is


odd


,










a
0

(
x
)



2


sin



(
θ
)



[


sin



(


(

k
+
1

)


θ

)


-

sin



(

k

θ

)



e


-
i



φ

(
x
)





]

,





if


k

+

b


is



even
.











(
54
)







Amplitudes After Ancilla Measurement. Note that the magnitudes of the amplitudes of the states |0,xcustom-character and |1,xcustom-character are equal; that is,





|ã1(0,x)|=|ãk(1,x)|,  (55)


for all k≥0 and x∈{0, 1, . . . , N−1}. Therefore, a measurement 440 of the ancilla qubit in the first register 410 after K iterations may yield a value of either 0 or 1 with equal probability. Let |ψK,bcustom-character be the normalized state of the second register 420 after performing K iterations, followed by a measurement 440 of the ancilla qubit 410, which may yield a value b∈{0,1}. |ψK,bcustom-character may be written as follows (Equation (56)):















"\[LeftBracketingBar]"


ψ

K
,
b





=




x
=
0


N
-
1





a

K
,
b


(
x
)





"\[LeftBracketingBar]"

x






,




(
56
)







where aK,b(x) are the normalized amplitudes of the basis states of the second register 420 (after performing K iterations and the measurement 440 of the ancilla 410). aK,b(x) may simply be given by Equation (57):






a
K,b(x)=√{square root over (2)}/ãK(b,x).  (57)


Much of the definition hereinbelow holds a) regardless of whether a measurement 440 is performed on the ancilla qubit 410 after the K iterations, and b) regardless of the value yielded by the ancilla measurement 440 (if performed). The primary goal of measuring 440 the ancilla 410 is to make the two registers 410, 420 unentangled from each other.


Basis State Probabilities After K Iterations:


Continuing to refer to FIGS. 4 and 5, let pK(x) be the probability for a measurement of the second register after K≥0 iterations to yield x. This probability may be written, in terms of the amplitudes in the “Basis State Amplitudes After K Iterations” section hereinabove, as follows (Equation (58)):






p
K(x)=[|ãK(0,x)|2+|ãK(1,x)|2]=|aK,0(x)|2=|aK,1(x)|2.   (58)


This expression shows that the probability pK(x) depends neither on whether the ancilla was measured, nor on the result of the ancilla measurement (if performed). From Equation (54), pK(x) may be written as follows (Equation (59)):














p
K

(
x
)

=





p
0

(
x
)



sin
2

(
θ
)







"\[LeftBracketingBar]"



sin



(


(

K
+
1

)


θ

)


-


sin

(

K

θ

)



e

i


φ

(
x
)







"\[RightBracketingBar]"


2








=






p
0

(
x
)



sin
2

(
θ
)


[



sin
2

(

K

θ

)

+


sin
2

(


(

K
+
1

)


θ

)

-

2


sin



(

K


θ

)



sin



(


(

K
+
1

)


θ

)



cos



(

φ

(
x
)

)



]

.








(
59
)







A person of skill in the art will immediately recognize that the probability amplification factor pK(x)/p0(x) is monotonic in cos(φ(x)) for all K≥0. The following trigonometric identities (Equation (60)) help elucidate the K dependence of this amplification factor:





sin2(C)+sin2(C+D)=sin2(D)+2 sin(C)sin(C+D)cos(D),





2 sin(C)sin(C+D)=cos(D)−cos(2C+D).  (60)


Setting C=Kθ and D=θ, these identities may be used to rewrite Equation (59) as follows (Equation (61)):






p
K(x)=p0(x){1−λK[cos(φ(x))−cos(θ)]},  (61)


where the K-dependent factor λK is given by Equation (62):











λ
K




2


sin



(

K

θ

)



sin



(


(

K
+
1

)


θ

)




sin
2

(
θ
)



=




cos



(
θ
)


-

cos



(


(


2

K

+
1

)


θ

)





sin
2

(
θ
)


.





(
62
)







For notational convenience, the fact that λK depends on θ is not explicitly indicated. The result in Equation (61) may be summarized as follows:


(1) Applying K iterations of the non-boolean amplitude amplification algorithm changes the probability of measuring x by a factor that is a linear function of cos(φ(x)). If the second register is initially in an equiprobable state (i.e., if p0(x)=constant), then the probability pK(x) after K iterations is itself a linear function of cos(φ(x)).


(2) If cos(φ(x))=cos(θ) for some x, the probability of a measurement of the second register yielding that x is unaffected by the algorithm.


(3) The slope of the linear dependence is −λK. If λK is positive, the states with cos(φ)<cos(θ) are amplified. Conversely, if λK is negative, states with cos(φ)>cos(θ) are amplified. The magnitude of λK controls the degree to which the preferential amplification has been performed.


From Equation (62), λK is an oscillatory function of K, centered around cos(θ)/sin2(θ) with an amplitude of 1/sin2(θ) and a period of π/θ. Recalling from Equation (30) that














x
=
0


N
-
1






p
0

(
x
)



cos



(

φ

(
x
)

)



=


cos



(
θ
)


=




x
=
0


N
-
1






p
0

(
x
)



cos



(
θ
)





,




(
63
)







one can verify that for any K≥0, the probabilities pK(x) from Equation (61) add up to 1.


From the definition of λK in Equation (62), for all K, λK is bounded from above by λoptimal defined as follows (Equation (64)):











λ
K



λ
optimal





cos



(
θ
)


+
1



sin
2

(
θ
)



=


1

1
-

cos



(
θ
)




.





(
64
)







The λKoptimal case represents the maximal preferential amplification of lower values of cos(φ) achievable by the algorithm. Let poptimal(x) be the state probability function corresponding to λKoptimal. From Equation (61),











p
optimal

(
x
)

=




p
0

(
x
)

[

1
-



cos



(

φ

(
x
)

)


-

cos



(
θ
)




1
-

cos



(
θ
)





]

.





(
65
)







Note that poptimal(x)=0 for inputs x with the highest possible value of cos(φ(x)), namely 1. In other words, poptimal reaches the limit set by the non-negativity of probabilities, in the context of the non-boolean amplitude amplification algorithm 400, 500 described hereinabove.


Number of Iterations to Perform:


In the non-boolean amplitude amplification algorithm 400, 500 described hereinabove, the number of iterations K to perform is left unspecified. Armed with Equation (62), this aspect of the algorithm 400, 500 will now be described in detail. Higher values of λK are advantageous to preferentially amplify lower values of cos(φ). Equation (62) illustrates that λK may be monotonically increasing for K=0, 1, . . . as long as 0≤(2K+1)θ≤π+θ or, equivalently, for










0

K




π

2

θ





,




(
66
)







where └v┘ denotes the floor of v. A good approach is to stop the algorithm 400, 500 just before the first iteration that, if performed, would cause value of λK to decrease (that is, from its value after the previous iteration). This approach leads to the choice K for the number of iterations to perform, given by










K
~

=




π

2

θ




.





(
67
)







The corresponding value of λK for K={tilde over (K)} is given by Equation (68):










λ

K
~


=



1


sin
2

(
θ
)


[


cos

(
θ
)

-

cos

(





π

2

θ





2

θ

+
θ

)


]

.





(
68
)







The choice {tilde over (K)} in Equation (67) for the number of iterations offers an amplification iff π>2θ>0 or, equivalently, iff 0<cos(θ)<1. At one of the extremes, namely θ=π/2, one has λ{tilde over (K)}=0. The other extreme, namely cos(θ)=1, corresponds to every state x with a non zero amplitude in the initial state |ψ0custom-character having cos(φ(x))=1. There is no scope for preferential amplification in this case.


Equation (68) illustrates that λK exactly equals λoptimal defined in Equation (64) if π/(2θ) is a half-integer. In terms of θ, this condition may be written as follows (Equation (69)):










θ



{


π
3

,

π
5

,

π
7

,





(

harmonic


progression

)



}



λ

K
~




=


λ
optimal

.





(
69
)







For generic values of θ, Equation (68) illustrates that AR satisfies the following (Equation 70)):












2


cos

(
θ
)




sin
2

(
θ
)




λ

K
~




λ
optimal


=




cos

(
θ
)

+
1



sin
2

(
θ
)


.





(
70
)







This equation may be rewritten as follows (Equation (71)):





λoptimal[1−tan2(θ/2)]≤λ{tilde over (K)}≤λoptimal,  (71)


using the following identity:











2


cos

(
θ
)




cos

(
θ
)

+
1


=



2
[



cos
2

(

θ
/
2

)

-


sin
2

(

θ
/
2

)


]



2



cos
2

(

θ
/
2

)


-
1
+
1


=

1
-



tan
2

(

θ
/
2

)

.







(
72
)







Equation (71) illustrates that for small θ, λR is approximately equal to λoptimal, custom-character2) relative error.


Mean and Higher Moments of Cos(φ) after K Iterations:


Let μK(n) be the n-th raw moment of cos(φ(x)) for a random value of x sampled by measuring the second register after K iterations.










μ
K

(
n
)







x
=
0


N
-
1





p
K

(
x
)





cos
n

(

φ

(
x
)

)

.







(
73
)







Under the notation of Equation (73), μ0(1) is simply cos(θ). From Equation (61),μK(n) may be written in terms of the initial moments (K=0) as follows (Equation (74)):














μ
K

(
n
)


=





x
=
0


N
-
1





p
0

(
x
)





cos
n

(

φ

(
x
)

)

[

1
-


λ
K

[


cos

(

φ

(
x
)

)

-

cos

(
θ
)


]


]









=



μ
0

(
n
)


-


λ
K

[


μ
0

(

n
+
1

)


-


μ
0

(
n
)




μ
0

(
1
)




]






.




(
74
)







In particular, let μK and σK2 represent the expected value and variance, respectively, of cos(φ(x)) after K iterations.





μK≡μK(1),





σK2≡μK(2)−[μK(1)]2.  (75)


Now, the result in Equation (74) for n=1 may be written as follows (Equation (76)):





μK−μ0=−λKσ02.  (76)


For λK>0, Equation (76) captures the reduction in the expected value of cos(φ(x)) resulting from K iterations of the algorithm 400, 500.


Cumulative Distribution Function of Cos(φ) after K Iterations:


Let FKcos(y) be the probability that cos(φ(x))≤y for an x sampled as per the probability distribution pK. FKcos is the cumulative distribution function of cos(φ) for a measurement after K iterations, and may be written as follows (Equations (77) and (78)):












F
K
cos

(
y
)

=




x
=
0


N
-
1



[



p
K

(
x
)




1


[

0
,



)


[

y
-

cos

(

φ

(
x
)

)


]


]



,




(
77
)














1
-


F
K
cos

(
y
)


=




x
=
0


N
-
1



[



p
K

(
x
)



(

1
-


1


[

0
,



)


[

y
-

cos

(

φ

(
x
)

)


]


)


]



,




(
78
)







where 1|0,∞) is the Heaviside step function, which equals 0 when its argument is negative and 1 when its argument is non-negative. Using the expression for pK in Equation (61), these equations may be written as follows (Equations (79) and (80)):












F
K
cos

(
y
)

=




F
0
cos

(
y
)



(

1
+


λ
K



μ
0



)


-


λ
K






x
=
0


N
-
1



{



p
0

(
x
)



cos

(

φ

(
x
)

)




1


[

0
,



)


[

y
-

cos

(

φ

(
x
)

)


]


}





,




(
79
)













1
-


F
K
cos

(
y
)


=



(

1
-


F
0
cos

(
y
)


)



(

1
+


λ
K



μ
0



)


-


λ
K






x
=
0


N
-
1




{



p
0

(
x
)




cos

(

φ

(
x
)

)

[

1
-


1


[

0
,



)


[

y
-

cos

(

φ

(
x
)

)


]


]


}

.








(
80
)







Every x that provides a non-zero contribution to the summation in Equation (79) satisfies cos(φ(x))≤y. This fact may be used to write Equation (81), as follows:





λK≥0⇒FKcos(y)≥F0cos(y)(1+λK0−y)).  (81)


Likewise, every x that provides a non-zero contribution to the summation in Equation (80) satisfies cos(φ(x))>y. This fact may be used to write Equation (82), as follows:





λK≥0⇒1−FKcos(y)≤(1−F0cos(y))(1+λK0−y)).  (82)


The inequalities in Equations (81) and (82) may be summarized as follows (Equation (83)):





λK≥0⇒Fkcos(y)≥F0cos(y)+λK max{F0cos(y)(μ0−y),(1−F0cos(y))(y−μ0)},   (83)


where the max function represents the maximum of its two arguments. This equation provides a lower bound on the probability that a measurement after K iterations yields a state whose cos(φ) value is no higher than y. Derivation of stronger bounds (or even the exact expression) for FKcos(y) may be possible if additional information is known about the initial distribution of cos(φ). For y≤μ0, the first argument of the max function in Equation (83) will be active, and for y≥μ0, the second argument will be active.


For the λK≤0 case, it can similarly be shown that





λK≤0⇒FKcos(y)≤F0cos(y)+λK min{F0cos(y)(μ0−y),(1−F0cos(y))(y−μ0)},   (84)


where the min function represents the minimum of its two arguments.


Boolean Oracle Case:


As described in the “Number of Iterations to Perform” section hereinabove, the heuristic choice for the number of iterations for the non-boolean amplitude amplification algorithm of the present invention (namely {tilde over (K)}=└π/(2θ)┘) is different from, but analogous to, the result for known boolean amplitude amplification algorithm of the prior art (namely └π/(4θa)┘). Consider the parameter θ in the boolean oracle case, say θbool. Let P0good be the probability for a measurement on the initial state |ψ0custom-character to yield a winning state. From Equation (30),











cos

(

θ
bool

)

=



[


-
1

×

P
0
good


]

+

[

1
×

(

1
-

P
0
good


)


]


=

1
-

2


P
0
good





,




(
85
)
















sin
2

(


θ
bool

/
2

)


=


P
0
good

.





(
86
)







Thus, in the boolean oracle case, sin2(θ/2) reduces to the initial probability of “success” (that is, measuring a winning state), which is captured by sin2a) in known boolean amplitude amplification algorithm(s). The parameter θ used herein reduces to the parameter 2θa used in known boolean amplitude amplification algorithm(s), and └π/(2θ)┘ reduces to └π/(4θa)┘.


In this way, the results of the “Analysis of the Non-Boolean Amplitude Amplification Algorithm” section hereinabove in general, and the “Number of Iterations to perform” section hereinabove in particular, may be seen as generalizations of the corresponding results in known boolean amplitude amplification algorithm(s) as described hereinabove.


Alternative Formulation of the Algorithm:


Referring again to FIGS. 4 and 5, in the formulation of the non-boolean amplitude amplification algorithm 400, 500 of the present invention, an ancilla qubit (first register) 410 may be included for the purpose of making the quantity custom-characterΨ0|Uφ0custom-character=custom-characterΨ0custom-character real valued. If, in a particular use case, it is guaranteed that custom-characterψ0|Uφ0custom-character will be real-valued (or have a negligible imaginary part, for example, and without limitation, by replacing the function φ(x) with φ′(x)=r(x)φ(x), where r: {0, 1, . . . N−1}→{−1,+1} is a random function independent of φ(x), with mean 0 (for x sampled by measuring |ψ0custom-character) even without introducing the ancilla 410, then the algorithm 400, 500 described above may be used without the ancilla 410: that is, may alternate between applying operator 430, 432 denoted Sψ0 Uφ during the odd iterations and applying operator 430, 434 denoted Sψ0 Uφ during the even iterations. In other words, the properties and structure of two-register system are not exploited in the algorithm description, beyond making custom-characterΨ0|Uφ0custom-character real-valued.


However, Equations (33) and (34) illustrate that the states |αcustom-character=Uφ0custom-character and |βcustom-character=Uφ0custom-character are related by





custom-character=[X⊗I]|αcustom-character,|αcustom-character=[X⊗I]|βcustom-character,  (87)


where X is the bit-flip or the Pauli-X operator 340. This relation may be exploited to avoid having two separate cases—k being odd and even—in the final expression for |Ψkcustom-character in Equation (51). The expression for both cases may be made the same by acting the Pauli-X gate 340 on the ancilla 410, once at the end, if the total number of iterations is even.


More interestingly, the relationship between |αcustom-character and |βcustom-character may be used to avoid having two different operations in the first place, for the odd and even iterations. This leads to the following alternative formulation of the non-boolean amplitude amplification algorithm: During each iteration, odd or even, act the same operator Qiter defined by






Q
iter
≡S
Ψ

0

U
φ[X⊗I].  (88)


This alternative formulation is depicted as a circuit 700 in FIG. 7 and as a pseudocode 800 in FIG. 8.


From Equations (43) and (87), the action of Qiter on and |αcustom-character may be derived as follows (Equations (89) and (90)):

























Q

i

t

e

r




"\[RightBracketingBar]"




Ψ
0




=


S

Ψ
0




U
φ






"\[RightBracketingBar]"





Ψ
0




=

2


cos

(
θ
)






"\[RightBracketingBar]"





Ψ
0




-




"\[RightBracketingBar]"




α



,




(
89
)
























Q

i

t

e

r




"\[RightBracketingBar]"



α



=


S

Ψ
0




U
φ






"\[RightBracketingBar]"




β



=




"\[RightBracketingBar]"





Ψ
0




.




(
90
)







Let |Ψkaltcustom-character be the state of the two-register system after k iterations under this alternative formulation 700, 800 (before any measurement of the ancilla 410), as follows (Equation (91)):





kalt)≡Qiterk0custom-character.  (91)


Using similar manipulations as those leading to Equation (51) hereinabove, |Ψkalt) may be expressed, for all k≥0, as follows (Equation (92)):


















"\[RightBracketingBar]"


Ψ
k
alt




=


1

sin

(
θ
)


[


sin

(


(

k
+
1

)


θ

)





"\[LeftBracketingBar]"


Ψ
0







-


sin

(

k

θ

)





"\[LeftBracketingBar]"

α





]

.




(
92
)







Note that this expression for |Ψkalt) is almost identical to the expression for |Ψkcustom-character in Equation (51), but without two separate cases for the odd and even values of k. Much of the analysis of the original formulation of the non-boolean amplitude amplification algorithm 400, 500 described hereinabove holds for the alternative formulation 700, 800 described hereinabove as well, including the expressions for the state probabilities pK(x), mean μK, raw moments λK(n), and the cumulative distribution function FKcos.


In addition to simplifying the amplification algorithm (by using the same operation for every iteration), the Qiter operator used in algorithms 700, 800 allows for a clearer presentation of the quantum mean estimation algorithm, as described hereinbelow.


Quantum Mean Estimation Algorithm:


A quantum mean estimation algorithm according to certain embodiments of the present invention may operate to estimate the expected value of eiφ(x) for x sampled by measuring a given superposition state |ψ0custom-character. Let Eψ0[e] denote this expected value, as follows (Equation (93)):












E

ψ
0


[

e

i

φ


]






ψ
0





"\[LeftBracketingBar]"


U
φ



"\[RightBracketingBar]"




ψ
0





=




x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2




e

i


φ

(
x
)



.







(
93
)







This equation may be written as follows (Equation (94)):






E
ψ

0
[e]=Re[Eψ0[e]]+i Im[Eψ0[e]],  (94)


where the real and imaginary parts are given by Equations (95) and (96), respectively, as follows:











Re
[


E

ψ
0


[

e

i

φ


]

]

=




x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2



cos

(

φ

(
x
)

)




,




(
95
)













Im
[


E

ψ
0


[

e

i

φ


]

]

=




x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2




sin

(

φ

(
x
)

)

.







(
96
)







The mean estimation may therefore be performed in two parts: one for estimating the mean of cos(φ), and the other for estimating the mean of sin(φ). Note that the expectation of cos(φ) under the state |ψ0custom-character is precisely cos(θ) defined in Equation (30).


Estimating the Mean of cos(φ):


The connection shown in the “Boolean Oracle Case” section hereinabove between the parameter θ and the parameter θa serves as the intuition behind the quantum mean estimation algorithm of the present invention. In the known boolean amplitude estimation algorithm described hereinabove, the parameter θa is estimated using QPE (Note: The estimation of θQ is only (needed to be) performed up to a two-fold ambiguity of {θa,π−θa}). The estimate for θa is then turned into an estimate for the initial winning probability. The non-boolean quantum mean estimation algorithm of the present invention may operate to estimate the parameter θ defined in Equation (30) using QPE (Note: The estimation of θ is only (needed to be) performed up to a two fold ambiguity of {θ,2π−θ}). The estimate for θ may then be translated into an estimate for the initial expected value of cos(φ(x)), namely cos(θ).


Toward the end of actualizing the abovementioned intuition into a working algorithm, a key observation is that |Ψcustom-character may be written as follows (Equation (97)):














"\[RightBracketingBar]"


Ψ
0




=









"\[RightBracketingBar]"


η
+




-



"\[RightBracketingBar]"




η
-





2



,




(
97
)







where |η+custom-character and |ηcustom-character are given by Equation (98):













"\[LeftBracketingBar]"


η
±




=









e


±
i


θ






"\[LeftBracketingBar]"


Ψ
0





-



"\[RightBracketingBar]"



α




i


2



sin



(
θ
)



.





(
98
)







Note: The forms of the eigenstates |η+custom-character and |ηcustom-character in Equation (98) may be determined from the form of the matrix Sθ in Equation (48). These forms may also be determined from Equation (92) by rewriting the sin functions in terms of complex exponential functions.


The expressions for |η+custom-character and |ηcustom-character in Equation (98) may be used to verify Equation (97). Crucially, |η+custom-character and |ηcustom-character are unit normalized eigenstates of the unitary operator Qiter, with eigenvalues eand e−iθ, respectively.






Q
iter±custom-character=e±iθ±custom-character,  (99)






custom-characterη±±custom-character=1.  (100)


The properties of |η+custom-character and |ηcustom-character in Equation (99) and Equation (100) may be verified using Equation (89), Equation (90), and Equation (98). The observations in Equation (97) and Equation (99) lead to the following algorithm for estimating cos(θ):


(1) Perform the QPE algorithm with a) the two-register operator Qiter serving the role of the unitary operator under consideration, and b) the superposition state |Ψ0) in place of the eigenstate required by the QPE algorithm as input. Let the output of this step, appropriately scaled to be an estimate of the phase angle in the range [0,2π), be {circumflex over (ω)}.


(2) Return cos({circumflex over (ω)}) as the estimate for cos(θ) (i.e., the real part of Eψ0[e]). Note: If the circuit implementation of Qiter is wrong by an overall (state independent) phase ϕerr, then the estimate for cos(θ) is cos({circumflex over (ω)}−ϕerr). This is important, for example, if the operation [2|0,0custom-charactercustom-character0,0|−I] is only implemented up to a factor of −1 (i.e., with ϕerr=π). Note that the final state probabilities under the non-boolean amplitude amplification algorithm are unaffected by such an overall phase error.


Proof of correctness of the algorithm: |Ψ0custom-character is a superposition of the eigenstates |η+custom-character and |ηcustom-character of the unitary operator Qiter. This implies that {circumflex over (ω)} may either be an estimate for the phase angle of |η+custom-character, namely θ, or an estimate for the phase angle of |ηcustom-character, namely 2π−θ. (Note: If θ=0, the phase angle being estimated is 0 for both |η+custom-character and |ηcustom-character. For θ≠0, {circumflex over (ω)} will be an estimate for either θ or 2π−θ with equal probability. Since θ lies in [0,π] and 2π−θ lies in [π,2π], the output {circumflex over (ω)} can be converted into an estimate for θ alone (although doing so is not necessary)). Since, cos(2π−θ)=cos(θ), it follows that cos({circumflex over (ω)}) is an estimate for cos(θ).


Estimating the Mean of e:


The algorithm for estimating the expected value of cos(φ) in the section hereinabove may be re-purposed to estimate the expected value of sin(φ) by using the fact that





sin(φ)=cos(φ−π/2).  (101)


In other words, the imaginary part of Eψ0[e] is the real part of Eψ0[ei(φ−π/2)]. By using the oracle Uφ−π/2 (for the function φ−π/2), instead of Uφ, in the mean estimation algorithm of the preceding section, the imaginary part of Eψ0[e] may also be estimated. This completes the estimation of Eψ0[e].


For concreteness, Uφ−π2 may be explicitly written as






U
φ−π/2
=e
−iπ/2|0custom-charactercustom-character0|⊗Uφ+eiπ/2|1custom-charactercustom-character1|⊗Uφ.  (102)


Referring now to FIG. 9, exemplary circuit 900 illustrates implementation of Uφ−π/2 using the oracle 932 denoted Uφ, the bit-flip operator 940 denoted X, and the phase-shift operator Rϕ (shown as elements 950, 952).


Note that the algorithm does not use the knowledge that {|0custom-character, . . . , |N−1custom-character} is an eigenbasis of Uφ. Therefore, this algorithm may be used to estimate custom-characterψ0|U|ψ0custom-character for any unitary operator U.


Quantum Speedup:


The speedup offered by the quantum mean estimation algorithm 900 over classical methods will now be discussed in detail, in the context of estimating the mean of cos(φ) alone. This discussion may be extended in a straightforward way to estimation of Eψ0[e].


Classical Approaches to Estimating the Mean: For an arbitrary function φ and a known sampling distribution p0(x) for the inputs x, one classical approach to finding the mean of cos(φ(x)) is to sequentially query the value of φ(x) for all the inputs and use the query results to compute the mean. Let the permutation (x0, x1, . . . , xN-1) of the inputs (0, 1, . . . , N−1) be the order in which the inputs are queried. The range of allowed values of cos(θ), based only on results for the first q inputs, is given by the following (Equation (103)):










[





j
=
0


q
-
1





p
0

(
x
)



cos



(

φ

(

x
j

)

)



-




j
=
q


N
-
1




p
0

(
x
)



]



cos



(
θ
)





[





j
=
0


q
-
1





p
0

(
x
)



cos



(

φ

(

x
j

)

)



+




j
=
q


N
-
1




p
0

(
x
)



]

.





(
103
)







These bounds are derived by setting the values of cos(φ) for all the unqueried inputs to their highest and lowest possible values, namely +1 and −1. The range of allowed values of cos(θ) shrinks as more and more inputs are queried. In particular, if p0(x) is equal for all the inputs x, the width of the allowed range (based on q queries) is given by 2(N−q)/N. This strategy may take custom-character(N) queries before the width of the allowed range reduces to even, say, 1. Thus, this strategy will not be feasible for large values of N.


An alternative classical approach is to probabilistically estimate the expected value as follows:


(1) Independently sample q random inputs (x1, . . . xq) as per the distribution p0.


(2) Return the sample mean of cos(φ) over the random inputs as an estimate for cos(θ).


Under this approach, the standard deviation of the estimate scales as ˜σ0/√{square root over (q)}, where σ0 is the standard deviation of cos(φ) under the distribution p0.


Precision Vs Number of Queries for the Quantum Algorithm: Note that one call to the operator Qiter corresponds to custom-character(1) calls to A0 and Uφ (and their inverses). Let q be the number of times the (controlled) Qiter operation is performed during the QPE subroutine. As q increases, the uncertainty on the estimate for the phase-angle θ (up to a two-fold ambiguity) falls at the rate of custom-character(1/q). Consequently, the uncertainty on cos(θ) also falls at the rate of custom-character(1/q). This represents a quadratic speedup over the classical, probabilistic approach, under which the error falls as custom-character(1/√{square root over (q)}).


Note that the variance of the estimate for cos(θ) is independent of a) the size of input space N, and b) the variance σ02 of cos(φ(x)) under the distribution p0(x). It only depends on the true value of cos(θ) and the number of queries q performed during the QPE subroutine.


Demonstrating the Algorithms Using a Toy Example


Referring again to FIGS. 4, 5, and 9, the non-boolean amplitude amplification algorithm 400, 500 and the mean estimation algorithm 900 will both be demonstrated using a toy example. Let the input to the oracle Uφ (i.e., the second register 420), contain 8 qubits. This leads to 28=256 basis input states, namely |0custom-character, . . . , |255custom-character. Let the toy function φ(x) be














φ

(
x
)

=


x

2

5

5




π
4



,






for






x

=
0

,
1
,


,
255.







(
104
)







The largest phase-shift applied by the corresponding oracle 432 denoted Uφ on any basis state is π/4, for the state |255custom-character. Since, cos(φ(x)) is monotonically decreasing in x, the goal of the amplitude amplification algorithm 400, 500 is to amplify the probabilities of higher values of x.


Let the initial state, from which the amplification is performed, be the uniform superposition state |scustom-character.

















"\[LeftBracketingBar]"


ψ
0




=



"\[LeftBracketingBar]"

s




=


1


2

5

6








x
=
0


2

5

5





"\[LeftBracketingBar]"

x






.




(
105
)







Such simple forms for the oracle function and the initial state allow for a good demonstration of the algorithms of the present invention.


For this toy example, from Equation (30), cos(θ) and θ are given by














cos



(
θ
)


=



1

2

5

6







x
=
0


2

5

5




cos



(


x

2

5

5




π
4


)






0.9001


,






θ



0.45

7
.









(
106
)







Referring now to FIG. 10, graph 1000 shows the value 1010 of λK, from Equation (62), for the first few of a range 1020 of values of K (more specifically, for K=0, 1, . . . , 14). The dots 1030 (only a subset labeled, for clarity) correspond to the different integer values 1020 of K. The black solid curve 1040 depicts the sinusoidal dependence of the value 1010 of λK on the range 1040 of K. The dotted lines 1050 indicate that the value 1010 of λK oscillates around a reference 1060 of cos(θ)/sin2(θ) with an amplitude 1070 of 1/sin2(θ) and a period 1080 of π/θ (in K values). The heuristic choice for the total number of iterations {tilde over (K)}=[π/(2θ)] is 3 for this example.


Amplitude Amplification:


Continuing with the toy example, and referring now to chart 1100 of FIG. 11, the quantum circuit for the non-boolean amplitude amplification algorithm 400, 500 was implemented in a quantum computing framework for three different values of the total number of iterations K, namely K=1, 2, and 3. The solid histograms 1130, 1140, 1150 show the observed measurement frequencies 1110 of the different values 1120 of x∈{0, 1 . . . , 255} after performing the non-boolean amplitude amplification algorithm 400, 500. The solid histograms 1130, 1140, 1150 correspond to the total number of iterations K being 1, 2, and 3, respectively. In each case, the observed frequencies are based on simulating (and measuring) the circuit for the algorithm 106 times (i.e., 106 shots). The dashed curves 1132, 1142, 1152, in good agreement (almost coincident) with their corresponding solid histograms 1130, 1140, 1150, respectively, show the predictions pK(x) (for the measurement frequencies) computed using Equation (61). While pK(x) may be technically defined only for the integer values of x, in FIG. 11 the dashed curves 1132, 1142, 1152 are interpolated for non-integer values of x using Equation (61).


As can be seen from FIG. 11, in each case, the algorithm 400, 500 preferentially amplifies lower values of cos(φ(x)) or, equivalently, higher values of x. This result is expected from the fact that λK>0 for all three values of K. Furthermore, as K increases from 0 to {tilde over (K)}=3, the preferential amplification grows stronger. Note that the probabilities of the x-s for which cos (Φ(x))≈cos(θ) are left approximately unchanged by the algorithm, as indicated by the dotted crosshair 1160.


Mean Estimation:


Continuing with the toy example, and referring now to graphs 1200, 1250 of FIG. 12, results of demonstrating the quantum circuit for the non-boolean mean estimation algorithm 900 will now be described in detail. Only the estimation of cos(θ) (i.e., the real part of Eψ0[e]) is demonstrated herein. The imaginary part may also be estimated using the same technique, as described in “Estimating the Mean of e” hereinabove.


Let M be the number of qubits used in the QPE subroutine of the mean estimation algorithm 900, to contain the phase information. This corresponds to performing the (controlled) Qiter operation 2M−1 times during the QPE subroutine. Note that the estimated phase {circumflex over (ω)} may only take the following discrete values:










ω
ˆ




{



2

π

j


2
M







"\[LeftBracketingBar]"



j


{

0
,


,


2
M

-
1


}




}

.





(
107
)







In this way, the value of M controls the precision of the estimated phase and, by extension, the precision of the estimate for cos(θ); the higher the value of M, the higher the precision.


For the demonstration, two different quantum circuits were implemented, again using a quantum computing framework, for the mean estimation algorithm 900; one with M=4 and the other with M=8. Each circuit was simulated (and measured) 106 times, to get a sample of {circumflex over (ω)} values all in the range [0,2π).


The observed frequencies 1210 (scaled by 1/bin-width) of the different values 1220 of {circumflex over (ω)} are shown as histograms on a linear scale in top graph 1200, and on a logarithmic scale in the bottom graph 1250. Here the bin-width of the histograms is given by 2π/2M, which is the difference between neighboring allowed values of {circumflex over (ω)}.


The dashed histogram 1230 and solid histogram 1240 correspond to the circuits with 4 and 8 phase measurement qubits, respectively. The exact values of θ and 2π−θ for the toy example are indicated with vertical dotted lines 1232, 1242, respectively. In both cases (M=4 and M=8), the observed frequencies peak near the exact values of θ and 2π−θ, demonstrating that {circumflex over (ω)} is a good estimate for them, up to a two-fold ambiguity. (Note: The upward trends near the left (−1) and right (+1) edges of the plots in are artifacts caused by the Jacobian determinant for the map from {circumflex over (ω)} to cos({circumflex over (ω)})). Furthermore, as expected, using more qubits for estimating the phase leads to a more precise estimate.


Ancilla-Free Versions of the Algorithms:


Both algorithms introduced this in this paper so far, namely (1) the amplitude algorithm of FIGS. 4 and 5 and its alternative formulation in FIG. 8, and (2) the mean estimation algorithm of FIG. 9, use an ancilla qubit to make the quantity custom-characterΨ0|Uφ0custom-character real valued. This is important for achieving the respective goals of the algorithms. However, the same algorithms may be performed without the ancilla, albeit to achieve different goals, which may be relevant in some use cases.


Ancilla-Free Non-Boolean Amplitude Amplification:


The ancilla-free version of the amplitude amplification algorithm is almost identical to the algorithm introduced hereinabove at FIGS. 4 and 5. The only difference is that, in the ancilla-free version, the single-register operators Sψ0, Uφ, and Uφ are used in place of the two-register operators SΨ0, Uφ, and Uφ, respectively. For concreteness, the ancilla-free algorithm may proceed as follows:


(1) Initialize a system in the state |ψ0custom-character.


(2) Act the operation Sψ0Uφ during the odd iterations and Sψ0Uφ during the even iterations.


Analogous to the two-register states |αcustom-character and |βcustom-character in Equations (31) and (32), let the single-register states |α′custom-character and |β′custom-character be defined as


















2




"\[LeftBracketingBar]"


α








U
φ




"\[RightBracketingBar]"




ψ
0











=




x
=
0


N
-
1




e

i


φ

(
x
)





a
0



(
x
)





"\[LeftBracketingBar]"

x






,















"\[LeftBracketingBar]"


β







U
φ





"\[RightBracketingBar]"




ψ
0











=




x
=
0


N
-
1




e


-
i



φ

(
x
)






a
0

(
x
)





"\[LeftBracketingBar]"

x






.








(
108
)







Analogous to θ defined in Equation (30), let θ′∈[0,π/2] and δ∈[0,2π) be implicitly defined by











cos



(

θ


)



e

i

δ








ψ
0





"\[LeftBracketingBar]"


α







=




x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2




e

i


φ

(
x
)



.







(
109
)







Variables cos(θ′) and δ are the magnitude and phase, respectively, of the initial (i.e., x sampled from |ψ0custom-character) expected value of e. An important difference between θ′ and θ is that cos(θ′) is restricted to be non-negative, unlike cos(θ), which may be positive, negative, or zero.


Note that cos(θ′) may be written as











cos



(

θ


)


=




x
=
0


N
-
1







"\[LeftBracketingBar]"



a
0

(
x
)



"\[RightBracketingBar]"


2



e

i


φ′

(
x
)






,




(
110
)







where φ′(x) is given by





φ′(x)≡φ(x)−δ.  (111)


Acting the oracle Uφ for the function φ may be thought of as acting the oracle Uφ′ for the function φ′, followed by performing a global, state independent phase-shift of δ. Furthermore, from Equation (120), it can be seen that custom-characterψ0|Uφ′0custom-character is real-valued. This observation may be used to re-purpose the analysis in the “Analysis of the Non-Boolean Amplitude Amplification Algorithm” section hereinabove for the ancilla-free version; the corresponding results are presented here without explicit proofs.


Let |ψkcustom-character be the state of the system of the after k≥0 iterations of the ancilla-free algorithm. Analogous to Equation (51), |ψ′kcustom-character may be written as













"\[LeftBracketingBar]"


ψ
k





=

{











e

i

δ



sin



(

θ
'

)



[

sin



(


(

k
+
1

)



θ



)





"\[LeftBracketingBar]"


ψ
0






-

sin



(

k


θ



)



e


-
i


δ






"\[LeftBracketingBar]"


α







]

,





if


k


is


odd

,












1

sin



(

θ


)



[

sin



(


(

k
+
1

)



θ



)





"\[LeftBracketingBar]"


ψ
0






-

sin



(

k


θ



)



e

i

δ






"\[LeftBracketingBar]"


β







]


,




if


k


is



even
.










(
112
)







Let p′K(x) be the probability of measuring the system in state x after K iterations. Analogous to Equation (61), p′K(x) can be written as follows (Equation (113)):






p′
K(x)=p0(x){1−λ′K[cos(φ(x)−δ)−cos(θ′)]},  (113)


where the λ′K, the ancilla-free analogue of λK, is given by










λ
K


=



2


sin



(

K


θ



)



sin



(


(

K
+
1

)



θ



)




sin
2

(

θ


)


=




cos



(

θ


)


-

cos



(


(


2

K

+
1

)



θ



)





sin
2

(

θ


)


.






(
114
)







In this case, the probability amplification factor p′K/p0 is linear in cos(φ−δ).


Ancilla-Free Mean Estimation:


The ancilla-free mean estimation algorithm described in this subsection may estimate the magnitude of custom-characterψ0|U|ψ0custom-character for a given unitary operator U. Hereinbelow the algorithm is presented in terms of the oracle Uφ, and the goal of the algorithm is to estimate cos(θ′) from Equation (109) (i.e., the magnitude of Eψ0[e]≡custom-characterψ0|Uφ0custom-character).


Let the unitary operator Qevenodd be defined as follows (Equation 115)):






Q
evenodd
≡S
ψ

0

U
φ
S
ψ

0

U
φ
.  (115)


Its action corresponds to performing the (ancilla-free) even-iteration operation once, followed by the odd-iteration operation. Analogous to Equations (97) and (98), the state |ψ0custom-character can be written as














"\[LeftBracketingBar]"


ψ
0




=








"\[LeftBracketingBar]"


η
+





-

|

η
-






2



,




(
116
)







where |η′+custom-character and |η″custom-character are given by













"\[LeftBracketingBar]"


η
±





=







e


±
i


θ








"\[LeftBracketingBar]"


ψ
0





-


e


-
i


δ






"\[LeftBracketingBar]"


α








i


2



sin



(

θ


)



.





(
117
)







|η′+custom-character and |η′custom-character are unit-normalized eigenstates of Qevenodd with eigenvalues e2iθ, and e−2iθ, respectively.














Q

e

ven

odd






"\[LeftBracketingBar]"


η
±






=


e


±
2


i

θ








"\[LeftBracketingBar]"


η
±







,




(
118
)
















η
±






"\[LeftBracketingBar]"


η
±






=

1
.





(
119
)







The observations in Equations (118) and (119) lead to the following algorithm for estimating cos(θ′):


(1) Perform the QPE algorithm with Qevenodd serving the role of the unitary operator under consideration, and the superposition state |ψ0custom-character in place of the eigenstate required by the QPE algorithm as input. Let the output of this step, appropriately scaled to be an estimate of the phase angle in the range [0,2π), be {circumflex over (ω)}.


(2) Return |cos({circumflex over (ω)}/2)| as the estimate for cos(θ′).


In this version of the algorithm, {circumflex over (ω)} will be an estimate for either 2θ or 2π−2θ. (Note: If θ′=0, the phase angle being estimated is 0 for both |η′+custom-character and |η′custom-character.) So, {circumflex over (ω)}/2 will be an estimate for either θ′ or π−θ′. Since, a) cos(π−θ′)=−cos(θ′), and b) cos(θ′) is a non-negative number, it follows that |cos({circumflex over (ω)}/2)| is an estimate for cos(θ′).


Potential advantageous applications of the algorithms of the present invention may include the following:


Approximate Optimization:


A straightforward application of the non-boolean amplitude amplification algorithm of the present invention is in the optimization of objective functions defined over a discrete input space. The objective function to be optimized needs to be mapped onto the function φ of the oracle Uφ, with the basis states of the oracle corresponding to the different discrete inputs of the objective function. After performing an appropriate number of iterations of the algorithm, measuring the state of the system will yield “good” states with amplified probabilities. Multiple repetitions of the algorithm (multiple shots) may be performed to probabilistically improve the quality of the optimization.


Note that the technique is not guaranteed to yield the true optimal input, and the performance of the technique will depend crucially on factors like a) the map from the objective function to the oracle function φ, b) the number of iterations K, c) the initial superposition |ψ0custom-character, and, in particular, d) the initial distribution of φ under the superposition |ψ0custom-character. This approach joins known quantum optimization techniques.


Simulating Probability Distributions:


The amplitude amplification algorithm may be useful for simulating certain probability distributions. By choosing the initial state |ψ0custom-character, oracle Uφ, and the number of iterations K, one can control the final sampling probabilities pK(x) of the basis states; the exact expression for pK(x) in terms of these factors is given in Equation (61).


Estimating the Overlap Between Two States:


Let |ψcustom-character and |ϕcustom-character be two different states produced by acting the unitary operators A and B, respectively, on the state |0custom-character.





custom-character=A|0custom-character,|ϕcustom-character=B|0custom-character.  (120)


Estimating the overlap |custom-characterψ|ϕcustom-character| between the two states is an important task with several applications, including in Quantum Machine Learning (QML). Several algorithms, including the Swap test, can be used for estimating this overlap. For the Swap test, the uncertainty in the estimated value of |custom-characterψ|ϕcustom-character| falls as custom-character(1/√{square root over (q)}) in the number of queries q to the unitaries A and B (used to the create the states |ψcustom-characterand |ϕcustom-character).


On the other hand, the mean estimation algorithm of the present invention also be used to estimate custom-characterψ|ϕcustom-characterby noting that






custom-characterψ|ϕcustom-character=custom-character0|AB|0custom-character.  (121)


So, by setting






U≡A

B,  (122)





0custom-character≡|0custom-character,  (123)


values custom-characterψ|ϕcustom-character may be estimated as custom-characterψ0|U|ψ0custom-character using the mean estimation algorithm of FIG. 9. If one is only interested in the magnitude of custom-characterψ|ϕcustom-character, the ancilla-free version of the mean estimation algorithm described hereinabove will also suffice. Since, for the mean estimation algorithm, the uncertainty of the estimate falls as custom-character(1/q) in the number of queries q to the unitaries A and B (or their inverses), this approach offers a quadratic speedup over the Swap test. Furthermore, the custom-character(1/q) scaling of the error achieved by this approach matches the performance of the known optimal quantum algorithm for the overlap-estimation task.


Meta-Oracles to Evaluate the Superposition |ψcustom-charactercustom-character and Unitary U:


Recall from Equations (97) and (98) that













Q

i

t

e

r






"\[LeftBracketingBar]"


Ψ
0





=






e


t
˙


θ






"\[LeftBracketingBar]"


η
+





-


e


-
i


θ






"\[LeftBracketingBar]"


η
-







2



,




(
124
)







where cos(θ) is the real part of custom-characterψ0|Uφ0custom-character. Note that the parameter θ depends on the superposition |ψ0custom-character and the unitary Uφ. The action of Qiter on |Ψ0) is to apply a phase-shift of θ on the projection along |η+custom-character and a phase-shift of −θ on the projection along |ηcustom-character. This property may be used to create a meta-oracle which evaluates the superposition |Ψ0custom-character and/or the unitary Uφ (or a generic unitary U) based on the corresponding value of θ. More specifically, if the circuit A0 for producing |Ψ0custom-character and/or the circuit for U are additionally parameterized using “control” quantum registers (provided as inputs to the circuits), then a meta-oracle may be created using Equation (24) to evaluate the states of the control registers. Such meta-oracles may be used with quantum optimization algorithms, including the non-boolean amplitude amplification algorithm of the present invention, to find “good” values (or states) of the control registers.


Variational quantum circuits (i.e., quantum circuits parameterized by (classical) free parameters) have several applications, including in QML. Likewise, quantum circuits parameterized by quantum registers may also have applications (e.g., in QML and quantum statistical inference).


Some of the illustrative aspects of the present invention may be advantageous in solving the problems herein described and other problems not discussed which are discoverable by a skilled artisan.


While the above description contains much specificity, these should not be construed as limitations on the scope of any embodiment, but as exemplifications of the presented embodiments thereof. Many other ramifications and variations are possible within the teachings of the various embodiments. While the invention has been described with reference to exemplary embodiments, it will be understood by those skilled in the art that various changes may be made and equivalents may be substituted for elements thereof without departing from the scope of the invention. In addition, many modifications may be made to adapt a particular situation or material to the teachings of the invention without departing from the essential scope thereof. Therefore, it is intended that the invention not be limited to the particular embodiment disclosed as the best or only mode contemplated for carrying out this invention, but that the invention will include all embodiments falling within the scope of the appended claims. Also, in the drawings and the description, there have been disclosed exemplary embodiments of the invention and, although specific terms may have been employed, they are unless otherwise stated used in a generic and descriptive sense only and not for purposes of limitation, the scope of the invention therefore not being so limited. Moreover, the use of the terms first, second, etc. do not denote any order or importance, but rather the terms first, second, etc. are used to distinguish one element from another. Furthermore, the use of the terms a, an, etc. do not denote a limitation of quantity, but rather denote the presence of at least one of the referenced item.


Thus, the scope of the invention should be determined by the appended claims and their legal equivalents, and not by the examples given.

Claims
  • 1. A method of performing quantum calculation on an oracle Uφ for a non-boolean function φ, comprising: initializing an ancilla qubit in a |+ state and an input qubit in a |ψ0 state of a plurality of eigenstates |x to define a two-register state |Ψ0≡|+,ψ0;for each of a plurality K of iterations receiving, using the input qubit, a respective one of the plurality of eigenstates |x defining an input basis state,for odd iterations, acting on the input basis state using a selective phase-flip unitary operator circuit SΨ0 and a controlled unitary operator circuit Uφ, andfor even iterations, acting on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and a controlled inverse unitary operator circuit Uφ†.
  • 2. The method according to claim 1, further comprising measuring, after the plurality K of iterations, the ancilla qubit in a 0/1 basis.
  • 3. The method according to claim 1, wherein the selective phase-flip unitary operator circuit SΨ0 further comprises: a Hadamard transform H,a unitary operator A0,a unitary operator I, andan inverse unitary operator A0†;wherein the selective phase-flip unitary operator SΨ0=[H⊗A0][2|0,00,0|−I][H⊗A0†].
  • 4. The method according to claim 1, wherein the acting on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and the controlled unitary operator circuit Uφ further comprises, for the ancilla qubit in a state |0, acting on the input qubit as Uφ|0,x=e+iφ(x)|0,x, Uφ|1,x=e−iφ(x)|1,x.
  • 5. The method according to claim 1, wherein the acting on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and the controlled inverse unitary operator circuit Uφ† further comprises, for the ancilla qubit in a state |1, acting on the input qubit as Uφ†|0,x=e+iφ(x)|0,x, Uφ†|1,x=e−iφ(x)|1,x.
  • 6. The method according to claim 1, further comprising: receiving, using the input qubit, the |ψ0 state defining an input random state;acting on the input random state using a controlled estimation unitary operator circuit Uφ−π/2.
  • 7. The method according to claim 6, wherein the controlled estimation unitary operator circuit Uφ−π/2 further comprises: the controlled unitary operator circuit Uφ,at least one bit-flip operator X, andat least one phase-shift operator Rϕ;wherein the controlled estimation unitary operator circuit Uφ−π/2=e−iπ/2|00|⊗Uφ+eiπ/2|11|⊗Uφ†.
  • 8. A quantum computing device for performing quantum calculation on an oracle Uφ for a non-boolean function φ, comprising: a two-register quantum system comprising an ancilla qubit, andan input qubit; anda non-boolean quantum oracle comprising a selective phase-flip unitary operator circuit SΨ0,a controlled unitary operator circuit Uφ, anda controlled inverse unitary operator circuit Uφ†;wherein the quantum computing device is configured to initialize the ancilla qubit in a |+ state and the input qubit in a |ψ0 state of a plurality of eigenstates |x to define a two-register state |Ψ0≡|+,ψ0;for each of a plurality K of iterations receive, using the input qubit, a respective one of the plurality of eigenstates |x defining an input basis state,for odd iterations of the plurality K of iterations, act on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and the controlled unitary operator circuit Uφ, andfor even iterations of the plurality K of iterations, act on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and the controlled inverse unitary operator circuit Uφ†.
  • 9. The quantum computing device according to claim 8, further configured to measure, after the plurality K of iterations, the ancilla qubit in a 0/1 basis.
  • 10. The quantum computing device according to claim 8, wherein the selective phase-flip unitary operator circuit SΨ0 further comprises: a Hadamard transform H,a unitary operator A0,a unitary operator I, andan inverse unitary operator A0†;wherein the selective phase-flip unitary operator SΨ0=[H⊗A0][2|0,00,0|−I][H⊗A0†].
  • 11. The quantum computing device according to claim 8, further configured, for the ancilla qubit in a state |0, to act on the input qubit as Uφ|0,x=e+iφ(x)|0,x, Uφ|1,x=e−iφ(x)|1,x.
  • 12. The quantum computing device according to claim 8, further configured, for the ancilla qubit in a state |1, to act on the input qubit as Uφ†|0,x=e+iφ(x)|0,x, Uφ†|1,x=e−iφ(x)|1,x.
  • 13. The quantum computing device according to claim 8, further comprising a controlled estimation unitary operator circuit Uφ−π/2, and configured to: receive, using the input qubit, the |ψ0 state defining an input random state; andact on the input random state using the controlled estimation unitary operator circuit Uφ−π/2.
  • 14. The quantum computing device according to claim 13, wherein the controlled estimation unitary operator circuit Uφ−π/2 further comprises: the controlled unitary operator circuit Uφ,at least one bit-flip operator X, andat least one phase-shift operator Rϕ;wherein the controlled estimation unitary operator circuit Uφ−π/2=e−iπ/2|00|⊗Uφ+eiπ/2|11|⊗Uφ†.
  • 15. A system of quantum circuits for implementing an oracle U q for a non-boolean function φ, the system configured to: initialize an ancilla qubit in a |+ state and an input qubit in a |ψ0 state of a plurality of eigenstates |x to define a two-register state |Ψ0≡|+,ψ0;for each of a plurality K of iterations receive, using the input qubit, a respective one of the plurality of eigenstates |x defining an input basis state,for odd iterations of the plurality K of iterations, act on the input basis state using a selective phase-flip unitary operator circuit SΨ0 and a controlled unitary operator circuit Uφ, andfor even iterations of the plurality K of iterations, act on the input basis state using the selective phase-flip unitary operator circuit SΨ0 and a controlled inverse unitary operator circuit Uφ†.
  • 16. The system according to claim 15, further configured to measure, after the plurality K of iterations, the ancilla qubit in a 0/1 basis.
  • 17. The system according to claim 15, wherein the selective phase-flip unitary operator circuit SΨ0 further comprises: a Hadamard transform H,a unitary operator A0,a unitary operator I, andan inverse unitary operator A0†;wherein the selective phase-flip unitary operator SΨ0=[H⊗A0][2|0,00,0|−I][H⊗A0†].
  • 18. The system according to claim 15, further configured, for the ancilla qubit in a state |0, to act on the input qubit as Uφ|0,x=e+iφ(x)|0,x, Uφ|1,x=e−iφ(x)|1,x.
  • 19. The system according to claim 15, further configured, for the ancilla qubit in a state |1, to act on the input qubit as Uφ†|0,x=e+iφ(x)|0,x, Uφ†|1,x=e−iφ(x)|1,x.
  • 20. The system according to claim 15, further configured to: receive, using the input qubit, the |ψ0 state defining an input random state; andact on the input random state using a controlled estimation unitary operator circuit Uφ−π/2 comprising: the controlled unitary operator circuit Uφ,at least one bit-flip operator X, andat least one phase-shift operator Rϕ;wherein the controlled estimation unitary operator circuit Uφ−π/2=e−iπ/2|00|⊗Uφ+eiπ/2|11|⊗Uφ†.
STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH OR DEVELOPMENT

The invention described in this patent application was made with Government support under the Fermi Research Alliance, LLC, Contract Number DE-ACO2-07CH11359 awarded by the U.S. Department of Energy. The Government has certain rights in the invention.