Channel#
- class discopy.quantum.channel.Channel(array, *args, **kwargs)[source]#
Bases:
Tensor
A channel is a tensor with
CQ
types asdom
andcod
.- Parameters:
array – The array of shape
dom.to_dim() @ cod.to_dim()
inside the channel.dom (T) – The domain of the channel.
cod (T) – The codomain of the channel.
- dtype#
alias of
complex
- classmethod measure(dim, destructive=True)[source]#
Measure a quantum dimension into a classical dimension.
- classmethod encode(dim, constructive=True)[source]#
Encode a classical dimension into a quantum dimension.