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

Add selector_hartree and selector_fock to meanfield #326

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

Conversation

pablosanjose
Copy link
Owner

@pablosanjose pablosanjose commented Dec 10, 2024

When doing meanfield calculations, sometimes we want long-range Hartree interactions (which take the form of purely onsite terms), but don't need long-range Fock terms (which induce long-range hoppings, which in turn often make calculations more expensive).

Currently, the selector kwarg in meanfield sets the interacting site pairs for building both the Hartree onsite terms and the Fock hopping terms. The only way to switch off Fock is to set fock = 0, but that doesn't eliminate the Fock hopping terms, it just makes them zero, producing unnecessary overhead in some solvers (e.g. GS.Schur, which then requires building a large supercell to preserve only nearest-cell hoppings).

In this PR we provide selector_hartree that applies to the calculation of Hartree onsite terms, overriding the general selector that applies to both Hatree and Fock by default. In this way, we can set selector = (; range = 0) (i.e. the default), fock = 0 and selector_hartree = (; range = large_distance), and have long-range Hartree-only meanfields without the long-range hopping overhead.

EDIT: we also add selector_fock for completeness and symmetry. Both default to selector, which is the one to use when we don't want to make a difference, just as potential is the one to use, instead of hartree and fock, when we want to treat hartree and fock consistently.

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.45%. Comparing base (8a8b193) to head (8865823).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #326   +/-   ##
=======================================
  Coverage   92.45%   92.45%           
=======================================
  Files          41       41           
  Lines        7074     7074           
=======================================
  Hits         6540     6540           
  Misses        534      534           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pablosanjose pablosanjose changed the title Add selector_hartree to meanfield Add selector_hartree and selector_fock to meanfield Dec 10, 2024
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

Successfully merging this pull request may close these issues.

2 participants