-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
ishermitian/issymmetric should accept optional atol keyword parameter #28885
Comments
I think this "feature" is not consistent with other julia methods such as |
See the discussion in #10298. |
I agree that the default behavior of |
simple enough to redefine
|
It's possibly less of a decision and more that no one has submitted a PR? But I suspect there is little point since lots of other routines will fail or produce surprising results unless it's exact. |
If this is the case, it could be clarified by having an open issue regarding this missing feature. This could be accomplished most easily by opening and renaming this one, while perhaps adjusting the top comment (I no longer have the permission to do any of this), or alternatively by having a new issue elsewhere. Suggested [edited] title: |
In my own personal experience of dealing with quantum mechanics numerically, the most common use case for this missing feature has been as a sanity check that a matrix I have constructed is actually Hermitian before treating it conceptually as such. Without such a check, it is much easier to let a non-physical Hamiltonian or observable slip through. Often, the matrix I have constructed will be non-Hermitian only by the tiniest amounts (e.g. because floating point addition is non-associative), and I'd like to perform a conceptual test of whether the matrix is "close enough" to Hermitian. |
ishermitian
is too restrictive
Reopened and renamed as suggested. |
my use case is also as a sanity check to make sure that a numerically simulated matrix that should be symmetric actually is. |
my re-definition above would be better if the added keyword argument were |
@garrison see #36243 (comment). |
Oh, interesting find regarding #36243. I had been thinking recently that anything decided here should apply to |
|
I wrote a package a while back to try to approach specifying measure of closeness in a uniform way: IsApprox.jl. I included code for many functions/methods including
|
I was expecting the following code print two
true
s.Instead, I get
true
andfalse
.The
ishermitian
turns out using==
. Isn't it better to use≈
or add anatol
keyword parameter?julia/stdlib/LinearAlgebra/src/generic.jl
Line 971 in 4498d27
The text was updated successfully, but these errors were encountered: