Digits#

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

Bases: ClassicalGate

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

Examples

>>> assert Bits(1, 0) == Digits(1, 0, dim=2)
>>> assert Digits(2, dim=4).eval()\
...     == Tensor(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.