loom.interpreter.applicator.generate_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.generate_syndromes.generate_syndromes(interpretation_step, stabilizers, block, stab_measurements)[source]

Generate new Syndromes for the given stabilizers and its associated block. Stabilizers are passed explicitly as they follow the same order as the stab_measurements variable used to compute the Syndromes.

CAUTION: This function pops the entries from the stabilizer_updates field of the interpretation step to compute corrections. This may cause issues in the future if the information in this field also needs to be accessed somewhere else.

Parameters:
  • interpretation_step (InterpretationStep) – The updated interpretation step implementing the operation

  • stabilizers (tuple[Stabilizer, ...]) – Stabilizers that were measured, results are included in stab_measurements

  • block (Block) – Block containing the stabilizers

  • stab_measurements (tuple[tuple[Cbit, ...], ...]) – Measurements used to create the syndromes. Each index contains a tuple of Cbits associated to the stabilizer at the same index in stabilizers.

Returns:

Syndromes created for the stabilizers, they are returned in the same order as the stabilizers are given.

Return type:

tuple[Syndrome, …]