qcmet.benchmarks.QuantumVolumeFixedQubits#

class qcmet.benchmarks.QuantumVolumeFixedQubits(trials=100, qubits=4, save_path=None, seed=None)[source]#

Implementation of the Quantum Volume Metric.

This class generates square circuits with Nq qubits and Nq layers of gates, where the layers comprise of an Nq qubit gate which randomly changes the order of qubits and a column of Haar-random two-qubit gates. The ideal probabilites of all bistrings are determined from noiseless simulations and the heavy output probability is calculated for each circuit. Finally, the condition for the device achieving a quantum volume of 2^Nq is checked.

__init__(trials=100, qubits=4, save_path=None, seed=None)[source]#

Initialize the quantum volume benchmark.

Parameters:
  • trials (int) – The number of circuits to generate.

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

  • seed (int, optional) – Set the seed for random number generation.

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

Methods

__init__([trials, qubits, save_path, seed])

Initialize the quantum volume 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

circuits

Gets all benchmark circuits.

experiment_data

Getter for experiment_data dataframe.

num_qubits

Number of qubits in this benchmark.