tqec.templates.qubit.QubitTemplate#
- class QubitTemplate(default_increments: Displacement | None = None)[source]#
An error-corrected qubit.
The below text represents this template for an input
k == 2
1 5 6 5 6 2 7 9 10 9 10 11 8 10 9 10 9 12 7 9 10 9 10 11 8 10 9 10 9 12 3 13 14 13 14 4
- __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.