-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement HMA #94
Comments
I've starting working on this. The first issue is that I'm not sure the best way to compute the Fi * dri sum that we need. We could
|
Based upon our previous conversation I had been thinking we would go with (2). Is one or the other approach more favorable for properties that require the second derivative of the force? I would think (2) would become more appealing? |
Right, something like option (2) would be needed for the second derivative anyway. I'll pursue that approach for F*dr. As a bonus, as long as the energy routines know about HMA anyway, we can use a lattice-based truncation scheme that makes everything more precise and accurate. |
Another issue is how to read in the harmonic pressure. This needs to be computed outside Cassandra (with lattice dynamics) and provided somehow in the input file. It's the Delta P(hat) term that shows up in the pressure formula in Table 1 in 10.1103/PhysRevE.92.043303. Can I look for a second parameter on the Property_Info line?
and then the harmonic pressure would be taken as 9? It looks like it would be easy enough to implement in terms of the code, but it deviates from the other parameters (none of which take any extra argument). |
Another option would be
or
Thats my thoughts at the moment at least, but its also a bit clunky to have two different sections to edit. Let me chew on it a bit more. |
Is there any other information that HMA will need from the user? |
I don't think we need any other information for HMA. The HMA section would make more sense if there were more bits of information that we need. But it would certainly be more direct and align better with how other parts work. And it would work better if we ever come up with more information we want later. |
@ajschult conclusion is to leave it in the |
I implemented the lattice cutoff for HMA (cutoff is based on the lattice sites rather than the current coordinates), which improves the precision further and allows people to use a "cut" potential rather than some flavor of shifting. But it's a bit uglier than I had hoped. You can see it here: Most of the energy_routines.f90 changes are to handle this except for the HMA_calc block at the bottom. Particularly sad is the need to set rabx, raby and rabz to atomic rxij, ryij and rzij. Let me know your thoughts and/or if you have ideas of how to do this more cleanly. |
@ajschult sorry for the slow reply. I've taken a look at your branch. I don't think its too bad, but I agree it would be nice if it was a little cleaner. I'm not terribly bothered by setting I'm not sure that this solution is better, but food for thought: Could we add a IF (need_HMA) THEN
CALL Check_AtomPair_Lattice_Cutoff(atom1, atom2, get_vdw, get_qq, this_box)
ELSE
CALL Check_AtomPair_Cutoff(rijsq, get_vdw, get_qq, this_box) Inside It's a little clunky in that the Also, IIRC, we use a molecular virial, so you'll probably want to double check that you're getting what you expect there. I'm betting it works out correctly, but just a heads up. |
I've implemented what you described now. I think it's an improvement; it's less code and easier to follow. In theory, it's a bit slower because it has to compute the atom-atom separation even if it won't be used (because the lattice sites are outside the truncation), but it's already skipping the molecule-molecule distance computation, so the lattice cutoff approach is still just as fast as the standard approach. |
Hey @ajschult, just wanted to touch base on this and see how it was coming. Is there anything else you need from us? No worries at all if things got busy 👍. |
Is your feature request related to a problem? Please describe.
Harmonically Mapped Averaging (HMA) allows crystal properties (energy, pressure, heat capacity) to be computed more efficiently (more precision in the same time or the same precision in less time). Other benefits include reduced finite-size effects, reduced truncation effects, shorter decorrelation time and faster equilibration.
Describe the solution you'd like
We'll be adding code to compute HMA properties.
Describe alternatives you've considered
HMA properties could be computed by dumping forces and coordinates to files, but the output would be huge.
Further information, files or links (optional)
HMA paper: https://doi.org/10.1103/PhysRevE.92.043303
HMA in LAMMPS paper: https://doi.org/10.1063/1.5129942
HMA for VASP paper: https://doi.org/10.1016/j.cpc.2020.107554
LAMMPS pull request: lammps/lammps#1503
The text was updated successfully, but these errors were encountered: