mosdef-hub / gmso

Flexible storage of chemical topology for molecular simulation
https://gmso.mosdef.org
MIT License
52 stars 32 forks source link

Parmed -> GMSO loses layered dihedrals #561

Open rsdefever opened 3 years ago

rsdefever commented 3 years ago

If a parmed.Structure has multiple dihedral potentials for a single set of atoms, then this information is lost in the conversion to the gmso.Topology.

I have put together a gist with a simplified example:

import parmed
from gmso.external import from_parmed

pmd = parmed.load_file("emim_fake.top", xyz="emim.gro")
top = from_parmed(pmd)

print(top.dihedral_types)
print(pmd.dihedrals)
umesh-timalsina commented 3 years ago

Inorder to keep the current API consistent, we can introduce two new concepts to be contained in GMSO topology:

  1. class LayeredDihedral: Subclasses gmso.Dihedral but has a list of dihedral types associated with it
  2. class LayeredImproper: Subclasses gmso.Improper but has a list of improper types associated with it

With these concepts, there are the following changes:

  1. Update Topology Methods
  2. get_index method