Skip to content
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

Allow construction of Hamiltonian by providing Harmonics #233

Open
BacAmorim opened this issue Jan 3, 2024 · 2 comments
Open

Allow construction of Hamiltonian by providing Harmonics #233

BacAmorim opened this issue Jan 3, 2024 · 2 comments

Comments

@BacAmorim
Copy link

It would be useful to expose the creation of Hamiltonians / general operators by directly providing the matrices of the harmonics.

The interface could be the following:

h = hamiltonian(lat, 
[
((0), h0), 
((1), h1), 
((-1), h2)
]
)

Would create a Quantica Hamiltonian with 3 harmonics, where h0, h1 and h2 are matrices. This approach could be used to create Quantica Hamiltonians from a Wannier90 calculation, with the Harmonics being read using WannierIO.jl See also Wannier90 interface #4

@pablosanjose
Copy link
Owner

pablosanjose commented Jan 3, 2024

This can totally be done, and it is quite trivial, since we have HybridSparseMatrix(b::OrbitalBlockStructure{B}, flat::SparseMatrixCSC{Complex{T},Int}) constructors that can convert the flat input matrices to the required hybrid matrices.

I would probably make the second argument a Dict, though, like Dict(SA[0] => h0, SA[1] => h1,...).

Regardless of this functionality, that would be good to have, the Wannier90 problem could alternatively/additionally use an approach of the type @hopping([s´, s] -> wannier90((s´.dn, s´.i), (s.dn, s.i)), as described in #229, to import Wannier90 files, where wannier90::Wannier90 would be an object created from a Wannier90 output file, so we don't need to build the Dict as an intermediate object.

@pablosanjose
Copy link
Owner

pablosanjose commented Apr 19, 2024

With #229 and #264 now merged, I'm wondering if we still need this. @BacAmorim, could you make an argument for the usecase?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants