CKMdgGate.get_unitary_and_grad

CKMdgGate.get_unitary_and_grad(params=[])

Return a tuple combining the outputs of get_unitary and get_grad.

Parameters:

params (RealVector) – The unitary parameters, see Unitary.get_unitary() for more info.

Returns:

tuple containing:

UnitaryMatrix: The unitary matrix, see Unitary.get_unitary() for more info.

np.ndarray: The unitary’s gradient, see get_grad().

Return type:

tuple[UnitaryMatrix, npt.NDArray[np.complex128]]

Notes

Can be overridden to potentially speed up optimization by calculating both at the same time.