iqm.benchmarks.entanglement.ghz.GHZBenchmark#

class iqm.benchmarks.entanglement.ghz.GHZBenchmark(backend: IQMBackend | IQMFacadeBackend | str, configuration: GHZConfiguration)#

Bases: Benchmark

The GHZ Benchmark estimates the quality of generated Greenberger–Horne–Zeilinger states.

Attributes

Methods

add_configuration_to_dataset(dataset)

Creates a xarray.Dataset and adds the circuits and configuration metadata to it.

analysis_function(run)

Analyze counts and compute the state fidelity.

append_rms(num_rms, qubit_layout)

Appends 1Q Clifford gates sampled uniformly at random to all qubits in the given circuit.

execute(backend)

Executes the benchmark.

generate_coherence_meas_circuits(...)

Takes a given GHZ circuit and outputs circuits needed to measure fidelity via mult.

generate_native_ghz(qubit_layout, ...)

Generate a circuit preparing a GHZ state.

generate_readout_circuit(qubit_layout, ...)

A wrapper for the creation of different circuits to estimate the fidelity.

name()

Returns the name of the benchmark.

Parameters:
static analysis_function(run: BenchmarkRunResult) BenchmarkAnalysisResult#

Analyze counts and compute the state fidelity.

Parameters:

run (BenchmarkRunResult) – The RunResult object containing a dataset with counts and benchmark parameters.

Returns:

An object containing the dataset, plots, and observations.

Return type:

BenchmarkAnalysisResult

classmethod name() str#

Returns the name of the benchmark.

Return type:

str

generate_native_ghz(qubit_layout: list[int], qubit_count: int, routine: str) CircuitGroup#

Generate a circuit preparing a GHZ state.

The GHZ state is generated according to a given routine and transpiled to the native gate set and topology.

Parameters:
  • qubit_layout (list[int]) – The subset of system-qubits used in the protocol, indexed from 0

  • qubit_count (int) – The number of qubits for which a GHZ state should be created. This values should be smaller or equal to the number of qubits in qubit_layout

  • routine (str) – The routine to generate the GHZ circuit

Returns:

QuantumCircuit implementing GHZ native state

Return type:

CircuitGroup

generate_coherence_meas_circuits(qubit_layout: list[int], qubit_count: int) list[IQMCircuit]#

Takes a given GHZ circuit and outputs circuits needed to measure fidelity via mult. q. coherences method.

Parameters:
  • qubit_layout (list[int]) – The subset of system-qubits used in the protocol, indexed from 0

  • qubit_count (int) – The number of qubits for which a GHZ state should be created. This values should be smaller or equal to the number of qubits in qubit_layout

Returns:

A list of transpiled quantum circuits to be measured

Return type:

list[IQMCircuit]

append_rms(num_rms: int, qubit_layout: list[int]) list[IQMCircuit]#

Appends 1Q Clifford gates sampled uniformly at random to all qubits in the given circuit.

Parameters:
  • num_rms (int) – How many randomized measurement circuits are generated

  • qubit_layout (list[int]) – The subset of system-qubits used in the protocol, indexed from 0

Returns:

List of the original circuit with 1Q Clifford gates appended to it

Return type:

list[IQMCircuit]

generate_readout_circuit(qubit_layout: list[int], qubit_count: int) CircuitGroup#

A wrapper for the creation of different circuits to estimate the fidelity.

Parameters:
  • qubit_layout (list[int]) – The subset of system-qubits used in the protocol, indexed from 0

  • qubit_count (int) – The number of qubits for which a GHZ state should be created. This values should be smaller or equal to the number of qubits in qubit_layout

Returns:

A list of transpiled quantum circuits to be measured

Return type:

CircuitGroup

add_configuration_to_dataset(dataset: Dataset) None#

Creates a xarray.Dataset and adds the circuits and configuration metadata to it.

Parameters:

dataset (Dataset) – The dataset containing the benchmark information

Returns:

Dataset to be used for further data storage

Return type:

None

execute(backend: IQMBackend | IQMFacadeBackend) Dataset#

Executes the benchmark.

Parameters:

backend (IQMBackend | IQMFacadeBackend)

Return type:

Dataset