cqmap#

Implements classical-quantum maps.

CQMap implements the classical-quantum processes of Picturing Quantum Processes, Coecke and Kissinger (2018). Objects are given by a quantum dimension Q (a.k.a. double wires) and a classical dimension C (a.k.a. single wires). Arrows are given by arrays of the appropriate shape, see CQMap. For example, states of type Q are density matrices:

>>> from discopy.quantum import Ket, H
>>> (Ket(0) >> H).eval(mixed=True).round(1)
CQMap(dom=CQ(), cod=Q(Dim(2)), array=[0.5+0.j, 0.5+0.j, 0.5+0.j, 0.5+0.j])