qermit.probabilistic_error_cancellation¶
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_PEC_learning_based_MitEx(device_backend, simulator_backend, **kwargs)[source]¶
Generates MitEx object for mitigating errors using learning based Probabilistic Error Cancellation (PEC), as introduced in https://arxiv.org/abs/2005.07601.
- Parameters:
- Key simulator_mitex:
MitEx object ideal state simulations are run on, default simulator_backend.
- Key device_mitex:
MitEx object observable experiments are run on, default device_backend.
- Key seed:
Seed for np.random, default None.
- Key optimisation_level:
Optimisation level for initial compilation, default 0.
- Key num_cliff:
The number of random Clifford circuits generated for each primary circuit, default 10.
- Raises:
RuntimeError – Raised if the backend gate set does not include CX or CZ gates.
- Return type:
- Returns:
MitEx object implementing error-mitigation via learning based PEC.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_rebase_to_frames_and_computing()[source]¶
Generates task which rebases circuits into the Frame and Computing gate set, as defined in https://arxiv.org/abs/2005.07601. In particular, all two qubit gates are Clifford gates (called Frame gates), and all single qubit gates (called Computing gates) are merged where possible.
- Return type:
- Returns:
MitTask object which rebases circuits into the Frame and Computing gate set.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_run_with_quasi_prob()[source]¶
Generates task which converts list of quasi probabilities and noisy circuit results into error mitigated results.
- Return type:
- Returns:
MitTask performing mitigation given noisy results and quasi-probabilities.
- qermit.probabilistic_error_cancellation.pec_learning_based.collate_results_task_gen()[source]¶
Generates task which collates results from running circuit, and circuits with frame gates wrapped in Pauli gates. The results are collated so as to facilitate learning the quasiprobabilities required for correction. The data itself is not changed by this task.
- Return type:
- Returns:
MitTask object collating results.
- qermit.probabilistic_error_cancellation.pec_learning_based.learn_quasi_probs_task_gen(num_cliff_circ)[source]¶
Generates task which characterises quasi-probabilities. This takes ideal simulation results (from running Clifford circuit) and noisy results, and uses them to deduce quasi-probabilities for later correction of real experiment results.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_get_clifford_training_set(simulator_backend, num_rand_cliff)[source]¶
Generates task which creates characterisation Clifford circuits. These circuits are constructed from an initial circuit by replacing all Computing gates with random Clifford gates.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_label_gates()[source]¶
Generates task which labels all gates as either Computing or Frame. Frame gates are 2-qubit Clifford gates and Computing gates are single qubit gates. Circuits should be rebased to Frame and Computing before this task.
- Return type:
- Returns:
MitTask performing labelling of gates.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_wrap_frame_gates()[source]¶
Generates task which wraps Frame gates in Pauli gates, initially set to the identity. Pauli gates are labelled as such.
- Return type:
- Returns:
MitTask which performs wrapping.
- qermit.probabilistic_error_cancellation.pec_learning_based.gen_get_noisy_circuits(backend, **kwargs)[source]¶
Generates task which create list of circuts, build from original by adding an error to one of the Frame gates. An error here is recreated by replacing a pair of Pauli gates, wrapped around one Frame gate, by a Pauli gate. Note that there will be a new circuit for each possible Pauli error.