mqt.qecc.codes.constructions.color_codes.color_code

A color code class.

Classes

LatticeType

The type of lattice used for the color code.

ColorCode

A base class for color codes on a three-valent, three-colourable lattice.

Module Contents

class LatticeType[source]

Bases: enum.StrEnum

The type of lattice used for the color code.

class ColorCode(distance: int, lattice_type: LatticeType)[source]

Bases: mqt.qecc.codes.core.css_code.CSSCode

A base class for color codes on a three-valent, three-colourable lattice.

add_qubits() → None[source]

Compute the ancilla and data qubits lists from the lattice type.

construct_layout() → None[source]

Construct the adjacency lists of the code from the qubits lists. Assumes add_qubits was called.

compute_logical() → None[source]

Compute the logical operators of the code.

get_syndrome(error: numpy.typing.NDArray[int_]) → numpy.typing.NDArray[int_][source]

Compute the syndrome of the error.

check_if_logical_error(residual: numpy.typing.NDArray[int_]) → bool[source]

Check if the residual is a logical error.