loom.validator.circuit_validation_wrappers
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.validator.circuit_validation_wrappers.is_logical_operation_circuit_valid(circuit, input_block, x_operators_sparse_pauli_map, z_operators_sparse_pauli_map)[source]
Checks if the logical operation circuit is a valid one. The function checks that the circuit: - does not alter the check operators - acts on the logical level in a way that is consistent with the logical operation defined by the x and z maps
For example, for a CNOT gate from qubit 0 to qubit 1 we know that: - X0 -> X0X1 - X1 -> X1 - Z0 -> Z0 - Z1 -> Z0Z1
and thus the input pauli map arguments will be: - x_operators_sparse_pauli_map = [“X0X1”, “X1”] - z_operators_sparse_pauli_map = [“Z0”, “Z0Z1”]
- Parameters:
circuit (Circuit) – The logical operation circuit.
input_block (Block | tuple[Block, ...]) – The input Block object(s).
x_operators_sparse_pauli_map (list[str]) – The list of sparse Pauli strings describing how each X operator is transformed. No sign is needed and the order matches the transformation of the logical operators X0, X1, …
z_operators_sparse_pauli_map (list[str]) – The list of sparse Pauli strings describing how each Z operator is transformed. No sign is needed and the order matches the transformation of the logical operators Z0, Z1, …
- Returns:
The result of the checks.
- Return type:
- loom.validator.circuit_validation_wrappers.is_syndrome_extraction_circuit_valid(circuit, input_block, measurement_to_input_stabilizer_map)[source]
Tests if the syndrome extraction circuit is a valid one. The function checks that the circuit: - does not alter the check operators - acts on the logical level as identity - measures indeed the specified input check operators with specific measurement operations
- Parameters:
circuit (Circuit) – The syndrome extraction circuit.
input_block (Block | tuple[Block, ...]) – The input Block object(s).
measurement_to_input_stabilizer_map (dict[str, Stabilizer]) – Dictionary matching the classical channel name of a measurement operation with a stabilizer in the input code.
- Returns:
The result of the checks.
- Return type: