qcmet.benchmarks.MirroredCircuits#
- class qcmet.benchmarks.MirroredCircuits(qubits, num_circuits, m=None, clifford_operators=None, seed=None, save_path=None)[source]#
Implementation of the mirrored circuits average polarization metric.
This class takes in or creates a base circuit of Cliffords, and creates the mirrored circuits including random Paulis to suppress accidental error cancellation. It returns the average polarization metric measuring the average similarity between the exact expected output and the measured output bitstrings.
- __init__(qubits, num_circuits, m=None, clifford_operators=None, seed=None, save_path=None)[source]#
Initialize the MirroredCircuits benchmark.
- Parameters:
qubits (int | List[int]) – The number of qubits as either a list of qubit indices or int specifying number of qubits.
num_circuits (int) – The number of mirrored circuits k.
m (int, optional) – The number of Clifford layers used when no list of Clifford operators is passed in.
clifford_operators (List[Clifford], optional) – The list of Clifford operators to use as the base circuit
seed (int, optional) – Random seed to use for randomisations, defaults to None, meaning that it will be defined at random
save_path (str | Path | FileManager | None, optional) – Directory path to save results. Defaults to None.
Methods
__init__(qubits, num_circuits[, m, ...])Initialize the MirroredCircuits benchmark.
analyze()Analyze measurements to return benchmark results.
generate_circuits()Generate benchmark circuits, user facing.
has_plotting()Check if _plot function is implemented in benchmark.
load_circuit_measurements(circuit_measurements)Load measurement counts into the experiment_data DataFrame.
measurements_to_probabilities()Convert raw measurement counts to normalized probabilities.
plot([axes])Plot benchmark result, user facing.
run([device, num_shots, max_circs_per_job])Run benchmark.
save()Save benchmark current state.
set_save_path(save_path)Set benchmark save path if not set in class constructor.
Attributes
circuitsGets all benchmark circuits.
experiment_dataGetter for experiment_data dataframe.
num_qubitsNumber of qubits in this benchmark.