Pipe#
- class tqec.computation.Pipe(u, v, kind)[source]#
Bases:
object
A block connecting two
Cube
objects.The pipes connect the cubes in the block graph. Topologically, the pipes open the boundaries of the cubes and wire them together to form the topological structure representing the computation. In the circuit level, the pipes make modifications to the blocks of operations represented by the cubes. Importantly, the pipes themselves do not occupy spacetime volume.
WARNING: The attributes u and v will be ordered to ensure the position of u is less than v.
- u#
The cube at the head of the pipe. The position of u will be guaranteed to be less than v.
- v#
The cube at the tail of the pipe. The position of v will be guaranteed to be greater than u.
- kind#
The kind of the pipe.
Methods
__init__
(u, v, kind)Check if the pipe is compatible with the cubes it connects.
from_cubes
(u, v)Construct a pipe connecting two cubes and infer the pipe kind.
Attributes
Detailed methods
- check_compatible_with_cubes()[source]#
Check if the pipe is compatible with the cubes it connects.
For compatibility, each cube (head and tail) must match the pipe’s basis along each direction, except for the direction of the pipe, if the cube is of type
ZXCube
.- Raises:
TQECException – If the pipe is not compatible with the cubes.
- Return type:
None
- static from_cubes(u, v)[source]#
Construct a pipe connecting two cubes and infer the pipe kind.
- Parameters:
- Returns:
The pipe connecting the two cubes.
- Raises:
TQECException – If the cubes are not neighbours or both of them are not ZX cubes.
TQECException – If kind of the pipe cannot be inferred from the cubes.
- Return type: