tqec.utils#

Defines a few core data-structures that are independent of other tqec modules.

The goal of this module is to host data-structures that do not clearly belong to another existing tqec sub-module and that also do not import any code from the other tqec sub-modules.

Functions

round_or_fail(f[, atol])

Try to round the provided f to the nearest integer and raise if f was not close enough to this integer.

Classes

BlockPosition2D(x, y)

Represents the position of a block on a 2-dimensional plane.

Direction3D(value[, names, module, ...])

Axis directions in the 3D spacetime diagram.

LinearFunction([slope, offset])

Represents a linear function.

NoiseModel(idle_depolarization[, ...])

Orientation(value[, names, module, ...])

Either horizontal or vertical orientation.

PhysicalQubitPosition2D(x, y)

Represents the position of a physical qubit on a 2-dimensional plane.

PlaquettePosition2D(x, y)

Represents the position of a plaquette on a 2-dimensional plane.

Position3D(x, y, z)

A 3D integer position.

Scalable2D(x, y)

A pair of scalable quantities.

Shape2D(x, y)

Shift2D(x, y)

SignedDirection3D(direction, towards_positive)

Signed directions in the 3D spacetime diagram.

Exceptions