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

Problem in make_deltaforces() of Chignolin_Coarse-Grained_Tutorial.ipynb #31

Open
a96123155 opened this issue May 27, 2023 · 2 comments
Assignees

Comments

@a96123155
Copy link

Hi, there is a problem in Chignolin_Coarse-Grained_Tutorial.ipynb:

>>> make_deltaforces(coords_npz, forces_npz, delta_forces_npz, forcefield, psf, exclusions, device, forceterms) Check for broken coords. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 9/9 [00:00<00:00, 985.43it/s] No broken frames /home/ubuntu/.local/lib/python3.9/site-packages/torchmd/systems.py:49: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). self.pos[:] = torch.tensor( /home/ubuntu/.local/lib/python3.9/site-packages/torchmd/systems.py:73: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor). self.box[r][torch.eye(3).bool()] = torch.tensor( Producing delta forces 0%| | 0/18689 [00:00<?, ?it/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/ubuntu/.local/lib/python3.9/site-packages/torchmd_cg/utils/make_deltaforces.py", line 80, in make_deltaforces Epot = forces.compute(co.reshape([1, natoms, 3]), system.box, system.forces) File "/home/ubuntu/.local/lib/python3.9/site-packages/torchmd/forces.py", line 293, in compute E, force_coeff = evaluate_repulsion_CG( File "/home/ubuntu/.local/lib/python3.9/site-packages/torchmd/forces.py", line 429, in evaluate_repulsion_CG coef = B[atomtype_indices[:, 0], atomtype_indices[:, 1]] TypeError: 'NoneType' object is not subscriptable

@Lord-Kelsier
Copy link

Hey @a96123155, I manage to fix it by adding Lennard-Jones potential in the force terms: forceterms = ['Bonds','RepulsionCG', "lj"].

That's because 'RepulsionCG' requires the B term of the LJ potential ( $4\varepsilon (\frac{\sigma}{r}) ^ 6$ )

@ARKAtheVLOGGER
Copy link

does anyone know how to generate ca_force.npy ? I have performed md simulations and have .dcd, .vel, .prmtop files.

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

4 participants