cirq.map_eigenvalues

cirq.map_eigenvalues(matrix: numpy.ndarray, func: Callable[complex, complex], *, rtol: float = 1e-05, atol: float = 1e-08) → numpy.ndarray[source]

Applies a function to the eigenvalues of a matrix.

Given M = sum_k a_k |v_k><v_k|.

Parameters:
  • matrix – The matrix to modify with the function.
  • func – The function to apply to the eigenvalues of the matrix.
  • rtol – Relative threshold used when separating eigenspaces.
  • atol – Absolute threshold used when separating eigenspaces.
Returns:

The transformed matrix.