Non-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation
PPrepared for submission to
ACM Transactions on Quantum Computing
FERMILAB-PUB-21-018-QIS
February 09, 2021
Non-Boolean Quantum Amplitude Amplification andQuantum Mean Estimation
PRASANTH SHYAMSUNDAR (cid:18) , Fermi National Accelerator Laboratory, USAThis paper generalizes the quantum amplitude amplification and amplitude estimation algorithms to workwith non-boolean oracles. The action of a non-boolean oracle ๐ ๐ on an eigenstate | ๐ฅ โฉ is to apply a state-dependent phase-shift ๐ ( ๐ฅ ) . Unlike boolean oracles, the eigenvalues exp ( ๐๐ ( ๐ฅ )) of a non-boolean oracle arenot restricted to be ยฑ . Two new oracular algorithms based on such non-boolean oracles are introduced. Thefirst is the non-boolean amplitude amplification algorithm, which preferentially amplifies the amplitudes ofthe eigenstates based on the value of ๐ ( ๐ฅ ) . Starting from a given initial superposition state | ๐ โฉ , the basisstates with lower values of cos ( ๐ ) are amplified at the expense of the basis states with higher values of cos ( ๐ ) .The second algorithm is the quantum mean estimation algorithm, which uses quantum phase estimationto estimate the expectation (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) , i.e., the expected value of exp ( ๐๐ ( ๐ฅ )) for a random ๐ฅ sampled bymaking a measurement on | ๐ โฉ . It is shown that the quantum mean estimation algorithm offers a quadraticspeedup over the corresponding classical algorithm. Both algorithms are demonstrated using simulations fora toy example. Potential applications of the algorithms are briefly discussed.CCS Concepts: โข Theory of computation โ Quantum computation theory ; โข
Computer systems or-ganization โ Quantum computing .Additional Key Words and Phrases: quantum algorithm, quantum speedup, Groverโs algorithm, quantummachine learning, state overlap
Groverโs algorithm, introduced in Ref. [1], is a quantum search algorithm for finding the uniqueinput ๐ฅ good that satisfies ๐ bool ( ๐ฅ good ) = , (1)for a given boolean function ๐ bool : { , , . . . , ๐ โ } โ { , } . Such an input ๐ฅ good satisfying (1) isreferred to as the winning input of ๐ bool . Groverโs original algorithm has also been adapted to workwith boolean functions with multiple winning inputs [2], where the goal is to find any one of thewinning inputs.An important generalization of Groverโs algorithm is the amplitude amplification algorithm[3โ5], in which the function ๐ bool is accessed through a boolean quantum oracle ^ ๐ ๐ bool that acts onthe orthonormal basis states | โฉ , . . . , | ๐ โ โฉ as follows: ^ ๐ ๐ bool | ๐ฅ โฉ = (cid:40) โ | ๐ฅ โฉ , if ๐ bool ( ๐ฅ ) = , + | ๐ฅ โฉ , if ๐ bool ( ๐ฅ ) = . (2)In this way, the oracle marks the winning states by flipping their phase (shifting the phase by ๐ ).Given a superposition state | ๐ โฉ , the goal of the amplitude amplification algorithm is to amplifythe amplitudes (in the superposition state) of the winning states. The algorithm accomplishesthis iteratively, by initializing a quantum system in the state | ๐ โฉ and performing the operation ๐ ๐ ^ ๐ ๐ bool on the system during each iteration, where ๐ ๐ โก | ๐ โฉ โจ ๐ | โ ๐ผ . (3)Here, ๐ผ is the identity operator. Performing a measurement on the system after the iterative ampli-fication process results in one of winning states with high probability. Groverโs original algorithm Authorโs address: Prasanth Shyamsundar, [email protected], Fermi National Accelerator Laboratory, Fermilab QuantumInstitute, PO Box 500, Batavia, Illinois, 60510-0500, USA. a r X i v : . [ qu a n t - ph ] F e b Prasanth Shyamsundar is a special case of the amplitude amplification algorithm, where a) the uniform superposition state | ๐ โฉ , given by | ๐ โฉ = โ ๐ ๐ โ โ๏ธ ๐ฅ = | ๐ฅ โฉ , (4)is used as the initial state | ๐ โฉ of the system, and b) there is exactly one winning input.Closely related to the amplitude amplification algorithm is the amplitude estimation algorithm [5,6]. It combines ideas from the amplitude amplification algorithm and the quantum phase estimation(QPE) algorithm [7] to estimate the probability that making a measurement on the initial state | ๐ โฉ will yield a winning input. If the uniform superposition state | ๐ โฉ is used as | ๐ โฉ , the amplitudeestimation algorithm can help estimate the number of winning inputs of ๐ bool โthis special case isalso referred to as the quantum counting algorithm [6].The amplitude amplification algorithm and the amplitude estimation algorithm have a widerange of applications, and are important primitives that feature as subroutines in a number ofother quantum algorithms [8โ18]. The amplitude amplification algorithm can be used to find awinning input to ๐ bool with O (cid:0) โ ๐ (cid:1) queries of the quantum oracle, regardless of whether thenumber of winning states is a priori known or unknown [2]. This represents a quadratic speedupover classical algorithms, which require O ( ๐ ) evaluations of the function ๐ bool . Similarly, theamplitude estimation algorithm also offers a quadratic speedup over the corresponding classicalapproaches [5]. The quadratic speedup due to the amplitude amplification algorithm has beenshown to be optimal for oracular quantum search algorithms [19].A limitation of the amplitude amplification and estimation algorithms is that they work onlywith boolean oracles, which classify the basis states as good and bad. On the other hand, one mightbe interested in using these algorithms in the context of a non-boolean function of the input ๐ฅ . Insuch situations, the typical approach is to create a boolean oracle from the non-boolean function,by using a threshold value of the function as the decision boundaryโthe winning states are theones for which the value of the function is, say, less than the chosen threshold value [20, 21]. Inthis way, the problem at hand can be adapted to work with the standard amplitude amplificationand estimation algorithms. Another approach is to adapt the algorithms to work directly withnon-boolean functions [15].This paper generalizes the amplitude amplification and estimation algorithms to work withquantum oracles for non-boolean functions. In particular, a) the boolean amplitude amplificationalgorithm of Ref. [5] is generalized to the non-boolean amplitude amplification algorithm, andb) the amplitude estimation algorithm of Ref. [5] is generalized to the quantum mean estimationalgorithm. Henceforth, the qualifiers โbooleanโ and โnon-booleanโ will be used whenever necessary,in order to distinguish between the different versions of the amplitude amplification algorithm.The rest of this section introduces non-boolean oracles and describes the goals of the two mainalgorithms of this paper. The behavior of the boolean oracle ^ ๐ ๐ bool in (2) can be generalized to non-boolean functions byallowing the oracle to perform arbitrary phase-shifts on the different basis states. More concretely,let ๐ : { , , . . . , ๐ โ } โ R be a real-valued function, and let ๐ ๐ be a quantum oracle given by ๐ ๐ โก ๐ โ โ๏ธ ๐ฅ = ๐ ๐๐ ( ๐ฅ ) | ๐ฅ โฉ โจ ๐ฅ | . (5) The
O (โ ๐ ) and O ( ๐ ) scalings for the quantum and classical algorithms, respectively, hold assuming that the number ofwinning states does not scale with ๐ . on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 3 The actions of the oracle ๐ ๐ and its inverse ๐ โ ๐ on the basis states | โฉ , . . . , | ๐ โ โฉ are given by ๐ ๐ | ๐ฅ โฉ = ๐ + ๐๐ ( ๐ฅ ) | ๐ฅ โฉ = (cid:104) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) + ๐ sin (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:105) | ๐ฅ โฉ , (6) ๐ โ ๐ | ๐ฅ โฉ = ๐ โ ๐๐ ( ๐ฅ ) | ๐ฅ โฉ = (cid:104) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โ ๐ sin (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:105) | ๐ฅ โฉ . (7) Given an oracle ๐ ๐ and an initial state | ๐ โฉ , the goal of the non-boolean amplitude amplificationalgorithm introduced in this paper is to preferentially amplify the amplitudes of the basis states | ๐ฅ โฉ with lower values of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) , at the expense of the amplitude of states with higher valuesof cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . Depending on the context in which the algorithm is to be used, a different functionof interest ๐ (which is intended to guide the amplification) can be appropriately mapped onto thefunction ๐ . For example, if the range of ๐ is [ , ] and one intends to amplify the states with highervalues of ๐ , then (8) shows two different options for formulating the problem in terms of ๐ . ๐ ( ๐ฅ ) = ๐ ๐ ( ๐ฅ ) or ๐ ( ๐ฅ ) = arccos (cid:0) โ ๐ ( ๐ฅ ) (cid:1) . (8)In both these cases, cos ( ๐ ) is monotonically decreasing in ๐ .The connection between the boolean and non-boolean amplitude amplification algorithms canbe seen as follows: If either of the two options in (8) is used to map a boolean function ๐ bool onto ๐ bool , then ๐ bool ( ๐ฅ ) = (cid:40) ๐ , if ๐ bool ( ๐ฅ ) = , , if ๐ bool ( ๐ฅ ) = . (9)In this case, it can be seen from (2), (6), and (7) that the oracle ๐ ๐ and its inverse ๐ โ ๐ both reduce toa boolean oracle as follows: ๐ ๐ bool = ๐ โ ๐ bool = ^ ๐ ๐ bool . (10)Congruently, the task of amplifying (the amplitude of) the states with lower values of cos ( ๐ ) alignswith the task of amplifying the winning states | ๐ฅ โฉ with ๐ bool ( ๐ฅ ) = . Given a generic unitary operator ๐ and a state | ๐ โฉ , the goal of the quantum mean estimationalgorithm introduced in this paper is to estimate the quantity โจ ๐ | ๐ | ๐ โฉ . (11)In this paper, this task will be phrased in terms of the oracle ๐ ๐ as estimating the expectation of theeigenvalue ๐ ๐๐ ( ๐ฅ ) , for a state | ๐ฅ โฉ chosen randomly by making a measurement on the superpositionstate | ๐ โฉ . The connection between the two tasks can be seen, using (5), as follows: (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) = ๐ โ โ๏ธ ๐ฅ = (cid:10) ๐ (cid:12)(cid:12) ๐ ๐๐ ( ๐ฅ ) (cid:12)(cid:12) ๐ฅ (cid:11) (cid:10) ๐ฅ (cid:12)(cid:12) ๐ (cid:11) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) โจ ๐ฅ | ๐ โฉ (cid:12)(cid:12) ๐ ๐๐ ( ๐ฅ ) . (12)Here, (cid:12)(cid:12) โจ ๐ฅ | ๐ โฉ (cid:12)(cid:12) is the probability for a measurement on | ๐ โฉ to yield ๐ฅ . The only difference between โข estimating (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) for an oracle ๐ ๐ of the form in (5), and โข estimating โจ ๐ | ๐ | ๐ โฉ for a generic unitary operator ๐ is that {| โฉ , . . . , | ๐ โ โฉ} is known, beforehand, to be an eigenbasis of ๐ ๐ . On the other hand, theeigenstates of a generic unitary operator ๐ may be a priori unknown. However, as we will see, themean estimation algorithm of this paper does not use the knowledge of the eigenstates, and henceis applicable for generic unitary operators ๐ as well. Prasanth Shyamsundar
As mentioned before, the mean estimation algorithm of this paper is a generalization of theamplitude estimation algorithm of Ref. [5]. To see the connection between the respective tasksof these algorithms, note that the eigenvalues of a boolean oracle are either + or โ , and theexpectation of the eigenvalue under | ๐ โฉ is directly related to the probability of a measurementyielding a winning state with eigenvalue โ . This probability is precisely the quantity estimatedby the amplitude estimation algorithm.The rest of the paper is organized as follows: The non-boolean amplitude amplification algorithmis described in Section 2 and analyzed in Section 3. Section 4 contains the description and analysisof the quantum mean estimation algorithm. Both these algorithms are demonstrated using a toyexample in Section 5. Slightly modified versions of the algorithms are provided in Section 6. Thetasks performed by these modified algorithms are related to, but different from, the tasks of thealgorithms introduced in Section 2 and Section 4. Finally, the findings of this study and summarizedand contextualized briefly in Section 7. In addition to the quantum system (or qubits) that serve as inputs to the quantum oracle, thenon-boolean amplitude amplification algorithm introduced in this section will use one extra ancillaqubit. For concreteness, let the quantum system used in the algorithm consist of two quantumregisters. The first register contains the lone ancilla qubit, and the second register will be actedupon by the quantum oracle.The notations | ๐ โฉ โ | ๐ โฉ and | ๐, ๐ โฉ will both refer to the state where the two registers are unen-tangled, with the first register in state | ๐ โฉ and the second register in state | ๐ โฉ . The tensor productnotation โ will also be used to combine operators that act on the individual registers into operatorsthat simultaneously act on both registers. Such two-register operators will be represented byboldface symbols, e.g., S ๐ฟ , U ๐ , I . Likewise, boldface symbols will be used to represent the states ofthe two-register system in the braโket notation, e.g., | ๐ฟ โฉ . Throughout this paper, any state writtenin the braโket notation, e.g., | ๐ โฉ , will be unit normalized, i.e., normalized to 1. The dagger notation( โ ) will be used to denote the Hermitian conjugate of an operator, which is also the inverse for aunitary operator.Throughout this paper, unless otherwise specified, {| โฉ , | โฉ , . . . , | ๐ โ โฉ} will be used as thebasis for (the state space of) the second register. Any measurement of the second register will referto measurement in this basis. Likewise, unless otherwise specified, (cid:110) | , โฉ , | , โฉ , . . . , | , ๐ โ โฉ (cid:111) โช (cid:110) | , โฉ , | , โฉ , . . . , | , ๐ โ โฉ (cid:111) (13)will be used as the basis for the two-register system.Let | ๐ โฉ be the initial state of the second register from which the amplification process is tobegin. Let ๐ด be the unitary operator that changes the state of the second register from | โฉ to | ๐ โฉ . | ๐ โฉ โก ๐ด | โฉ โก ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) | ๐ฅ โฉ , such that ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) = , (14)where ๐ ( ๐ฅ ) is the initial amplitude of the basis state | ๐ฅ โฉ . It is implicitly assumed here that there exists a state | โฉ which is simultaneously an eigenstate of ๐ ๐ , as well as a special,easy-to-prepare state of the second register. The algorithms of this paper can be modified to work even without thisassumptionโit is made only for notational convenience. on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 5 Circuit for S ๐ฟ register 1(ancilla) ๐ป | , โฉ โจ , | โ I ๐ป register 2 ๐ด โ ๐ด Fig. 1. Quantum circuit for an implementation of S ๐ฟ , based on (19) . As we will see shortly, the algorithm introduced in this section will initialize the ancilla in the |+โฉ state given by |+โฉ = | โฉ + | โฉโ . (15)Anticipating this, let the two-register state | ๐ฟ โฉ be defined as | ๐ฟ โฉ โก |+ ,๐ โฉ = | ,๐ โฉ + | ,๐ โฉโ (16a) = โ ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) (cid:104) | , ๐ฅ โฉ + | , ๐ฅ โฉ (cid:105) . (16b) The following unitary operations will be used in the generalized amplitude amplification algorithmof this paper:
Let the two-register unitary operator S ๐ฟ be defined as S ๐ฟ โก | ๐ฟ โฉ โจ ๐ฟ | โ I (17a) = |+ ,๐ โฉ โจ+ ,๐ | โ I , (17b)where I is the two-register identity operator. S ๐ฟ leaves the state | ๐ฟ โฉ unchanged and flips thephase of any state orthogonal to | ๐ฟ โฉ . S ๐ฟ is simply the two-register generalization of ๐ ๐ used inthe boolean amplitude amplification algorithm. From (14) and (16), it can be seen that | ๐ฟ โฉ = (cid:104) ๐ป โ ๐ด (cid:105) | , โฉ , (18)where ๐ป is the Hadamard transform. This allows S ๐ฟ to be expressed as S ๐ฟ = (cid:104) ๐ป โ ๐ด (cid:105) (cid:104) | , โฉ โจ , | โ I (cid:105) (cid:104) ๐ป โ ๐ด โ (cid:105) . (19)This expression leads to an implementation of S ๐ฟ , as depicted in Figure 1, provided one has accessto the quantum circuits that implement ๐ด and ๐ด โ . Let the two-register unitary operator U ๐ be defined as U ๐ โก | โฉ โจ | โ ๐ ๐ + | โฉ โจ | โ ๐ โ ๐ . (20)Its action on the basis states of the two-register system is given by U ๐ | , ๐ฅ โฉ = ๐ + ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ , (21) Prasanth Shyamsundar
Circuit for U ๐ register 1(ancilla) ๐ ๐ register 2 ๐ ๐ ๐ โ ๐ Fig. 2. Quantum circuit for an implementation of U ๐ using controlled calls to the ๐ ๐ and ๐ โ ๐ oracles. Circuit for U โ ๐ register 1(ancilla) ๐ ๐ register 2 ๐ ๐ ๐ โ ๐ Fig. 3. Quantum circuit for an implementation of U โ ๐ using controlled calls to the ๐ ๐ and ๐ โ ๐ oracles. U ๐ | , ๐ฅ โฉ = ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ . (22)If the ancilla is in state | โฉ , U ๐ acts ๐ ๐ on the second register. On the other hand, if the ancilla is instate | โฉ , it acts ๐ โ ๐ on the second register. The inverse of U ๐ is given by U โ ๐ = | โฉ โจ | โ ๐ โ ๐ + | โฉ โจ | โ ๐ ๐ , (23)and the action of U โ ๐ on the basis states is given by U โ ๐ | , ๐ฅ โฉ = ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ , (24) U โ ๐ | , ๐ฅ โฉ = ๐ + ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ . (25)The amplitude amplification algorithm for non-boolean functions will involve calls to both U ๐ and U โ ๐ . Figure 2 and Figure 3 depict implementations of U ๐ and U โ ๐ using a) the bit-flip (or Pauli-X)gate ๐ , and b) controlled ๐ ๐ and ๐ โ ๐ operations, with the ancilla serving as the control qubit. The amplitude amplification algorithm for non-boolean functions is iterative and consists of thefollowing steps:(1) Initialize the two-register system in the | ๐ฟ โฉ state.(2) Perform ๐พ iterations: During the odd iterations, apply the operation S ๐ฟ U ๐ on the system.During the even iterations, apply S ๐ฟ U โ ๐ on the system.(3) After the ๐พ iterations, measure the ancilla (first register) in the 0/1 basis.Up to a certain number of iterations, the iterative steps are designed to amplify the amplitude ofthe basis states | , ๐ฅ โฉ and | , ๐ฅ โฉ with lower values of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . The measurement of the ancilla at on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 7 Odd iterations Even iterations . . . . . . register 1(ancilla) : |+โฉ U ๐ S ๐ฟ U โ ๐ S ๐ฟ (ignored)register 2: | ๐ โฉ Final state
Fig. 4. Quantum circuit for the non-boolean amplitude amplification algorithm.
Algorithm 1
Non-boolean amplitude amplification algorithm of Section 2. initialize | ๐ฟ โฉ : = | ๐ฟ โฉ for ๐ : = to ๐พ do if ๐ is odd then update | ๐ฟ โฉ : = S ๐ฟ U ๐ | ๐ฟ โฉ else update | ๐ฟ โฉ : = S ๐ฟ U โ ๐ | ๐ฟ โฉ end if end for Measure the ancilla in the 0/1 basis.the end of the algorithm is performed simply to ensure that the two registers will not be entangledin the final state of the system. The quantum circuit and the pseudocode for the algorithm areshown in Figure 4 and Algorithm 1, respectively. For pedagogical reasons, the specification of ๐พ ,the number of iterations to perform, has been deferred to Section 3, which contains an analysis ofthe algorithm. From (20) and (23), it can be seen that for the boolean oracle case given by ๐ ( ๐ฅ ) = ๐ ๐ bool ( ๐ฅ ) , U ๐ and U โ ๐ both reduce to ๐ผ โ ^ ๐ ๐ bool , where ^ ๐ ๐ bool is the oracle used in the boolean amplitude amplificationalgorithm. Furthermore, if the first register is in the |+โฉ state, from (3) and (17), the action of S ๐ฟ isgiven by S ๐ฟ (cid:104) |+โฉ โ | ๐ โฉ (cid:105) = |+โฉ โ (cid:104) ๐ ๐ | ๐ โฉ (cid:105) . (26)Note that the first register is unaffected here. Thus, for the boolean oracle case, Algorithm 1 reducesto simply acting ๐ ๐ ^ ๐ ๐ bool on the second register during each iterationโthe ancilla qubit remainsuntouched and unentangled from the second register. In this way, the algorithm presented in thissection is a generalization of the boolean amplitude amplification algorithm described in Section 1.The two key differences of the generalized algorithm from the boolean one, apart from the usageof a non-boolean oracle, are(1) The addition of the ancilla, which doubles the dimension of the state space of the system, and(2) Alternating between using U ๐ and U โ ๐ during the odd and even iterations.The motivation for these modifications will be provided in Section 3.1 and Section 3.2, respectively. Prasanth Shyamsundar
Let | ๐ฟ ๐ โฉ be the state of the two-register system after ๐ = , , . . . , ๐พ iterations of the amplitudeamplification algorithm (but before the measurement of the ancilla). For ๐ > , | ๐ฟ ๐ โฉ can berecursively written as | ๐ฟ ๐ โฉ โก ๏ฃฑ๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃณ S ๐ฟ U ๐ | ๐ฟ ๐ โ โฉ , if ๐ is odd , S ๐ฟ U โ ๐ | ๐ฟ ๐ โ โฉ , if ๐ is even . (27)Let ห ๐ ๐ ( , ๐ฅ ) and ห ๐ ๐ ( , ๐ฅ ) be the normalized amplitudes of the basis states | , ๐ฅ โฉ and | , ๐ฅ โฉ , respec-tively, in the superposition | ๐ฟ ๐ โฉ . | ๐ฟ ๐ โฉ โก ๐ โ๏ธ ๐ฅ = (cid:104) ห ๐ ๐ ( , ๐ฅ ) | , ๐ฅ โฉ + ห ๐ ๐ ( , ๐ฅ ) | , ๐ฅ โฉ (cid:105) . (28)In the initial state | ๐ฟ โฉ , the amplitudes ห ๐ ( , ๐ฅ ) and ห ๐ ( , ๐ฅ ) are both given, from (16), by ห ๐ ( , ๐ฅ ) = ห ๐ ( , ๐ฅ ) = ๐ ( ๐ฅ )โ . (29)Let the parameter ๐ โ [ , ๐ ] be implicitly defined by cos ( ๐ ) โก ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . (30) cos ( ๐ ) is the expected value of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) over bitstrings ๐ฅ sampled by measuring the state | ๐ โฉ .Let the two-register states | ๐ถ โฉ and | ๐ท โฉ be defined as | ๐ถ โฉ โก U ๐ | ๐ฟ โฉ , (31) | ๐ท โฉ โก U โ ๐ | ๐ฟ โฉ . (32)They will be used to track the evolution of the system through the iterative steps of the algorithm.Using (16), (20), and (23), | ๐ถ โฉ and | ๐ท โฉ can be written as | ๐ถ โฉ = โ ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) (cid:104) ๐ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ + ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ (cid:105) , (33) | ๐ท โฉ = โ ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) (cid:104) ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ + ๐ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ (cid:105) . (34)Note that ๐ , | ๐ถ โฉ , and | ๐ท โฉ are all implicitly dependent on the function ๐ and the initial state | ๐ โฉ .For notational convenience, these dependencies are not explicitly indicated. After one iterative step, the system will be in state | ๐ฟ โฉ given by | ๐ฟ โฉ = S ๐ฟ U ๐ | ๐ฟ โฉ . (35)Using (17) and (31), this can be written as | ๐ฟ โฉ = S ๐ฟ | ๐ถ โฉ = โจ ๐ฟ | ๐ถ โฉ | ๐ฟ โฉ โ | ๐ถ โฉ . (36)From (16), (30), and (33), โจ ๐ฟ | ๐ถ โฉ = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) (cid:104) ๐ ๐๐ ( ๐ฅ ) โจ , ๐ฅ | , ๐ฅ โฉ + ๐ โ ๐๐ ( ๐ฅ ) โจ , ๐ฅ | , ๐ฅ โฉ (cid:105) (37a) on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 9 = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) (cid:104) ๐ ๐๐ ( ๐ฅ ) + ๐ โ ๐๐ ( ๐ฅ ) (cid:105) (37b) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) (cid:0) ๐ ( ๐ฅ ) (cid:1) = cos ( ๐ ) . (37c)Note that โจ ๐ฟ | ๐ถ โฉ is real-valued. This fact is crucial to the functioning of the algorithm, as we willsee later in this subsection. The motivation behind adding an ancilla qubit, effectively doubling thenumber of basis states, is precisely to make โจ ๐ฟ | ๐ถ โฉ real-valued.From (36) and (37), | ๐ฟ โฉ can be written as | ๐ฟ โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ถ โฉ . (38)From (16) and (33), the amplitude ห ๐ ( , ๐ฅ ) of the basis state | , ๐ฅ โฉ in the superposition | ๐ฟ โฉ can bewritten as ห ๐ ( , ๐ฅ ) = โจ , ๐ฅ | ๐ฟ โฉ = ๐ ( ๐ฅ )โ (cid:104) ( ๐ ) โ ๐ ๐๐ ( ๐ฅ ) (cid:105) . (39)Likewise, the amplitude ห ๐ ( , ๐ฅ ) of the basis state | , ๐ฅ โฉ can be written as ห ๐ ( , ๐ฅ ) = โจ , ๐ฅ | ๐ฟ โฉ = ๐ ( ๐ฅ )โ (cid:104) ( ๐ ) โ ๐ โ ๐๐ ( ๐ฅ ) (cid:105) . (40)From (39) and (40), it can be seen that after one iterative step, the amplitudes of | , ๐ฅ โฉ and | , ๐ฅ โฉ have acquired factors of (cid:2) ( ๐ ) โ ๐ ๐๐ ( ๐ฅ ) (cid:3) and (cid:2) ( ๐ ) โ ๐ โ ๐๐ ( ๐ฅ ) (cid:3) , respectively. Now, (cid:12)(cid:12) ห ๐ ( , ๐ฅ ) (cid:12)(cid:12) (cid:12)(cid:12) ห ๐ ( , ๐ฅ ) (cid:12)(cid:12) = (cid:12)(cid:12) ห ๐ ( , ๐ฅ ) (cid:12)(cid:12) (cid:12)(cid:12) ห ๐ ( , ๐ฅ ) (cid:12)(cid:12) = ( ๐ ) + โ ( ๐ ) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . (41)This shows that if cos ( ๐ ) is positive, the magnitude of the โamplitude amplification factorโ afterone iteration is monotonically decreasing in cos ( ๐ ) . This preferential amplification of states withlower values of cos ( ๐ ) is precisely what the algorithm set out to do.Note that this monotonicity property relies crucially on โจ ๐ฟ | ๐ถ โฉ being real-valued in (36). If โจ ๐ฟ | ๐ถ โฉ is complex, with a phase ๐ฟ โ { , ๐ } , then the amplification will be monotonic in cos ( ๐ โ ๐ฟ ) ,which does not meet the present goal of the algorithm. The case where โจ ๐ฟ | ๐ถ โฉ is not real-valuedis explored further in Section 6. Equations (16), (17), (20), (23), (31), and (32) can be used to derive the following identities, whichcapture the actions of the operators S ๐ฟ , U ๐ , and U โ ๐ on the states | ๐ฟ โฉ , | ๐ถ โฉ , and | ๐ท โฉ : S ๐ฟ | ๐ฟ โฉ = | ๐ฟ โฉ , (42) S ๐ฟ | ๐ถ โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ถ โฉ , (43) S ๐ฟ | ๐ท โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ท โฉ , (44) U ๐ | ๐ฟ โฉ = | ๐ถ โฉ , (45) U ๐ | ๐ถ โฉ = โ ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) (cid:104) ๐ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ + ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ (cid:105) , (46) U ๐ | ๐ท โฉ = | ๐ฟ โฉ , (47) U โ ๐ | ๐ฟ โฉ = | ๐ท โฉ , (48) U โ ๐ | ๐ถ โฉ = | ๐ฟ โฉ , (49) Subspace spannedby | ๐ฟ โฉ and | ๐ท โฉ Subspace spannedby | ๐ฟ โฉ and | ๐ถ โฉ odd iterationseven iterations Fig. 5. Illustration depicting the evolution of the state of two-register system through the iterations of thenon-boolean amplitude amplification algorithm. U โ ๐ | ๐ท โฉ = โ ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) (cid:104) ๐ โ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ + ๐ ๐๐ ( ๐ฅ ) | , ๐ฅ โฉ (cid:105) . (50)We can see that the subspace spanned by the states | ๐ฟ โฉ , | ๐ถ โฉ , and | ๐ท โฉ is almost stable under theaction of S ๐ฟ , U ๐ , and U โ ๐ . Only the actions of U ๐ on | ๐ถ โฉ and U โ ๐ on | ๐ท โฉ can take the state of thesystem out of this subspace. The motivation behind alternating between using U ๐ and U โ ๐ duringthe odd and the even iterations is to keep the state of the system within the subspace spanned by | ๐ฟ โฉ , | ๐ถ โฉ , and | ๐ท โฉ .From the identities above, we can write the following expressions capturing the relevant actionsof the odd iteration operator S ๐ฟ U ๐ and the even iteration operator S ๐ฟ U โ ๐ : S ๐ฟ U ๐ | ๐ฟ โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ถ โฉ , (51) S ๐ฟ U ๐ | ๐ท โฉ = | ๐ฟ โฉ , (52) S ๐ฟ U โ ๐ | ๐ฟ โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ท โฉ , (53) S ๐ฟ U โ ๐ | ๐ถ โฉ = | ๐ฟ โฉ . (54)From these expressions, it can be seen that the odd iteration operator S ๐ฟ U ๐ maps any state in thespace spanned by | ๐ฟ โฉ and | ๐ท โฉ to a state in the space spanned by | ๐ฟ โฉ and | ๐ถ โฉ . Conversely, theeven iteration operator S ๐ฟ U โ ๐ maps any state in the space spanned by | ๐ฟ โฉ and | ๐ถ โฉ to a state inthe space spanned by | ๐ฟ โฉ and | ๐ท โฉ . Since the algorithm begins with the system initialized in thestate | ๐ฟ โฉ , it can be seen that the state of the system oscillates between the two subspaces duringthe odd and even iterations, as depicted in Figure 5. ๐ Iterations
Using (27) and (51โ54), the state | ๐ฟ ๐ โฉ of the two-register system after ๐ โฅ iterations can bewritten, in matrix multiplication notation, as | ๐ฟ ๐ โฉ = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ (cid:104) | ๐ฟ โฉ | ๐ถ โฉ (cid:105) ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ( ๐ ) โ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป ๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป , if ๐ is odd , (cid:104) | ๐ฟ โฉ | ๐ท โฉ (cid:105) ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ( ๐ ) โ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป ๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป , if ๐ is even . (55) on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 11 As shown in Appendix A, (55) can be simplified to | ๐ฟ ๐ โฉ = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) | ๐ฟ โฉ โ sin ( ๐๐ ) | ๐ถ โฉ (cid:105) , if ๐ is odd , ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) | ๐ฟ โฉ โ sin ( ๐๐ ) | ๐ท โฉ (cid:105) , if ๐ is even . (56) ๐ Iterations
From (16), (33), (34), and (56), the amplitudes ห ๐ ๐ ( , ๐ฅ ) of the basis states | , ๐ฅ โฉ after ๐ โฅ iterationscan be written as ห ๐ ๐ ( , ๐ฅ ) = โจ , ๐ฅ | ๐ฟ ๐ โฉ = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ is odd ,๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ โ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ is even . (57)Similarly, the amplitudes ห ๐ ๐ ( , ๐ฅ ) of the basis states | , ๐ฅ โฉ can be written as ห ๐ ๐ ( , ๐ฅ ) = โจ , ๐ฅ | ๐ฟ ๐ โฉ = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ โ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ is odd ,๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ is even . (58)These expressions can be summarized, for ๐ โ { , } , as ห ๐ ๐ ( ๐, ๐ฅ ) = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ + ๐ is odd ,๐ ( ๐ฅ )โ ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๐ โ ๐๐ ( ๐ฅ ) (cid:105) , if ๐ + ๐ is even . (59) Amplitudes After Ancilla Measurement.
Note that the magnitudes of the amplitudes of the states | , ๐ฅ โฉ and | , ๐ฅ โฉ are equal, i.e., (cid:12)(cid:12) ห ๐ ๐ ( , ๐ฅ ) (cid:12)(cid:12) = (cid:12)(cid:12) ห ๐ ๐ ( , ๐ฅ ) (cid:12)(cid:12) , (60)for all ๐ โฅ and ๐ฅ โ { , , . . . , ๐ โ } . So, a measurement of the ancilla qubit in the first register after ๐พ iterations will yield a value of either 0 or 1 with equal probability. Let (cid:12)(cid:12) ๐ ๐พ,๐ (cid:11) be the normalizedstate of the second register after performing ๐พ iterations, followed by a measurement of the ancillaqubit, which yields a value ๐ โ { , } . (cid:12)(cid:12) ๐ ๐พ,๐ (cid:11) can be written as (cid:12)(cid:12) ๐ ๐พ,๐ (cid:11) = ๐ โ โ๏ธ ๐ฅ = ๐ ๐พ,๐ ( ๐ฅ ) | ๐ฅ โฉ , (61)where ๐ ๐พ,๐ ( ๐ฅ ) are the normalized amplitudes of the basis states of the second register (afterperforming ๐พ iterations and the measurement of the ancilla). ๐ ๐พ,๐ ( ๐ฅ ) is simply given by ๐ ๐พ,๐ ( ๐ฅ ) = โ ๐ ๐พ ( ๐, ๐ฅ ) . (62)Much of the following discussion holds a) regardless of whether or not a measurement is performedon the ancilla qubit after the ๐พ iterations, and b) regardless of the value yielded by the ancillameasurement (if performed)โthe primary goal of measuring the ancilla is simply to make the tworegisters unentangled from each other. ๐พ Iterations
Let ๐ ๐พ ( ๐ฅ ) be the probability for a measurement of the second register after ๐พ โฅ iterations toyield ๐ฅ . It can be written in terms of the amplitudes in Section 3.4 as ๐ ๐พ ( ๐ฅ ) = (cid:104)(cid:12)(cid:12) ห ๐ ๐พ ( , ๐ฅ ) (cid:12)(cid:12) + (cid:12)(cid:12) ห ๐ ๐พ ( , ๐ฅ ) (cid:12)(cid:12) (cid:105) = (cid:12)(cid:12) ๐ ๐พ, ( ๐ฅ ) (cid:12)(cid:12) = (cid:12)(cid:12) ๐ ๐พ, ( ๐ฅ ) (cid:12)(cid:12) . (63)This expression shows that the probability ๐ ๐พ ( ๐ฅ ) depends neither on whether the ancilla wasmeasured, nor on the result of the ancilla measurement (if performed). From (59), ๐ ๐พ ( ๐ฅ ) can bewritten as ๐ ๐พ ( ๐ฅ ) = ๐ ( ๐ฅ ) sin ( ๐ ) (cid:12)(cid:12)(cid:12) sin (cid:0) ( ๐พ + ) ๐ (cid:1) โ sin ( ๐พ๐ ) ๐ ๐๐ ( ๐ฅ ) (cid:12)(cid:12)(cid:12) (64) = ๐ ( ๐ฅ ) sin ( ๐ ) (cid:104) sin ( ๐พ๐ ) + sin (cid:0) ( ๐พ + ) ๐ (cid:1) โ ( ๐พ๐ ) sin (cid:0) ( ๐พ + ) ๐ (cid:1) cos (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:105) . (65)It can be seen here that the probability amplification factor ๐ ๐พ ( ๐ฅ )/ ๐ ( ๐ฅ ) is monotonic in cos (cid:0) ๐ ( ๐ฅ ) (cid:1) for all ๐พ โฅ . The following trigonometric identities, proved in Appendix B, help elucidate the ๐พ dependence of this amplification factor: sin ( ๐ถ ) + sin ( ๐ถ + ๐ท ) = sin ( ๐ท ) + ( ๐ถ ) sin ( ๐ถ + ๐ท ) cos ( ๐ท ) , (66) ( ๐ถ ) sin ( ๐ถ + ๐ท ) = cos ( ๐ท ) โ cos ( ๐ถ + ๐ท ) . (67)Setting ๐ถ = ๐พ๐ and ๐ท = ๐ , these identities can be used to rewrite (65) as ๐ ๐พ ( ๐ฅ ) = ๐ ( ๐ฅ ) (cid:110) โ ๐ ๐พ (cid:104) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โ cos ( ๐ ) (cid:105) (cid:111) , (68)where the ๐พ -dependent factor ๐ ๐พ is given by ๐ ๐พ โก ( ๐พ๐ ) sin (cid:0) ( ๐พ + ) ๐ (cid:1) sin ( ๐ ) = cos ( ๐ ) โ cos (cid:0) ( ๐พ + ) ๐ (cid:1) sin ( ๐ ) . (69)For notational convenience, the fact that ๐ ๐พ depends on ๐ is not explicitly indicated. The result in(68) can be summarized as follows: โข Applying ๐พ iterations of the non-boolean amplitude amplification algorithm changes theprobability of measuring ๐ฅ by a factor that is a linear function of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . If the secondregister is initially in an equiprobable state, i.e., if ๐ ( ๐ฅ ) = constant , then the probability ๐ ๐พ ( ๐ฅ ) after ๐พ iterations is itself a linear function of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . โข If cos (cid:0) ๐ ( ๐ฅ ) (cid:1) = cos ( ๐ ) for some ๐ฅ , the probability of a measurement of the second registeryielding that ๐ฅ is unaffected by the algorithm. โข The slope of the linear dependence is โ ๐ ๐พ . โ If ๐ ๐พ is positive, the states with cos ( ๐ ) < cos ( ๐ ) are amplified. Conversely, if ๐ ๐พ is negative,states with cos ( ๐ ) > cos ( ๐ ) are amplified. โ The magnitude of ๐ ๐พ controls the degree to which the preferential amplification has beenperformed.From (69), it can be seen that ๐ ๐พ is an oscillatory function of ๐พ , centered around cos ( ๐ )/ sin ( ๐ ) ,with an amplitude of / sin ( ๐ ) and a period of ๐ / ๐ . Recalling from (30) that ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) = cos ( ๐ ) = ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) cos ( ๐ ) , (70)one can verify that for any ๐พ โฅ , the probabilities ๐ ๐พ ( ๐ฅ ) from (68) add up to 1. on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 13 From the definition of ๐ ๐พ in (69), it can be seen that for all ๐พ , ๐ ๐พ is bounded from above by ๐ optimal defined as ๐ ๐พ โค ๐ optimal โก cos ( ๐ ) + ( ๐ ) = โ cos ( ๐ ) . (71)The ๐ ๐พ = ๐ optimal case represents the maximal preferential amplification of lower values of cos ( ๐ ) achievable by the algorithm. Let ๐ optimal ( ๐ฅ ) be the state probability function corresponding to ๐ ๐พ = ๐ optimal . From (68), ๐ optimal ( ๐ฅ ) = ๐ ( ๐ฅ ) (cid:20) โ cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โ cos ( ๐ ) โ cos ( ๐ ) (cid:21) . (72)It is interesting to note that ๐ optimal ( ๐ฅ ) = for inputs ๐ฅ with the highest possible value of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) ,namely 1. In other words, ๐ optimal reaches the limit set by the non-negativity of probabilities, inthe context of the algorithm under consideration. In the description of the algorithm in Section 2, the number of iterations ๐พ to perform was leftunspecified. Armed with (69), this aspect of the algorithm can now be tackled. Higher values of ๐ ๐พ are preferable for the purposes of this paper, namely to preferentially amplify lower values of cos ( ๐ ) . From (69), it can be seen that ๐ ๐พ is monotonically increasing for ๐พ = , , . . . as long as โค ( ๐พ + ) ๐ โค ๐ + ๐ or, equivalently, for โค ๐พ โค (cid:106) ๐ ๐ (cid:107) , (73)where โ ๐ฃ โ denotes the floor of ๐ฃ . As with the boolean amplitude amplification algorithm of Ref. [5],a good approach is to stop the algorithm just before the first iteration that, if performed, wouldcause value of ๐ ๐พ to decrease (from its value after the previous iteration). This leads to the choice ห ๐พ for the number of iterations to perform, given by ห ๐พ = (cid:106) ๐ ๐ (cid:107) . (74)The corresponding value of ๐ ๐พ for ๐พ = ห ๐พ is given by ๐ ห ๐พ = ( ๐ ) (cid:104) cos ( ๐ ) โ cos (cid:16) (cid:106) ๐ ๐ (cid:107) ๐ + ๐ (cid:17) (cid:105) . (75)The choice ห ๐พ in (74) for the number of iterations offers an amplification iff ๐ > ๐ > or,equivalently, iff < cos ( ๐ ) < . At one of the extremes, namely ๐ = ๐ / , we have ๐ ห ๐พ = . Theother extreme, namely cos ( ๐ ) = , corresponds to every state ๐ฅ with a non-zero amplitude in theinitial state | ๐ โฉ having cos (cid:0) ๐ ( ๐ฅ ) (cid:1) = ; there is no scope for preferential amplification in this case.From (75), it can be seen that ๐ ห ๐พ exactly equals ๐ optimal defined in (71) if ๐ /( ๐ ) is a half-integer.In terms of ๐ , this condition can be written as ๐ โ (cid:110) ๐ , ๐ , ๐ , . . . (harmonic progression) (cid:111) โ ๐ ห ๐พ = ๐ optimal . (76)For generic values of ๐ , from (75), it can be seen that ๐ ห ๐พ satisfies ( ๐ ) sin ( ๐ ) โค ๐ ห ๐พ โค ๐ optimal = cos ( ๐ ) + ( ๐ ) . (77)This can be rewritten as ๐ optimal (cid:104) โ tan ( ๐ / ) (cid:105) โค ๐ ห ๐พ โค ๐ optimal , (78) using the following identity: ( ๐ ) cos ( ๐ ) + = (cid:104) cos ( ๐ / ) โ sin ( ๐ / ) (cid:105) ( ๐ / ) โ + = โ tan ( ๐ / ) . (79)From (78), it can be seen that for small ๐ , ๐ ห ๐พ is approximately equal to ๐ optimal , within an O ( ๐ ) relative error. cos ( ๐ ) After ๐พ Iterations
Let ๐ ( ๐ ) ๐พ be the ๐ -th raw moment of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) for a random value of ๐ฅ sampled by measuring thesecond register after ๐พ iterations. ๐ ( ๐ ) ๐พ โก ๐ โ โ๏ธ ๐ฅ = ๐ ๐พ ( ๐ฅ ) cos ๐ (cid:0) ๐ ( ๐ฅ ) (cid:1) . (80)Under this notation, ๐ ( ) is simply cos ( ๐ ) . From (68), we can write ๐ ( ๐ ) ๐พ in terms of the initialmoments ( ๐พ = ) as ๐ ( ๐ ) ๐พ = ๐ โ โ๏ธ ๐ฅ = ๐ ( ๐ฅ ) cos ๐ (cid:0) ๐ ( ๐ฅ ) (cid:1) (cid:104) โ ๐ ๐พ (cid:104) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โ cos ( ๐ ) (cid:105) (cid:105) (81a) = ๐ ( ๐ ) โ ๐ ๐พ (cid:104) ๐ ( ๐ + ) โ ๐ ( ๐ ) ๐ ( ) (cid:105) . (81b)In particular, let ๐ ๐พ and ๐ ๐พ represent the expected value and variance, respectively, of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) after ๐พ iterations. ๐ ๐พ โก ๐ ( ) ๐พ , (82) ๐ ๐พ โก ๐ ( ) ๐พ โ (cid:104) ๐ ( ) ๐พ (cid:105) . (83)Now, the result in (81) for ๐ = can be written as ๐ ๐พ โ ๐ = โ ๐ ๐พ ๐ . (84)For ๐ ๐พ > , this equation captures the reduction in the expected value of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) resulting from ๐พ iterations of the algorithm. cos ( ๐ ) After ๐พ Iterations
Let ๐น cos ๐พ ( ๐ฆ ) be the probability that cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โค ๐ฆ , for an ๐ฅ sampled as per the probability distribution ๐ ๐พ . ๐น cos ๐พ is the cumulative distribution function of cos ( ๐ ) for a measurement after ๐พ iterations, andcan be written as ๐น cos ๐พ ( ๐ฆ ) = ๐ โ โ๏ธ ๐ฅ = (cid:104) ๐ ๐พ ( ๐ฅ ) [ , โ) (cid:2) ๐ฆ โ cos (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:3) (cid:105) , (85) โ ๐น cos ๐พ ( ๐ฆ ) = ๐ โ โ๏ธ ๐ฅ = (cid:104) ๐ ๐พ ( ๐ฅ ) (cid:16) โ [ , โ) (cid:2) ๐ฆ โ cos (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:3) (cid:17) (cid:105) , (86)where [ , โ) is the Heaviside step function, which equals when its argument is negative and when its argument is non-negative. Using the expression for ๐ ๐พ in (68), these can be written as ๐น cos ๐พ ( ๐ฆ ) = ๐น cos0 ( ๐ฆ ) (cid:16) + ๐ ๐พ ๐ (cid:17) โ ๐ ๐พ ๐ โ โ๏ธ ๐ฅ = (cid:110) ๐ ( ๐ฅ ) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) [ , โ) (cid:2) ๐ฆ โ cos (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:3) (cid:111) , (87) on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 15 โ ๐น cos ๐พ ( ๐ฆ ) = (cid:16) โ ๐น cos0 ( ๐ฆ ) (cid:17) (cid:16) + ๐ ๐พ ๐ (cid:17) โ ๐ ๐พ ๐ โ โ๏ธ ๐ฅ = (cid:110) ๐ ( ๐ฅ ) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) (cid:104) โ [ , โ) (cid:2) ๐ฆ โ cos (cid:0) ๐ ( ๐ฅ ) (cid:1)(cid:3) (cid:105) (cid:111) . (88)Every ๐ฅ that provides a non-zero contribution to the summation in (87) satisfies cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โค ๐ฆ .This fact can be used to write ๐ ๐พ โฅ โ ๐น cos ๐พ ( ๐ฆ ) โฅ ๐น cos0 ( ๐ฆ ) (cid:16) + ๐ ๐พ (cid:0) ๐ โ ๐ฆ (cid:1)(cid:17) . (89)Likewise, every ๐ฅ that provides a non-zero contribution to the summation in (88) satisfies cos (cid:0) ๐ ( ๐ฅ ) (cid:1) > ๐ฆ . This can be used to write ๐ ๐พ โฅ โ โ ๐น cos ๐พ ( ๐ฆ ) โค (cid:16) โ ๐น cos0 ( ๐ฆ ) (cid:17) (cid:16) + ๐ ๐พ (cid:0) ๐ โ ๐ฆ (cid:1)(cid:17) . (90)The inequalities in (89) and (90) can be summarized as ๐ ๐พ โฅ โ ๐น cos ๐ ( ๐ฆ ) โฅ ๐น cos0 ( ๐ฆ ) + ๐ ๐พ max (cid:110) ๐น cos0 ( ๐ฆ ) (cid:0) ๐ โ ๐ฆ (cid:1) , (cid:16) โ ๐น cos0 ( ๐ฆ ) (cid:17) (cid:0) ๐ฆ โ ๐ (cid:1)(cid:111) , (91)where the max function represents the maximum of its two arguments. This equation provides alower bound on the probability that a measurement after ๐พ iterations yields a state whose cos ( ๐ ) value is no higher than ๐ฆ . It may be possible to derive stronger bounds (or even the exact expression)for ๐น cos ๐พ ( ๐ฆ ) if additional information is known about the initial distribution of cos ( ๐ ) . For ๐ฆ โค ๐ ,the first argument of the max function in (91) will be active, and for ๐ฆ โฅ ๐ , the second argumentwill be active.For the ๐ ๐พ โค case, it can similarly be shown that ๐ ๐พ โค โ ๐น cos ๐พ ( ๐ฆ ) โค ๐น cos0 ( ๐ฆ ) + ๐ ๐พ min (cid:110) ๐น cos0 ( ๐ฆ ) (cid:0) ๐ โ ๐ฆ (cid:1) , (cid:16) โ ๐น cos0 ( ๐ฆ ) (cid:17) (cid:0) ๐ฆ โ ๐ (cid:1)(cid:111) , (92)where the min function represents the minimum of its two arguments. The result in Section 3.6 for the heuristic choice for the number of iterations, namely ห ๐พ = โ ๐ /( ๐ )โ ,might be reminiscent of the analogous result for the boolean amplitude amplification algorithm inRef. [5], namely โ ๐ /( ๐ ๐ )โ . The similarity between the two results is not accidental. To see this,consider the parameter ๐ in the boolean oracle case, say ๐ bool . Let ๐ good0 be the probability for ameasurement on the initial state | ๐ โฉ to yield a winning state. From (30), cos ( ๐ bool ) = (cid:104) โ ร ๐ good0 (cid:105) + (cid:104) ร (cid:16) โ ๐ good0 (cid:17)(cid:105) = โ ๐ good0 , (93) โ sin ( ๐ bool / ) = ๐ good0 . (94)Thus, in the boolean oracle case โข sin ( ๐ / ) reduces to the initial probability of โsuccessโ (measuring a winning state), whichis captured by sin ( ๐ ๐ ) in Ref. [5], and โข The parameter ๐ used in this paper reduces to the parameter ๐ ๐ used in Ref. [5], and โ ๐ /( ๐ )โ reduces to โ ๐ /( ๐ ๐ )โ .In this way, the results of Section 3 in general, and Section 3.6 in particular, can be seen asgeneralizations of the corresponding results in Ref. [5]. Q iter (single iteration) . . . . . . register 1(ancilla) : |+โฉ ๐ U ๐ S ๐ฟ (ignored)register 2: | ๐ โฉ Final state
Fig. 6. Quantum circuit for the alternative formulation, in Section 3.10, of the non-boolean amplitudeamplification algorithm.
Algorithm 2
Alternative formulation, in Section 3.10, of the non-boolean amplitude amplificationalgorithm. initialize | ๐ฟ โฉ : = | ๐ฟ โฉ for ๐ : = to ๐พ do update | ๐ฟ โฉ : = S ๐ฟ U ๐ [ ๐ โ ๐ผ ] | ๐ฟ โฉ end for Measure the ancilla in the 0/1 basis.
In the formulation of the non-boolean amplitude amplification algorithm in Section 2, an ancillaqubit (first register) was included solely for the purpose of making the quantity (cid:10) ๐ฟ (cid:12)(cid:12) U ๐ (cid:12)(cid:12) ๐ฟ (cid:11) = โจ ๐ฟ | ๐ถ โฉ real-valued. If, in a particular use case, it is guaranteed that (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) will be real-valued(or have a negligible imaginary part ) even without introducing the ancilla, then the algorithmdescribed in Section 2 can be used without the ancilla: alternate between applying ๐ ๐ ๐ ๐ during theodd iterations and ๐ ๐ ๐ โ ๐ during the even iterations. In other words, the properties and structure oftwo-register system were not exploited in the algorithm description, beyond making (cid:10) ๐ฟ (cid:12)(cid:12) U ๐ (cid:12)(cid:12) ๐ฟ (cid:11) real-valued.However, from (33) and (34), it can be seen that the states | ๐ถ โฉ = U ๐ | ๐ฟ โฉ and | ๐ท โฉ = U โ ๐ | ๐ฟ โฉ arerelated by | ๐ท โฉ = [ ๐ โ ๐ผ ] | ๐ถ โฉ , | ๐ถ โฉ = [ ๐ โ ๐ผ ] | ๐ท โฉ , (95)where ๐ is the bit-flip or the Pauli-X operator. This can be exploited to avoid having two separatecasesโ ๐ being odd and evenโin the final expression for | ๐ฟ ๐ โฉ in (56). The expression for both casescan be made the same by acting the Pauli-X gate on the ancilla, once at the end, if the total numberof iterations is even.More interestingly, the relationship between | ๐ถ โฉ and | ๐ท โฉ can be used to avoid having two differentoperations in the first place, for the odd and even iterations. This leads to the following alternativeformulation of the non-boolean amplitude amplification algorithm: During each iteration, odd oreven, act the same operator Q iter defined by Q iter โก S ๐ฟ U ๐ [ ๐ โ ๐ผ ] . (96)This alternative formulation is depicted as a circuit in Figure 2 and as a pseudocode in Algorithm 2. This could be achieved, e.g, by replacing the function ๐ ( ๐ฅ ) with ๐ โฒ ( ๐ฅ ) = ๐ ( ๐ฅ ) ๐ ( ๐ฅ ) , where ๐ : { , , . . . ๐ โ } โ {โ , + } is a random function independent of ๐ ( ๐ฅ ) , with mean (for ๐ฅ sampled by measuring | ๐ โฉ ). on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 17 From (51), (52), and (95), the action of Q iter on | ๐ฟ โฉ and | ๐ถ โฉ can be derived as follows: Q iter | ๐ฟ โฉ = S ๐ฟ U ๐ | ๐ฟ โฉ = ( ๐ ) | ๐ฟ โฉ โ | ๐ถ โฉ , (97) Q iter | ๐ถ โฉ = S ๐ฟ U ๐ | ๐ท โฉ = | ๐ฟ โฉ . (98)Let (cid:12)(cid:12) ๐ฟ alt ๐ (cid:11) be the state of the two-register system after ๐ iterations under this alternative formulation(before any measurement of the ancilla). (cid:12)(cid:12) ๐ฟ alt ๐ (cid:11) โก Q ๐ iter | ๐ฟ โฉ . (99)Using similar manipulations as in Appendix A, (cid:12)(cid:12) ๐ฟ alt ๐ (cid:11) can be expressed, for all ๐ โฅ , as (cid:12)(cid:12) ๐ฟ alt ๐ (cid:11) = ( ๐ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ (cid:1) | ๐ฟ โฉ โ sin ( ๐๐ ) | ๐ถ โฉ (cid:105) . (100)Note that this expression for (cid:12)(cid:12) ๐ฟ alt ๐ (cid:11) is almost identical to the expression for | ๐ฟ ๐ โฉ in (56), but withouttwo separate cases for the odd and even values of ๐ . Much of the analysis of the original formulationof the algorithm in Section 3 holds for the alternative formulation as well, including the expressionsfor the state probabilities ๐ ๐พ ( ๐ฅ ) , mean ๐ ๐พ , raw moments ๐ ( ๐ ) ๐พ , and the cumulative distributionfunction ๐น cos ๐พ .In addition to simplifying the amplification algorithm (by using the same operation for everyiteration), the Q iter operator used in this subsection allows for a clearer presentation of the quantummean estimation algorithm, which will be introduced next. The goal of the quantum mean estimation algorithm is to estimate the expected value of ๐ ๐๐ ( ๐ฅ ) for ๐ฅ sampled by measuring a given superposition state | ๐ โฉ . Let ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) denote this expected value. ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) โก (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) ๐ ๐๐ ( ๐ฅ ) . (101)This can be written as ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) = Re (cid:104) ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) (cid:105) + ๐ Im (cid:104) ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) (cid:105) , (102)where the real and imaginary parts are given by Re (cid:104) ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) (cid:105) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) cos (cid:0) ๐ ( ๐ฅ ) (cid:1) , (103) Im (cid:104) ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) (cid:105) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) sin (cid:0) ๐ ( ๐ฅ ) (cid:1) . (104)The mean estimation can 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 ( ๐ ) underthe state | ๐ โฉ is precisely cos ( ๐ ) defined in (30). cos ( ๐ ) The connection shown in Section 3.9 between the parameter ๐ and the parameter ๐ ๐ used inRef. [5] serves as the intuition behind the quantum mean estimation algorithm of this paper. Inthe amplitude estimation algorithm of Ref. [5], the parameter ๐ ๐ is estimated using QPE. Theestimate for ๐ ๐ is then turned into an estimate for the initial winning probability. Likewise, here The estimation of ๐ ๐ is only (needed to be) performed up to a two-fold ambiguity of { ๐ ๐ , ๐ โ ๐ ๐ } . the basic idea is to estimate the parameter ๐ defined in (30) using QPE. The estimate for ๐ canthen be translated into an estimate for the initial expected value of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) , namely cos ( ๐ ) . Therest of this subsection will actualize this intuition into a working algorithm.The key observation is that | ๐ฟ โฉ can be written as | ๐ฟ โฉ = | ๐ผ + โฉ โ | ๐ผ โ โฉโ , (105)where | ๐ผ + โฉ and | ๐ผ โ โฉ are given by | ๐ผ ยฑ โฉ = ๐ ยฑ ๐๐ | ๐ฟ โฉ โ | ๐ถ โฉ ๐ โ ( ๐ ) . (106)The expressions for | ๐ผ + โฉ and | ๐ผ โ โฉ in (106) can be used to verify (105). Crucially, | ๐ผ + โฉ and | ๐ผ โ โฉ areunit normalized eigenstates of the unitary operator Q iter , with eigenvalues ๐ ๐๐ and ๐ โ ๐๐ , respectively. Q iter | ๐ผ ยฑ โฉ = ๐ ยฑ ๐๐ | ๐ผ ยฑ โฉ , (107) โจ ๐ผ ยฑ | ๐ผ ยฑ โฉ = . (108)The properties of | ๐ผ + โฉ and | ๐ผ โ โฉ in (107) and (108) can be verified using (97), (98), and (106), asshown in Appendix C. The observations in (105) and (107) lead to the following algorithm forestimating cos ( ๐ ) :(1) Perform the QPE algorithm with โข the two-register operator Q iter serving the role of the unitary operator under consideration,and โข the superposition state | ๐ฟ โฉ in place of the eigenstate required by the QPE algorithm asinput.Let the output of this step, appropriately scaled to be an estimate of the phase angle in therange [ , ๐ ) , be ^ ๐ .(2) Return cos (cid:0) ^ ๐ (cid:1) as the estimate for cos ( ๐ ) , i.e., the real part of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) . Proof of correctness of the algorithm: | ๐ฟ โฉ is a superposition of the eigenstates | ๐ผ + โฉ and | ๐ผ โ โฉ ofthe unitary operator Q iter . This implies that ^ ๐ will either be an estimate for the phase angle of | ๐ผ + โฉ ,namely ๐ , or an estimate for the phase angle of | ๐ผ โ โฉ , namely ๐ โ ๐ . Since, cos ( ๐ โ ๐ ) = cos ( ๐ ) ,it follows that cos (cid:0) ^ ๐ (cid:1) is an estimate for cos ( ๐ ) . ๐ ๐๐ The algorithm for estimating the expected value of cos ( ๐ ) in the previous subsection can bere-purposed to estimate the expected value of sin ( ๐ ) by using the fact that sin ( ๐ ) = cos ( ๐ โ ๐ / ) . (109) The estimation of ๐ is only (needed to be) performed up to a two-fold ambiguity of { ๐, ๐ โ ๐ } . The forms of the eigenstates | ๐ผ + โฉ and | ๐ผ โ โฉ in (106) can be guessed from the form of the matrix ๐ ๐ in Appendix A. Theycan also be guessed from (100), by rewriting the sin functions in terms of complex exponential functions. If the circuit implementation of Q iter is wrong by an overall (state independent) phase ๐ err , then the estimate for cos ( ๐ ) is cos ( ^ ๐ โ ๐ err ) . This is important, for example, if the operation (cid:2) | , โฉ โจ , | โ I (cid:3) is only implemented up to a factor of โ , i.e., with ๐ err = ๐ . Note that the final state probabilities under the non-boolean amplitude amplification algorithm areunaffected by such an overall phase error. If ๐ = , the phase angle being estimated is for both | ๐ผ + โฉ and | ๐ผ โ โฉ . For ๐ โ , ^ ๐ will be an estimate for either ๐ or ๐ โ ๐ with equal probability , but this detail is not important. Since ๐ lies in [ , ๐ ] and ๐ โ ๐ lies in [ ๐, ๐ ] , the output ^ ๐ can be converted into an estimate for ๐ alone. But this isnot necessary. on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 19 Circuit for U ๐ โ ๐ / register 1(ancilla) U ๐ ๐ ๐ / ๐ ๐ โ ๐ / ๐ register 2 Fig. 7. Quantum circuit for an implementation of U ๐ โ ๐ / using U ๐ . In other words, the imaginary part of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) is the real part of ๐ธ ๐ (cid:2) ๐ ๐ ( ๐ โ ๐ / ) (cid:3) . By using the oracle U ๐ โ ๐ / (for the function ๐ โ ๐ / ), instead of U ๐ , in the mean estimation algorithm of Section 4.1,the imaginary part of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) can also be estimated. This completes the estimation of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) .For concreteness, U ๐ โ ๐ / can be explicitly written as U ๐ โ ๐ / = ๐ โ ๐๐ / | โฉ โจ | โ ๐ ๐ + ๐ ๐๐ / | โฉ โจ | โ ๐ โ ๐ . (110)An implementation of U ๐ โ ๐ / using the oracle U ๐ , the bit-flip operator ๐ , and the phase-shiftoperator ๐ ๐ is shown in Figure 7.Note that the algorithm does not, in any way, use the knowledge that {| โฉ , . . . , | ๐ โ โฉ} is aneigenbasis of ๐ ๐ . So, this algorithm can be used to estimate โจ ๐ | ๐ | ๐ โฉ for any unitary operator ๐ . The speedup offered by the quantum mean estimation algorithm over classical methods will bediscussed here, in the context of estimating the mean of cos ( ๐ ) alone. The discussion can beextended in a straightforward way to the estimation of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) . For an arbitrary function ๐ and a knownsampling distribution ๐ ( ๐ฅ ) for the inputs ๐ฅ , one classical approach to finding the mean of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) is to sequentially query the value of ๐ ( ๐ฅ ) for all the inputs, and use the query results to compute themean. Let the permutation ( ๐ฅ , ๐ฅ , . . . , ๐ฅ ๐ โ ) of the inputs ( , , . . . , ๐ โ ) be the order in whichthe inputs are queried. The range of allowed values of cos ( ๐ ) , based only on results for the first ๐ inputs, is given by (cid:34) ๐ โ โ๏ธ ๐ = ๐ ( ๐ฅ ) cos (cid:0) ๐ ( ๐ฅ ๐ ) (cid:1) โ ๐ โ โ๏ธ ๐ = ๐ ๐ ( ๐ฅ ) (cid:35) โค cos ( ๐ ) โค (cid:34) ๐ โ โ๏ธ ๐ = ๐ ( ๐ฅ ) cos (cid:0) ๐ ( ๐ฅ ๐ ) (cid:1) + ๐ โ โ๏ธ ๐ = ๐ ๐ ( ๐ฅ ) (cid:35) . (111)These bounds are derived by setting the values of cos ( ๐ ) for all the unqueried inputs to their highestand lowest possible values, namely + and โ . The range of allowed values of cos ( ๐ ) shrinks asmore and more inputs are queried. In particular, if ๐ ( ๐ฅ ) is equal for all the inputs ๐ฅ , the widthof the allowed range (based on ๐ queries) is given by ( ๐ โ ๐ )/ ๐ . This strategy will take O ( ๐ ) queries before the width of the allowed range reduces to even, say, 1. Thus, this strategy will notbe feasible for large values of ๐ .A better classical approach is to probabilistically estimate the expected value as follows:(1) Independently sample ๐ random inputs ( ๐ฅ , . . . ๐ฅ ๐ ) as per the distribution ๐ .(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 โผ ๐ /โ ๐ , where ๐ is thestandard deviation of cos ( ๐ ) under the distribution ๐ . Note that one call to the operator Q iter corresponds to O ( ) calls to ๐ด and the oracles ๐ ๐ and ๐ โ ๐ . Let ๐ be the number of times the(controlled) Q iter operation is performed during the QPE subroutine. As ๐ increases, the uncertaintyon the estimate for the phase-angle ๐ (up to a two-fold ambiguity) falls at the rate of O ( / ๐ ) [7].Consequently, the uncertainty on cos ( ๐ ) also falls at the rate of O ( / ๐ ) . This represents a quadraticspeedup over the classical, probabilistic approach, under which the error falls as O ( /โ ๐ ) . Notethat the variance of the estimate for cos ( ๐ ) is independent of a) the size of input space ๐ , and b)the variance ๐ of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) under the distribution ๐ ( ๐ฅ ) . It only depends on the true value of cos ( ๐ ) and the number of queries ๐ performed during the QPE subroutine. In this section, the non-boolean amplitude amplification algorithm and the mean estimationalgorithm will both be demonstrated using a toy example. Let the input to the oracle ๐ ๐ , i.e., thesecond register, contain 8 qubits. This leads to = basis input states, namely | โฉ , . . . , | โฉ .Let the toy function ๐ ( ๐ฅ ) be ๐ ( ๐ฅ ) = ๐ฅ ๐ , for ๐ฅ = , , . . . , . (112)The largest phase-shift applied by the corresponding oracle ๐ ๐ on any basis state is ๐ / , for the state | โฉ . Since, cos (cid:0) ๐ ( ๐ฅ ) (cid:1) is monotonically decreasing in ๐ฅ , the goal of the amplitude amplificationalgorithm is to amplify the probabilities of higher values of ๐ฅ .Let the initial state, from which the amplification is performed, be the uniform superpositionstate | ๐ โฉ . | ๐ โฉ = | ๐ โฉ = โ โ๏ธ ๐ฅ = | ๐ฅ โฉ . (113)Such simple forms for the oracle function and the initial state allow for a good demonstration ofthe algorithms.For this toy example, from (30), cos ( ๐ ) and ๐ are given by cos ( ๐ ) = โ๏ธ ๐ฅ = cos (cid:16) ๐ฅ ๐ (cid:17) โ . , (114) ๐ โ . . (115)Figure 8 shows the value of ๐ ๐พ , from (69), for the first few values of ๐พ . The heuristic choice for thetotal number of iterations ห ๐พ = โ ๐ /( ๐ )โ is 3 for this example, as can also be seen from Figure 8. For this toy example, the quantum circuit for the non-boolean amplitude amplification algorithmwas implemented in Qiskit [22] for three different values of the total number of iterations ๐พ ,namely ๐พ = , , and . In each case, the resulting circuit was simulated (and measured) timesusing Qiskitโs QASM simulator. The estimated measurement frequencies for the observations ๐ฅ = , , . . . , are shown in Figure 9 as solid, unfilled, histogramsโthe colors green, red, andblue correspond to ๐พ = , , and , respectively. The expected measurement frequencies, namely ๐ ๐พ ( ๐ฅ ) from (68), are also shown in Figure 9 as dashed curves, and are in good agreement with thecorresponding histograms.As can be seen from Figure 9, in each case, the algorithm preferentially amplifies lower values of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) or, equivalently, higher values of ๐ฅ . This is expected from the fact that ๐ ๐พ > for allthree values of ๐พ . Furthermore, as ๐พ increases from 0 to ห ๐พ = , the preferential amplification grows on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 21 K K cos( )sin ( ) cos( ) + 1sin ( ) cos( ) 1sin ( ) Fig. 8. Plot showing ๐ ๐พ for ๐พ = , , . . . , , for the toy example considered in Section 5. The red dotscorrespond to the different integer values of ๐พ . The black solid curve depicts the sinusoidal dependence of ๐ ๐พ on ๐พ . The dotted lines indicate that ๐ ๐พ oscillates around cos ( ๐ )/ sin ( ๐ ) with an amplitude of / sin ( ๐ ) anda period of ๐ / ๐ (in ๐พ values). x F r e q u e n c y K=1 K = K = p ( x ) = 1/2 x = () Observed for K = 1Observed for K = 2Observed for K = 3 Prediction for K = 1Prediction for K = 2Prediction for K = 3 Fig. 9. The solid histograms show the observed measurement frequencies of the different values of ๐ฅ โ{ , . . . , } after performing the non-boolean amplitude amplification algorithm. The green, red, and bluesolid histograms correspond to the total number of iterations ๐พ being 1, 2, and 3, respectively. In each case,the observed frequencies are based on simulating the circuit for the algorithm times, i.e., shots. Thedashed curves, almost coincident with their corresponding solid histograms, show the predictions ๐ ๐พ ( ๐ฅ ) (forthe measurement frequencies) computed using (68) . While ๐ ๐พ ( ๐ฅ ) is technically defined only for the integervalues of ๐ฅ , here the dashed curves are interpolated for non-integer values of ๐ฅ using (68) . Phase estimate F r e q u e n c y / b i n - w i d t h = = Phase estimate F r e q u e n c y / b i n - w i d t h = = Fig. 10. Histograms showing the observed frequency/bin-width for the different phase estimation outcomes ^ ๐ , for the toy example considered in Section 5. The left and right panels show the frequency/bin-width ( ๐ฆ -axis)on linear and logarithmic scales, respectively. In both panels, the green-dashed and red-solid histogramscorrespond to using and qubits to measure the phase, respectively. The purple-dotted vertical lines onboth panels correspond to ^ ๐ = ๐ and ^ ๐ = ๐ โ ๐ . In each histogram, the last bin (ending at ๐ ) is simply acontinuation of the first bin (starting at ), and corresponds to ^ ๐ = . stronger. Note that the probabilities of the ๐ฅ -s for which cos (cid:0) ๐ ( ๐ฅ ) (cid:1) โ cos ( ๐ ) are left approximatelyunchanged by the algorithm, as indicated by the purple-dotted crosshair in Figure 9. Only the estimation of cos ( ๐ ) , i.e., the real part of ๐ธ (cid:2) ๐ ๐๐ (cid:3) is demonstrated here. The imaginary partcan also be estimated using the same technique, as described in Section 4.2.Let ๐ be the number of qubits used in the QPE subroutine of the mean estimation algorithm, tocontain the phase information. This corresponds to performing the (controlled) Q iter operation ๐ โ times during the QPE subroutine. Note that the estimated phase ^ ๐ can only take the followingdiscrete values [7]: ^ ๐ โ (cid:26) ๐ ๐ ๐ (cid:12)(cid:12)(cid:12) ๐ โ (cid:8) , . . . , ๐ โ (cid:9) (cid:27) . (116)In this way, the value of ๐ controls the precision of the estimated phase and, by extension, theprecision of the estimate for cos ( ๐ ) โthe higher the value of ๐ , the higher the precision.Two different quantum circuits were implemented, again using Qiskit, for the mean estimationalgorithm; one with ๐ = and the other with ๐ = . Each circuit was simulated (and measured)using Qiskitโs QASM simulator times, to get a sample of ^ ๐ values, all in the range [ , ๐ ) .The observed frequencies (scaled by 1/bin-width) of the different values of ^ ๐ are shown ashistograms on a linear scale in the left panel of Figure 10, and on a logarithmic scale in the rightpanel. Here the bin-width of the histograms is given by ๐ / ๐ , which is the difference betweenneighboring allowed values of ^ ๐ . The green-dashed and red-solid histograms in Figure 10 correspondto the circuits with and phase measurement qubits, respectively. The exact values of ๐ and ๐ โ ๐ for this toy example are indicated with vertical purple-dotted lines. In both cases ( ๐ = and ๐ = ), the observed frequencies peak near the exact values of ๐ and ๐ โ ๐ , demonstratingthat ^ ๐ is a good estimate for them, up to a two-fold ambiguity. Furthermore, as expected, usingmore qubits for estimating the phase leads to a more precise estimate.Figure 11 shows the observed frequencies (scaled by 1/bin-width) of the different values of cos ( ^ ๐ ) , which is the estimate for the mean cos ( ๐ ) . As with Figure 10, a) the green-dashed and on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 23 Mean estimate cos( ) F r e q u e n c y / b i n - w i d t h c o s () = c o s () Mean estimate cos( ) F r e q u e n c y / b i n - w i d t h c o s () = c o s () Fig. 11. Histograms showing the observed frequency/bin-width for the different values of cos ( ^ ๐ ) , for the toyexample considered in Section 5. The left and right panels show the frequency/bin-width ( ๐ฆ -axis) on linearand logarithmic scales, respectively. In both panels, the green-dashed and red-solid histograms correspond tousing 4 and 8 qubits respectively. The purple-dotted vertical lines correspond to cos ( ^ ๐ ) = cos ( ๐ โฒ ) . The bins ofthe cos ( ^ ๐ ) histograms are induced by the equal-width bins of the corresponding ^ ๐ histograms in Figure 10. red-solid histograms correspond to 4 and 8 phase measurement qubits, respectively, and b) the leftand right panels show the histograms on linear and logarithmic scales, respectively. In each panel,the exact value of cos ( ๐ ) is also indicated as a vertical purple-dotted line. As can be seen fromFigure 11, the observed frequencies peak near the exact value of cos ( ๐ ) , indicating that cos ( ^ ๐ ) isa good estimate for the same. Both algorithms introduced this in this paper so far, namely โข the amplitude algorithm of Section 2 and its alternative formulation in Section 3.10, and โข the mean estimation algorithm of Section 4use an ancilla qubit to make the quantity (cid:10) ๐ฟ (cid:12)(cid:12) U ๐ (cid:12)(cid:12) ๐ฟ (cid:11) real-valued. This is important for achievingthe respective goals of the algorithms. However, the same algorithms can be performed without theancilla, albeit to achieve different goals, which may be relevant in some use cases. In this section,the ancilla-free versions of the algorithms will be briefly described and analyzed. The ancilla-free version of the amplitude amplification algorithm is almost identical to the algorithmintroduced in Section 2. The only difference is that in the ancilla-free version, the single-register op-erators ๐ ๐ , ๐ ๐ , and ๐ โ ๐ are used in place of the two-register operators S ๐ฟ , U ๐ , and U โ ๐ , respectively.For concreteness, the algorithm proceeds as follows:(1) Initialize a system in the state | ๐ โฉ .(2) Act the operation ๐ ๐ ๐ ๐ during the odd iterations and ๐ ๐ ๐ โ ๐ during the even iterations. The upward trends near the left ( โ ) and right ( + ) edges of the plots in Figure 11 are artifacts caused by the Jacobiandeterminant for the map from ^ ๐ to cos ( ^ ๐ ). Analogous to the two-register states | ๐ถ โฉ and | ๐ท โฉ in (31) and (32), let the single-register states | ๐ผ โฒ โฉ and | ๐ฝ โฒ โฉ be defined as | ๐ผ โฒ โฉ โก ๐ ๐ | ๐ โฉ = ๐ โ โ๏ธ ๐ฅ = ๐ ๐๐ ( ๐ฅ ) ๐ ( ๐ฅ ) | ๐ฅ โฉ , (117) | ๐ฝ โฒ โฉ โก ๐ โ ๐ | ๐ โฉ = ๐ โ โ๏ธ ๐ฅ = ๐ โ ๐๐ ( ๐ฅ ) ๐ ( ๐ฅ ) | ๐ฅ โฉ . (118)Analogous to ๐ defined in (30), let ๐ โฒ โ [ , ๐ / ] and ๐ฟ โ [ , ๐ ) be implicitly defined by cos ( ๐ โฒ ) ๐ ๐๐ฟ โก โจ ๐ | ๐ผ โฒ โฉ = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) ๐ ๐๐ ( ๐ฅ ) . (119) cos ( ๐ โฒ ) and ๐ฟ are the magnitude and phase, respectively, of the initial (i.e., ๐ฅ sampled from | ๐ โฉ )expected value of ๐ ๐๐ . An important difference between ๐ โฒ and ๐ is that cos ( ๐ โฒ ) is restricted to benon-negative, unlike cos ( ๐ ) , which can be positive, negative, or zero.Note that cos ( ๐ โฒ ) can be written as cos ( ๐ โฒ ) = ๐ โ โ๏ธ ๐ฅ = (cid:12)(cid:12) ๐ ( ๐ฅ ) (cid:12)(cid:12) ๐ ๐๐ โฒ ( ๐ฅ ) , (120)where ๐ โฒ ( ๐ฅ ) is given by ๐ โฒ ( ๐ฅ ) โก ๐ ( ๐ฅ ) โ ๐ฟ . (121)Acting the oracle ๐ ๐ for the function ๐ can be thought of as acting the oracle ๐ ๐ โฒ for the function ๐ โฒ , followed performing a global, state independent phase-shift of ๐ฟ . Furthermore, from (120), it canseen that (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ โฒ (cid:12)(cid:12) ๐ (cid:11) is real-valued. This observation can be used to re-purpose the analysis inSection 3 for the ancilla-free version; the corresponding results are presented here without explicitproofs.Let (cid:12)(cid:12) ๐ โฒ ๐ (cid:11) be the state of the system of the after ๐ โฅ iterations of the ancilla-free algorithm.Analogous to (56), (cid:12)(cid:12) ๐ โฒ ๐ (cid:11) can be written as (cid:12)(cid:12) ๐ โฒ ๐ (cid:11) = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ๐ ๐๐ฟ sin ( ๐ โฒ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ โฒ (cid:1) | ๐ โฉ โ sin ( ๐๐ โฒ ) ๐ โ ๐๐ฟ | ๐ผ โฒ โฉ (cid:105) , if ๐ is odd , ( ๐ โฒ ) (cid:104) sin (cid:0) ( ๐ + ) ๐ โฒ (cid:1) | ๐ โฉ โ sin ( ๐๐ โฒ ) ๐ ๐๐ฟ | ๐ฝ โฒ โฉ (cid:105) , if ๐ is even . (122)Let ๐ โฒ ๐พ ( ๐ฅ ) be probability of measuring the system in state ๐ฅ after ๐พ iterations. Analogous to (68), ๐ โฒ ๐พ ( ๐ฅ ) can be written as ๐ โฒ ๐พ ( ๐ฅ ) = ๐ ( ๐ฅ ) (cid:110) โ ๐ โฒ ๐พ (cid:104) cos (cid:0) ๐ ( ๐ฅ ) โ ๐ฟ (cid:1) โ cos ( ๐ โฒ ) (cid:105) (cid:111) , (123)where the ๐ โฒ ๐พ , the ancilla-free analogue of ๐ ๐พ , is given by ๐ โฒ ๐พ = ( ๐พ๐ โฒ ) sin (cid:0) ( ๐พ + ) ๐ โฒ (cid:1) sin ( ๐ โฒ ) = cos ( ๐ โฒ ) โ cos (cid:0) ( ๐พ + ) ๐ โฒ (cid:1) sin ( ๐ โฒ ) . (124)In this case, the probability amplification factor ๐ โฒ ๐พ / ๐ is linear in cos ( ๐ โ ๐ฟ ) . on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 25 The ancilla-free mean estimation algorithm described in this subsection can estimate the magni-tude of โจ ๐ | ๐ | ๐ โฉ for a given unitary operator ๐ . Here the algorithm is presented in terms ofthe oracle ๐ ๐ , and the goal of the algorithm is to estimate cos ( ๐ โฒ ) from (119), i.e., the magnitude of ๐ธ ๐ (cid:2) ๐ ๐๐ (cid:3) โก (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) .Let the unitary operator ๐ evenodd be defined as ๐ evenodd โก ๐ ๐ ๐ ๐ ๐ ๐ ๐ โ ๐ . (125)Its action corresponds to performing the (ancilla-free) even-iteration operation once, followed bythe odd-iteration operation. Analogous to (105) and (106), the state | ๐ โฉ can be written as | ๐ โฉ = (cid:12)(cid:12) ๐ โฒ+ (cid:11) โ (cid:12)(cid:12) ๐ โฒโ (cid:11) โ , (126)where (cid:12)(cid:12) ๐ โฒ+ (cid:11) and (cid:12)(cid:12) ๐ โฒโ (cid:11) are given by (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = ๐ ยฑ ๐๐ โฒ | ๐ โฉ โ ๐ โ ๐๐ฟ | ๐ผ โฒ โฉ ๐ โ ( ๐ โฒ ) . (127) (cid:12)(cid:12) ๐ โฒ+ (cid:11) and (cid:12)(cid:12) ๐ โฒโ (cid:11) are unit-normalized eigenstates of ๐ evenodd with eigenvalues ๐ ๐๐ โฒ and ๐ โ ๐๐ โฒ , respec-tively. ๐ evenodd (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = ๐ ยฑ ๐๐ โฒ (cid:12)(cid:12) ๐ โฒยฑ (cid:11) , (128) (cid:10) ๐ โฒยฑ (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = . (129)These properties of (cid:12)(cid:12) ๐ โฒ+ (cid:11) and (cid:12)(cid:12) ๐ โฒโ (cid:11) in (128) and (129) are proved in Appendix D. The observations in(126) and (128) lead to the following algorithm for estimating cos ( ๐ โฒ ) :(1) Perform the QPE algorithm with โข ๐ evenodd serving the role of the unitary operator under consideration, and โข the superposition state | ๐ โฉ in place of the eigenstate required by the QPE algorithm asinput.Let the output of this step, appropriately scaled to be an estimate of the phase angle in therange [ , ๐ ) , be ^ ๐ .(2) Return (cid:12)(cid:12) cos (cid:0) ^ ๐ / (cid:1)(cid:12)(cid:12) as the estimate for cos ( ๐ โฒ ) . Proof of correctness of the algorithm:
In this version of the algorithm, ^ ๐ will be an estimatefor either ๐ or ๐ โ ๐ . So, ^ ๐ / will be an estimate for either ๐ โฒ or ๐ โ ๐ โฒ . Since, a) cos ( ๐ โ ๐ โฒ ) = โ cos ( ๐ โฒ ) , and b) cos ( ๐ โฒ ) is a non-negative number, it follows that (cid:12)(cid:12) cos (cid:0) ^ ๐ / (cid:1)(cid:12)(cid:12) is an estimate for cos ( ๐ โฒ ) . In this paper, two new oracular quantum algorithms were introduced and analyzed. The action ofthe oracle ๐ ๐ on a basis state | ๐ฅ โฉ is to apply a state dependent, real-valued phase shift ๐ ( ๐ฅ ) .The first algorithm is the non-boolean amplitude amplification algorithm, which, starting froman initial superposition state | ๐ โฉ , preferentially amplifies the amplitudes of the basis states basedon the value of cos ( ๐ ) . In this paper, the goal of the algorithm was chosen to be to preferentiallyamplify the states with lower values of cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . The algorithm is iterative in nature. After ๐พ iterations, the probability for a measurement of the system to yield ๐ฅ , namely ๐ ๐พ ( ๐ฅ ) , differs from If ๐ โฒ = , the phase angle being estimated is for both (cid:12)(cid:12) ๐ โฒ+ (cid:11) and (cid:12)(cid:12) ๐ โฒโ (cid:11) . the original probability ๐ ( ๐ฅ ) by a factor that is linear in cos (cid:0) ๐ ( ๐ฅ ) (cid:1) . The coefficient โ ๐ ๐พ of thislinear dependence controls the degree (and direction) of the preferential amplification.The second algorithm is the quantum mean estimation algorithm, which uses QPE as a subroutinein order to estimate the expectation of ๐ ๐ under | ๐ โฉ , i.e., (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) . The algorithm offers aquadratic speedup over the classical approach of estimating the expectation, as a sample mean overrandomly sampled inputs.The non-boolean amplitude amplification algorithm and the quantum mean estimation algorithmare generalizations, respectively, of the boolean amplitude amplification and amplitude estimationalgorithms. The boolean algorithms are widely applicable and feature as primitives in severalquantum algorithms [8โ18] because of the generic nature of the tasks they accomplish. Furthermore,several extensions and variations of the boolean algorithms exist in the literature, e.g., Refs. [2, 5,14, 15, 23โ33].Likewise, the non-boolean algorithms introduced in this paper also perform fairly generic taskswith a wide range of applicability. In addition, there is also a lot of scope for extending and modifyingthese algorithms. For example, โข In this paper, the choice ห ๐พ for the number of iterations to perform (in the amplitude amplifi-cation algorithm) was derived for the case where the value of cos ( ๐ ) is a priori known. Onthe other hand, if cos ( ๐ ) is not known beforehand, one can devise strategies for choosing thenumber of iterations as in Refs. [2, 5], โข There exist versions of the boolean amplification algorithm in the literature [5, 24] that use ageneralized version of the operator ๐ ๐ given by ๐ gen ๐ ( ๐ ) = (cid:2) โ ๐ ๐๐ (cid:3) | ๐ โฉ โจ ๐ | โ ๐ผ . (130)The generalized operator ๐ gen ๐ ( ๐ ) reduces to ๐ ๐ for ๐ = ๐ . Such a modification, with anappropriately chosen value of ๐ , can be used to improve the success probability of theboolean amplification algorithm to [5, 24]. A similar improvement may be possible for thenon-boolean amplification algorithm as well, by similarly generalizing the S ๐ฟ operator. โข Several variants of the (boolean) amplitude estimation algorithm exist in the literature [26โ32], which use classical post-processing either to completely avoid using the QPE algorithm,or to reduce the depth of the circuits used in the QPE subroutine. It may be possible toconstruct similar variants for the mean estimation algorithm of this paper.In the rest of this section, some assorted thoughts on the potential applications of the algorithmsof this paper are presented, in no particular order.
A straightforward application of the non-boolean amplitude amplification algorithm is in theoptimization of objective functions defined over a discrete input space. The objective function tobe optimized needs to be mapped onto the function ๐ of the oracle ๐ ๐ , with the basis states of theoracle corresponding to the different discrete inputs of the objective function. After performingan 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) canbe performed to probabilistically improve the quality of the optimization.Note that the technique is not guaranteed to yield the true optimal input, and the performanceof the technique will depend crucially on factors like a) the map from the objective function to theoracle function ๐ , b) the number of iterations ๐พ , c) the initial superposition | ๐ โฉ , and in particular,d) the initial distribution of ๐ under the superposition | ๐ โฉ . This approach joins the list of other on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 27 quantum optimization techniques [15, 34], including the Quantum Approximate OptimizationAlgorithm [35, 36] and Adiabatic Quantum Optimization [37โ39].Analyzing the performance of the non-boolean amplitude amplification algorithm for the purposeof approximate optimization is beyond the scope of this work, but the results in Section 3.7 andSection 3.8 can be useful for such analyses. The amplitude amplification algorithm could be useful for simulating certain probability distribu-tions. By choosing the initial state | ๐ โฉ , oracle ๐ ๐ , and the number of iterations ๐พ , one can controlthe final sampling probabilities ๐ ๐พ ( ๐ฅ ) of the basis states; the exact expression for ๐ ๐พ ( ๐ฅ ) in terms ofthese factors is given in (68). Let | ๐ โฉ and | ๐ โฉ be two different states produced by acting the unitary operators ๐ด and ๐ต , respectively,on the state | โฉ . | ๐ โฉ = ๐ด | โฉ , | ๐ โฉ = ๐ต | โฉ . (131)Estimating the overlap (cid:12)(cid:12) โจ ๐ | ๐ โฉ (cid:12)(cid:12) between the two states is an important task with several applica-tions [40โ44], including in Quantum Machine Learning (QML) [45โ48]. Several algorithms [49โ51], including the Swap test [52] can be used for estimating this overlap. For the Swap test, theuncertainty in the estimated value of (cid:12)(cid:12) โจ ๐ | ๐ โฉ (cid:12)(cid:12) falls as O ( /โ ๐ ) in the number of queries ๐ to theunitaries ๐ด and ๐ต (used to the create the states | ๐ โฉ and | ๐ โฉ ).On the other hand, the mean estimation algorithm of this paper can also be used to estimate โจ ๐ | ๐ โฉ by noting that โจ ๐ | ๐ โฉ = (cid:10) (cid:12)(cid:12) ๐ด โ ๐ต (cid:12)(cid:12) (cid:11) . (132)So, by setting ๐ โก ๐ด โ ๐ต , (133) | ๐ โฉ โก | โฉ , (134) โจ ๐ | ๐ โฉ can be estimated as โจ ๐ | ๐ | ๐ โฉ using the mean estimation algorithm of Section 4. If one isonly interested in the magnitude of โจ ๐ | ๐ โฉ , the ancilla-free version of the mean estimation algorithmin Section 6.2 will also suffice. Since, for the mean estimation algorithm, the uncertainty of theestimate falls as O ( / ๐ ) in the number of queries ๐ to the unitaries ๐ด and ๐ต (or their inverses),this approach offers a quadratic speedup over the Swap test. Furthermore, the O ( / ๐ ) scaling ofthe error achieved by this approach matches the performance of the optimal quantum algorithm,derived in [50], for the overlap-estimation task. | ๐ โฉ and Unitary ๐ Recall from (105) and (107) that Q iter | ๐ฟ โฉ = ๐ ๐๐ | ๐ผ + โฉ โ ๐ โ ๐๐ | ๐ผ โ โฉโ , (135)where cos ( ๐ ) is the real part of (cid:10) ๐ (cid:12)(cid:12) ๐ ๐ (cid:12)(cid:12) ๐ (cid:11) . Note that the parameter ๐ depends on the superposition | ๐ โฉ and the unitary ๐ ๐ . The action of Q iter on | ๐ฟ โฉ is to apply a phase-shift of ๐ on the projectionalong | ๐ผ + โฉ and a phase-shift of โ ๐ on the projection along | ๐ผ โ โฉ . This property can be used to createa meta-oracle, which evaluates the superposition | ๐ฟ โฉ and/or the unitary ๐ ๐ (or a generic unitary ๐ ) based on the corresponding value of ๐ . More specifically, if the circuit ๐ด for producing | ๐ฟ โฉ and/or the circuit for ๐ are additionally parameterized using โcontrolโ quantum registers (provided as inputs to the circuits), then a meta-oracle can be created using (135) to evaluate the states ofthe control registers. The construction of such a meta-oracle is explicitly shown in Appendix E.Such meta-oracles can be used with quantum optimization algorithms, including the non-booleanamplitude amplification algorithm of this paper, to find โgoodโ values (or states) of the controlregisters.Variational quantum circuits, i.e., quantum circuits parameterized by (classical) free parametershave several applications [35, 36, 53], including in QML [54โ61]. Likewise, quantum circuitsparameterized by quantum registers can also have applications, e.g., in QML and quantum statisticalinference. The ideas of this subsection and Appendix E can be used to โtrainโ such circuits in amanifestly quantum manner; this will be explored further in future work. ACKNOWLEDGMENTS
The author thanks A. Jahin, K. Matchev, S. Mrenna, G. Perdue, E. Peters for useful discussions andfeedback. The author is partially supported by the U.S. Department of Energy, Office of Science,Office of High Energy Physics QuantISED program under the grants a) โHEP Machine Learningand Optimization Go Quantumโ, Award Number 0000240323, and b) โDOE QuantiSED ConsortiumQCCFP-QMLQCFโ, Award Number DE-SC0019219.This manuscript has been authored by Fermi Research Alliance, LLC under Contract No. DE-AC02-07CH11359 with the U.S. Department of Energy, Office of Science, Office of High EnergyPhysics.
CODE AND DATA AVAILABILITY
The code and data that support the findings of this study are openly available at the followingURL: https://gitlab.com/prasanthcakewalk/code-and-data-availability/ under the directory named arXiv_2102.xxxxx . REFERENCES [1] Lov K. Grover. 1996. A fast quantum mechanical algorithm for database search. In
Proceedings of the Twenty-EighthAnnual ACM Symposium on Theory of Computing (STOC โ96). Association for Computing Machinery, Philadelphia,Pennsylvania, USA, 212โ219. isbn: 0897917855. doi: 10.1145/237814.237866. arXiv: quant-ph/9605043.[2] Michel Boyer, Gilles Brassard, Peter Hรธyer, and Alain Tapp. 1998. Tight bounds on quantum searching.
Fortschritteder Physik , 46, 4-5, 493โ505. doi: 10.1002/(SICI)1521-3978(199806)46:4/5<493::AID-PROP493>3.0.CO;2-P. arXiv:quant-ph/9605034.[3] Gilles Brassard and Peter Hรธyer. 1997. An exact quantum polynomial-time algorithm for simonโs problem. In
Proceedings of the Fifth Israeli Symposium on Theory of Computing and Systems , 12โ23. doi: 10.1109/ISTCS.1997.595153.arXiv: quant-ph/9704027.[4] Lov K. Grover. 1998. Quantum computers can search rapidly by using almost any transformation.
Phys. Rev. Lett. , 80,4329โ4332. doi: 10.1103/PhysRevLett.80.4329. arXiv: quant-ph/9712011.[5] Gilles Brassard, Peter Hรธyer, Michele Mosca, and Alain Tapp. 2002. Quantum amplitude amplification and estimation.In
Quantum Computation and Information (AMS Contemporary Mathematics). Samuel J. Lomonaco Jr. and Howard E.Brandt, editors. Volume 305, 53โ74. isbn: 9780821821404. doi: 10.1090/conm/305/05215. arXiv: quant-ph/0005055.[6] Gilles Brassard, Peter Hรธyer, and Alain Tapp. 1998. Quantum counting. In
Automata, Languages and Programming .Kim G. Larsen, Sven Skyum, and Glynn Winskel, editors. Springer Berlin Heidelberg, Berlin, Heidelberg, 820โ831.arXiv: quant-ph/9805082.[7] Richard Cleve, Artur Ekert, Chiara Macchiavello, and Michele Mosca. 1998. Quantum algorithms revisited.
Proceedingsof the Royal Society of London. Series A: Mathematical, Physical and Engineering Sciences , 454, 1969, 339โ354. doi:10.1098/rspa.1998.0164. arXiv: quant-ph/9708016.[8] Gilles Brassard, Peter Hรธyer, and Alain Tapp. 1997. Quantum cryptanalysis of hash and claw-free functions.
SIGACTNews , 28, 2, (June 1997), 14โ19. issn: 0163-5700. doi: 10.1145/261342.261346.[9] W. P. Baritompa, D. W. Bulger, and G. R. Wood. 2005. Groverโs quantum algorithm applied to global optimization.
SIAM Journal on Optimization , 15, 4, 1170โ1184. doi: 10.1137/040605072. on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 29 [10] Gilles Brassard, Peter Hรyer, and Alain Tapp. 1998. Quantum cryptanalysis of hash and claw-free functions. In
LATINโ98: Theoretical Informatics . Clรกudio L. Lucchesi and Arnaldo V. Moura, editors. Springer Berlin Heidelberg,Berlin, Heidelberg, 163โ169. isbn: 978-3-540-69715-2.[11] Indranil Chakrabarty, Shahzor Khan, and Vanshdeep Singh. 2017. Dynamic grover search: applications in recommen-dation systems and optimization problems.
Quantum Information Processing , 16, 6, (June 2017), 1โ21. issn: 1570-0755.doi: 10.1007/s11128-017-1600-4.[12] Martin Fรผrer. 2008. Solving np-complete problems with quantum search. In
LATIN 2008: Theoretical Informatics .Eduardo Sany Laber, Claudson Bornstein, Loana Tito Nogueira, and Luerbio Faria, editors. Springer Berlin Heidelberg,Berlin, Heidelberg, 784โ792. isbn: 978-3-540-78773-0.[13] Guodong Sun, Shenghui Su, and Maozhi Xu. 2014. Quantum algorithm for polynomial root finding problem. In , 469โ473. doi: 10.1109/CIS.2014.40.[14] Yanhu Chen, Shijie Wei, Xiong Gao, Cen Wang, Jian Wu, and Hongxiang Guo. 2019. An Optimized QuantumMaximum or Minimum Searching Algorithm and its Circuits. arXiv: 1908.07943 [quant-ph] .[15] Tad Hogg and Dmitriy Portnov. 2000. Quantum optimization.
Information Sciences , 128, 3, 181โ197. issn: 0020-0255.doi: https://doi.org/10.1016/S0020-0255(00)00052-9. arXiv: quant-ph/0006090.[16] Ashwin Nayak and Felix Wu. 1999. The quantum query complexity of approximating the median and relatedstatistics. In
Proceedings of the Thirty-First Annual ACM Symposium on Theory of Computing (STOC โ99). Associationfor Computing Machinery, Atlanta, Georgia, USA, 384โ393. isbn: 1581130678. doi: 10.1145/301250.301349.[17] Changqing Gong, Zhaoyang Dong, Abdullah Gani, and Han Qi. 2020. Quantum k-means algorithm based on Trustedserver in Quantum Cloud Computing. arXiv: 2011.04402 [quant-ph] .[18] Shouvanik Chakrabarti, Rajiv Krishnakumar, Guglielmo Mazzola, Nikitas Stamatopoulos, Stefan Woerner, andWilliam J. Zeng. 2020. A Threshold for Quantum Advantage in Derivative Pricing. arXiv: 2012.03819 [quant-ph] .[19] Charles H. Bennett, Ethan Bernstein, Gilles Brassard, and Umesh Vazirani. 1997. Strengths and weaknesses of quantumcomputing.
SIAM Journal on Computing , 26, 5, 1510โ1523. doi: 10.1137/S0097539796300933. arXiv: quant-ph/9701001.[20] Christoph Dรผrr and Peter Hรธyer. 1996. A quantum algorithm for finding the minimum. arXiv: quant-ph/9607014.[21] Luis Antonio Brasil Kowada, Carlile Lavor, Renato Portugal, and Celina M. H. de Figueiredo. 2008. A new quantumalgorithm for solving the minimum searching problem.
International Journal of Quantum Information , 06, 03, 427โ436.doi: 10.1142/S021974990800361X.[22] Qiskit research community. 2019. Qiskit: an open-source framework for quantum computing. (2019). doi: 10.5281/zenodo.2562110.[23] Eli Biham, Ofer Biham, David Biron, Markus Grassl, and Daniel A. Lidar. 1999. Groverโs quantum search algorithmfor an arbitrary initial amplitude distribution.
Phys. Rev. A , 60, 2742โ2745, 4. doi: 10.1103/PhysRevA.60.2742. arXiv:quant-ph/9807027.[24] F. M. Toyama, Wytse Van Dijk, and Yuki Nogami. 2013. Quantum search with certainty based on modified groveralgorithms: optimum choice of parameters.
Quantum Information Processing , 12, 1897โ1914. doi: 10.1007/s11128-012-0498-0.[25] Tudor Giurgica-Tiron, Iordanis Kerenidis, Farrokh Labib, Anupam Prakash, and William J. Zeng. 2020. Low depthalgorithms for quantum amplitude estimation. arXiv: 2012.03348 [quant-ph] .[26] Krysta M. Svore, Matthew B. Hastings, and Michael Freedman. 2014. Faster phase estimation.
Quantum Info. Comput. ,14, 3โ4, (March 2014), 306โ328. issn: 1533-7146.[27] Yohichi Suzuki, Shumpei Uno, Rudy Raymond, Tomoki Tanaka, Tamiya Onodera, and Naoki Yamamoto. 2020.Amplitude estimation without phase estimation.
Quantum Information Processing , 19, 75. doi: 10.1007/s11128-019-2565-2.[28] Dmitry Grinko, Julien Gacon, Christa Zoufal, and Stefan Woerner. 2019. Iterative Quantum Amplitude Estimation.arXiv: 1912.05559 [quant-ph] .[29] Kouhei Nakaji. 2020. Faster Amplitude Estimation.
Quantum Information & Computation , 20, 13โ14. arXiv: 2003.02417 [quant-ph] .[30] 2019.
Quantum approximate counting, simplified . Symposium on Simplicity in Algorithms (SOSA) , 24โ32. doi: 10.1137/1.9781611976014.5. arXiv: 1908.10846 [quant-ph] .[31] Guoming Wang, Dax Enshan Koh, Peter D. Johnson, and Yudong Cao. 2020. Bayesian Inference with EngineeredLikelihood Functions for Robust Amplitude Estimation. arXiv: 2006.09350 [quant-ph] .[32] Eric G. Brown, Oktay Goktas, and W. K. Tham. 2020. Quantum Amplitude Estimation in the Presence of Noise. arXiv:2006.14145 [quant-ph] .[33] Yan Wang. 2017. A Quantum Walk Enhanced Grover Search Algorithm for Global Optimization. arXiv: 1711.07825 [quant-ph] .[34] Juan Miguel Arrazola and Thomas R. Bromley. 2018. Using gaussian boson sampling to find dense subgraphs.
Phys.Rev. Lett. , 121, 030503, 3. doi: 10.1103/PhysRevLett.121.030503. arXiv: 1803.10730 [quant-ph] . [35] Edward Farhi, Jeffrey Goldstone, and Sam Gutmann. 2014. A Quantum Approximate Optimization Algorithm. arXiv:1411.4028 [quant-ph] .[36] Edward Farhi and Aram W. Harrow. 2016. Quantum Supremacy through the Quantum Approximate OptimizationAlgorithm. arXiv: 1602.07674 [quant-ph] .[37] A.B. Finnila, M.A. Gomez, C. Sebenik, C. Stenson, and J.D. Doll. 1994. Quantum annealing: a new method forminimizing multidimensional functions. Chemical Physics Letters , 219, 5, 343โ348. issn: 0009-2614. doi: https ://doi.org/10.1016/0009-2614(94)00117-0. arXiv: chem-ph/9404003.[38] Tadashi Kadowaki and Hidetoshi Nishimori. 1998. Quantum annealing in the transverse ising model.
Phys. Rev. E , 58,5355โ5363, 5. doi: 10.1103/PhysRevE.58.5355. arXiv: cond-mat/9804280.[39] Edward Farhi, Jeffrey Goldstone, Sam Gutmann, and Michael Sipser. 2000. Quantum Computation by AdiabaticEvolution. arXiv: quant-ph/0001106.[40] Harry Buhrman, Richard Cleve, John Watrous, and Ronald de Wolf. 2001. Quantum fingerprinting.
Phys. Rev. Lett. ,87, 167902, 16. doi: 10.1103/PhysRevLett.87.167902.[41] J. Niel de Beaudrap. 2004. One-qubit fingerprinting schemes.
Phys. Rev. A , 69, 022307, 2. doi: 10.1103/PhysRevA.69.022307.[42] Niraj Kumar, Eleni Diamanti, and Iordanis Kerenidis. 2017. Efficient quantum communications with coherent statefingerprints over multiple channels.
Phys. Rev. A , 95, 032337, 3. doi: 10.1103/PhysRevA.95.032337.[43] Aram W. Harrow and Ashley Montanaro. 2013. Testing product states, quantum merlin-arthur games and tensoroptimization.
J. ACM , 60, 1, (February 2013). issn: 0004-5411. doi: 10.1145/2432622.2432625.[44] Aram W. Harrow, Avinatan Hassidim, and Seth Lloyd. 2009. Quantum algorithm for linear systems of equations.
Phys. Rev. Lett. , 103, 150502, 15. doi: 10.1103/PhysRevLett.103.150502.[45] Seth Lloyd, Masoud Mohseni, and Patrick Rebentrost. 2013. Quantum algorithms for supervised and unsupervisedmachine learning. arXiv: 1307.0411 [quant-ph] .[46] Patrick Rebentrost, Masoud Mohseni, and Seth Lloyd. 2014. Quantum support vector machine for big data classifica-tion.
Phys. Rev. Lett. , 113, 130503, 13. doi: 10.1103/PhysRevLett.113.130503. arXiv: 1307.0471 [quant-ph] .[47] Nathan Wiebe, Ashish Kapoor, and Krysta M. Svore. 2015. Quantum algorithms for nearest-neighbor methods forsupervised and unsupervised learning.
Quantum Info. Comput. , 15, 3โ4, (March 2015), 316โโ356. issn: 1533-7146.arXiv: 1401.2142 [quant-ph] .[48] Maria Schuld, Ville Bergholm, Christian Gogolin, Josh Izaac, and Nathan Killoran. 2019. Evaluating analytic gradientson quantum hardware.
Phys. Rev. A , 99, 032331, 3. doi: 10.1103/PhysRevA.99.032331. arXiv: 1811.11184 [quant-ph] .[49] Lukasz Cincio, Yiฤit Subaลฤฑ, Andrew T Sornborger, and Patrick J Coles. 2018. Learning the quantum algorithm forstate overlap.
New Journal of Physics , 20, 11, 113022. doi: 10.1088/1367-2630/aae94a. arXiv: 1803.04114 [quant-ph] .[50] Marco Fanizza, Matteo Rosati, Michalis Skotiniotis, John Calsamiglia, and Vittorio Giovannetti. 2020. Beyond the swaptest: optimal estimation of quantum state overlap.
Phys. Rev. Lett. , 124, 060503, 6. doi: 10.1103/PhysRevLett.124.060503.arXiv: 1906.10639 [quant-ph] .[51] Ulysse Chabaud, Eleni Diamanti, Damian Markham, Elham Kashefi, and Antoine Joux. 2018. Optimal quantum-programmable projective measurement with linear optics.
Phys. Rev. A , 98, 062318, 6. doi: 10.1103/PhysRevA.98.062318.[52] Harry Buhrman, Richard Cleve, John Watrous, and Ronald de Wolf. 2001. Quantum fingerprinting.
Phys. Rev. Lett. ,87, 167902, 16. doi: 10.1103/PhysRevLett.87.167902. arXiv: quant-ph/0102001.[53] Alberto Peruzzo, Jarrod Mcclean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J. Love, Alรกn Aspuru-Guzik, and Jeremy L. OโBrien. 2014. A variational eigenvalue solver on a photonic quantum processor.
NatureCommunications , 5, 4213. doi: 10.1038/ncomms5213. arXiv: 1304.3061 [quant-ph] .[54] Marcello Benedetti, Erika Lloyd, Stefan Sack, and Mattia Fiorentini. 2019. Parameterized quantum circuits as machinelearning models.
Quantum Science and Technology , 4, 4, 043001. doi: 10.1088/2058-9565/ab4eb5. arXiv: 1906.07682 [quant-ph] .[55] Vojtฤch Havlรญฤek, Antonio D. Cรณrcoles, Kristan Temme, Aram W. Harrow, Abhinav Kandala, Jerry M. Chow, andJay M. Gambetta. 2019. Supervised learning with quantum-enhanced feature spaces.
Nature , 567, 209โ212. doi:10.1038/s41586-019-0980-2. arXiv: 1804.11326 [quant-ph] .[56] Kosuke Mitarai, Makoto Negoro, Masahiro Kitagawa, and Keisuke Fujii. 2018. Quantum circuit learning.
Phys. Rev. A ,98, 032309, 3. doi: 10.1103/PhysRevA.98.032309. arXiv: 1803.00745 [quant-ph] .[57] Edward Farhi and Hartmut Neven. 2018. Classification with Quantum Neural Networks on Near Term Processors.arXiv: 1802.06002 [quant-ph] .[58] Nimish Mishra, Manik Kapil, Hemant Rakesh, Amit Anand, Nilima Mishra, Aakash Warke, Soumya Sarkar, SanchayanDutta, Sabhyata Gupta, Aditya Prasad Dash, Rakshit Gharat, Yagnik Chatterjee, Shuvarati Roy, Shivam Raj, ValayKumar Jain, Shreeram Bagaria, Smit Chaudhary, Vishwanath Singh, Rituparna Maji, Priyanka Dalei, Bikash K. Behera,Sabyasachi Mukhopadhyay, and Prasanta K. Panigrahi. 2021. Quantum machine learning: a review and current on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 31 status. In
Data Management, Analytics and Innovation . Neha Sharma, Amlan Chakrabarti, Valentina Emilia Balas,and Jan Martinovic, editors. Springer Singapore, Singapore, 101โ145. isbn: 978-981-15-5619-7.[59] Maria Schuld, Alex Bocharov, Krysta M. Svore, and Nathan Wiebe. 2020. Circuit-centric quantum classifiers.
Phys.Rev. A , 101, 032308, 3. doi: 10.1103/PhysRevA.101.032308. arXiv: 1804.00633 [quant-ph] .[60] Edward Grant, Marcello Benedetti, Shuxiang Cao, Andrew Hallam, Joshua Lockhart, Vid Stojevic, Andrew G. Green,and Simone Severini. 2018. Hierarchical quantum classifiers. npj Quantum Information , 4, 65. doi: 10.1038/s41534-018-0116-9. arXiv: 1804.03680 [quant-ph] .[61] Guillaume Verdon, Trevor McCourt, Enxhell Luzhnica, Vikash Singh, Stefan Leichenauer, and Jack Hidary. 2019. AQuantum Walk Enhanced Grover Search Algorithm for Global Optimization. arXiv: 1909.12264 [quant-ph] . A DERIVATION OF THE SYSTEM STATE AFTER ๐ ITERATIONS
This section contains the derivation of (56) from (55). Let the matrix ๐ ๐ be defined as ๐ ๐ โก (cid:34) ( ๐ ) โ (cid:35) . (136)From (55), | ๐ฟ ๐ โฉ = ๏ฃฑ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃฒ๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃด๏ฃณ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ | ๐ฟ โฉ| ๐ถ โฉ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป ๐ ๐ ๐๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป , if ๐ is odd , ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ | ๐ฟ โฉ| ๐ท โฉ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป ๐ ๐ ๐๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป , if ๐ is even . (137)where the superscript ๐ denotes transposition. ๐ ๐ can be diagonalized as ๐ ๐ = ๐ ๐ (cid:34) ๐ โ ๐๐ ๐ ๐๐ (cid:35) ๐ โ ๐ , (138)where the matrix ๐ ๐ and its inverse ๐ โ ๐ are given by ๐ ๐ = โ ๐ ( ๐ ) (cid:34) ๐ โ ๐๐ ๐ ๐๐ โ โ (cid:35) , ๐ โ ๐ = (cid:34) โ โ ๐ ๐๐ ๐ โ ๐๐ (cid:35) . (139)Now, ๐ ๐๐ can be written as ๐ ๐๐ = ๐ ๐ (cid:34) ๐ โ ๐๐ ๐ ๐๐ (cid:35) ๐ ๐ โ ๐ = ๐ ๐ (cid:34) ๐ โ ๐๐๐ ๐ ๐๐๐ (cid:35) ๐ โ ๐ . (140)From (139) and (140), ๐ ๐๐ (cid:34) (cid:35) = ๐ ๐ (cid:34) ๐ โ ๐๐๐ ๐ ๐๐๐ (cid:35) (cid:34) โ (cid:35) (141a) = ๐ ๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ โ ๐ โ ๐๐๐ ๐ ๐๐๐ ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป = ( ๐ ) ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ sin (cid:0) ( ๐ + ) ๐ (cid:1) โ sin ( ๐๐ ) ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป . (141b)Plugging this back into (137) leads to (56). B PROOFS OF RELEVANT TRIGONOMETRIC IDENTITIES
This section contains the derivations of the trigonometric identities (66) and (67). The derivationswill be based on the following standard trigonometric identities: sin (โ ๐ถ ) = โ sin ( ๐ถ ) , (142) cos (โ ๐ถ ) = cos ( ๐ถ ) , (143) sin ( ๐ถ ) + cos ( ๐ถ ) = , (144) sin ( ๐ถ + ๐ท ) = sin ( ๐ถ ) cos ( ๐ท ) + cos ( ๐ถ ) sin ( ๐ท ) , (145) cos ( ๐ถ + ๐ท ) = cos ( ๐ถ ) cos ( ๐ท ) โ sin ( ๐ถ ) sin ( ๐ท ) . (146) B.1 Proof of Identity (66)From (145), sin ( ๐ถ + ๐ท ) sin ( ๐ถ โ ๐ท ) = (cid:104) sin ( ๐ถ ) cos ( ๐ท ) + cos ( ๐ถ ) sin ( ๐ท ) (cid:105) ร (cid:104) sin ( ๐ถ ) cos ( ๐ท ) โ cos ( ๐ถ ) sin ( ๐ท ) (cid:105) (147a) = sin ( ๐ถ ) cos ( ๐ท ) โ cos ( ๐ถ ) sin ( ๐ท ) (147b) = sin ( ๐ถ ) (cid:104) โ sin ( ๐ท ) (cid:105) โ (cid:104) โ sin ( ๐ถ ) (cid:105) sin ( ๐ท ) (147c) = sin ( ๐ถ ) โ sin ( ๐ท ) . (147d)Now, from (145), sin ( ๐ถ ) + sin ( ๐ถ + ๐ท ) = sin ( ๐ถ ) + sin ( ๐ถ + ๐ท ) (cid:104) sin ( ๐ถ ) cos ( ๐ท ) + cos ( ๐ถ ) sin ( ๐ท ) (cid:3) (148) = sin ( ๐ถ ) + ( ๐ถ ) cos ( ๐ท ) sin ( ๐ถ + ๐ท )โ sin ( ๐ถ + ๐ท ) (cid:104) sin ( ๐ถ ) cos ( ๐ท ) โ cos ( ๐ถ ) sin ( ๐ท ) (cid:105) . (149)Using (145) again, sin ( ๐ถ ) + sin ( ๐ถ + ๐ท ) = sin ( ๐ถ ) + ( ๐ถ ) cos ( ๐ท ) sin ( ๐ถ + ๐ท ) โ sin ( ๐ถ + ๐ท ) sin ( ๐ถ โ ๐ท ) . (150)Using (147d) here leads to sin ( ๐ถ ) + sin ( ๐ถ + ๐ท ) = sin ( ๐ท ) + ( ๐ถ ) cos ( ๐ท ) sin ( ๐ถ + ๐ท ) , (151)which completes the proof of (66). B.2 Proof of Identity (67)From (146), cos ( ๐ถ + ๐ท ) = cos ( ๐ถ ) cos ( ๐ถ + ๐ท ) โ sin ( ๐ถ ) sin ( ๐ถ + ๐ท ) (152) = cos (โ ๐ถ ) cos ( ๐ถ + ๐ท ) โ sin (โ ๐ถ ) sin ( ๐ถ + ๐ท ) โ ( ๐ถ ) sin ( ๐ถ + ๐ท ) (153)Using (146) again leads to cos ( ๐ถ + ๐ท ) = cos (โ ๐ถ + ๐ถ + ๐ท ) โ ( ๐ถ ) sin ( ๐ถ + ๐ท ) (154) = cos ( ๐ท ) โ ( ๐ถ ) sin ( ๐ถ + ๐ท ) , (155)which completes the proof of (67). on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 33 C PROPERTIES OF | ๐ผ + โฉ AND | ๐ผ โ โฉ This section contains the proof of (107) and (108), which state that | ๐ผ + โฉ and | ๐ผ โ โฉ are unit normalizedeigenstates of Q iter with eigenvalues ๐ ๐๐ and ๐ โ ๐๐ , respectively. From (97), (98), and (106), Q iter | ๐ผ ยฑ โฉ = ๐ ยฑ ๐๐ (cid:104) ( ๐ ) | ๐ฟ โฉ โ | ๐ถ โฉ (cid:105) โ | ๐ฟ โฉ ๐ โ ( ๐ ) (156a) = ๐ ยฑ ๐๐ ๏ฃฎ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฏ๏ฃฐ (cid:104) ( ๐ ) โ ๐ โ ๐๐ (cid:105) | ๐ฟ โฉ โ | ๐ถ โฉ ๐ โ ( ๐ ) ๏ฃน๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃบ๏ฃป (156b) = ๐ ยฑ ๐๐ (cid:20) ๐ ยฑ ๐๐ | ๐ฟ โฉ โ | ๐ถ โฉ ๐ โ ( ๐ ) (cid:21) = ๐ ยฑ ๐๐ | ๐ผ ยฑ โฉ . (156c)This completes the proof of (107). From (37) and (106), โจ ๐ผ ยฑ | ๐ผ ยฑ โฉ = โจ ๐ฟ | ๐ฟ โฉ + โจ ๐ถ | ๐ถ โฉ โ ๐ ยฑ ๐๐ โจ ๐ถ | ๐ฟ โฉ โ ๐ โ ๐๐ โจ ๐ฟ | ๐ถ โฉ ( ๐ ) (157a) = + โ ( ๐ ) ( ๐ ) = . (157b)This completes the proof of (108). D PROPERTIES OF (cid:12)(cid:12) ๐ โฒ+ (cid:11) AND (cid:12)(cid:12) ๐ โฒโ (cid:11) This section contains the proof of (128) and (129), which state that (cid:12)(cid:12) ๐ โฒ+ (cid:11) and (cid:12)(cid:12) ๐ โฒโ (cid:11) are unit normalizedeigenstates of ๐ evenodd with eigenvalues ๐ ๐๐ โฒ and ๐ โ ๐๐ โฒ , respectively. From (3), (117), (118), and(119), the action of ๐ evenodd on | ๐ โฉ can be written as ๐ evenodd | ๐ โฉ = ๐ ๐ ๐ ๐ ๐ ๐ | ๐ฝ โฒ โฉ (158a) = ๐ ๐ ๐ ๐ (cid:104) โจ ๐ | ๐ฝ โฒ โฉ | ๐ โฉ โ | ๐ฝ โฒ โฉ (cid:105) (158b) = ๐ ๐ (cid:104) โจ ๐ | ๐ฝ โฒ โฉ | ๐ผ โฒ โฉ โ | ๐ โฉ (cid:105) (158c) = โจ ๐ | ๐ฝ โฒ โฉ (cid:104) โจ ๐ | ๐ผ โฒ โฉ | ๐ โฉ โ | ๐ผ โฒ โฉ (cid:105) โ | ๐ โฉ (158d) = (cid:2) ( ๐ โฒ ) โ (cid:3) | ๐ โฉ โ ( ๐ โฒ ) ๐ โ ๐๐ฟ | ๐ผ โฒ โฉ , (158e)and the action of ๐ evenodd on | ๐ผ โฒ โฉ can be written as ๐ evenodd | ๐ผ โฒ โฉ = ๐ ๐ ๐ ๐ ๐ ๐ | ๐ โฉ (159a) = ๐ ๐ ๐ ๐ | ๐ โฉ (159b) = ๐ ๐ | ๐ผ โฒ โฉ (159c) = โจ ๐ | ๐ผ โฒ โฉ | ๐ โฉ โ | ๐ผ โฒ โฉ (159d) = ( ๐ โฒ ) ๐ ๐๐ฟ | ๐ โฉ โ | ๐ผ โฒ โฉ . (159e)Now, using (125), (158), and (159), ๐ evenodd (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = (cid:104) ( ๐ โฒ ) โ โ ( ๐ โฒ ) ๐ โ ๐๐ โฒ (cid:105) ๐ ยฑ ๐๐ โฒ | ๐ โฉ โ (cid:104) ( ๐ โฒ ) ๐ ยฑ ๐๐ โฒ โ (cid:105) ๐ โ ๐๐ฟ | ๐ผ โฒ โฉ ๐ โ ( ๐ โฒ ) . (160) Using ( ๐ โฒ ) = ๐ ๐๐ โฒ + ๐ โ ๐๐ โฒ it can be shown that ( ๐ โฒ ) โ โ ( ๐ โฒ ) ๐ โ ๐๐ โฒ = ( ๐ โฒ ) ๐ ยฑ ๐๐ โฒ โ = ๐ ยฑ ๐๐ โฒ . (161)Using this identity, (160) can be simplified as ๐ evenodd (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = ๐ ยฑ ๐๐ โฒ (cid:12)(cid:12) ๐ โฒยฑ (cid:11) . (162)This completes the proof of (128).From (119) and (127), (cid:10) ๐ โฒยฑ (cid:12)(cid:12) ๐ โฒยฑ (cid:11) = โจ ๐ | ๐ โฉ + โจ ๐ผ โฒ | ๐ผ โฒ โฉ โ ๐ ยฑ ๐๐ โฒ + ๐๐ฟ โจ ๐ผ โฒ | ๐ โฉ โ ๐ โ ๐๐ โฒ โ ๐๐ฟ โจ ๐ | ๐ผ โฒ โฉ ( ๐ โฒ ) (163a) = + โ ๐ ยฑ ๐๐ โฒ cos ( ๐ โฒ ) โ ๐ โ ๐๐ โฒ cos ( ๐ โฒ ) ( ๐ โฒ ) = โ ( ๐ โฒ ) ( ๐ โฒ ) = . (163b)This completes the proof of (129). E META-ORACLE CONSTRUCTION
This section describes the construction of the meta-oracle discussed in Section 7.4. For the purposesof this section, it is more natural to work with generic unitary operators ๐ , instead of oracles ๐ ๐ with a known eigenbasis. Accordingly, the subscript โ ๐ โ will be dropped from the oracles ๐ ๐ and U ๐ . Similarly, the subscript โ โ will be dropped from the circuit ๐ด , and the states | ๐ โฉ and | ๐ฟ โฉ ,since they are not to be interpreted as โinitial statesโ in this section. The symbol |ยทโฉ will refer to anarbitrary pure state of a quantum system.Let ๐๐ด be a meta-circuit for preparing the state | ๐ โฉ , parameterized by an additional โcontrolโquantum register (with an orthonormal basis {| โฉ ctrl , | โฉ ctrl , . . . , | ๐ ๐ด โ โฉ ctrl } ) as follows: ๐๐ด (cid:104) | ๐ฅ ๐ด โฉ ctrl โ |ยทโฉ (cid:105) = | ๐ฅ ๐ด โฉ ctrl โ (cid:2) ๐ด ( ๐ฅ ๐ด ) |ยทโฉ (cid:3) , โ ๐ฅ ๐ด โ { , . . . , ๐ ๐ด โ } , (164) ๐๐ด (cid:104) | ๐ฅ ๐ด โฉ ctrl โ | โฉ (cid:105) = | ๐ฅ ๐ด โฉ ctrl โ | ๐ ( ๐ฅ ๐ด )โฉ , โ ๐ฅ ๐ด โ { , . . . , ๐ ๐ด โ } . (165)Here, the operator ๐ด ( ๐ฅ ๐ด ) and the state | ๐ ( ๐ฅ ๐ด )โฉ are both parameterized by ๐ฅ ๐ด via the quantumregister with the subscript โ ctrl โ. Likewise, let ๐๐ be a meta-circuit for the unitary ๐ , parameterizedby an additional quantum register (with an orthonormal basis {| โฉ ctrl , . . . , | ๐ ๐ โ โฉ ctrl } ) as follows: ๐๐ (cid:104) | ๐ฅ ๐ โฉ ctrl โ |ยทโฉ (cid:105) = | ๐ฅ ๐ โฉ ctrl โ (cid:2) ๐ ( ๐ฅ ๐ ) |ยทโฉ (cid:3) , โ ๐ฅ ๐ โ { , . . . , ๐ ๐ โ } . (166)Here ๐ ( ๐ฅ ๐ ) is parameterized by the parameter ๐ฅ ๐ . The unitary operations performed by ๐๐ด and ๐๐ can be written as ๐๐ด = ๐ ๐ด โ โ๏ธ ๐ฅ ๐ด = (cid:104) | ๐ฅ ๐ด โฉ โจ ๐ฅ ๐ด | (cid:105) ctrl โ ๐ด ( ๐ฅ ๐ด ) , (167) ๐๐ = ๐ ๐ โ โ๏ธ ๐ฅ ๐ = (cid:104) | ๐ฅ ๐ โฉ โจ ๐ฅ ๐ | (cid:105) ctrl โ ๐ ( ๐ฅ ๐ ) . (168)The meta-circuits ๐๐ด and ๐๐ are depicted in Figure 12. Under this setup, โข The two-register state | ๐ฟ โฉ and operator S ๐ฟ will be parameterized as | ๐ฟ ( ๐ฅ ๐ด )โฉ = |+โฉ โ | ๐ ( ๐ฅ ๐ด )โฉ , (169) S ๐ฟ ( ๐ฅ ๐ด ) = | ๐ฟ ( ๐ฅ ๐ด )โฉ โจ ๐ฟ ( ๐ฅ ๐ด )| โ I . (170) โข The two-register operator U = ๐ป โ ๐ will be parameterized as U ( ๐ฅ ๐ ) . on-Boolean Quantum Amplitude Amplification and Quantum Mean Estimation 35 ๐๐ด control | ๐ฅ ๐ด โฉ ctrl ๐ด ( ๐ฅ ๐ด ) ๐๐ control | ๐ฅ ๐ โฉ ctrl ๐ ( ๐ฅ ๐ ) Fig. 12. Meta-circuits ๐๐ด (left panel) and ๐๐ (right panel), which implement the parameterized operations ๐ด ( ๐ฅ ๐ด ) and ๐ ( ๐ฅ ๐ ) , respectively. The actions of the circuits ๐๐ด and ๐๐ are shown for the case when theircontrol registers are in the basis states | ๐ฅ ๐ด โฉ ctrl and | ๐ฅ ๐ โฉ ctrl , respectively. MQ iter ๐๐ด control: | ๐ฅ ๐ด โฉ ctrl ๐ ยฑ ๐๐ ( ๐ฅ ๐ด ,๐ฅ ๐ ) ร input state ๐๐ control: | ๐ฅ ๐ โฉ ctrl original two registers (cid:12)(cid:12) ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ ) (cid:11) : ๐ U ( ๐ฅ ๐ ) S ๐ฟ ( ๐ฅ ๐ด ) Fig. 13. Quantum circuit for the meta-oracle MQ iter , which evaluates the states of the control registers. Theaction of the oracle is shown for the case when the inputs state is follows: The control registers of ๐๐ด and ๐๐ are in basis states | ๐ฅ ๐ด โฉ ctrl and | ๐ฅ ๐ โฉ ctrl , respectively, and the original two (non-control) registers are inthe state | ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ . โข The quantity ๐ and the two-register states | ๐ผ ยฑ โฉ will be parameterized as ๐ ( ๐ฅ ๐ด , ๐ฅ ๐ ) = arccos (cid:104) Re (cid:2) โจ ๐ ( ๐ฅ ๐ด ) | ๐ ( ๐ฅ ๐ ) | ๐ ( ๐ฅ ๐ด โฉ (cid:3) (cid:105) , (171) | ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ = ๐ ยฑ ๐๐ ( ๐ฅ ๐ด ,๐ฅ ๐ ) | ๐ฟ ( ๐ฅ ๐ด )โฉ โ U ( ๐ฅ ๐ ) | ๐ฟ ( ๐ฅ ๐ด )โฉ ๐ โ (cid:0) ๐ ( ๐ฅ ๐ด , ๐ฅ ๐ ) (cid:1) . (172)Now, using ๐๐ด and ๐๐ , one can create a meta-operator MQ iter , which is simply Q iter parame-terized additionally by ๐ฅ ๐ด and ๐ฅ ๐ . The circuit for MQ iter is shown in Figure 13. From (107), theaction of MQ iter on | ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ can be written as MQ iter (cid:104) | ๐ฅ ๐ด , ๐ฅ ๐ โฉ ctrl โ | ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ (cid:105) = ๐ ยฑ ๐๐ ( ๐ฅ ๐ด ,๐ฅ ๐ ) (cid:104) | ๐ฅ ๐ด , ๐ฅ ๐ โฉ ctrl โ | ๐ผ ยฑ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ (cid:105) . (173)From this equation, it can be see that MQ iter acts as a meta-oracle that evaluates the state of thecontrols registers based on the corresponding value of ๐ . Furthermore, MQ iter accomplishes thistask using only O ( ) calls to ๐๐ด and ๐๐ . This meta-oracle can be used with the non-booleanamplitude amplification algorithm of this paper to find โgoodโ states for the control registers. Notethat to use MQ iter as an oracle for the control registers, the original two (non-control) registers must be coupled to the control registers using ๐ด ( ๐ฅ ๐ด ) : |+โฉ โ (cid:104) ๐ด ( ๐ฅ ๐ด ) | โฉ (cid:105) = | ๐ฟ ( ๐ฅ ๐ด )โฉ = | ๐ผ + ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉ โ | ๐ผ โ ( ๐ฅ ๐ด , ๐ฅ ๐ )โฉโ . (174)This coupling step can be incorporated into the circuit used to create the initial superposition inputof the meta-oracle MQ iter .A construction similar to the one in this section can be used to create a meta-oracle ๐๐ evenodd (parameterized version of ๐ evenodd ), which evaluates the control registers based on cos (cid:0) ๐ โฒ ( ๐ฅ ๐ด , ๐ฅ ๐ ) (cid:1) = (cid:12)(cid:12) โจ ๐ ( ๐ฅ ๐ด ) | ๐ ( ๐ฅ ๐ ) | ๐ ( ๐ฅ ๐ด )โฉ (cid:12)(cid:12) ..