supermarq.benchmarks.ghz

Classes

GHZ

Represents the GHZ state preparation benchmark parameterized by the number of qubits n.

Module Contents

class supermarq.benchmarks.ghz.GHZ(num_qubits: int, method: str = 'ladder')

Bases: supermarq.benchmark.Benchmark

Represents the GHZ state preparation benchmark parameterized by the number of qubits n.

Device performance is based on the Hellinger fidelity between the experimental and ideal probability distributions.

circuit() → cirq.Circuit

Generate an n-qubit GHZ cirq circuit.

Returns:

A cirq.Circuit.

qiskit_circuit() → qiskit.QuantumCircuit

Generate an n-qubit GHZ qiskit circuit.

Returns:

A qiskit.QuantumCircuit.

score(counts: dict[str, float]) → float

Compute the Hellinger fidelity between the experimental and ideal results.

The ideal results are 50% probabilty of measuring the all-zero state and 50% probability of measuring the all-one state.

The formula for the Hellinger fidelity between two distributions p and q is given by $(sum_i{p_i q_i})^2$.

Parameters:

counts – A dictionary containing the measurement counts from circuit execution.

Returns:

Hellinger fidelity as a float.

method = 'ladder'
num_qubits