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 bug in UHF gradient code #2344

Merged
merged 2 commits into from
Nov 5, 2021
Merged

Conversation

fevangelista
Copy link
Contributor

@fevangelista fevangelista commented Nov 4, 2021

Description

This PR fixes a bug in the UHF gradients for systems with no beta electrons (1-electron systems).
On line 463 of psi4/src/psi4/scfgrad/jk_grad.cc I couldn't avoid skipping this operation because this buffer is read somewhere else (and it practically does not matter for 1-electron systems).

// > Stripe < //
psio_->write(unit_b_, "(A|ij)", (char*)Aijp[0], sizeof(double) * np * nb * nb, next_Aijb, &next_Aijb);

Todos

  • Fixes logic in scf_grad code

Checklist

Status

  • Ready for review
  • Ready for merge

@fevangelista fevangelista changed the title Fix bug and add test Fix bug in UHF gradient code Nov 4, 2021
@JonathonMisiewicz
Copy link
Contributor

One thing that needs to be added: update tests/CMakeLists.txt with the name of your new test.

Copy link
Member

@loriab loriab left a comment

Choose a reason for hiding this comment

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

I added to the tests/CMakeLists directly.

@JonathonMisiewicz JonathonMisiewicz added this to the Psi4 1.5 milestone Nov 5, 2021
@JonathonMisiewicz JonathonMisiewicz merged commit ace6b39 into psi4:master Nov 5, 2021
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

4 participants