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

Nexus: Extend excitations to allow 'lowest' gap #3628

Merged
merged 41 commits into from
Dec 3, 2021

Conversation

mcbennet
Copy link
Contributor

Proposed changes

This PR allows the user to specify 'lowest' for the excitation, e.g.,

generate_qmcpack(
...,
excitation = ['up','lowest'], # 'up' can be replaced with 'down', 'singlet', or 'triplet'
...,
)

where nexus will then generate the lowest excitation for the given type (up,down,singlet,triplet) based on the energy index (electron count). The resulting qmcpack input will contain the corresponding excitation in energy format.

This PR also fixes a couple minor bugs in the previous 'singlet' and 'triplet' types.

In addition, post analysis checks for the various excitation input types have been added -- the user's input is checked against qmcpack's generated einspline files to verify that the user's requested excitation is consistent with the change to the einspline file.

What type(s) of changes does this code introduce?

  • Bugfix
  • New feature

Does this introduce a breaking change?

  • No. nxs-tests pass in ubuntu desktop (with the exception of simulation_module)

What systems has this change been tested on?

Ubuntu desktop

Checklist

  • Yes. This PR is up to date with current the current state of 'develop'
  • N/A. Code added or changed in the PR has been clang-formatted
  • No. This PR adds tests to cover any new code, or to catch a bug that is being fixed
  • No. Documentation has been added (if appropriate)

@qmc-robot
Copy link

Can one of the admins verify this patch?

@mcbennet mcbennet marked this pull request as draft November 23, 2021 17:46
@mcbennet
Copy link
Contributor Author

mcbennet commented Nov 23, 2021

Changing to draft PR. There are a few additional tests I would like to look at before this goes in.

@mcbennet
Copy link
Contributor Author

mcbennet commented Nov 24, 2021

Okay, IMO this PR is ready to go in -- removing draft state. For diamond (primitive with 4 up and 4 down electrons), I tested that the VMC-NoJ kinetic energies from various excitation (gamma-to-gamma) specifications agree with the total kinetic energy from the eshdf tool. That plot is attached. This test was necessary because ['*','lowest'] will produce a qmcpack input that is equivalent to excitation = ['*','-4 +5'], and we want to verify that this agrees with the 'band' excitation type.

Ground: ground state WF
Up-Band: excitation = ['up','0 3 0 4']
Dn-Band: excitation = ['down','0 3 0 4']
Up-Energy: excitation = ['up','-4 +5']
Up-Binary: excitation = ['singlet','-4 +5'] -> Before running, CSF coefficients are changed by hand to make excitation consistent with others above, i.e., (0.707,0.707) -> (1.000,0.000)

All the VMC KEs appear to be in really good agreement here and also in good agreement with eshdf.

Screenshot from 2021-11-24 08-28-37

@mcbennet mcbennet marked this pull request as ready for review November 24, 2021 13:39
@jtkrogel
Copy link
Contributor

Looking good overall. Just needs some hardening.

@mcbennet mcbennet marked this pull request as ready for review November 29, 2021 20:21
@mcbennet
Copy link
Contributor Author

This PR should now be ready for review.

@ye-luo
Copy link
Contributor

ye-luo commented Nov 29, 2021

Test this please

Copy link
Contributor

@jtkrogel jtkrogel left a comment

Choose a reason for hiding this comment

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

See comments below.

nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack_input.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack_input.py Outdated Show resolved Hide resolved
@mcbennet
Copy link
Contributor Author

mcbennet commented Dec 2, 2021

@jtkrogel I think everything in your review is either addressed or outdated

nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
else:
bands[bnum] = cb
#end if
elif 'VB' in b:
Copy link
Contributor

@jtkrogel jtkrogel Dec 2, 2021

Choose a reason for hiding this comment

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

Still needs lowercase comparison ('vb' in b.lower()). And similar for any other cases.

nexus/lib/qmcpack.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack_input.py Outdated Show resolved Hide resolved
nexus/lib/qmcpack_input.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jtkrogel jtkrogel left a comment

Choose a reason for hiding this comment

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

LGTM

@ye-luo
Copy link
Contributor

ye-luo commented Dec 3, 2021

Test this please

@ye-luo ye-luo enabled auto-merge December 3, 2021 19:15
@ye-luo ye-luo merged commit 6b2364e into QMCPACK:develop Dec 3, 2021
@mcbennet mcbennet deleted the nxs_excitations branch December 3, 2021 20:05
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.

None yet

5 participants