class RepetitionCode(d, T=0)[source]

Implementation of a distance d repetition code, implemented over T syndrome measurement rounds.

Creates the circuits corresponding to a logical 0 and 1 encoded using a repetition code.

  • d (int) – Number of code qubits (and hence repetitions) used.

  • T (int) – Number of rounds of ancilla-assisted syndrome measurement.

Additional information:

No measurements are added to the circuit if T=0. Otherwise T rounds are added, followed by measurement of the code qubits (corresponding to a logical measurement and final syndrome measurement round).




self.circuit as a list, with


param raw_results

A dictionary whose keys are logical values,


Readout of all code qubits, which corresponds to a logical measurement as well as allowing for a measurement of the syndrome to be inferred.

RepetitionCode.syndrome_measurement([reset, …])

Application of a syndrome measurement round.

RepetitionCode.x([logs, barrier])

Applies a logical x to the circuits for the given logical values.