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

Analytical gradients not added in vectorized manner #35

Closed
ajkerr0 opened this issue Jun 27, 2016 · 3 comments
Closed

Analytical gradients not added in vectorized manner #35

ajkerr0 opened this issue Jun 27, 2016 · 3 comments

Comments

@ajkerr0
Copy link
Owner

ajkerr0 commented Jun 27, 2016

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.

ajkerr0 added a commit that referenced this issue Jul 25, 2016
Fix a critical error in which the analtyical bond bending forces weren't being added to the running gradient total, instead they were assigning values to the rows so the 'last' assignments were the gradient values.  This fixes #36 and maybe we can eliminate the issues to amend #35.
ajkerr0 referenced this issue Jul 25, 2016
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.
@ajkerr0 ajkerr0 closed this as completed Jul 25, 2016
@ajkerr0
Copy link
Owner Author

ajkerr0 commented Aug 2, 2016

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.

@ajkerr0 ajkerr0 reopened this Aug 2, 2016
ajkerr0 added a commit that referenced this issue Aug 2, 2016
@ajkerr0
Copy link
Owner Author

ajkerr0 commented Aug 2, 2016

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.

@ajkerr0
Copy link
Owner Author

ajkerr0 commented Aug 2, 2016

np.add.at looks promising. We should try it then time it against the loop case.

@ajkerr0 ajkerr0 closed this as completed in f2dc297 Aug 2, 2016
ajkerr0 added a commit that referenced this issue Aug 3, 2016
In accordance to #50, #36, #35: fix the dihedral and Lennard-Jones interactions so that the gradient additions are vectorized (with repeating indices).  Also add the 180/pi term to the dihedral angle gradient.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant