-
Notifications
You must be signed in to change notification settings - Fork 4
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
Analytical gradients not added in vectorized manner #35
Comments
Change the for loop implementation to a numpy vectorized one in the analytical gradient definition of Molecule. It was implemented in this way to remove the possibility of there being an error in the addition (there wasn't, see #36). Also 'finish' the dihedral angle interaction force.
There's still a problem where the attempts to add them vectorized isn't working. For example, graphene(radius=1). But for default dingus it works. |
…he vectorized manner wasn't working. See #35
Maybe refer to http://stackoverflow.com/questions/2004364/increment-numpy-array-with-repeated-indices I think the problem is related to repated indices in ibonds, jbonds, iangles, etxc. |
np.add.at looks promising. We should try it then time it against the loop case. |
For now the forces due to bond interactions are added to the initialized gradient via for loops instead of doing it by numpy vectorization. This method appears to work in bond length gradients for example, but may not necessarily be ideal.
The text was updated successfully, but these errors were encountered: