PlaquetteQubits#

class tqec.plaquette.PlaquetteQubits(data_qubits: 'list[GridQubit]', syndrome_qubits: 'list[GridQubit]')[source]#

Bases: object

Methods

__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_qubits

data_qubits_indices

data_qubits_with_indices

qubit_map

syndrome_qubits_indices

syndrome_qubits_with_indices

data_qubits

syndrome_qubits

Detailed 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_qubits and syndrome_qubits.

Returns:

a new instance of PlaquetteQubits with the provided data_qubits and syndrome_qubits.

Return type:

PlaquetteQubits

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]

to_dict()[source]#

Return a dictionary representation of the plaquette qubits.

Returns:

a dictionary with the keys data_qubits and syndrome_qubits and their corresponding values.

Return type:

dict[str, Any]