View on GitHub
Open this notebook in GitHub to run it yourself
Oblivious Amplitude Amplification
This demo explains the Oblivious Amplitude Amplification algorithm (OAA) [2], which can be used as a building block in algorithms such as Hamiltonian simulations. We start with a short recap, then show how to use it in conjunction with the Linear Combination of Unitaries (LCU) algorithm.Problem formulation
- Input: A -block-encoding of a matrix .
- Promise: is unitary (or close to unitary).
- Output: A -block-encoding of .
Background
Recap: Amplitude Amplification
Ref. [1] shows how to use the Grover operator to amplify a specific state. In detail, given a unitary to prepare a state : and a unitary to implement a reflection over the state : We want to decrease the amplitude of to be
Why Another Version?
As you might have noticed, the amplification requires the “recipe” for the preparation of , and uses it to perform the reflection around the initial state. In certain scenarios, such as in Hamiltonian simulations, we might not be able to create the initial state or it is very inefficient. Specifically, we look at a -block-encoding of a matrix : (For detailed explanations of block-encodings and Hamiltonian simulations, see this demo.) We want to amplify the amplitude of the state that is in the block, i.e., . This sometimes can be done in post-selection, but if we use more than once in the algorithm, then the amplitude to sample the “good” states exponentially decreases. It turns out, however, that if is unitary, then we can reflect about the initial state for any using the operator where , which is analogous to the reflection about the zero state. Then we get the same effective 2D picture! So, to get with probability , roughly Grover iterations are needed.
Building the Algorithm with Classiq

Example: Unitary LCU Amplification
Here we take the matrix and block-encode it using LCU, creating the matrix . In general, though LCU is a combination of unitaries, the result is not necessarily unitary. In this specific example, the matrix is unitary, and so the encoding can be amplified using oblivious amplitude amplification.Block-encoding the Hamiltonian
First show that the sampled state after the application of is in the wanted block only in of the cases, meaning that in this case . The input to is a randomly sampled vector of normalized amplitudes.| data | block | count | probability | bitstring | |
|---|---|---|---|---|---|
| 3 | 0 | 0 | 323 | 0.157715 | 0000 |
| 4 | 2 | 0 | 122 | 0.059570 | 0010 |
| 8 | 1 | 0 | 73 | 0.035645 | 0001 |
Output:
Block-encoding Amplification
Now we wrap with the oblivious amplitude amplification scheme. It is almost like regular Grover, except that it does not take the initial state preparation to the Grover operator. Also, the Grover diffuser only works on the block qubits. (We take advantage of the language capturing mechanism.) Theblock_oracle ( in the used notation) operates on the block qubits and checks that they are in the wanted block (i.e., equal to the state ).
The operator is represented by the function block_encoding.
As the original total amplitude of the “good states” is , exactly one Grover iteration will amplify the amplitude to
Output:
| data | block | count | probability | bitstring | |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 1353 | 0.660645 | 0000 |
| 1 | 2 | 0 | 456 | 0.222656 | 0010 |
| 2 | 1 | 0 | 239 | 0.116699 | 0001 |
Output: