Skip to content

Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property#234

Open
jpbrodrick89 wants to merge 4 commits into
devfrom
jpb/hevd
Open

Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property#234
jpbrodrick89 wants to merge 4 commits into
devfrom
jpb/hevd

Conversation

@jpbrodrick89

Copy link
Copy Markdown
Collaborator

This adds a new Hermitian eigenvalue solver HEVD which uses jnp.linalg.eigh under the hood. Don't worry this is not me moving to support general eigenvalue querying but merely stands as a more efficient version of SVD for Hermitian rank-deficient operators. There is little controversial about this PR except if there was a specific reason the .H property was not added initially and the branchy way of removing singular eigenvalues when tagged as rank deficient.

Changes made:

  • Adds a new lineax.HEVD that performs Hermite eigenvalue decomposition on Hermitian operators
  • HEVD has awareness of eigenvalue ordering when statically truncating singular eigenvalue based on `MaxRankTag``
  • AutoLinearSolver(well_posed=False) dispatches to HEVD by default for Hermitian operators
  • Adds is_hermitian check. To ensure custom user linear operators don't raise with AutoLinearSolver(well_posed=False) provides a default fallback implementation which queries symmetry and definiteness. All lineax operator receive dedicated registrations even if their implementation is identical to the fallback.
  • is_symmetric will register True if is_hermitian and real.
  • Adds hermitian_tag and wires it into all tag propagation (tags from checks, transpose tags, invert tags)
  • Adds .H operator property which calls operator.conj().transpose() unless the operator is Hermitian, in which case it no-ops.
  • Adopts .H in _linear_solve_jvp_rule to take advantage of no-op and also queries is_hermitian to skip conjugate transposing the state.
  • Applies the optimisations first floated in jvp optimisations for pseudoinverse solvers #217 by noticing that a lot of rectangular solver have a "Gram partner" (SVD -> HEVD, Tall QR -> Cholesky, Tall Normal -> inner) as such we can can call linear_solve_p with the Gram partner when calculating the $(A^H A)^\dagger$ term.

I'm open to alternative names if there are strong opinions, options include EIGH, EigH, HermitianEigenValueSolver but I prefer the obvious analogue of HEVD with SVD.

@adconner this will affect #221 as we will need to cover Hermitian indefinite rank-deficient (I think I've added the old-style versions here). Note I'm definitely happy to get rid of the test that asserts iterative solves raise for singular matrices as I triggered a configuration where this failed.

@jpbrodrick89 jpbrodrick89 changed the title Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property` Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property Jun 21, 2026
@jpbrodrick89 jpbrodrick89 added the feature New feature label Jun 23, 2026
@jpbrodrick89 jpbrodrick89 changed the base branch from jpb/refactor-AbstractLinearSolver to dev June 27, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant