positioned_block_synthesis#
- tqec.interop.positioned_block_synthesis(g)[source]#
Convert a positioned ZX graph to a
BlockGraph
.This strategy requires specifying the 3D positions of each vertex explicitly in the ZX graph. Then the conversion converts each vertex by looking at its nearest neighbors to infer the cube and pipe kind. The conversion maps each vertex to a cube in the block graph and each edge to a pipe connecting the corresponding cubes.
The conversion process is as follows:
Construct blocks for all the L/T/X-shape subgraphs in the ZX graph.
Construct pipes connecting ports/Y to ports/Y nodes.
Greedily construct the pipes until no more pipes can be inferred.
If there are still nodes left, then choose orientation for an arbitrary node and repeat step 3 and 4 until all nodes are handled or conflicts are detected.
- Parameters:
g (PositionedZX) – The positioned ZX graph to be converted to a block graph.
- Returns:
The
BlockGraph
object converted from the ZX graph.- Raises:
TQECException – A valid block graph cannot be constructed.
- Return type: