tqec.templates.layout.LayoutTemplate#
- class LayoutTemplate(element_layout: dict[Position2D, RectangularTemplate], default_increments: Displacement | None = None)[source]#
- __init__(element_layout: dict[Position2D, RectangularTemplate], default_increments: Displacement | None = None) None [source]#
A template representing a layout of other templates.
Each element template in the layout is placed at a specific position in the 2D grid.
Note
The provided template positions have only one restriction: two templates should not be at the same position. In particular, this class does not require that the provided template are spatially connected or entirely cover a rectangular portion of the 2 spatial dimensions.
- Parameters:
element_layout – a dictionary with the position of the element templates in the layout as keys and the templates as values.
default_increments – default increments between two plaquettes. Defaults to Displacement(2, 2) when None.
Methods
__init__
(element_layout[, default_increments])A template representing a layout of other templates.
element_shape
(k)Return the uniform shape of the element templates.
get_increments
()Get the default increments of the template.
get_indices_map_for_instantiation
([...])get_midline_plaquettes
(k[, orientation])Returns the default observable qubits for the template.
get_spatially_distinct_subtemplates
(k[, ...])Returns a representation of all the distinct sub-templates of the provided manhattan radius.
instantiate
(k[, plaquette_indices])Generate the numpy array representing the template.
instantiation_origin
(k)Coordinates of the top-left entry origin.
shape
(k)Returns the current template shape.
Attributes
expected_plaquettes_number
Returns the number of plaquettes expected from the instantiate method.
origin_shift
scalable_shape
Returns a scalable version of the template shape.