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.) Begin MeasureBlockSyndromes composite operation session
- B.) Get stabilizers and syndrome circuit templates from the block
B.1) Get the stabilizers from the block
B.2) Get the stabilizer circuit templates from the block
- C.) Resolve circuits with actual channels (quantum and classical)
C.1) Find the channels for the qubits (create them if they don’t exist) and keep track of these in the right order
C.2) Get the classical bit labels from the syndrome circuit
- D.) For each cycle:
D.1) Create classical channels and measurement records
D.2) Clone syndrome circuits and remap channels
- D.3) Weave circuits together into a single time slice
NOTE: We currently assume that the circuits are constructed in order, this is the responsibility of the user
D.4) Append woven circuit to interpretation step
D.5) Generate new syndromes for the stabilizers
D.6) Create new detectors for the syndromes
D.7) Update interpretation step with syndromes and detectors
E.) End MeasureBlockSyndromes composite operation session and append 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: