ZXCube#
- class tqec.computation.ZXCube(x, y, z)[source]#
Bases:
CubeKind
The kind of cubes consisting of only X or Z basis boundaries.
- Parameters:
x (Basis)
y (Basis)
z (Basis)
- x#
Looking at the cube along the x-axis, the basis of the walls observed.
- Type:
tqec.utils.enums.Basis
- y#
Looking at the cube along the y-axis, the basis of the walls observed.
- Type:
tqec.utils.enums.Basis
- z#
Looking at the cube along the z-axis, the basis of the walls observed.
- Type:
tqec.utils.enums.Basis
Methods
__init__
(x, y, z)Return all the allowed
ZXCube
instances.as_tuple
()Return a tuple of
(self.x, self.y, self.z)
.from_str
(string)Create a cube kind from the string representation.
get_basis_along
(direction)Get the basis of the walls along the given direction axis.
Return the corresponding
ZXKind
of the cube kind.Attributes
Detailed methods
- __init__(x, y, z)#
- Parameters:
x (Basis)
y (Basis)
z (Basis)
- Return type:
None
- static all_kinds()[source]#
Return all the allowed
ZXCube
instances.- Returns:
The list of all the allowed
ZXCube
instances.- Return type:
list[ZXCube]
- as_tuple()[source]#
Return a tuple of
(self.x, self.y, self.z)
.- Returns:
A tuple of
(self.x, self.y, self.z)
.- Return type:
tuple[Basis, Basis, Basis]
- static from_str(string)[source]#
Create a cube kind from the string representation.
The string must be a 3-character string consisting of
'X'
or'Z'
, representing the basis of the walls along the x, y, and z axes. For example, a cube with left-right walls in the X basis, front-back walls in the Z basis, and top-bottom walls in the X basis can be constructed from the string'XZX'
.
- get_basis_along(direction)[source]#
Get the basis of the walls along the given direction axis.
- Parameters:
direction (Direction3D) – The direction of the axis along which the basis is queried.
- Returns:
The basis of the walls along the given direction axis.
- Return type:
Basis