num_trials

forest.benchmarking.robust_phase_estimation.num_trials(depth, max_depth, multiplicative_factor: float = 1.0, additive_error: float = None, alpha: float = 2.5, beta: float = 0.5) → int

Calculate the optimal number of shots per program with a given depth.

The calculation is given by equations V.11 and V.17 in [RPE]. A non-default multiplicative factor breaks the optimality guarantee. Larger additive_error leads to a longer experiment, but the variance bounds only apply if the additive_error sufficiently reflects reality.

Parameters:
  • depth – the depth of the program whose number of trials is calculated
  • max_depth – maximum depth of programs in the experiment
  • multiplicative_factor – extra add-hoc factor that multiplies the optimal number of shots
  • additive_error – estimate of the max additive error in the experiment, eq. V.15 of [RPE]
  • alpha – a hyper-parameter in equation V.11 of [RPE], suggested to be 5/2, > 2
  • beta – a hyper-parameter in equation V.11 of [RPE], suggested to be 1/2, > 0
Returns:

Mj, the number of shots for program with depth 2**(j-1) in iteration j of RPE