CubeSpec#

class tqec.compile.CubeSpec(kind, spatial_arms=JunctionArms.NONE)[source]#

Bases: object

Specification of a cube in a block graph.

The template of the CompiledBlock will be determined based on the specification. This class can be used as a key to look up the corresponding CompiledBlock before applying the substitution rules.

Parameters:
  • kind (CubeKind)

  • spatial_arms (SpatialArms)

cube_kind#

The kind of the cube.

spatial_arms#

Flag indicating the spatial directions the cube connects to the adjacent cubes. This is useful for spatial cubes (XXZ and ZZX) where the arms can determine the template used to implement the cube.

Type:

tqec.compile.specs.enums.SpatialArms

Methods

__init__(kind[, spatial_arms])

from_cube(cube, graph)

Returns the cube spec from a cube in a block graph.

Attributes

is_spatial

spatial_arms

kind

Detailed methods

__init__(kind, spatial_arms=JunctionArms.NONE)#
Parameters:
  • kind (CubeKind)

  • spatial_arms (SpatialArms)

Return type:

None

static from_cube(cube, graph)[source]#

Returns the cube spec from a cube in a block graph.

Parameters:
Return type:

CubeSpec