tqec.circuit.observable_qubits.observable_qubits_from_template

observable_qubits_from_template(template: Template, plaquettes: Sequence[Plaquette] | Mapping[int, Plaquette], orientation: TemplateOrientation = TemplateOrientation.HORIZONTAL) Sequence[tuple[GridQubit, int]][source]

Return the default observable qubits for the given template and its plaquettes.

Parameters:
  • template – The template to get the default observable qubits from.

  • plaquettes – The plaquettes to use to get the accurate positions of the observable qubits.

  • orientation – Whether to get the observable qubits from the horizontal or vertical midline. Defaults to horizontal.

Raises:
  • TQECException – If the number of plaquettes does not match the expected number.

  • TQECException – If the plaquettes are provided as a dictionary and 0 is in the keys.

  • TQECException – If the template does not have a definable midline.

Returns:

The sequence of qubits and offsets for the observable qubits.