class discopy.quantum.gates.Digits(*args, **kwargs)[source]#

Bases: ClassicalGate

Classical state for a given string of digits of a given dimension.


>>> from discopy.tensor import Dim, Tensor
>>> assert Digits(2, dim=4).eval()\
...     == Tensor[complex](dom=Dim(1), cod=Dim(4), array=[0, 0, 1, 0])
property dim#

The dimension of the information units.

>>> assert Bits(1, 0).dim == 2
property digits#

The digits of a classical state.

property bitstring#

The digits of a classical state.