class discopy.quantum.gates.Digits(*digits, dim=None, is_dagger=False)[source]#

Bases: ClassicalGate

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


>>> 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.