DifferentiableUnitary
- class DifferentiableUnitary[source]
Bases:
Unitary
A differentiable unitary-valued function.
A DifferentiableUnitary inherits from Unitary and additionally exposes the
get_grad()
abstract method and theget_unitary_and_grad()
method.Attributes
The matrix dimension for this unitary.
The number of real parameters this unitary-valued function takes.
The number of qudits this unitary can act on.
The number of orthogonal states for each qudit.
Methods
check_parameters
(params)Check parameters are valid and match the unitary.
get_grad
([params])Return the gradient for the unitary map as an np.ndarray.
get_unitary
([params])Map real-valued params to a UnitaryMatrix.
get_unitary_and_grad
([params])Return a tuple combining the outputs of get_unitary and get_grad.
Return true if this unitary doesn't take parameters.
Return true if this unitary is parameterized.
Return true if this unitary can only act on qubits.
is_qudit_only
(radix)Return true if this unitary can only act on radix-qudits.
Return true if this unitary can only act on qutrits.
is_self_inverse
([params])Checks whether the unitary is its own inverse.