tqec.computation.correlation.CorrelationSurface#

class CorrelationSurface(nodes: frozenset[~tqec.computation.zx_graph.ZXNode], span: frozenset[~tqec.computation.zx_graph.ZXEdge] = frozenset({}), external_stabilizer: dict[str, str] = <factory>)[source]#

A correlation surface in the logical computation.

The correlation surface specifies the correlation between the logical operators in the spacetime diagram. Logical observable can be derived from the boundaries of the correlation surface.

The correlation surface is defined by the set of edges in the ZX graph. Each edge represents a X/Z surface within the pipe in the BlockGraph picture. A Y surface is represented by two distinct edges, one for the X surface and one for the Z surface. Therefore, the nodes of the edges in the correlation surface must be Z/X type nodes.

nodes#

A set of ZXNode representing the nodes in the correlation surface. The kind of the node is determined by what kinds of correlation the node supports. If both X and Z correlation are supported, the node is a Y type node.

Type:

frozenset[tqec.computation.zx_graph.ZXNode]

span#

A set of ZXEdge representing the correlation between logical operators spanning in the 3D space. The edges in the span must be between Z/X type nodes.

Type:

frozenset[tqec.computation.zx_graph.ZXEdge]

external_stabilizer#

A mapping from the port label to the Pauli operator at the port, which represents the spacetime stabilizer for the correlation surface. Sign of the stabilizer is neglected.

Type:

dict[str, str]

__init__(nodes: frozenset[~tqec.computation.zx_graph.ZXNode], span: frozenset[~tqec.computation.zx_graph.ZXEdge] = frozenset({}), external_stabilizer: dict[str, str] = <factory>) None#

Methods

__init__(nodes[, span, external_stabilizer])

from_span(zx_graph, span)

Construct a correlation surface from the correlation span.

get_correlation_types(span)

Get the correlation types at the nodes in the correlation span.

Attributes

has_single_node

Return True if the correlation surface contains only one node.

node_correlation_types

Return a mapping from the position of the node to the correlation type supported at the node.

span

nodes

external_stabilizer