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

Multicomponent #849

Open
antoine-levitt opened this issue Apr 14, 2023 · 4 comments
Open

Multicomponent #849

antoine-levitt opened this issue Apr 14, 2023 · 4 comments

Comments

@antoine-levitt
Copy link
Member

@epolack and @LaurentVidal95 need support for multicomponent (psi(x) is a vector) for twisted bilayer graphene

It would also be nice to have for

  • non collinear spin
  • solving maxwell equations (and making dftk do photonics!)
  • multicomponent Bose Einstein condensates
    -...?

Main design points is how we represent things like psi, rho and V, hopefully without rewriting everything, destroying code readability or performance. Doesn't sound easy but let's try. Maybe this is the time where we'll need to switch to custom data structures rather than plain arrays...

I'll write up in more details the use cases I know of, so we can try to find a good design

@antoine-levitt
Copy link
Member Author

@epolack @LaurentVidal95 can you also write a few words on what data structures you use right now and how well it works?

@mfherbst
Copy link
Member

Puh sounds tough, but I'm curious. It feels like project in size and annoyance related to the bloch / supercell issue.

@antoine-levitt
Copy link
Member Author

Probably simpler than bloch/supercell. It's "just" making everything vectors. The tricky bit is doing it properly...

@antoine-levitt
Copy link
Member Author

So, after discussion with Etienne and Laurent: we take the representation psi[iG][sigma], with Vector{SVector}, so that it's easy to convert to linear indices. We introduce a new field n_components in Model (possibly a type parameter? Will see), and a n_dof, equal to length(G_vectors) * n_components, in both PWBasis and Kpoint. A number of routines will have to be modified, but Etienne says it's not too bad. As a first attempt we don't modify the density building: later, we will probably want rho[i,j,k][sigma,sigma']. Etienne and Laurent will test on TBG; later, we should try to refactor the spin code to allow for noncollinear magnetism.

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