|View source on GitHub|
Purity estimator from speckle purity benchmarking.
cirq.experiments.purity_from_probabilities( hilbert_space_dimension: int, probabilities: Sequence[float] ) -> float
Estimates purity from empirical probabilities of observed bitstrings.
This estimator assumes that the circuit used in experiment is sufficiently scrambling that its output probabilities follow the Porter-Thomas distribution. This assumption holds for typical instances of random quantum circuits of sufficient depth.
The state resulting from the experimental implementation of the circuit is modeled as
ρ = p |𝜓⟩⟨𝜓| + (1 - p) I / D
where |𝜓⟩ is a pure state, I / D is the maximally mixed state, and p is between 0 and 1. The purity of this state is given by p**2. If p = 1, then the bitstring probabilities are modeled as being drawn from the Porter-Thomas distribution, with probability density function given by
f(x) = (D - 1) (1 - x)**(D - 2).
The mean of this distribution is 1 / D and its variance is (D - 1) / [D2 (D + 1)]. In general, the variance of the distribution is multipled by p2. Therefore, the purity can be computed by dividing the variance of the empirical probabilities by the Porter-Thomas variance (D - 1) / [D**2 (D + 1)].
||Dimension of the Hilbert space on which the quantum circuits acts.|
||Empirical probabilities of bitstrings observed in experiment.|
|Estimate of the purity of the state resulting from the experimental implementation of a quantum circuit.|