ffsim.linalg.logm_unitary¶
- ffsim.linalg.logm_unitary(mat)[source]¶
Compute the principal matrix logarithm of a unitary matrix.
The logarithm is computed from the Schur decomposition, which for a unitary matrix takes the form
mat = vecs @ diag(eigs) @ vecs.conj().T, wherevecsis unitary and the eigenvalueseigslie on the unit circle. The logarithm is obtained by replacing each eigenvalue with the imaginary number given by its phase.This is faster than the general-purpose
scipy.linalg.logm(), and unlike that function it returns an antihermitian matrix by construction.