Repository navigation
Conversation
8c4ffde to
4a76d70
Compare
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
4a76d70 to
bb80d5e
Compare
lkdvos
left a comment
There was a problem hiding this comment.
Overall definitely fine by me, although maybe we can discuss the API of this a little bit:
In general, my idea was that the algorithm struct holds all of the settings, so no additional keywords are needed for the f!(in, out, alg) methods. This mostly is beneficial to reason about signatures etc, for example I think the non-inplace methods wouldn't properly pass on the check_hermiticity keyword and instead would pass that to the select_algorithm function. I think most of our algorithm structs are generic so you can do something like get(alg.kwargs, :check_hermiticity, true) to get it out generically?
For the name, do you think it might make sense to just have a package-wide unsafe keyword that basically disables all checks, or something similar?
|
Extremely open to API changes. I didn't go with generic unsafe since only eigh has a similar check (e.g. I think no other function checks for posdef or something). But putting it in the alg can also be done and we just ignore that for eig and co. I'll try that and we can see if we like how it looks, it will simplify things for Enzyme too. |
I was really torn about what to call this check.
check_hermiticityseems accurate but is ugly, butcheck_hermitianis already taken by the function itself.The idea here is to allow users to avoid the
check_hermitiancalls if they are sure the input matrix is hermitian, ie if they just calledproject_hermitian!on it. This comes up for example in the C4v CTMRG case where we computeeigh_valson something that was just projected.