do_dfe(qc: pyquil.api._quantum_computer.QuantumComputer, benchmarker: pyquil.api._benchmark.BenchmarkConnection, program: pyquil.quil.Program, qubits: List[int], kind: str, mc_n_terms: int = None, num_shots: int = 1000, active_reset: bool = False, group_tpb_settings: bool = False, mitigate_readout_errors: bool = True, show_progress_bar: bool = False) → Tuple[Tuple[float, float], forest.benchmarking.observable_estimation.ObservablesExperiment, List[forest.benchmarking.observable_estimation.ExperimentResult]]¶
A wrapper around experiment generation, data acquisition, and estimation that runs a DFE experiment and returns the (fidelity, std_err) pair along with the experiment and results.
- qc – A quantum computer object on which the experiment will run.
- benchmarker – object returned from pyquil.api.get_benchmarker() used to conjugate each Pauli by the Clifford program
- program – A program comprised of Clifford group gates that either constructs the
state or defines the process for which we estimate the fidelity, depending on whether
kindis ‘state’ or ‘process’ respectively.
- qubits – The qubits to perform DFE on. This can be a superset of the qubits
program, in which case it is assumed the identity acts on these qubits. Note that we assume qubits are initialized to the
- kind – A string describing the kind of DFE to do (‘state’ or ‘process’)
- mc_n_terms – Number of randomly chosen observables to measure for Monte Carlo DFE.
By default, when this is None, we do exhaustive DFE. The number should be a constant less
2**len(qubits), otherwise exhaustive DFE is more efficient.
- num_shots – The number of shots to be taken for each experiment setting.
- active_reset – Boolean flag indicating whether experiments should begin with an active reset instruction (this can make the collection of experiments run a lot faster).
- group_tpb_settings – if true, compatible settings will be formed into groups that can be estimated concurrently from the same shot data. This will speed up the data acquisition time by reducing the total number of runs, but be aware that grouped settings will have non-zero covariance. TODO: set default True after handling covariance.
- mitigate_readout_errors – Boolean flag indicating whether bias due to imperfect readout should be corrected
- show_progress_bar – displays a progress bar via tqdm if true.
The estimated fidelity of the state prepared by or process represented by the input
program, as implemented on the provided
qc, along with the standard error of the estimate. The experiment and corresponding results are also returned.