loom.interpreter.interpreter
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.interpreter.cleanup_final_step(final_step)[source]
Clean up the final interpretation step before it is returned to the user.
- Parameters:
final_step (InterpretationStep) – Final interpretation step which should be cleaned up before returning it to the user
- Returns:
Cleaned up interpretation step
- Return type:
- loom.interpreter.interpreter.interpret_eka(eka, debug_mode=True)[source]
Interpret the Eka object and return the final InterpretationStep. The function iterates over all operations in the Eka and applies them to the current InterpretationStep. The function also handles the case where multiple operations are applied in parallel during the same timestep.
- Parameters:
eka (Eka) –
- Eka object describing the operations to perform, as well as the initial state
of the blocks.
debug_mode (bool) – Flag indicating whether the interpretation should be done in debug mode. Activating debug mode will enable commutation validation for Block
- Returns:
Final InterpretationStep containing the interpreted operations and the final circuit.
- Return type:
- loom.interpreter.interpreter.interpret_operation(eka, step, op, same_timeslice, debug_mode)[source]
This function interprets the given operation and returns a new InterpretationStep which contains all modifications due to the operation. The function itself finds the right applicator for the given operation and calls it. The actual implementation of the operation is done in the applicator.
- Parameters:
eka (Eka) – The Eka object for which the operation should be interpreted. The Eka is passed on to the applicator. This allows the applicator to access the lattice and the syndrome circuits
step (InterpretationStep) – Current InterpretationStep to which the modifications due to the operation should be applied
op (
loom.eka.operations.base_operation.Operation) – Operation to be interpretedsame_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. Currently, the effects of debug mode are: - Disabling the commutation validation of Block
- Returns:
New InterpretationStep containing all modifications due to the operation
- Return type: