estimate_purity¶
-
forest.benchmarking.randomized_benchmarking.
estimate_purity
(dim: int, op_expect: numpy.ndarray, renorm: bool = True)¶ The renormalized, or ‘shifted’, purity is given in equation (10) of [ECN] where d is the dimension of the Hilbert space, 2**num_qubits
Parameters: - dim – dimension of the hilbert space
- op_expect – array of estimated expectations of each operator being measured
- renorm – flag that renormalizes result to be between 0 and 1
Returns: purity given the operator expectations