unitaria.util.sample_bound

unitaria.util.sample_bound(precision: float, failure_probability: float) int[source]

Number of samples needed in Monte Carlo amplitude estimation

Specificall, computes a number of samples that guarantees the given precision with the given failure probability, when computing the square root of the expected value (corresponding to the amplitude of a quantum state).