CompiledBlock#
- class tqec.compile.CompiledBlock(template, layers)[source]#
Bases:
object
Represents a specific implementation of a cube in a
BlockGraph
.- Parameters:
template (RectangularTemplate)
layers (list[Plaquettes])
- template#
the template that defines the cube implementation.
- Type:
tqec.templates.base.RectangularTemplate
- layers#
a list of
Plaquettes
that represent different functional layers of the cube. When aligning twoCompiledBlock
instances, the layers are aligned in order. Typically, there are three layers in most cube implementations: Initialization, Repetitions, and Measurement.- Type:
Methods
__init__
(template, layers)update_layers
(substitution)Update the plaquettes in a specific layer of the block.
Attributes
num_layers
Number of layers in the block.
Template representing the 2-dimensional footprint of the block.
Different functional layers of the block.
Detailed methods
- __init__(template, layers)#
- Parameters:
template (RectangularTemplate)
layers (list[Plaquettes])
- Return type:
None
- update_layers(substitution)[source]#
Update the plaquettes in a specific layer of the block.
Warning
This method modifies the
layers
attribute in place.- Parameters:
substitution (Mapping[int, Plaquettes]) – a mapping from the layer index to the plaquettes that should be used to update the layer. The index can be negative, which means the layer is counted from the end of the layers list.
- Return type:
None