-
Notifications
You must be signed in to change notification settings - Fork 8
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
Redesign how hermiticity of a Hamiltonian is encoded #14
Comments
I think it is a good idea to add a field Also, I think it would be useful to add a method to Finally, I think the forcing of setindex! to preserve hermicity (by automatically adding a hopping B=>A, if we set a A=>B hopping), should be an option My reason to propose this as an optition is the output of Wannier calculation. The hoppings are returned without any concern of hermiticity. If we always force hermiticity in Just my €0.02. |
I think I agree. The main reason of the Hermitian wrapper is to be able to have type-stable diagonalize methods, that return either real or complex eigenvalues. The approach in pablosanjose/Elsa.jl#37 addresses this issue, and I think the decision there is solid. The The problem of having a field that promises hermiticity is that it could lie, unless we force the API everywhere to respect this. If we use a setindex! that does not I suspect the only way to solve this is to make the Finally, another reason to not encode hermiticity at the type level, and keep it as a Boolean struct field as you say, is that the package is already becoming slightly parametric-heavy. This is still not a problem for compilation time, but in the future I'd like to look into ways of simplifying the type parametrizations if possible. |
I'm less inclined since #38 to bake in privileged behavior for Hermitian matrices. As the package progresses it will become more and more common, I think, to consider open systems with non-Hermitian self-energies, or other uses beyond the strict tight-binding mindset. I'm currently working in a problem with a non-symmetric real "Hamiltonian" (in the sense of an inverse equation of motion Green's function) that benefits from all the Quantica machinery (including bandstructure calculation) without being Hermitian. I suggest we close this for the moment until we find a real need to impose/check hermiticity in a non-standard way. Otherwise, we should simply follow the Julia approach and extend the API with wrapped |
Checking whether a very large Hamiltonian is Hermitian is inefficient, particularly for compressed-column sparse Hamiltonians which do not favor row access. Currently, we have no way to encode Hermiticity, and this is unfortunate.
We could add a field to a Hamiltonian that signals hermiticity when the original model is hermitian, and then force
setindex!
to preserve hermiticity. Alternatively we could wrap it inHermitian
. The latter would be the more Julian solution, but then we should makeHamiltonian
satisfy theAbstractMatrix
interface, which is probably not possible, as it is a more general object.This issue is a reminder and an invitation to discuss possible designs.
The text was updated successfully, but these errors were encountered: