PlaquetteQubits#
- class tqec.plaquette.PlaquetteQubits(data_qubits: 'list[GridQubit]', syndrome_qubits: 'list[GridQubit]')[source]#
Bases:
objectMethods
__init__(data_qubits, syndrome_qubits)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_qubitsReturn all the qubits represented by
self.data_qubits_indicesReturn an iterator over the index of each data-qubit.
data_qubits_with_indicesReturn an iterator over each data-qubit and their indices.
qubit_mapReturn the qubit map representing
self.syndrome_qubits_indicesReturn an iterator over the index of each syndrome-qubit.
syndrome_qubits_with_indicesReturn an iterator over each syndrome-qubit and their indices.
data_qubitssyndrome_qubitsDetailed methods
- Parameters:
data_qubits (list[GridQubit])
syndrome_qubits (list[GridQubit])
- __init__(data_qubits, syndrome_qubits)#
- Parameters:
data_qubits (list[GridQubit])
syndrome_qubits (list[GridQubit])
- Return type:
None
- static from_dict(data)[source]#
Return a plaquette qubits from its dictionary representation.
- Parameters:
data (dict[str, Any]) – dictionary with the keys
data_qubitsandsyndrome_qubits.- Returns:
a new instance of
PlaquetteQubitswith the provideddata_qubitsandsyndrome_qubits.- Return type:
- get_edge_qubits(orientation=Orientation.HORIZONTAL)[source]#
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)[source]#
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]