Ty#

class discopy.quantum.circuit.Ty(*t)[source]#

Bases: Ty

Implement the input and output types of Circuit.

Examples

>>> assert bit == Ty(Digit(2))
>>> assert qubit == Ty(Qudit(2))
>>> assert bit @ qubit != qubit @ bit

You can construct n qubits by taking powers of qubit:

>>> print(bit ** 2 @ qubit ** 3)
bit @ bit @ qubit @ qubit @ qubit