tqec.templates.base.RectangularTemplate#
- class RectangularTemplate(default_increments: Displacement | None = None)[source]#
- __init__(default_increments: Displacement | None = None) None #
Base class for all the templates.
This class is the base of all templates and provide the necessary interface that all templates should implement to be usable by the library.
- Parameters:
default_increments – default increments between two plaquettes. Defaults to Displacement(2, 2) when None
Methods
__init__
([default_increments])Base class for all the templates.
get_increments
()Get the default increments of the template.
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.
scalable_shape
Returns a scalable version of the template shape.