supermarq.qcvv.irb
Tooling for interleaved randomised benchmarking.
Classes
Interleaved random benchmarking (IRB) experiment. |
|
Data structure for the IRB experiment results. |
|
Data structure for the RB experiment results. |
Module Contents
- class supermarq.qcvv.irb.IRB(num_circuits: int, cycle_depths: collections.abc.Iterable[int], interleaved_gate: cirq.Gate | None = cirq.Z, qubits: int | collections.abc.Sequence[cirq.Qid] = 1, clifford_op_gateset: cirq.CompilationTargetGateset = cirq.CZTargetGateset(), *, random_seed: int | numpy.random.Generator | None = None, _samples: list[supermarq.qcvv.base_experiment.Sample] | None = None, **kwargs: str)
Bases:
supermarq.qcvv.base_experiment.QCVVExperiment[_RBResultsBase]Interleaved random benchmarking (IRB) experiment.
IRB estimates the gate error of specified Clifford gate, \(\mathcal{C}^*\). This is achieved by first choosing a random sequence, \(\{\mathcal{C_i}\}_m\) of \(m\) Clifford gates and then using this to generate two circuits. The first is generated by appending to this sequence the single gate that corresponds to the inverse of the original sequence. The second circuit it obtained by inserting the interleaving gate, \(\mathcal{C}^*\) after each gate in the sequence and then again appending the corresponding inverse element of the new circuit. Thus both circuits correspond to the identity operation.
We run both circuits on the specified target and calculate the probability of measuring the resulting state in the ground state, \(p(0...0)\). This gives the circuit fidelity
\[f(m) = 2p(0...0) - 1\]We can then fit an exponential decay \(\log(f) \sim m\) to this circuit fidelity for each circuit, with decay rates \(\alpha\) and \(\tilde{\alpha}\) for the circuit without and with interleaving respectively. Finally the gate error of the specified gate, \(\mathcal{C}^*\) is estimated as
\[e_{\mathcal{C}^*} = \frac{1}{2} \left(1 - \frac{\tilde{\alpha}}{\alpha}\right)\]For more details see: https://arxiv.org/abs/1203.4550
- gates_per_clifford(samples: int = 500) dict[str, float]
Samples a number of random Clifford operations and calculates the average number of single and two qubit gates used to implement them. Note this depends on the gateset chosen for the experiment.
- Parameters:
samples – Number of samples to use. Defaults to 500.
- Returns:
A dictionary with the average number of one and two qubit gates used.
- random_clifford() cirq.CliffordGate
Returns: A random clifford gate with the correct number of qubits for the current experiment.
- random_single_qubit_clifford() cirq.SingleQubitCliffordGate
Choose a random single qubit clifford gate.
- Returns:
The random clifford gate.
- random_two_qubit_clifford() cirq.CliffordGate
Choose a random two qubit clifford gate.
For algorithm details see https://arxiv.org/abs/1402.4848 & https://arxiv.org/abs/1210.7011.
- Returns:
The random clifford gate.
- clifford_op_gateset
The gateset to use when implementing Clifford operations.
- class supermarq.qcvv.irb.IRBResults
Bases:
_RBResultsBaseData structure for the IRB experiment results.
- plot_results(filename: str | None = None) matplotlib.pyplot.Figure
Plot the exponential decay of the circuit fidelity with cycle depth.
- Parameters:
filename – Optional argument providing a filename to save the plots to. Defaults to None, indicating not to save the plot.
- Returns:
A single matplotlib figure containing the IRB and RB decay plots and the corresponding fits.
- Raises:
RuntimeError – If no data is stored.
- print_results() None
Prints the key results data.
- property average_interleaved_gate_error: float
Returns: Estimate of the interleaving gate error.
- property average_interleaved_gate_error_std: float
Returns: Standard deviation of the estimate for the interleaving gate error.
- property irb_decay_coefficient: float
Returns: Decay coefficient estimate with the interleaving gate.
- property irb_decay_coefficient_std: float
Returns: Standard deviation of the decay coefficient estimate with the interleaving gate.
- class supermarq.qcvv.irb.RBResults
Bases:
_RBResultsBaseData structure for the RB experiment results.
- plot_results(filename: str | None = None) matplotlib.pyplot.Figure
Plot the exponential decay of the circuit fidelity with cycle depth.
- Parameters:
filename – Optional argument providing a filename to save the plots to. Defaults to None, indicating not to save the plot.
- Returns:
A single matplotlib figure containing the RB decay plot and the corresponding fit.
- Raises:
RuntimeError – If no data is stored.
- print_results() None
Prints the key results data.
- property average_error_per_clifford: float
Returns: Estimate of the average error per Clifford operation.
- property average_error_per_clifford_std: float
Returns: Standard deviation of the the average error per Clifford operation.