workbench_algorithms.utils.amplitude_amplification_utils
Utility functions for amplitude amplification.
get_final_reflection_angle
Compute the optimal final angles for vanilla amplitude amplification.
Notes: - The equation is complex, so optimization is used to determine the best angles. - Optimal angles minimize the difference in Eq. (12) from arXiv:0005055.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
optimal_full_refls
|
int
|
Number of full reflections needed. |
required |
p_succ
|
float
|
Initial probability of obtaining the good state. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[float], List[float]]
|
Tuple of angles (in degrees) for the final AA reflection. The first value is for reflection around the initial state, and the second for reflection around the good state. |
calculate_vanilla_amp_amp_angles
Compute the optimal number of iterations and reflection angles for fixed-point amplitude amplification.
Reference
- Section 2.1 of arXiv:0005055.
Note
- All angles are set to \(\pi\) except for the last, which is adjusted for exact final overlap.
- The target state is obtained exactly (up to numerical precision).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_succ
|
float
|
Initial probability of obtaining the good state. |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[float], List[float]]
|
Angles for amplitude amplification reflections. |
calculate_fixed_point_amp_amp_angles
Compute the optimal number of iterations and reflection angles for fixed-point amplitude amplification.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
p_succ
|
float
|
Initial probability of obtaining the good state. |
required |
eps_targ
|
float
|
Target error \(\epsilon\). |
required |
Returns:
| Type | Description |
|---|---|
Tuple[List[float], List[float]]
|
The first list ( |