Evaluate parameter derivatives for NLPP#4402
Conversation
Add evaluateDerivativesWF and evaluateDerivRatios to RotatedSPOs
|
The original particleset and the reference particle exist as |
Use the reference particle set and the reference particle index rather than adding them as function arguments.
Add evaluateDerivativesWF to DiracDeterminantBatched
Add evaluateDerivRatios to DiracDeterminantBatched
|
Test this please |
ye-luo
left a comment
There was a problem hiding this comment.
Need to think about expanding coverage. But I would recommend merging the current PR as it is. LGTM.
|
|
||
|
|
||
| /// Determinant ratios and parameter derivatives of the wavefunction for virtual moves | ||
| virtual void evaluateDerivRatios(const VirtualParticleSet& VP, |
There was a problem hiding this comment.
For both added APIs, I feel it will be better to pass the inverse matrix in instead of recomputing inside. Consider that in a later PR.
There was a problem hiding this comment.
Agree, as per my comment above.
| for (int j = 0; j < nel; j++) | ||
| psiM_inv(i, j) = psiM_all(i, j); | ||
|
|
||
| Invert(psiM_inv.data(), nel, nel); |
There was a problem hiding this comment.
Noting the full cubic cost of matrix inversion here. However, getting something working first takes precedence over possible alternatives. Plus considering that the initial electron counts will be smallish, this might not be so bad.
prckent
left a comment
There was a problem hiding this comment.
LGTM
Thanks Mark! Exciting development.
|
Test this please |
| for (int j = 0; j < nel; j++) | ||
| psiM_inv(i, j) = psiM_all(i, j); | ||
|
|
||
| Invert(psiM_inv.data(), nel, nel); |
There was a problem hiding this comment.
This is the inverse that is likely to get expensive, as it gets call nknot times.
Maybe combining a Sherman-Morrison update with the matrix multiply below will lead to some simplifications.
There was a problem hiding this comment.
I believe the math can be formulated without any update.
Add
evaluateDerivativesWFfor single determinants to RotatedSPOs. This enables the Hamiltonian parameter derivative from NLPP for single determinant for non-batched NLPP. The function is a reduced version ofevaluateDerivatives. It only needs the derivative of the wavefunction.Add
evaluateDerivRatiosfor single determinants to RotatedSPOs. This enables the Hamiltonian parameter derivative from NLPP for single determinants for the batched NLPP algorithm. The function combines functionality fromevaluateDetRatiosandevaluateDerivativesWF. Two parameters were added toevaluateDerivRatios- the original particle set, and the index of the electron being moved. The derivatives of the rotation matrix need an inverse of the entire matrix of orbitals. I don't know if there are shortcuts to get away without needing these, but this is the most straightforward combining of existing code.These changes were pulled out of #4351
What type(s) of changes does this code introduce?
Delete the items that do not apply
Does this introduce a breaking change?
What systems has this change been tested on?
laptop
Checklist
Update the following with a yes where the items apply. If you're unsure about any of them, don't hesitate to ask. This is
simply a reminder of what we are going to look for before merging your code.