tqec.circuit#

Defines core classes and functions to represent and manipulate quantum circuits.

This package defines the core class ScheduledCircuit that is used to represent a quantum circuit in the tqec library. It also defines a few core functions:

  • annotate_detectors_automatically() that takes a quantum circuit implementing a complete QEC circuit and adds DETECTOR annotations.

  • generate_circuit() that takes a Template instance and a description of plaquettes via a Plaquettes instance and generates a ScheduledCircuit instance that corresponds to the circuit described.

  • merge_scheduled_circuits() that is a function that helps merging several ScheduledCircuit instances containing gates that are potentially scheduled at the same time (but not on the same qubits).

Functions from this package are really the backbone of the tqec library and are re-used in higher-level packages (such as tqec.compile).

Modules

coordinates

Implements a wrapper to standardise stim coordinate system across the code base.

generation

Defines generate_circuit(), one of the core method of the tqec package.

instructions

Defines a few functions to analyse and create stim.CircuitInstruction instances.

measurement

Defines two classes to represent measurements in a quantum circuit.

measurement_map

moment

Defines a class analogous to cirq.Moment

observable_qubits

qubit

Defines GridQubit and helper functions to manage qubits.

qubit_map

schedule