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

Cleanup remove_distant_points function. #3012

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

susilehtola
Copy link
Member

@susilehtola susilehtola commented Jul 12, 2023

Description

I was looking through the source code to understand what the DFT_REMOVE_DISTANT_POINTS keyword does, and realized I could not understand what the remove_distant_points function was doing. I also suspect that that code was partly wrong.

This PR cleans up that function so that it now does what it should.

However, it is also evident that the logic of this function is not optimal. Instead of checking if any nucleus is within the maximal spatial extent of the basis set, one should check if any nucleus is within the extent of that nucleus' basis functions. This is just a drive-by commit, as I don't think it's worthwhile to spend time on Psi4's quadrature code, since IntegratorXX and GauXC offer a reusable solution that could be used also in Psi4 with significant negative LOCs.

User API & Changelog headlines

  • RN 1
  • RN 2

Dev notes & details

  • Feature1
  • Feature2

Questions

  • Question1

Checklist

Status

  • Ready for review
  • Ready for merge

Vector3 v = molecule_->xyz(atom);
double R = (P.x - v[0]) * (P.x - v[0]) + (P.y - v[1]) * (P.y - v[1]) + (P.z - v[2]) * (P.z - v[2]);
for (int A = 0; A < molecule_->natom(); A++) {
if (Q == A) continue;
Copy link
Member Author

Choose a reason for hiding this comment

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

Specifically, this looks odd to me: why is the code comparing the atomic grid index with an atom index?

Copy link
Member

Choose a reason for hiding this comment

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

here's the last edit of that block: 6141a69#diff-b6a47943fd1f813dc381d6a9e5de7b37bf671d4997497cbaa911a29a359ab66fR4473 . @hokru might be able to comment.

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

2 participants