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

Forces: Include ion-ion force contribution to ACForce #1769

Closed
rcclay opened this issue Jul 29, 2019 · 5 comments
Closed

Forces: Include ion-ion force contribution to ACForce #1769

rcclay opened this issue Jul 29, 2019 · 5 comments

Comments

@rcclay
Copy link
Contributor

rcclay commented Jul 29, 2019

Currently, ACForce does not appear to accumulate the ion-ion contribution to the total force on the ions. I feel like this should be included by default. Verification that this can be computed is needed for the PBC case, and implementation is definitely needed for the openBC case.

@jtkrogel
Copy link
Contributor

jtkrogel commented Aug 1, 2019

@rcclay We are targeting molecules in open boundary conditions first, so ion-ion force in OBC will be needed. It seems like this should be pretty simple to add. Is this something you can do in the near future?

@rcclay
Copy link
Contributor Author

rcclay commented Aug 1, 2019

@jtkrogel Sure. It's the easiest force to compute, just need to sit down, implement, and unit test it.

@tiihonej
Copy link
Contributor

I can take a look at the ion-ion force in OBC, unless you already have it ready, @rcclay?

@rcclay
Copy link
Contributor Author

rcclay commented Aug 21, 2019

Feel free to take a stab at it. It'll go in src/QMCHamiltonians/CoulombPotential.h . If you check the constructor, there's a "if(!is_active)" block, indicating whether QMCPACK expects those particles to be moving or not. If they don't, it currently computes the like-species energy in the constructor and returns it every time the estimator is queried so you don't have to recompute it at every electron step. I would do forces the same way. You can consult src/QMCHamiltonians/CoulombPBCAA.cpp to see how this was done in PBC's. OpenBC's will be easier since you don't have to worry about ewald breakups.

1.) Implement bare like species forces. Look at evaluateAA() in CoulombPotential to get an idea of how the charge and distance tables are accessed. You'll be messing with \mathbf{dr} now instead of just scalar quantities for forces. You can park it in its own evaluateForces routine or something for compartmentalization.
2.) ForceBase class provides a prefix variable (the name of the force quantity in scalar.dat), an addObservablesF() function for registering these to scalar.dat, and a "forces" vector for storing the forces. You'll need to call the addObservablesF() and set the aforementioned variables, ideally with some logic guarding these operations (if ComputeForces==True, then do stuff... otherwise don't). See CoulombPBCAA
3.) To work with the ACForce estimator, you'll need to add an evaluateWithIonDerivs() function. You'll need to set "hf_terms" to whatever forces you computed, and set "pulay_terms" to zero. Likewise, see CoulombPBCAA.

Feel free to ask questions!

@rcclay
Copy link
Contributor Author

rcclay commented Nov 7, 2019

Closed by #1820

@rcclay rcclay closed this as completed Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants