Skip to content

Remove hybrid pair styles #1205

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/releasehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Please note that all releases prior to a version 1.0.0 are considered pre-releas
* #1137 Internally use `openmm.LangevinMiddleIntegrator`, including in the OpenMM driver.
* #1186 `GROMACSSystem.molecules` is changed from a dictionary to a list of tuples.
* #1192 `Interchange.to_pdb` now uses `ensure_unique_atom_names="residues"` when writing PDB files, matching longstanding behavior of the toolkit. For more flexibility, use the `Interchange.topology` and options provided by `openff.toolkit.Topology.to_file`.
* #1203 Hybrid pair styles, which were never necessary, are no longer used in LAMMPS files.

### Bug fixes

Expand Down
6 changes: 3 additions & 3 deletions examples/lammps/lammps.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,9 @@
"boundary p p p\n",
"\n",
"# Bonded interactions in Sage force field\n",
"bond_style hybrid harmonic\n",
"angle_style hybrid harmonic\n",
"dihedral_style hybrid fourier\n",
"bond_style harmonic\n",
"angle_style harmonic\n",
"dihedral_style fourier\n",
"improper_style cvff\n",
"special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 0.8333333333\n",
"\n",
Expand Down
1 change: 1 addition & 0 deletions examples/protein_ligand/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ out.*
out_pointenergy.mdp
log.lammps
tmp.in
*.itp
6 changes: 3 additions & 3 deletions openff/interchange/components/mdconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,14 +287,14 @@ def _get_coeffs_of_constrained_bonds_and_angles(
)

if len(interchange["Bonds"].key_map) > 0:
lmp.write("bond_style hybrid harmonic\n")
lmp.write("bond_style harmonic\n")

if len(interchange["Angles"].key_map) > 0:
lmp.write("angle_style hybrid harmonic\n")
lmp.write("angle_style harmonic\n")

try:
if len(interchange["ProperTorsions"].key_map) > 0:
lmp.write("dihedral_style hybrid fourier\n")
lmp.write("dihedral_style fourier\n")
except LookupError:
# no torsions here
pass
Expand Down
6 changes: 3 additions & 3 deletions openff/interchange/interop/lammps/export/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def _write_bond_coeffs(lmp_file: IO, interchange: Interchange):
k = k * 0.5 # Account for LAMMPS wrapping 1/2 into k
length = params["length"].to(unit.angstrom).magnitude

lmp_file.write(f"{bond_type_idx + 1:d} harmonic\t{k:.16g}\t{length:.16g}\n")
lmp_file.write(f"{bond_type_idx + 1:d}\t{k:.16g}\t{length:.16g}\n")

lmp_file.write("\n")

Expand All @@ -180,7 +180,7 @@ def _write_angle_coeffs(lmp_file: IO, interchange: Interchange):
k = k * 0.5 # Account for LAMMPS wrapping 1/2 into k
theta = params["angle"].to(unit.degree).magnitude

lmp_file.write(f"{angle_type_idx + 1:d} harmonic\t{k:.16g}\t{theta:.16g}\n")
lmp_file.write(f"{angle_type_idx + 1:d}\t{k:.16g}\t{theta:.16g}\n")

lmp_file.write("\n")

Expand All @@ -202,7 +202,7 @@ def _write_proper_coeffs(lmp_file: IO, interchange: Interchange):
k = k / idivf

lmp_file.write(
f"{proper_type_idx + 1:d} fourier 1\t{k:.16g}\t{n:d}\t{phase:.16g}\n",
f"{proper_type_idx + 1:d} 1\t{k:.16g}\t{n:d}\t{phase:.16g}\n",
)

lmp_file.write("\n")
Expand Down