[Qmod Classiq-library function]Applies the Amplitude Amplification algorithm; Prepares a state using the given space_transform function, and applies reps repetititions
of the grover operator, using the given oracle functions which marks the “good” states.Parameters:
Name
Type
Description
Default
reps
CInt
Number of repetitions to apply the grover operator on the initial state. Should be determined by the user, according to the calculated amplification.
required
oracle
QCallable[QArray[QBit]]
The oracle operator that marks the “good” states. This operator should flip the sign of the amplitude of the “good” state.
required
space_transform
QCallable[QArray[QBit]]
The space transform operator (which is known also the state preparation operator). First applied to prepare the state before the amplification, then used inside the Grover operator.
[Qmod Classiq-library function]Applies an exact version of the Amplitude Amplification algorithm, assuming knowledge of the amplitude of the marked state.
The function should be applied on the zero state, and it takes care for preparing the initial state before amplification using the space_transform.Based on the algorithm in Quantum state preparation without coherent arithmetic.Assuming the space_transform creates a state ∣ψ⟩=a∣ψ{good}⟩+{1−a}∣ψ{bad}⟩, given a as the amplitude
argument, the function will load exactly the state ∣ψ{good}⟩.Note: if the amplitude argument is not exact, the resulting state will not be exactly ∣ψ{good}⟩, and there will be additional internal auxilliary of the function that is not released correctly.Parameters:
Name
Type
Description
Default
amplitude
CReal
The amplitude of the state ∥ψ{good}⟩ with regards to the initial state prepared by space_transform.
required
oracle
QCallable[QArray[QBit]]
The oracle operator that marks the “good” states. This operator should flip the sign of the amplitude of the “good” state.
required
space_transform
QCallable[QArray[QBit]]
The space transform operator (which is known also the state preparation operator). First applied to prepare the state before the amplification, then used inside the Grover operator.