SignedDirection3D#
- class tqec.utils.SignedDirection3D(direction, towards_positive)[source]#
Bases:
object
Signed directions in the 3D spacetime diagram.
Methods
__init__
(direction, towards_positive)from_string
(s)Return the signed direction from a string.
Attributes
direction
towards_positive
Detailed methods
- Parameters:
direction (Direction3D)
towards_positive (bool)
- __init__(direction, towards_positive)#
- Parameters:
direction (Direction3D)
towards_positive (bool)
- Return type:
None
- static from_string(s)[source]#
Return the signed direction from a string.
- Parameters:
s (str) – The string representation of the signed direction. The string should have the format “<sign><direction>”, where “<direction>” is one of “X”, “Y”, “Z” and “<sign>” is either “+” or “-“.
- Returns:
The signed direction.
- Raises:
TQECException – If the string does not match the expected format.
- Return type: