Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linalg: Schur decomposition #892

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Conversation

perazz
Copy link
Contributor

@perazz perazz commented Nov 20, 2024

Compute the Schur decomposition of a real or complex square matrix: $A = Z T Z^H$.

Proposed implementation

  • call schur(A, T, Z [, eigvals] [, overwrite_a] [, storage] [, err]) : subroutine interface
  • call schur_space(A, lwork [, err]) query internal storage size for pre-allocation.

Key facts

  • The Schur decomposition is based on LAPACK's General Schur decomposition (*GEES) and eigenvalue sorting mechanisms.
  • The output matrix $T$ is upper-triangular for complex matrices and quasi-upper-triangular for real matrices, with possible $2 \times 2$ blocks on the diagonal.
  • Optionally, the user may request eigenvalues of $A$, which are the diagonal elements of $T$.
  • The function supports an overwrite_a flag (default: .false.). If .true., and storage is user-provided, the input matrix a will be overwritten, avoiding memory allocation.

Progress

  • base implementation
  • tests
  • documentation
  • submodule
  • examples
  • workspace size evaluation

Prior art

  • Numpy: not available
  • Scipy: T, Z = schur(a, output='real', lwork=None, overwrite_a=False, sort=None, check_finite=True)

cc: @fortran-lang/stdlib @jvdp1 @jalvesz @loiseaujc

@perazz perazz marked this pull request as ready for review November 20, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant