Plaquettes#

class tqec.plaquette.Plaquettes(collection)[source]#

Bases: object

Represent a collection of plaquettes that might be applied to a Template instance.

The goal of this class is to abstract away how a “collection of plaquettes” is represented and to provide a unique interface in order to retrieve plaquettes when building a quantum circuit from a template and plaquettes.

It also checks that the represented collection is valid, which means that it does not include any plaquette associated with index 0 (that is internally and conventionally reserved for the empty plaquette).

Methods

__init__(collection)

map_indices(callable)

repeat(repetitions)

to_name_dict()

with_updated_plaquettes(plaquettes_to_update)

Attributes

has_default

collection

Detailed methods

Parameters:

collection (FrozenDefaultDict[int, Plaquette])

__init__(collection)#
Parameters:

collection (FrozenDefaultDict[int, Plaquette])

Return type:

None

map_indices(callable)[source]#
Parameters:

callable (Callable[[int], int])

Return type:

Plaquettes

repeat(repetitions)[source]#
Parameters:

repetitions (LinearFunction)

Return type:

RepeatedPlaquettes

to_name_dict()[source]#
Return type:

dict[int | Literal[‘default’], str]

with_updated_plaquettes(plaquettes_to_update)[source]#
Parameters:

plaquettes_to_update (Mapping[int, Plaquette])

Return type:

Plaquettes