loom.interpreter.applicator.measure_block_syndromes

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.

loom.interpreter.applicator.measure_block_syndromes.measureblocksyndromes(interpretation_step, operation, same_timeslice, debug_mode)[source]

Measure the syndromes of all stabilizers in a block.

The algorithm is the following:

  • A.) For each stabilizer in the block, get the corresponding circuit (template)

    • A.1) Get the stabilizers from the block

    • A.2) Get the stabilizer circuit templates from the block

  • B.) Resolve the circuit with actual channels:

    • B.1) Get the qubit labels from the stabilizer

    • B.2) Get the classical bit labels from the syndrome circuit

    • B.3) Repeat for n_cycle:

      • B.3.1) Find the classical channels (create them if they don’t exist) and create cbits

      • B.3.2) Clone the syndrome circuit and remap the channels

  • C.) Weave circuits together: NOTE we currently assume that the circuits are constructed in order, this is the responsibility of the user.

    • C.1) Check the assumption that all circuits are the same length

    • C.2) Add gates one by one to the intermediate circuit

  • D.) Generate new syndromes for the stabilizers involved

  • E.) Create new detectors for the new syndromes

  • F.) Update the interpretation_step with the new syndromes and detectors

  • G.) Update the interpretation_step with the new circuit

Parameters:
  • interpretation_step (InterpretationStep) – Interpretation step containing the block from which the syndrome should be measured.

  • operation (MeasureBlockSyndromes) – Syndrome measurement operation description.

  • same_timeslice (bool) – Flag indicating whether the operation is part of the same timestep as the previous operation.

  • debug_mode (bool) – Flag indicating whether the interpretation should be done in debug mode. Activating debug mode will enable commutation validation for Block.

Returns:

Interpretation step after the syndrome measurement operation.

Return type:

InterpretationStep