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

Add analytic dipole derivatives for RHF #1382

Merged
merged 7 commits into from Dec 10, 2018

Conversation

Projects
None yet
5 participants
@andysim
Member

andysim commented Nov 28, 2018

Description

Adds analytic dipole derivatives for RHF, allowing IR intensities to be computed; @loriab, @dsirianni and crew are working on the finite difference version for cases like DF-MP2, where finite differences of gradients are used for frequencies.

Todos

Notable points (developer or user-interest) that this PR has or will accomplish.

  • Adds dipole derivative code, and a test to verify that they match the CCQC programming project values

Questions

  • Does anybody object to wavefunction holding these?
  • Does anybody object to the various set_ methods of wavefunction taking SharedMatrix by value, not by reference?

Checklist

Status

  • Ready for review
  • Ready for merge

@loriab loriab referenced this pull request Nov 28, 2018

Open

IR intensities #68

3 of 5 tasks complete

@andysim andysim force-pushed the andysim:dipder branch from 21a173a to b321ddb Nov 29, 2018

@dgasmith

Looks great Andy! Thanks for working on this.

Show resolved Hide resolved psi4/src/export_wavefunction.cc Outdated
Show resolved Hide resolved psi4/src/psi4/libmints/mintshelper.cc Outdated

@loriab loriab referenced this pull request Dec 7, 2018

Open

parallelize longest ctests #1414

7 of 10 tasks complete

@loriab loriab added this to the Psi4 1.3 milestone Dec 9, 2018

andysim and others added some commits Nov 28, 2018

@andysim andysim force-pushed the andysim:dipder branch from a515e93 to ef347f2 Dec 9, 2018

@andysim

This comment has been minimized.

Member

andysim commented Dec 9, 2018

Ok, this one's been rebased and is ready for review. Many thanks to @loriab for the help integrating the code.

@loriab

loriab approved these changes Dec 9, 2018

I wrote part and could not write the other part, so I'm not the best reviewer. But LGTM, and I testify that it behaves like other codes for RHF non-DF IR intensities. Many thanks to @andysim for moving this forward.

@dgasmith

LGTM

auto perturbation_gradient = std::make_shared<Matrix>("Perturbation Gradient", natoms, 3);
auto dipole_gradients = dipole_grad(D);
double lambdas[3] = {xlambda, ylambda, zlambda};
C_DGEMM('n', 't', 3 * natoms, 1, 3, 1.0, dipole_gradients->pointer()[0], 3, &lambdas[0], 3, 0.0,

This comment has been minimized.

@dgasmith

dgasmith Dec 9, 2018

Member

Well, that's easier.

This comment has been minimized.

@andysim

andysim Dec 10, 2018

Member

Sure is. The pert_grad routine computed this contraction within the loops, so wasn't suitable for the dipole gradients. By computing the uncontracted dipole gradients and GEMMing them, we avoid repetition as you suggested - good call.

This comment has been minimized.

@jturney

jturney Dec 10, 2018

Member

Good call pulling the lambdas out of the loops.

@loriab loriab requested a review from jturney Dec 10, 2018

qcel.constants.get("fine-structure constant")**2 * qcel.constants.get("atomic unit of length") / 3)
uconv_D2A2u = (
qcel.constants.get('atomic unit of electric dipole mom.') * 1.e11 /
qcel.constants.get('hertz-inverse meter relationship') / qcel.constants.get('atomic unit of length'))**2

This comment has been minimized.

@jturney

jturney Dec 10, 2018

Member

Nice, I like the constants.

auto perturbation_gradient = std::make_shared<Matrix>("Perturbation Gradient", natoms, 3);
auto dipole_gradients = dipole_grad(D);
double lambdas[3] = {xlambda, ylambda, zlambda};
C_DGEMM('n', 't', 3 * natoms, 1, 3, 1.0, dipole_gradients->pointer()[0], 3, &lambdas[0], 3, 0.0,

This comment has been minimized.

@jturney

jturney Dec 10, 2018

Member

Good call pulling the lambdas out of the loops.

@jturney jturney merged commit bc9525d into psi4:master Dec 10, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
psi4.psi4 #20181209.5 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment