cirq.map_eigenvalues

cirq.map_eigenvalues(matrix: numpy.ndarray, func: Callable[complex, complex], tolerance: cirq.linalg.tolerance.Tolerance = Tolerance(rtol=1e-05, atol=1e-08, equal_nan=False)) → 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.
  • tolerance – Thresholds used when separating eigenspaces.
Returns:

The transformed matrix.