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

Fix handling of high l-momentum channels in ECP local potential #2920

Merged
merged 5 commits into from
Feb 16, 2021

Conversation

camelto2
Copy link
Contributor

Please review the developer documentation
on the wiki of this project that contains help and requirements.

Proposed changes

This PR closes issue #2917.
ECPComponentBuilder had a str,int map for allowed angular momentum, and only had up to "g".
Since the NonLocalECPComponent has implemented nonlocal channels up to lmax = 7 (j channel), I added to the angMon map up to lmax = 8 (k channel) since the k channel could be used as a local in that case.

Additionally, in ECPComponentBuidler::buildSemiLocalAndLocal I add a check to see if the requested angular momentum is actually in the angMon map. Otherwise it aborts

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

Delete the items that do not apply

  • Bugfix

Does this introduce a breaking change?

  • No

What systems has this change been tested on?

My workstation

Checklist

Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.

  • Yes. This PR is up to date with current the current state of 'develop'
  • Yes. 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?

src/QMCHamiltonians/ECPComponentBuilder.2.cpp Outdated Show resolved Hide resolved
src/QMCHamiltonians/ECPComponentBuilder.2.cpp Outdated Show resolved Hide resolved
@prckent prckent changed the title Ecp local fix Fix handling of high l-momentum channels in ECP local potential Feb 15, 2021
@prckent
Copy link
Contributor

prckent commented Feb 15, 2021

I changed the title to make writing the human readable changelog easier.

@@ -154,7 +154,7 @@ void ECPComponentBuilder::buildLocal(xmlNodePtr cur)
{
if (grid_global == 0)
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove {} for a single line. Please update all the places touched.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@@ -32,13 +32,13 @@ void ECPComponentBuilder::buildSemiLocalAndLocal(std::vector<xmlNodePtr>& semiPt
if (grid_global == 0)
{
app_error() << " Global grid needs to be defined." << std::endl;
Copy link
Contributor

@ye-luo ye-luo Feb 15, 2021

Choose a reason for hiding this comment

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

app_error() is more for printing from any rank which is unknown.
Since the error is uniform. Please
fuse

app_error() << "    Global grid needs to be defined." << std::endl;

into myComm->barrier_and_abort to print one copy only.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

rmax = std::max(rmax, rc);
if (angMon.find(lstr) == angMon.end())
{
app_error() << "requested angular momentum " << lstr << " not available.\n";
Copy link
Contributor

Choose a reason for hiding this comment

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

examples

myComm->barrier_and_abort("basisset \"" + basisset_name + "\" cannot be found\n");

You may use ostringstream to buffer contents if it is long.
myComm->barrier_and_abort(err_msg.str());

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Copy link
Contributor

@ye-luo ye-luo 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 Feb 15, 2021

Okay to test

@ye-luo ye-luo merged commit 35199b8 into QMCPACK:develop Feb 16, 2021
@camelto2 camelto2 deleted the ecp_local_fix branch February 16, 2021 20:37
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.

4 participants