qcmet.benchmarks.OverUnderRotationAngle#

class qcmet.benchmarks.OverUnderRotationAngle(qubits=1, delta_m=20, gate=<class 'qiskit.circuit.library.standard_gates.sx.SXGate'>, m_max=200, num_gates_for_id=4, save_path=None)[source]#

Benchmark to estimate coherent over-/under-rotation on one qubit.

This benchmark generates a family of pseudoidentity circuits of length m, measures the probability of state |0⟩ vs m, and fits the decay and oscillation to extract the rotation-angle error per gate. The fit model is

prob_0(m) = a + b*e^(–i*decay_rate*m)·cos(m*theta_err + phase)

config#

Holds ‘delta_m’, ‘m_max’, ‘num_gates_for_id’, and ‘m_array’.

Type:

dict

experiment_data#

Populated by BaseBenchmark after generate_circuits.

Type:

pd.DataFrame

fit_result#

Holds ‘popt’ and ‘pcov’ from curve_fit.

Type:

dict

fit_overrotation_amount#

Extracted angle error per SX gate, in units of π.

Type:

float

__init__(qubits=1, delta_m=20, gate=<class 'qiskit.circuit.library.standard_gates.sx.SXGate'>, m_max=200, num_gates_for_id=4, save_path=None)[source]#

Initialize the OverUnderRotationAngle benchmark.

Parameters:
  • delta_m (int) – Step size in repeat count m between pseudoidentity circuits.

  • m_max (int) – Maximum number of repeats (inclusive).

  • qubits (int | List[int]) – The number of qubits as either a list of qubit indices or int specifying number of qubits.

  • gate (Gate) – Gate to measure over-under rotation

  • num_gates_for_id (int) – Number of SX gates in each repeated pseudoidentity.

  • save_path (str | Path | FileManager | None, optional) – Directory path to save results. Defaults to None.

Methods

__init__([qubits, delta_m, gate, m_max, ...])

Initialize the OverUnderRotationAngle benchmark.

analyze()

Analyze measurements to return benchmark results.

fit_func(m, a, b, decay_rate, theta_err, phase)

Model function for fitting prob_0 vs m.

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

circuits

Gets all benchmark circuits.

experiment_data

Getter for experiment_data dataframe.

num_qubits

Number of qubits in this benchmark.

static fit_func(m, a, b, decay_rate, theta_err, phase)[source]#

Model function for fitting prob_0 vs m.

Parameters:
  • m (ndarray) – Repeat counts.

  • a (float) – Baseline offset.

  • b (float) – Amplitude scaling.

  • decay_rate (float) – Exponential decay constant.

  • theta_err (float) – Rotation angle error per pseudoidentity.

  • phase (float) – Phase offset of the cosine.

Returns:

Modeled prob_0 values at each m.

Return type:

ndarray