Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property#234
Open
jpbrodrick89 wants to merge 4 commits into
Open
Add HEVD solver, hermitian_tag, is_hermitian check and .H operator property#234jpbrodrick89 wants to merge 4 commits into
HEVD solver, hermitian_tag, is_hermitian check and .H operator property#234jpbrodrick89 wants to merge 4 commits into
Conversation
HEVD solver, hermitian_tag, is_hermitian check and .H operator property`HEVD solver, hermitian_tag, is_hermitian check and .H operator property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new Hermitian eigenvalue solver
HEVDwhich usesjnp.linalg.eighunder the hood. Don't worry this is not me moving to support general eigenvalue querying but merely stands as a more efficient version ofSVDfor Hermitian rank-deficient operators. There is little controversial about this PR except if there was a specific reason the.Hproperty was not added initially and the branchy way of removing singular eigenvalues when tagged as rank deficient.Changes made:
lineax.HEVDthat performs Hermite eigenvalue decomposition on Hermitian operatorsHEVDhas awareness of eigenvalue ordering when statically truncating singular eigenvalue based on `MaxRankTag``AutoLinearSolver(well_posed=False)dispatches toHEVDby default for Hermitian operatorsis_hermitiancheck. To ensure custom user linear operators don't raise withAutoLinearSolver(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_symmetricwill registerTrueifis_hermitianand real.hermitian_tagand wires it into all tag propagation (tags from checks, transpose tags, invert tags).Hoperator property which callsoperator.conj().transpose()unless the operator is Hermitian, in which case it no-ops..Hin_linear_solve_jvp_ruleto take advantage of no-op and also queriesis_hermitianto skip conjugate transposing the state.linear_solve_pwith the Gram partner when calculating theI'm open to alternative names if there are strong opinions, options include
EIGH,EigH,HermitianEigenValueSolverbut I prefer the obvious analogue ofHEVDwithSVD.@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.