-
Notifications
You must be signed in to change notification settings - Fork 21
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
Fitting certain parameters in Tersoff potential returns RuntimeError: the model does not provide an Extension routine #203
Comments
@ilia-nikiforov-umn @ellio167 any idea? Does this mean the Tersoff driver does not expose parameters? |
I'd clarify that this only happens for some of the parameters (Rc and Dc for example), while optimization of some other parameters like A and B works normally. |
This error message comes from here (in kimpy): I don't understand the error message text about an "Extension routine". It seems to just be the case that the compute routine has returned and error. My next step would be to look for error messages in the kim.log file to see if more information about the compute() error is provided. |
Thank you @ellio167 for the suggestion! I have tested all parameters in Tersoff potential and looked into the kim.log file of failed ones. For The case for
And it cannot be resolved if I keep Rc and Dc positive using log transformation. I thought this originates from the change in cutoff radius. However, even if I keep Rc and Dc fixed to the original or a different value using the 'fix' option in Any suggestions will be greatly appreciated. |
Hi @dengtq , great observations! Yes, parameters related to the cutoff distance should not be optimized. This is because, to speed up the fitting, KLIFF and many other fitting codes only generate the neighborlist once at the beginning and re-use it for later calculations. So, if params related to cutoff are optimized, there can be problems related to the neighborlist. You are on the right track to use |
@mjwen Thank you for the suggestion! So I just ran a few tests according to your suggestion and here's the observation. I tried to fix I then switched to the SW test, and it is identical to the case of Tersoff. If I fix Interestingly, if the cutoff is reduced, there is no error, either. My guess is that the neighbor list is calculated when initializing KIMModel, so if I change it with |
It makes sense that a smaller cutoff works fine, seems the previous larger cutoff should contain enough atoms. It is unexpected that setting to a larger value leads to a failing run. Here is how it works internally:
There seems to be something fishy going on. I will need some time to figure out the reason. Will update here. |
Thank you for the prompted response! I also checked my script and confirmed that The behavior can be reproduced using the SW test script and training set by adding cutoff to Look forward to your update. |
Hi @mjwen , I think I've found some clues. I print Meanwhile, My current fix is to add the following method to
And it is now working with an increased cutoff! If it is not breaking anything, I guess I'll use this fix for now. Please kindly help confirm that this is a valid fix. UPDATE some additional observations: After employing the above fix, the optimization will fail again with any And both |
Hi @dengtq, sorry for the late response. Your correction is totally OK. I took a closer look, and found that we intended to update the influence distance after parameter changes in the original code (see here); however, there is a bug, and the line actually should be: Do you mind creating a PR for this? Regarding your additional observations, I will need more time to delve into it and see what's going on. Will report back. |
@mjwen Thank you for the response. I have tried correcting the lines Sure I will create a PR later. And look forward to your thoughts on the transformation issue. |
When fitting certain parameters in Tersoff potential from openkim, the following RuntimeError is returned:
What is the cause of this error? Does that mean certain parameters cannot be optimized using kliff? Thank you for kind reply.
Environment:
Linux+Conda+python3.9
kim-api 2.3.0
kimpy 2.1.1
kliff 0.4.3
Tersoff potential from openkim: Tersoff_LAMMPS_Tersoff_1989_SiC__MO_171585019474_004
The text was updated successfully, but these errors were encountered: