Skip to content

ENH: Use hermitian kwarg in favor of h-suffix #9436

Open
@perimosocordiae

Description

@perimosocordiae

gh-8557 adds a hermitian=False kwarg to np.linalg.matrix_rank, which allows the use of a more efficient algorithm when the matrix is known to be hermitian.

Some other functions in np.linalg have similar considerations for this case, but require calling a different function for the hermitian case:

  • eigvals / eigvalsh
  • eig / eigh

(There's also fft vs hfft, but I don't want to touch that API if I can avoid it.)

The proposal: add hermitian keyword arguments to eigvals and eig, and encourage their use in place of eigvalsh and eigh.

Considerations: gh-8557 uses a simple boolean value, but @eric-wieser suggested allowing UPLO-style strings as well. This can be added to matrix_rank retroactively if desired, without breaking compatibility.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions