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 two CompiledBlock instances, the layers are aligned in order. Typically, there are three layers in most cube implementations: Initialization, Repetitions, and Measurement.

Type:

list[tqec.plaquette.plaquette.Plaquettes]

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

Template representing the 2-dimensional footprint of the block.

layers

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