Skip to content

workbench_algorithms.utils.amplitude_amplification_utils

Utility functions for amplitude amplification.

get_final_reflection_angle

get_final_reflection_angle(optimal_full_refls, p_succ)

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

calculate_vanilla_amp_amp_angles(p_succ)

Compute the optimal number of iterations and reflection angles for fixed-point amplitude amplification.

Reference
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

calculate_fixed_point_amp_amp_angles(p_succ, eps_targ)

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 (alphas) contains angles for reflections about the initial state, while the second list (betas) contains angles for reflections about the final state.