Skip to main content

class ColorEncoder5

Transversal encoder for the [[17,1,5]] 2D color code.

class SteaneEncoder

Transversal encoder for the [[7,1,3]] Steane code.

class TransversalEncoder

Base class for transversal quantum error correction encoders.

diagram

Return a timeline-svg diagram of the encoded circuit.

encode_transversally

Encode a program transversally by replacing physicalgates with transversal gates. Transform a program on m qubits into a program on n * m qubits (consisting of n code blocks). Parameters:
  • program_text (str) — The program to encode transversally.

encoding_flow_generators

Return the Pauli flow generators for the encoding circuit.

initialize

Initialize state preparation and apply encoding circuit. Apply the state preparation program for k qubits, then apply an encoding circuit to encode the state into n qubits. Parameters:
  • program_text (str) — The state preparation program for k qubits. Generally, this should be a simple program that prepares each of the k qubits in a single-qubit state.
  • encoding_program_text (optional) — An encoding circuit for a single logical qubit. This should encode a single logical qubit at input self.encoding_qubit into a state of n qubits. If not provided, the encoder will use a noiseless default encoding.

broadcast_targets

Broadcast gate target groups with a stride and set of offsets.