Cube#

class tqec.computation.Cube(position, kind, label='')[source]#

Bases: object

A fundamental building block of the logical computation.

A cube is a high-level abstraction of a block of quantum operations within a specific spacetime volume. These operations preserve or manipulate the quantum information encoded in the logical qubits.

For example, a single ZXZ kind cube can represent a quantum memory experiment for a surface code patch in logical Z basis. The default circuit implementation of the cube will consist of transversal Z basis resets, syndrome extraction cycles, and finally the Z basis transversal measurements. The spatial location of the physical qubits in the code patch and the time when the operations are applied are specified by the spacetime position of the cube.

Parameters:
position#

The position of the cube in the spacetime. The spatial coordinates determines which code patch the operations are applied to, and the time coordinate determines when the operations are applied.

Type:

tqec.utils.position.Position3D

kind#

The kind of the cube. It determines the basic logical operations represented by the cube.

Type:

tqec.computation.cube.CubeKind

label#

The label of the cube. It’s mainly used for annotating the input/output ports of the block graph. If the cube is a port, the label must be non-empty. Default is an empty string.

Type:

str

Methods

__init__(position, kind[, label])

to_zx_node()

Convert the cube to a ZXNode instance.

Attributes

is_port

Return whether the cube is of kind Port.

is_spatial

Return whether the cube is a spatial cube.

is_y_cube

Return whether the cube is of kind YCube.

is_zx_cube

Return whether the cube is of kind ZXCube.

label

position

kind

Detailed methods

__init__(position, kind, label='')#
Parameters:
Return type:

None

to_zx_node()[source]#

Convert the cube to a ZXNode instance.

Returns:

A ZX node with the same position and label as the cube, and the kind of the node is converted from the cube kind with to_zx_kind().

Return type:

ZXNode