tqec.computation#

Defines the data structures to represent the logical computations.

This module provides high-level abstractions to represent the fault-tolerant logical computations protected by surface code. There are two representations of the logical computation:

  • ZXGraph: A restricted form of the ZX diagram from the ZX-calculus.

  • BlockGraph: A graph consisting of individual building blocks that fully specify the boundary conditions and topological structures of the logical computation. It corresponds to the commonly used 3D spacetime diagram representation of a surface code logical computation.

Classes

BlockGraph([name])

Block graph representation of a logical computation.

Cube(position, kind[, label])

A fundamental building block of the logical computation.

CubeKind()

Base class for the kinds of cubes in the block graph.

Pipe(u, v, kind)

A block connecting two Cube objects.

PipeKind(x, y, z[, has_hadamard])

The kind of a pipe in the block graph.

Port()

Cube kind representing the open ports in the block graph.

YCube()

Cube kind representing the Y-basis initialization/measurements.

ZXCube(x, y, z)

The kind of cubes consisting of only X or Z basis boundaries.

ZXEdge(u, v[, has_hadamard])

An edge connecting two neighboring nodes in the ZX graph.

ZXGraph([name])

ZX graph representation of a logical computation.

ZXKind(value[, names, module, qualname, ...])

The kind of the node in the ZX graph.

ZXNode(position, kind[, label])

A node in the ZX graph.