RepeatedPlaquettes#

class tqec.plaquette.RepeatedPlaquettes(collection, repetitions)[source]#

Bases: Plaquettes

Represent plaquettes that should be repeated for several rounds.

Methods

__init__(collection, repetitions)

from_dict(data[, plaquettes])

Return a collection of plaquettes from its dictionary representation.

items()

map_indices(callable)

num_rounds(k)

repeat(repetitions)

to_dict([plaquettes_to_indices])

Return a dictionary representation of the plaquettes.

to_name_dict()

with_updated_plaquettes(plaquettes_to_update)

without_plaquettes(indices)

Attributes

repetitions

collection

Detailed methods

Parameters:
__init__(collection, repetitions)#
Parameters:
Return type:

None

static from_dict(data, plaquettes=None)#

Return a collection of plaquettes from its dictionary representation.

Parameters:
  • data (dict[str, Any]) – dictionary with the keys plaquettes and default.

  • plaquettes (Sequence[Plaquette] | None)

Returns:

a new instance of Plaquettes with the provided plaquettes and default.

Return type:

Plaquettes

items()#
Return type:

Iterable[tuple[int, Plaquette]]

map_indices(callable)#
Parameters:

callable (Callable[[int], int])

Return type:

Plaquettes

num_rounds(k)[source]#
Parameters:

k (int)

Return type:

int

repeat(repetitions)#
Parameters:

repetitions (LinearFunction)

Return type:

RepeatedPlaquettes

to_dict(plaquettes_to_indices=None)#

Return a dictionary representation of the plaquettes.

Parameters:

plaquettes_to_indices (dict[Plaquette, int] | None) – a dictionary mapping plaquettes to their indices. If provided, a plaquette will be represented by its index

Return type:

dict[str, Any]

to_name_dict()#
Return type:

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

with_updated_plaquettes(plaquettes_to_update)[source]#
Parameters:

plaquettes_to_update (Mapping[int, Plaquette])

Return type:

RepeatedPlaquettes

without_plaquettes(indices)#
Parameters:

indices (Collection[int])

Return type:

Plaquettes