loom.eka.eka

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.

class loom.eka.eka.Eka(*args, **kwargs)[source]

Bases: object

This dataclass contains all the information necessary to execute a logical circuit with embedded error correction.

Parameters:
  • lattice (Lattice) – Lattice on which the Eka is defined

  • blocks (tuple[Block, ...]) – Inital state of the block defining the logical qubits.

  • operations (tuple[loom.eka.operations.base_operation.Operation, …] | tuple[tuple[loom.eka.operations.base_operation.Operation, …], …]) – Operations to be executed on the block. Each tuple of operations is executed in parallel. The operations are executed in the order they are given in the tuple but their circuits are combined such that they can be executed in parallel. If the operations are specified as a tuple of operations, they are executed sequentially.

asdict()[source]

Create a dictionary representation of the Eka object.

Return type:

dict

blocks: tuple[Block, ...] = FieldInfo(annotation=tuple[Block, ...], required=False, default_factory=tuple, validate_default=False)
classmethod blocks_unique_labels(blocks)[source]

Check that blocks have unique labels.

Return type:

tuple[Block, ...]

classmethod blocks_valid_indices(blocks, info)[source]

Check that blocks have valid qubit indices. Every element in the tuple has to be larger or equal to 0 and smaller than the size of the lattice in the respective dimension (if the lattice has a finite size).

Return type:

tuple[Block, ...]

classmethod fromdict(data_dict)[source]

Instantiate an Eka object from a dictionary.

Return type:

Eka

lattice: Lattice
operations: tuple[Operation, ...] | tuple[tuple[Operation, ...], ...] = FieldInfo(annotation=Union[tuple[Operation, ...], tuple[tuple[Operation, ...], ...]], required=False, default_factory=tuple, validate_default=False)
classmethod operations_disjoint(operations)[source]

Check that operations are disjoint, i.e. no block is used in multiple operations. Casts the operations to a tuple of tuples if it is a tuple of operations.