-
Notifications
You must be signed in to change notification settings - Fork 1
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
Find the minimum side length for cells such that minimization doesn't fail sometimes. #2
Comments
I check Sam's code. Currently, the size of a supercell is 2.0 nm. I am trying 3.0 nm and 4.0 nm for testing. |
I think Sam might only have tested 1.8, and 2.0 was put into the code but not tested. But I can't remember. 3.0 will be bigger than needed. It should work as long as the cell length is 2x the short-range energy cutoff (which is 0.9 nm). But there could be some cells that start at greater than 2.0, but end up less than 1.8 nm I would try 2.2 and 2.4 nm. 3.0 nm is almost certainly not needed, and will be slower - the approximate compute time scales with the size of the system, and a system that is 3.0 x 3.0 x 3.0 nm will be (3/2)**3 = 3.38 times slower. |
Okay, I will try this 2.2/2.4. Currently, we have around 300 COD files, and only 10% of files can find the minimization energy. |
Huh, can you check in with Sam Kennedy on this? I think he was getting the majority of the files to minimize. Check the README.md file |
Sure, it will be better for us to confirm that. |
Note for @Yu-Tang-Lin For different supercells, Also, check with Sam whether the majority of the files minimize. |
Note for @Yu-Tang-Lin Number of min energy found from 292 COD file
|
So, I think that we need more information:
One thing that could be investigated is the effect of choosing different amounts of change when computing finite difference derivatives of the box vectors. Is minimization more stable if that difference is 2x bigger, or 2x smaller? Probably makes sense (after collecting the data above) to see if minimizing in a,b,c,\alpha,\beta,\gamma is better than minimizing in the 6 box vectors (will need to play around with math!) |
Note for @Yu-Tang-Lin The reason for error occurs when they minimize box vectors. (Generic error - Total 134 files) (36 files) ERROR: root: The periodic box size has decreased to less than twice the nonbonded cutoff. |
Note for @Yu-Tang-Lin I guess I know the reason. First, when I am changing the epsilon it indeed can solve some partial problems for Let me first assume those two issues may come from the same root cause. It come from the rule of OpenMM Periodic Boundary Conditions |
OK, interesting. I would imagine that a_x>0, b_y> 0, c_z > 0 would always be satisfied as long as there isn't a numerical stability issue with the minimization. The question is whether one of the other box conditions is not satisfied, not because it is unphysical, but because it is in the wrong format. I wonder if this could be fixed by initially, before minimization, rotating the box so that the longest side of the box is along the a_x axis, and the second longest axis along the b_xy plane? I am not entirely certain, though, I'm not quite understanding why OpenMM requests this format of the cells. |
Here is one package that could potentially be used to understand how to do some of these calculations: https://github.com/qzhu2017/PyXtal. This code (and the functions it links to) can explain how to do the conversion as well. Specifically, look at: https://github.com/qzhu2017/PyXtal/blob/master/pyxtal/lattice.py#L1621 (para2matrix) And https://github.com/qzhu2017/PyXtal/blob/master/pyxtal/lattice.py#L1581 (matrix2para) |
Note for @Yu-Tang-Lin For a coordinate system, What we want to do is Currently, I found our object function only accepts (x, y, z) as input, let me think about how to fix that |
COD (A, B, C, alpha, beta, gamma) → OpenMM getPeriodicBoxVectors (x, y, z) → OpenMM getPotentialEnergy (x, y, z) → epsilon convert to (A, B, C, alpha, beta, gamma) → add to to jacobian → convert back to (x, y, z) → OpenMM getPotentialEnergy (x, y, z) → optimizer |
Ww need to figure out how to set the minimum distance such that minimization doesn't fail when the cell box vectors change.
In theory, one could have the boxes change by a very large amount, on minimization, so one cannot guarantee that it will never fail, but in practice, there is a minimum distance.
Sam did this with 1.8 nm, and some percentage got stuck (see the readme). Is 2.0 nm enough? Does it need to be larger? We should figure out.
The text was updated successfully, but these errors were encountered: