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 the get_unitary_and_grad() method.

Attributes

dim

The matrix dimension for this unitary.

num_params

The number of real parameters this unitary-valued function takes.

num_qudits

The number of qudits this unitary can act on.

radixes

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.

is_constant()

Return true if this unitary doesn't take parameters.

is_parameterized()

Return true if this unitary is parameterized.

is_qubit_only()

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.

is_qutrit_only()

Return true if this unitary can only act on qutrits.

is_self_inverse([params])

Checks whether the unitary is its own inverse.