logical_cz_block_graph#

tqec.gallery.logical_cz_block_graph(support_flows=None)[source]#

Create a block graph for the logical CZ gate.

By default, the Hadamard edge in the CZ gate will be horizontal. If you want to use vertical Hadamard edges, you can rotate the graph by 90 degrees by calling ~tqec.computation.block_graph.BlockGraph.rotate.

Parameters:

support_flows (str | list[str] | None) – The stabilizer flow supported by the logical CZ gate. It determines the node kind at the ports of the graph. It can be either a single string like “XI -> XZ” or an iterable of strings like [“XI -> XZ”, “IZ -> IZ”] or None. If multiple flows are provided, a valid graph will be computed or an error will be raised if no valid graph can be found. If None, the graph will have open ports.

Returns:

A BlockGraph instance representing the logical CZ gate.

Raises:

TQECException – If there is Y Pauli operator in the stabilizer flows, or if provided stabilizer flows are not valid for the CZ gate, or if no valid graph can be found for the given stabilizer flows.

Return type:

BlockGraph