Digits#

class discopy.quantum.gates.Digits(name=None, dom=None, cod=None, data=None, *args, **kwargs)[source]#

Bases: ClassicalGate

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

Examples

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