Skip to main content

View on GitHub

Open this notebook in GitHub to run it yourself
The following is a usage example for the exact_amplitude_amplification function. We will amplify the state 1|1\rangle out of the state 0.070+0.931\sqrt{0.07}|0\rangle + \sqrt{0.93}|1\rangle. We provide the function with the following parameters:
  • amplitude: 0.07\sqrt{0.07}, the original amplitude of the wanted state.
  • oracle: ZZ, that will apply a (1)(-1) phase on the 1|1\rangle state.
  • space_transform: the state preparation function of the original state.
  • packed_vars: x, the quantum variable to apply on.
Notice that knowledge of the amplitude of the “good” state is need.
Output:
The concept in the implementation is to reduce the initial angle between the good and bad states to be an exact division of 1 by a integer:
output