-
Notifications
You must be signed in to change notification settings - Fork 459
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 Hessian bug #903
Fix Hessian bug #903
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.
Awesome.
@@ -336,7 +336,7 @@ void OverlapInt::compute_pair_deriv2(const GaussianShell& s1, const GaussianShel | |||
buffer_[(0*size)+ao12] += (4.0*a1*a1*x[l1+2][l2]*y[m1][m2]*z[n1][n2] - | |||
2.0*a1*(2*l1+1)*x[l1][l2]*y[m1][m2]*z[n1][n2]) * over_pf; | |||
if (l1 > 1) |
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.
Hmm, I think you just never tested anything beyond P orbitals. This if
statement will not be hit without D or higher.
I wish we could put weights on commits so that we could crank this one up. Three lines changed, but I am sure quite a bit of time looking into it.
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.
Three characters changed, but painful ones to track down, I'm sure.
I'll apply these changes to pyvib2 and see if tests/python/vibanalysis/ magically heals.
A thousand thanks for investigating this.
It was tested with higher angular momentum, which is why I’m confused. Lori and I sat down at the last hackathon to try and find problem cases, but couldn’t reproduce the error. What I’m really struggling with is the origin of the importance of atom order in the test provided in #901. It’s probably related to the fact that I only take derivatives on center A and use translational invariance relations to get the rest, but my flu addled brain is failing me right now. For the same reason, yes, this took me a while to track down. Oh well, hopefully this is the last bug we ever have in the hessians. Or anywhere...
… On Jan 27, 2018, at 8:16 PM, Daniel Smith ***@***.***> wrote:
@dgasmith commented on this pull request.
Awesome.
In psi4/src/psi4/libmints/overlap.cc:
> @@ -336,7 +336,7 @@ void OverlapInt::compute_pair_deriv2(const GaussianShell& s1, const GaussianShel
buffer_[(0*size)+ao12] += (4.0*a1*a1*x[l1+2][l2]*y[m1][m2]*z[n1][n2] -
2.0*a1*(2*l1+1)*x[l1][l2]*y[m1][m2]*z[n1][n2]) * over_pf;
if (l1 > 1)
Hmm, I think you just never tested anything beyond P orbitals. This if statement will not be hit without D or higher.
I wish we could put weights on commits so that we could crank this one up. Three lines changed, but I am sure quite a bit of time looking into it.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Looking great, @andysim! Gone from 1 pass, 1 fail w/normco errors in the tenths, and 3 radically fail to 4 pass and 1 fail with normco errors in the ten thousandths. Systems are formaldehyde, ammonia, methane, ethene, carbon dioxide. I think HOOH was the original suspicious one, so I'll dig that up. |
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.
Looks wonderful to me
Here's some of the errors in frequencies pre-fix; max is for HOOH TS. I've cherry-picked the commit into pyvib2, and the tests, if handy, are here.
|
Alrighty, this one should be ready to go now. I tried to cook up a simple test using f orbitals, but they're all too costly; in the end I just added a permutation to the atom ordering in our existing cc-pVDZ water test, because this is enough to reveal the bug. The fact that we've always had a working cc-pVDZ test case shows how subtle the bug is; the affected d components in water must be zero by symmetry. I did have a distorted water in my test suite to check that case, but didn't detect problems. Oh well, live and learn I guess. This should be a trivial review, and it clearly helps to address a couple of high priority tickets, so please have at it whenever you get a chance. Sorry again for the error. Next time you see me, I'll be at a chalkboard, writing "I will not cut and paste", à la Bart in the Simpsons opening credits. Except, instead of writing it, I'll be cutting and pasting it. |
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.
Oh man, I remember debugging this type of typos in other integrals. Kudos to you for finding them.
Description
A typo in the overlap integral second derivatives caused errors in the analytic hessians. The error seems to be confined to one of the three contributions to matrix elements where the angular momentum in the bra and ket differ, and only when the derivatives both refer to the same perturbation; which is why the code made it through the initial tests. I'm still trying to wrap my head around exactly why those tests work, so I'd like a day or two before this is ready to merge. My sincere apologies to all whom this bug inconvenienced. Fixes #791 and #901.
Todos
Notable points that this PR has either accomplished or will accomplish.
Questions
Status