Plaquette#

class tqec.plaquette.Plaquette(name, qubits, circuit, mergeable_instructions=<factory>)[source]#

Bases: object

Represents a QEC plaquette.

This class stores qubits in the plaquette local coordinate system and a scheduled circuit that should be applied on those qubits to perform the QEC experiment.

By convention, the local plaquette coordinate system is composed of a X-axis pointing to the right and a Y-axis pointing down.

name#

a unique name for the plaquette. This field is used to compare plaquettes efficiently (two Plaquette instances are considered equal if and only if their names are the same) as well as computing a hash value for any plaquette instance. Finally, the name is used to represent a Plaquette instance as a string.

Type:

str

qubits#

qubits used by the plaquette circuit, given in the local plaquette coordinate system.

Type:

tqec.plaquette.qubit.PlaquetteQubits

circuit#

scheduled quantum circuit implementing the computation that the plaquette should represent.

Type:

tqec.circuit.schedule.circuit.ScheduledCircuit

mergeable_instructions#

a set of instructions that can be merged. This is useful when merging several plaquettes’ circuits together to remove duplicate instructions.

Type:

frozenset[str]

Raises:

TQECException – if the provided circuit uses qubits not listed in qubits.

Parameters:

Methods

__init__(name, qubits, circuit[, ...])

project_on_boundary(projected_orientation)

Project the plaquette on boundary and return a new plaquette with the remaining qubits and circuit.

reliable_hash()

Attributes

num_measurements

origin

name

qubits

circuit

mergeable_instructions

Detailed methods

__init__(name, qubits, circuit, mergeable_instructions=<factory>)#
Parameters:
Return type:

None

project_on_boundary(projected_orientation)[source]#

Project the plaquette on boundary and return a new plaquette with the remaining qubits and circuit.

This method is useful for deriving a boundary plaquette from a integral plaquette.

Parameters:

projected_orientation (PlaquetteOrientation) – the orientation of the plaquette after the projection.

Returns:

A new plaquette with projected qubits and circuit. The qubits are updated to only keep the qubits on the side complementary to the provided orientation. The circuit is also updated to only use the kept qubits and empty moments with the corresponding schedules are removed.

Return type:

Plaquette

reliable_hash()[source]#
Return type:

int