BlockPosition2D#
- class tqec.utils.BlockPosition2D(x, y)[source]#
Bases:
Position2D
Represents the position of a block on a 2-dimensional plane.
Methods
__init__
(x, y)get_top_left_plaquette_position
(block_shape)Returns the position of the top-left plaquette of the block.
is_neighbour
(other)Check if the other position is near to this position, i.e. Manhattan distance is 1.
to_3d
([z])Attributes
x
y
Detailed methods
- Parameters:
x (int)
y (int)
- __init__(x, y)#
- Parameters:
x (int)
y (int)
- Return type:
None
- get_top_left_plaquette_position(block_shape)[source]#
Returns the position of the top-left plaquette of the block.
- Parameters:
block_shape (PlaquetteShape2D)
- Return type:
- is_neighbour(other)#
Check if the other position is near to this position, i.e. Manhattan distance is 1.
- Parameters:
other (Position2D)
- Return type:
bool
- to_3d(z=0)#
- Parameters:
z (int)
- Return type:
- with_block_coordinate_system()#
- Return type: