tqec.compile.blocks#
Provide a flexible representation to define blocks, the basic unit of computation in topological error corrected codes.
The main data-structure provided by this module is
Block
. It is able to represent in a flexible
manner anything that looks like a block in a topological computation represented
using SketchUp. In particular, that data-structure can be used to represent both
cubes and pipes.
In a topological computation, Block
instances will happen in parallel, and tqec
needs to account for that:
operations happening in parallel should be encoded in the same moment (i.e.,
between the same two TICK
instructions) in the resulting .stim
file.
Moreover, blocks might have different “schedules”. For example, the regular memory block follow the schedule:
initialisation layer,
repeat [memory layer],
measurement layer,
whereas a spatial pipe in the Y
axis needs to alternate plaquettes in its
repeated layer, leading to a schedule that is:
initialisation layer,
repeat [memory layer 1 alternated with memory layer 2],
measurement layer.
All these restrictions are handled by representing
Block
instances with
BaseLayer
and
BaseComposedLayer
instances.
See tqec.compile.blocks.layers
for more details.
Functions
Merge several stacks of layers executed in parallel into one stack of larger layers. |
Classes
|
Base class representing a composed "layer". |
|
Base class representing a "layer". |
|
Encodes the implementation of a block. |
|
A layer gluing several other layers together on a 2-dimensional grid. |
|
Internal class to represent the local indexing used to represent both cubes and pipes. |
|
Represents a layer with a template and some plaquettes. |
|
Represents a layer with a spatial footprint that is defined by a raw circuit. |
|
Composed layer implementing repetition. |
|
Composed layer implementing a fixed sequence of layers. |
|
Enumerates the 4 different spatial borders for a block. |
|
Enumerates the 2 different temporal borders for a block. |