SquarePlaquetteQubits#
- class tqec.plaquette.SquarePlaquetteQubits[source]#
Bases:
PlaquetteQubits
Represents the qubits used by a regular square plaquette.
Methods
__init__
()Represents the qubits used by a regular square plaquette.
from_dict
(data)Return a plaquette qubits from its dictionary representation.
get_edge_qubits
([orientation])Return the data qubits on the edge of the plaquette.
get_qubits_on_side
(side)Return the qubits one the provided side of the instance.
to_dict
()Return a dictionary representation of the plaquette qubits.
Attributes
all_qubits
Return all the qubits represented by
self
.data_qubits_indices
Return an iterator over the index of each data-qubit.
data_qubits_with_indices
Return an iterator over each data-qubit and their indices.
qubit_map
Return the qubit map representing
self
.syndrome_qubits_indices
Return an iterator over the index of each syndrome-qubit.
syndrome_qubits_with_indices
Return an iterator over each syndrome-qubit and their indices.
data_qubits
syndrome_qubits
Detailed methods
- static from_dict(data)#
Return a plaquette qubits from its dictionary representation.
- Parameters:
data (dict[str, Any]) – dictionary with the keys
data_qubits
andsyndrome_qubits
.- Returns:
a new instance of
PlaquetteQubits
with the provideddata_qubits
andsyndrome_qubits
.- Return type:
- get_edge_qubits(orientation=Orientation.HORIZONTAL)#
Return the data qubits on the edge of the plaquette. By convention, the edge is the one with the highest index in the relevant axis.
- Parameters:
orientation (TemplateOrientation, optional) – Whether to use horizontal or vertical orientation as the axis. Defaults to horizontal.
- Returns:
The qubits on the edge of the plaquette.
- Return type:
list[GridQubit]
- get_qubits_on_side(side)#
Return the qubits one the provided side of the instance.
A qubit is on the left-side if there is no other qubit in the instance with a strictly lower x-coordinate value. Similarly, a qubit is on the right-side if there is no other qubit in the instance with a strictly greater x-coordinate value. Up and down are about the y-coordinate.
- Parameters:
side (PlaquetteSide) – the side to find qubits on.
- Returns:
The qubits on the edge of the plaquette.
- Return type:
list[GridQubit]
- to_dict()#
Return a dictionary representation of the plaquette qubits.
- Returns:
a dictionary with the keys
data_qubits
andsyndrome_qubits
and their corresponding values.- Return type:
dict[str, Any]