qml.gradients.eigvals_to_frequencies

eigvals_to_frequencies(eigvals)[source]

Convert an eigenvalue spectrum to frequency values, defined as the the set of positive, unique differences of the eigenvalues in the spectrum.

Parameters

eigvals (tuple[int, float]) – eigenvalue spectra

Returns

frequencies

Return type

tuple[int, float]

Example

>>> eigvals = (-0.5, 0, 0, 0.5)
>>> eigvals_to_frequencies(eigvals)
(0.5, 1.0)