block_synthesis#

tqec.interop.block_synthesis(zx_graph, strategy=SynthesisStrategy.POSITIONED, *, positions=None, **_kwargs)[source]#

Perform block synthesis translating an instance of pyzx.GraphS to a BlockGraph.

Parameters:
  • zx_graph (GraphS) – a ZX graph to transform into a BlockGraph.

  • strategy (SynthesisStrategy) – strategy used to perform the translation.

  • positions (Mapping[int, Position3D] | None) – explicit block positioning for each node in the provided zx_graph. Only used when strategy == SynthesisStrategy.POSITIONED.

  • _kwargs (dict[str, Any])

Raises:

ValueError – if strategy == SynthesisStrategy.POSITIONED and positions is not provided.

Returns:

an instance of BlockGraph representing the provided zx_graph.

Return type:

BlockGraph