Parametrized

Contents

Parametrized#

class discopy.quantum.gates.Parametrized(name=None, dom=None, cod=None, data=None, *args, **kwargs)[source]#

Bases: Box

Abstract class for parametrized boxes in a quantum circuit.

Parameters:

Example

>>> from sympy.abc import phi
>>> from sympy import pi, exp, I
>>> assert Rz(phi).array[0,0] == exp(-1.0 * I * pi * phi)
>>> c = Rz(phi) >> Rz(-phi)
>>> assert c.lambdify(phi)(.25) == Rz(.25) >> Rz(-.25)