AmpAmpByOracle function

Standard Amplitude Amplification algorithm

function AmpAmpByOracle (nIterations : Int, stateOracle : Microsoft.Quantum.Canon.StateOracle, idxFlagQubit : Int) : (Qubit[] => Unit : Adjoint, Controlled)

Input

nIterations
Int

Number of iterations $n$ of amplitude amplification

stateOracle
StateOracle
idxFlagQubit
Int

Index to flag qubit

Output

An operation that implements the standard amplitude amplification quantum algorithm

Functors
Adjoint Controlled

Input: Qubit[]

Output: Unit

Remarks

This is the standard amplitude amplification algorithm obtained by a choice of reflection phases computed by AmpAmpPhasesStandard Assuming that \begin{align} A\ket{0}_{f}\ket{0}_s= \lambda\ket{1}_f\ket{\text{target}}_s + \sqrt{1-|\lambda|^2}\ket{0}_f\cdots, \end{align} this operation prepares the state \begin{align} \operatorname{AmpAmpByOracle}\ket{0}_{f}\ket{0}_s= \sin((2n+1)\sin^{-1}(\lambda))\ket{1}_f\ket{\text{target}}_s + \cdots\ket{0}_f \end{align} In most cases, flagQubit and ancillaRegister is initialized in the state $\ket{0}_f\ket{0}_a$.

References