ffsim.linalg.logm_special_orthogonal

ffsim.linalg.logm_special_orthogonal(mat)[source]

Compute a real antisymmetric matrix logarithm of a special orthogonal matrix.

The logarithm is computed from the real Schur decomposition, which for a special orthogonal matrix is block diagonal, with 2x2 rotation blocks and scalar blocks equal to +1 or -1. Each rotation block is replaced by its rotation angle, which is taken in the interval (-pi, pi], and the -1 blocks are paired into rotations by pi. The eigenvalues of the result therefore have imaginary parts in [-pi, pi].

Unlike logm_unitary(mat).real, this function returns a valid logarithm when the matrix has -1 eigenvalues. logm_unitary() maps each -1 eigenvalue to the imaginary number i*pi, so the real part loses the corresponding rotation.

The logarithm is not unique, and its entries can jump between branches as the input varies. This function does not check that the input is orthogonal.

Parameters:

mat (ndarray) – The special orthogonal matrix. A complex dtype is accepted as long as the imaginary part is zero.

Return type:

ndarray

Returns:

The real antisymmetric matrix logarithm of the special orthogonal matrix.

Raises:
  • ValueError – The matrix has a nonzero imaginary part.

  • ValueError – The matrix has an odd number of -1 eigenvalues, so it is not special orthogonal.