Ty#

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

Bases: discopy.frobenius.Ty

A circuit type is a frobenius type with Digit and Qudit objects inside.

Parameters:

inside (Digit | Qudit) – The digits and qudits inside the type.

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
ob_factory#

alias of Ob

factory#

alias of Ty