Hi PEMD team, thank you for this excellent project.
I found a reproducible issue in polymer OPLS-AA generation with LigParGen-based charges.
I used:
- homopolymer workflow
ff_source="ligpargen"
- short reference chain length = 2 repeat units
- long chain length = 71 repeat units
- neutral polymer (
charge=0)
Observed behavior:
- The short-chain LigParGen charge table is valid (no NaN).
- During charge transfer from short chain to long chain, most interior atoms in the long chain do not receive charges.
- The final bonded ITP contains many
nan charges.
- GROMACS then fails at EM step 0 with:
System total charge: nan
total potential energy is nan
From code reading, this seems related to the logic that defines middle repeat units as:
mid_atoms = best_matches[1:-1]
When there are only 2 repeat-unit matches, mid_atoms is empty, mid_mol becomes None, and interior assignment is skipped.
Question:
What is the intended behavior for short reference chains of length 1–2?
- Should users be required to set short chain length >= 3 (with explicit validation/error)?
- Or should there be a fallback rule to generate interior charges when
mid_atoms is empty (e.g., average the two matched units)?
Happy to submit a PR once you confirm the preferred behavior.
Hi PEMD team, thank you for this excellent project.
I found a reproducible issue in polymer OPLS-AA generation with LigParGen-based charges.
I used:
ff_source="ligpargen"charge=0)Observed behavior:
nancharges.System total charge: nantotal potential energy is nanFrom code reading, this seems related to the logic that defines middle repeat units as:
mid_atoms = best_matches[1:-1]When there are only 2 repeat-unit matches,
mid_atomsis empty,mid_molbecomesNone, and interior assignment is skipped.Question:
What is the intended behavior for short reference chains of length 1–2?
mid_atomsis empty (e.g., average the two matched units)?Happy to submit a PR once you confirm the preferred behavior.