supermarq.benchmarks.bit_code

Classes

BitCode

Creates a circuit for syndrome measurement in a bit-flip error correcting code.

Module Contents

class supermarq.benchmarks.bit_code.BitCode(num_data_qubits: int, num_rounds: int, bit_state: list[int])

Bases: supermarq.benchmark.Benchmark

Creates a circuit for syndrome measurement in a bit-flip error correcting code.

Parameters:
  • num_data_qubits – The number of data qubits.

  • num_rounds – The number of measurement rounds.

  • bit_state – A list denoting the state to initialize each data qubit to.

Returns:

A cirq.Circuit for the bit-flip error correcting code.

Raises:
  • ValueError – If bit_state is longer than num_data_qubits.

  • TypeError – If bit_state is not a list.

  • ValueError – If bit_state contains values not in {0,1}.

circuit() cirq.Circuit

Generates bit code circuit.

Returns:

A cirq.Circuit.

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

Compute benchmark score.

Device performance is given by the Hellinger fidelity between the experimental results and the ideal distribution. The ideal is known based on the bit_state parameter.

Parameters:

counts – Dictionary containing the measurement counts from running self.circuit().

Returns:

A float with the computed score.

bit_state
num_data_qubits
num_rounds