-
Notifications
You must be signed in to change notification settings - Fork 364
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
Analytical derivatives of the MO coefficients wrt nuclear coordinates and the evaluation of Atomic Polar Tensors #1706
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing Edward!
The changes to the grid code look good to me.
Please consider adding a few regtests.
Regarding the regression tests: Do I understand right that I need to move the output from a separate file Lines 707 to 709 in c623102
|
Yes. You need only to print a key result in the CP2K output file which you want to check, preferentially tagged e.g. with |
Since you are already using a printkey, it should be sufficient to set it to |
Unfortunately, there is still a merge conflict because our formatting changed in the meantime ( |
This morning, I ran |
e290494
to
a79b96c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found two nits, otherwise I think this is ready to be merged.
I'm going to squash merge this, but I feel that "Response for dC/dR_lambda^beta" might not be a very useful commit message. |
Seems good! Can you change the commit message or should I push once more? |
It's done. Thanks for upstreaming your changes! |
The dashboard found a couple of convention issues and what appears to be a double free. Instead of |
Should I create a new PR for the fixes? |
Yes, it would be great if you could fix these issue with a follow up PR. |
There are also issues with the tests using the Intel compiler. |
The assertion fails in https://github.com/cp2k/cp2k/blob/master/src/qs_dcdr_ao.F#L769-L771. I'm not sure what the fix is. Maybe replacing by Two more failing tests, where I don't understand what's going wrong, are |
The i386 test was failing already before your PR. The minimal, GCC7, and the Intel tests might have failed for the same reason, which is possibly fixed by your latest fix. We will see. |
Dear CP2K developers,
We used the code in this pull request for the calculations in this publication: doi.org/10.1063/5.0041056.
We added another response calculation called
dcdr_linres
toqs_linres_module
. The purpose is the analytical evaluation of the derivatives of the MO coefficients with respect to nuclear coordinates. The routinedcdr_response_dR
calculates$dCR = dC^0/dR^lambda_beta$
, wherelambda
enumerates the atom indices andbeta
the cartesian coordinates. The coefficient derivatives are then used to calculate the Atomic Polar Tensors (APTs)$P^lambda_alpha,beta = d<mu_alpha>/dR^lambda_beta$
, wheremu_alpha
are the components of the electric dipole operator. The routineapt_dR_localization
calculates the APTs using the localized dipole operator and localized orbitals.This pull request touches quite a few files in the core of CP2K to evaluate integral derivatives with respect to nuclear coordinates - instead of electronic coordinates. I hope that I didn't incur significant performance issues in the standard ground-state calculations.
This input: https://gist.github.com/edditler/97d8a3d2b8f23eb2bb0bcbee3bacfcfc results in this output: https://gist.github.com/edditler/0b517b67bd01346f5c6ad7674c5dc21c on my machine, using the sdbg, ssmp, and psmp binaries.
I ran the regression tests using the arch files generated by the toolchain with the command
tools/regtesting/do_regtest -arch local -version psmp -maxtasks 10 -mpiranks 2 -ompthreads 2
One can also use the implementation to evaluate the analytical Hessian matrix and improve geometry optimizations, but we didn't consider the needed interface.
Best regards,
Edward