tqec.circuit.operations.transformer.transform_to_stimcirq_compatible

transform_to_stimcirq_compatible(circuit: AbstractCircuit, *, context: TransformerContext | None = None) Circuit[source]

Transform the circuit to be compatible with stimcirq.

stimcirq is a library that allows to convert cirq circuits to stim circuits. It defines a set of annotations in cirq that are used to represent the operations specific to stim. In tqec, we define the same annotations with different semantics. This transformer is used to convert the tqec annotations to the stimcirq annotations. The transformed operations are:

  • ShiftCoords: converted to stimcirq.ShiftCoordsAnnotation.

  • Detector: converted to stimcirq.DetAnnotation with the correct relative keys computed.

  • Observable: converted to stimcirq.CumulativeObservableAnnotation with the correct relative keys computed.

Parameters:
  • circuit – The circuit to transform, which may contain tqec specific operations.

  • context – See cirq.transformer documentation.

Returns:

A new circuit with the tqec specific operations transformed to stimcirq compatible operations.