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

Model Hamiltonians #17

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Model Hamiltonians #17

wants to merge 8 commits into from

Conversation

wavefunction91
Copy link
Owner

Adding model hamiltonians

@wavefunction91 wavefunction91 added the enhancement New feature or request label Jun 7, 2023
src/macis/model/hubbard.cxx Outdated Show resolved Hide resolved
Comment on lines 13 to 15
for(size_t p = 0; p < nsites; ++p) {
// Half-filling Chemical Potential
T[p * (nsites+1)] = -U/2;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be worth making the chemical potential an argument with default value? I could imagine people wanting to shift it, even if it's a finite 1d-chain.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was something I wasn't sure on, glad to know it's a flexible parameter. Is there a general form for this Hamiltonian that we could document so we can be precise in what we're supposed to be doing here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A common form for the interaction in the particle-hole symmetric case is:

U/2 \sum_i (n_i - 1)^2

Where n_i is the full particle number operator in site i, adding spin up and down. This automatically adds the chemical potential term of -U/2, and also a constant energy term of U/2 which of course does not affect the physics. So, a meaningful option would be to accept the chemical potential deviation away from half-filling as input, in other words a \mu such that the full Hamiltonian is

[hopping] + U/2 \sum_i (n_i - 1)^2 + mu \sum_i n_i

What do you think?

Comment on lines 5 to 6
void hubbard_1d(size_t nsites, double t, double U, std::vector<double>& T,
std::vector<double>& V) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For model Hamiltonians like this one, it will make sense to add a new HamiltonianGenerator class that implements the single/double search instead of the double loop (Incidentally, it could make sense to add it to this branch. I could take charge of that, since I've already implemented something in these lines). This is especially true since many of the model systems have an extremely sparse V tensor, which makes this type of Hamiltonian build very efficient. To this end, we could consider the option of having these "integral building functions" return a vector listing the orbitals which have a non-sparse V sub-tensor. In the example of the Hubbard model, this will always be empty, since V is completely diagonal, and hence does not generate any double (or single) excitations. For an impurity model, this would be just the impurity.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea, If you can mock something up and push to this branch, that would be helpful. We can iterate on the design once something is in place.

Re Sparse vs dense storage, that's a good point. I'm hesitant to do this ad hoc though, if we're going to support sparse integrals, we should build up proper sparse tensor infrastructure (sparsexx can already cover the Matrix case, we would just need to generalize the CSR/CSV/COO to tensors which is relatively straight forward). However, even for some the largest cases that folks can do ED on for these types of problems (26-28 sites), integral storage is trivial compared to the CI vectors, so this kind of optimization may be premature. But I can definitely see the desire to have this in general, so we should figure out how to do it properly - I would say we should punt on that for a bit and maybe open an issue so we don't forget to cover it eventually.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I'll put what I have and push it in.

I didn't mean using a sparse tensor for the V's, I agree that's a bit premature (though useful at some point). I was thinking of storing the dense V, full of zeros, but having the HamiltonianGenerator instance only look for doubles/singles among a subset of orbitals. For example, in the Hubbard model, you want to tell it to look for singles everywhere, but for doubles nowhere (there are no doubles, at least in real space). This will dramatically reduce the cost of the Hamiltonian build. For impurity models, you want to look for singles everywhere, and for doubles only among the impurity orbitals (since the bath is non-interacting by construction, at least in DMFT). Since the impurity is typically much smaller than the bath, this again is an important speed-up.

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

Successfully merging this pull request may close these issues.

2 participants