loom.interpreter.applicator.measure_block_syndromes
Copyright 2024 Entropica Labs Pte Ltd
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
- 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: