qcmet.benchmarks.IdleQubitOscillationFrequency#
- class qcmet.benchmarks.IdleQubitOscillationFrequency(dt, t_max, extra_zz_crosstalk=0, qubit_index=0, crosstalk_qubit_index=None, save_path=None)[source]#
Implementation of the idle qubit oscillation frequency metric.
This class generates idle circuits for three initial states, |0>, |+> and |R>, measures the output under three bases, Z, X and Y, and computes the qubit purity oscillation frequency for each initial state, giving the largest among the three as the metric.
- __init__(dt, t_max, extra_zz_crosstalk=0, qubit_index=0, crosstalk_qubit_index=None, save_path=None)[source]#
Initialize the idle qubit oscillation frequency metric.
- Parameters:
dt (float) – The time interval for each idle step.
t_max (float) – The max idle time.
extra_zz_crosstalk (float, optional) – The strength of extra ZZ gates for simulating non-Markovian noise. If non-zero, circuits generated will be two-qubit circuits containing extra ZZ gates for each idle step. Defaults to 0.
qubit_index (int, optional) – The qubit index for routing. Defaults to 0.
crosstalk_qubit_index (optional) – The qubit index for the extra qubit used when extra_zz_crosstalk > 0. Defaults to qubit_index + 1.
save_path (str, optional) – Directory path to save results. Defaults to None.
Methods
__init__(dt, t_max[, extra_zz_crosstalk, ...])Initialize the idle qubit oscillation frequency metric.
add_idle_gates(circuit, steps)Add a number of idle gates to circuit corresponding to steps.
analyze()Analyze measurements to return benchmark results.
change_measurement_basis(circuit, basis)Change the measurement basis of circuit to be in basis.
fit_func(x, a, b, lambda_, omega)Exponentially decaying oscillation fit function.
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.
prepare_initial_state(circuit, initial_state)Prepare a specified initial state on circuit.
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.
- prepare_initial_state(circuit, initial_state)[source]#
Prepare a specified initial state on circuit.
- Parameters:
circuit (QuantumCircuit) – An empty circuit.
initial_state (int) – The initial state, represented by self._Z, self._X or self._Y.
- Returns:
None. The method updates circuit in place.
- add_idle_gates(circuit, steps)[source]#
Add a number of idle gates to circuit corresponding to steps.
- Parameters:
circuit (QuantumCircuit) – A circuit to add idle gates to.
steps (int) – The number of idle steps.
- Returns:
None. The method updates circuit in place.
- change_measurement_basis(circuit, basis)[source]#
Change the measurement basis of circuit to be in basis.
- Parameters:
circuit (QuantumCircuit) – A circuit to change the measurement basis for.
basis (int) – The basis to change to, represented by self._Z, self._X or self._Y.
- Returns:
None. The method updates circuit in place.