supermarq.benchmarks.ghz ======================== .. py:module:: supermarq.benchmarks.ghz Classes ------- .. autoapisummary:: supermarq.benchmarks.ghz.GHZ Module Contents --------------- .. py:class:: GHZ(num_qubits: int, method: str = 'ladder') Bases: :py:obj:`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. .. py:method:: circuit() -> cirq.Circuit Generate an n-qubit GHZ cirq circuit. :returns: A `cirq.Circuit`. .. py:method:: qiskit_circuit() -> qiskit.QuantumCircuit Generate an n-qubit GHZ qiskit circuit. :returns: A `qiskit.QuantumCircuit`. .. py:method:: 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$. :param counts: A dictionary containing the measurement counts from circuit execution. :returns: Hellinger fidelity as a float. .. py:attribute:: method :value: 'ladder' .. py:attribute:: num_qubits