loom.eka.syndrome_circuit

Copyright (c) Entropica Labs Pte Ltd 2025.

Use, distribution and reproduction of this program in its source or compiled form is prohibited without the express written consent of Entropica Labs Pte Ltd.

class loom.eka.syndrome_circuit.SyndromeCircuit(*args, **kwargs)[source]

Bases: object

A SyndromeCircuit object specifies one way to measure a pauli string. There can be multiple SyndromeCircuit objects for the same pauli string, specifying different circuits for how to measure it. The qubits in the circuit field are labeled 0, …, n. Once the actual syndrome extraction circuit for a stabilizer is generated, qubit i of the SyndromeCircuit object is replaced by stabilizer.data_qubits[i]. Therefore the qubit order inside stabilizer.data_qubits must match the order in which they are used in SyndromeCircuit.

Parameter

paulistr

The pauli string which this circuit is supposed to measure. Must be a string

name: str, optional

A name for the SyndromeCircuit object consisting of the characters {X, Y, Z}.

circuit: Circuit | None

The circuit instructions to measure the syndrome. If None is provided, a default circuit for the given pauli string is automatically constructed.

uuid: str

A uuid associated with the object

circuit: Circuit | None = FieldInfo(annotation=Union[Circuit, NoneType], required=False, default_factory=<lambda>, validate_default=True)
classmethod default_syndrome_circuit(value, info)[source]

In case the field circuit is not provided, the default syndrome extraction circuit is automatically assigned

name: str = FieldInfo(annotation=str, required=False, default_factory=<lambda>, metadata=[MinLen(min_length=1)])
pauli: str = FieldInfo(annotation=str, required=True, metadata=[MinLen(min_length=1)])
uuid: str = FieldInfo(annotation=str, required=False, default_factory=<lambda>, validate_default=True)
loom.eka.syndrome_circuit.default_circuit(pauli_str)[source]

Construct the default circuit corresponding to the input Pauli string.

Parameters:

pauli_str (str) – The input Pauli string of the stabilizer

Returns:

The circuit containing instructions measuring the stabilizer

Return type:

Circuit