From 4fb9c1faf2969d21522ea0735d487643ce6f860e Mon Sep 17 00:00:00 2001 From: bc118 Date: Wed, 15 Dec 2021 14:16:34 -0500 Subject: [PATCH 01/16] modified torsion potentials and added new Mie potential --- gmso/lib/jsons/MiePotential_n_6.json | 5 +++++ gmso/lib/jsons/PeriodicTorsionPotential.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 gmso/lib/jsons/MiePotential_n_6.json diff --git a/gmso/lib/jsons/MiePotential_n_6.json b/gmso/lib/jsons/MiePotential_n_6.json new file mode 100644 index 000000000..c4e3a7c07 --- /dev/null +++ b/gmso/lib/jsons/MiePotential_n_6.json @@ -0,0 +1,5 @@ +{ + "name": "MiePotential_n_6", + "expression": "(n/(n-6)) * (n/6)**(6/(n-6)) * epsilon * ((sigma/r)**n - (sigma/r)**6)", + "independent_variables": "r" +} diff --git a/gmso/lib/jsons/PeriodicTorsionPotential.json b/gmso/lib/jsons/PeriodicTorsionPotential.json index 84ada496b..a1f7f9369 100644 --- a/gmso/lib/jsons/PeriodicTorsionPotential.json +++ b/gmso/lib/jsons/PeriodicTorsionPotential.json @@ -1,5 +1,5 @@ { "name": "PeriodicTorsionPotential", - "expression": "k * (1 + cos(n * phi - phi_eq))", + "expression": "k0 + k1 * (1 + cos(1 * phi - phi1_eq)) + k2 * (1 + cos(2 * phi - phi2_eq)) + k3 * (1 + cos(3 * phi - phi3_eq)) + k4 * (1 + cos(4 * phi - phi4_eq)) + k5 * (1 + cos(5 * phi - phi5_eq))", "independent_variables": "phi" } From 804b1fe6c5678ffc1d043df739009d57351f71f4 Mon Sep 17 00:00:00 2001 From: bc118 Date: Wed, 15 Dec 2021 14:18:58 -0500 Subject: [PATCH 02/16] modified torsion potentials and added new Mie potential --- gmso/lib/jsons/RyckaertBellemansTorsionPotential.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json b/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json index ac59d0fe2..78dbf3af6 100644 --- a/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json +++ b/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json @@ -1,5 +1,5 @@ { "name": "RyckaertBellemansTorsionPotential", - "expression": "c0 * cos(phi)**0 + c1 * cos(phi)**1 + c2 * cos(phi)**2 + c3 * cos(phi)**3 + c4 * cos(phi)**4 + c5 * cos(phi)**5", + "expression": "c0 + c1 * cos(phi)**1 + c2 * cos(phi)**2 + c3 * cos(phi)**3 + c4 * cos(phi)**4 + c5 * cos(phi)**5", "independent_variables": "phi" } From 391e356209fd17e3f65af19d1afe07ec39c610ef Mon Sep 17 00:00:00 2001 From: bc118 Date: Wed, 15 Dec 2021 15:53:13 -0500 Subject: [PATCH 03/16] changed periodic torsion constant --- gmso/lib/jsons/PeriodicTorsionPotential.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/lib/jsons/PeriodicTorsionPotential.json b/gmso/lib/jsons/PeriodicTorsionPotential.json index a1f7f9369..2a836ac6c 100644 --- a/gmso/lib/jsons/PeriodicTorsionPotential.json +++ b/gmso/lib/jsons/PeriodicTorsionPotential.json @@ -1,5 +1,5 @@ { "name": "PeriodicTorsionPotential", - "expression": "k0 + k1 * (1 + cos(1 * phi - phi1_eq)) + k2 * (1 + cos(2 * phi - phi2_eq)) + k3 * (1 + cos(3 * phi - phi3_eq)) + k4 * (1 + cos(4 * phi - phi4_eq)) + k5 * (1 + cos(5 * phi - phi5_eq))", + "expression": "k0 + k1 * (1 + cos(1 * phi - phi_eq1)) + k2 * (1 + cos(2 * phi - phi_eq2)) + k3 * (1 + cos(3 * phi - phi_eq3)) + k4 * (1 + cos(4 * phi - phi_eq4)) + k5 * (1 + cos(5 * phi - phi_eq5))", "independent_variables": "phi" } From 09ff27cdd9164fe1cd6eff3e0b2f03f470396788 Mon Sep 17 00:00:00 2001 From: bc118 Date: Thu, 16 Dec 2021 20:56:34 -0500 Subject: [PATCH 04/16] removed the MiePotential_n_6.json file --- gmso/lib/jsons/MiePotential_n_6.json | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 gmso/lib/jsons/MiePotential_n_6.json diff --git a/gmso/lib/jsons/MiePotential_n_6.json b/gmso/lib/jsons/MiePotential_n_6.json deleted file mode 100644 index c4e3a7c07..000000000 --- a/gmso/lib/jsons/MiePotential_n_6.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "MiePotential_n_6", - "expression": "(n/(n-6)) * (n/6)**(6/(n-6)) * epsilon * ((sigma/r)**n - (sigma/r)**6)", - "independent_variables": "r" -} From 721d9ca4d7039e585af93f45d2d4b0b5795901a1 Mon Sep 17 00:00:00 2001 From: bc118 Date: Thu, 16 Dec 2021 21:06:22 -0500 Subject: [PATCH 05/16] changed RB RyckaertBellemansTorsionPotential.json angle to psi --- gmso/lib/jsons/RyckaertBellemansTorsionPotential.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json b/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json index 78dbf3af6..6748ccb17 100644 --- a/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json +++ b/gmso/lib/jsons/RyckaertBellemansTorsionPotential.json @@ -1,5 +1,5 @@ { "name": "RyckaertBellemansTorsionPotential", - "expression": "c0 + c1 * cos(phi)**1 + c2 * cos(phi)**2 + c3 * cos(phi)**3 + c4 * cos(phi)**4 + c5 * cos(phi)**5", - "independent_variables": "phi" + "expression": "c0 + c1 * cos(psi)**1 + c2 * cos(psi)**2 + c3 * cos(psi)**3 + c4 * cos(psi)**4 + c5 * cos(psi)**5", + "independent_variables": "psi" } From c7dbac1166d59b70233fc57d834bf5ebe17178d2 Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 14:51:32 -0500 Subject: [PATCH 06/16] fix tests for changing RB phi to psi --- gmso/tests/test_internal_conversions.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gmso/tests/test_internal_conversions.py b/gmso/tests/test_internal_conversions.py index 773f47820..3b4d8d379 100644 --- a/gmso/tests/test_internal_conversions.py +++ b/gmso/tests/test_internal_conversions.py @@ -33,7 +33,7 @@ def test_invalid_connection_type(self, templates): name = ryckaert_bellemans_torsion_potential.name expression = ( - str(ryckaert_bellemans_torsion_potential.expression) + " + 3 * psi" + str(ryckaert_bellemans_torsion_potential.expression) + " + 3 * phi" ) variables = ["phi", "psi"] @@ -49,7 +49,7 @@ def test_invalid_connection_type(self, templates): ryckaert_connection_type ) - expression = "c0+c1+c2+c3+c4+c5+phi" + expression = "c0+c1+c2+c3+c4+c5+psi" variables = ryckaert_bellemans_torsion_potential.independent_variables ryckaert_connection_type = DihedralType( name=name, @@ -149,7 +149,7 @@ def test_ryckaert_to_opls(self, templates): (param, val) for param, val in { **ryckaert_connection_type.parameters, - "phi": angle - np.pi, + "psi": angle - np.pi, }.items() ] ) @@ -206,7 +206,7 @@ def test_opls_to_ryckaert(self, templates): (param, val) for param, val in { **ryckaert_connection_type.parameters, - "phi": angle - np.pi, + "psi": angle - np.pi, }.items() ] ) From 60a5150c2ca9b10639c41be3c8ec4840184d488f Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 15:07:11 -0500 Subject: [PATCH 07/16] fix tests 2 for changing RB phi to psi --- gmso/tests/test_potential_templates.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gmso/tests/test_potential_templates.py b/gmso/tests/test_potential_templates.py index 508a6cb0b..a66a6b76f 100644 --- a/gmso/tests/test_potential_templates.py +++ b/gmso/tests/test_potential_templates.py @@ -39,7 +39,8 @@ def test_opls_torsion_potential(self, templates): opls_torsion_potential = templates["OPLSTorsionPotential"] assert opls_torsion_potential.name == "OPLSTorsionPotential" assert opls_torsion_potential.expression == sympy.sympify( - "0.5 * k0 + 0.5 * k1 * (1 + cos(phi)) +" + "0.5 * k0 + " + "0.5 * k1 * (1 + cos(phi)) +" "0.5 * k2 * (1 - cos(2*phi)) +" "0.5 * k3 * (1 + cos(3*phi)) +" "0.5 * k4 * (1 - cos(4*phi))" @@ -52,7 +53,12 @@ def test_periodic_torsion_potential(self, templates): periodic_torsion_potential = templates["PeriodicTorsionPotential"] assert periodic_torsion_potential.name == "PeriodicTorsionPotential" assert periodic_torsion_potential.expression == sympy.sympify( - "k * (1 + cos(n * phi - phi_eq))" + "k0 + " + "k1 * (1 + cos(1 * phi - phi_eq1)) + " + "k2 * (1 + cos(2 * phi - phi_eq2)) + " + "k3 * (1 + cos(3 * phi - phi_eq3)) + " + "k4 * (1 + cos(4 * phi - phi_eq4)) + " + "k5 * (1 + cos(5 * phi - phi_eq5))" ) assert periodic_torsion_potential.independent_variables == { sympy.sympify("phi") @@ -67,12 +73,12 @@ def test_ryckaert_bellemans_torsion_potential(self, templates): == "RyckaertBellemansTorsionPotential" ) assert ryckaert_bellemans_torsion_potential.expression == sympy.sympify( - "c0 * cos(phi)**0 + c1 * cos(phi)**1 +" - " c2 * cos(phi)**2 + c3 * cos(phi)**3 +" - " c4 * cos(phi)**4 + c5 * cos(phi)**5" + "c0 + c1 * cos(psi)**1 +" + " c2 * cos(psi)**2 + c3 * cos(psi)**3 +" + " c4 * cos(psi)**4 + c5 * cos(psi)**5" ) assert ryckaert_bellemans_torsion_potential.independent_variables == { - sympy.sympify("phi") + sympy.sympify("psi") } def test_harmonic_torsion_potential(self, templates): From 7345ba29f2f52c854b62000d6c517ec950d66e75 Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 15:49:05 -0500 Subject: [PATCH 08/16] fix tests 3 for modifying periodic formulas. --- gmso/tests/test_top.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/gmso/tests/test_top.py b/gmso/tests/test_top.py index 518b7be72..e0df05eb6 100644 --- a/gmso/tests/test_top.py +++ b/gmso/tests/test_top.py @@ -79,9 +79,17 @@ def test_ethane_periodic(self, typed_ethane): per_torsion = PotentialTemplateLibrary()["PeriodicTorsionPotential"] params = { - "k": 10 * u.Unit("kJ / mol"), - "phi_eq": 15 * u.Unit("degree"), - "n": 3 * u.Unit("dimensionless"), + "k0": 10 * u.Unit("kJ / mol"), + "k1": 1 * u.Unit("kJ / mol"), + "phi_eq1": 180 * u.Unit("degree"), + "k2": 2 * u.Unit("kJ / mol"), + "phi_eq2": 0 * u.Unit("degree"), + "k3": 3 * u.Unit("kJ / mol"), + "phi_eq3": 180 * u.Unit("degree"), + "k4": 4 * u.Unit("kJ / mol"), + "phi_eq4": 0 * u.Unit("degree"), + "k5": 5 * u.Unit("kJ / mol"), + "phi_eq5": 180 * u.Unit("degree"), } periodic_dihedral_type = ParametricPotential.from_template( potential_template=per_torsion, parameters=params From ab379cb3763e582791d2c712b844192ef52f2f2a Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:17:23 -0500 Subject: [PATCH 09/16] fix tests 4 changed files xmls from RB phi to psi. --- gmso/tests/files/carbon.xml | 42 ++++++++++++++------- gmso/tests/files/ethylene.xml | 26 ++++++------- gmso/tests/files/ff-example1.xml | 2 +- gmso/tests/files/ff_missing_atom_types.xml | 44 +++++++++++----------- gmso/tests/files/oplsaa-ethane_foyer.xml | 2 +- 5 files changed, 66 insertions(+), 50 deletions(-) diff --git a/gmso/tests/files/carbon.xml b/gmso/tests/files/carbon.xml index 8b202f6b0..26c0d1e6e 100644 --- a/gmso/tests/files/carbon.xml +++ b/gmso/tests/files/carbon.xml @@ -15,32 +15,48 @@ - + - - + + - + - - + + - - - - + + + + + + + + + + + + - - - + + + + + + + + + + + diff --git a/gmso/tests/files/ethylene.xml b/gmso/tests/files/ethylene.xml index 6345773dc..f32c1ab22 100644 --- a/gmso/tests/files/ethylene.xml +++ b/gmso/tests/files/ethylene.xml @@ -51,21 +51,21 @@ - - - - - - - + + + + + + + - - - - - - + + + + + + diff --git a/gmso/tests/files/ff-example1.xml b/gmso/tests/files/ff-example1.xml index 887ee8861..7f7de0255 100644 --- a/gmso/tests/files/ff-example1.xml +++ b/gmso/tests/files/ff-example1.xml @@ -90,7 +90,7 @@ - + diff --git a/gmso/tests/files/ff_missing_atom_types.xml b/gmso/tests/files/ff_missing_atom_types.xml index b2aed3a1a..091fd88bd 100644 --- a/gmso/tests/files/ff_missing_atom_types.xml +++ b/gmso/tests/files/ff_missing_atom_types.xml @@ -31,16 +31,16 @@ - + - - + + - + - - + + @@ -48,16 +48,16 @@ - + - - + + - + - - + + @@ -65,16 +65,16 @@ - + - - + + - + - - + + @@ -82,15 +82,15 @@ - + - - + + - + diff --git a/gmso/tests/files/oplsaa-ethane_foyer.xml b/gmso/tests/files/oplsaa-ethane_foyer.xml index 617647962..69d0dce31 100644 --- a/gmso/tests/files/oplsaa-ethane_foyer.xml +++ b/gmso/tests/files/oplsaa-ethane_foyer.xml @@ -57,7 +57,7 @@ - + From 18b9b4dd5c5d704ff181bd68ebf32884cd5e0d51 Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:19:00 -0500 Subject: [PATCH 10/16] fix tests 4 changed files xmls from RB phi to psi. --- gmso/tests/files/carbon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/tests/files/carbon.xml b/gmso/tests/files/carbon.xml index 26c0d1e6e..acb3746df 100644 --- a/gmso/tests/files/carbon.xml +++ b/gmso/tests/files/carbon.xml @@ -17,7 +17,7 @@ - + From 29bddb8a25138546c2438572e4d7a6fe12ed34b2 Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:19:59 -0500 Subject: [PATCH 11/16] fix tests 4 changed files xmls from RB phi to psi. --- gmso/tests/files/carbon.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/tests/files/carbon.xml b/gmso/tests/files/carbon.xml index acb3746df..2cf7792e6 100644 --- a/gmso/tests/files/carbon.xml +++ b/gmso/tests/files/carbon.xml @@ -18,7 +18,7 @@ - + From 8ac6eb73006a78711b4bafd3dfe0bc6c94e96beb Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:30:05 -0500 Subject: [PATCH 12/16] changed RB from phi to psi in convert_foyer_xml.py --- gmso/external/convert_foyer_xml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gmso/external/convert_foyer_xml.py b/gmso/external/convert_foyer_xml.py index f410a5a62..9c5d7d81e 100644 --- a/gmso/external/convert_foyer_xml.py +++ b/gmso/external/convert_foyer_xml.py @@ -478,9 +478,9 @@ def _write_rb_torsions(forcefield, ff_kwargs): forcefield, "DihedralTypes", attrib_dict={ - "expression": "c0 * cos(phi)**0 + c1 * cos(phi)**1 + " - "c2 * cos(phi)**2 + c3 * cos(phi)**3 + " - "c4 * cos(phi)**4 + c5 * cos(phi)**5", + "expression": "c0 * cos(psi)**0 + c1 * cos(psi)**1 + " + "c2 * cos(psi)**2 + c3 * cos(psi)**3 + " + "c4 * cos(psi)**4 + c5 * cos(psi)**5", }, ) From 2af112e00a79e053604eb122cf7a039d1d2e2f4f Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:30:38 -0500 Subject: [PATCH 13/16] changed RB from phi to psi in convert_foyer_xml.py --- gmso/external/convert_foyer_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/external/convert_foyer_xml.py b/gmso/external/convert_foyer_xml.py index 9c5d7d81e..fb3c91ba2 100644 --- a/gmso/external/convert_foyer_xml.py +++ b/gmso/external/convert_foyer_xml.py @@ -478,7 +478,7 @@ def _write_rb_torsions(forcefield, ff_kwargs): forcefield, "DihedralTypes", attrib_dict={ - "expression": "c0 * cos(psi)**0 + c1 * cos(psi)**1 + " + "expression": "c0 + c1 * cos(psi)**1 + " "c2 * cos(psi)**2 + c3 * cos(psi)**3 + " "c4 * cos(psi)**4 + c5 * cos(psi)**5", }, From 462dfe3b50daa856bd0c4a52892b93ac600dfff0 Mon Sep 17 00:00:00 2001 From: bc118 Date: Fri, 17 Dec 2021 17:46:01 -0500 Subject: [PATCH 14/16] changed c_x to cx for RB torsions in test_reference_xmls.py --- gmso/tests/test_reference_xmls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gmso/tests/test_reference_xmls.py b/gmso/tests/test_reference_xmls.py index cd5f69a48..b0192725c 100644 --- a/gmso/tests/test_reference_xmls.py +++ b/gmso/tests/test_reference_xmls.py @@ -451,7 +451,7 @@ def test_ethylene_forcefield(self): "4*epsilon*((sigma/r)**12 - (sigma/r)**6)", "0.5 * k * (r-r_eq)**2", "0.5 * k * (theta-theta_eq)**2", - "c_0 + c_1 * cos(psi) + c_2 * cos(psi)**2 + c_3 * cos(psi)**3 + c_4 * cos(psi)**4 + c_5 * cos(psi)**5", + "c0 + c1 * cos(psi) + c2 * cos(psi)**2 + c3 * cos(psi)**3 + c4 * cos(psi)**4 + c5 * cos(psi)**5", ] ] From bc70b1066c910ce790737dac72f9b834eeb5badc Mon Sep 17 00:00:00 2001 From: Co Quach Date: Fri, 17 Dec 2021 17:13:12 -0600 Subject: [PATCH 15/16] fix test_forcefield related bugs --- gmso/tests/files/ff_missing_atom_types.xml | 20 ++++++++++---------- gmso/tests/test_forcefield.py | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gmso/tests/files/ff_missing_atom_types.xml b/gmso/tests/files/ff_missing_atom_types.xml index 091fd88bd..bcc79aed1 100644 --- a/gmso/tests/files/ff_missing_atom_types.xml +++ b/gmso/tests/files/ff_missing_atom_types.xml @@ -31,16 +31,16 @@ - + - + - - + + @@ -48,16 +48,16 @@ - + - + - - + + @@ -67,8 +67,8 @@ - - + + diff --git a/gmso/tests/test_forcefield.py b/gmso/tests/test_forcefield.py index c814528a1..1401f1c93 100644 --- a/gmso/tests/test_forcefield.py +++ b/gmso/tests/test_forcefield.py @@ -478,7 +478,7 @@ def test_forcefield_get_potential_dihedral_type(self, opls_ethane_foyer): assert "c4" in params assert "c5" in params - assert sympify("phi") in dt.independent_variables + assert sympify("psi") in dt.independent_variables assert allclose_units_mixed( params.values(), From e4432decdb32eb03455b20aa46862e91ad2ba8a9 Mon Sep 17 00:00:00 2001 From: Co Quach Date: Fri, 17 Dec 2021 17:48:26 -0600 Subject: [PATCH 16/16] Change phi to psi in convert_parmed This will fix the failed test in test_lammps --- gmso/external/convert_parmed.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/gmso/external/convert_parmed.py b/gmso/external/convert_parmed.py index b1825455a..39d8baa74 100644 --- a/gmso/external/convert_parmed.py +++ b/gmso/external/convert_parmed.py @@ -398,10 +398,10 @@ def _dihedral_types_from_pmd(structure, dihedral_types_member_map=None): top_dihedraltype = gmso.DihedralType( parameters=dihedral_params, - expression="c0 * cos(phi)**0 + c1 * cos(phi)**1 + " - + "c2 * cos(phi)**2 + c3 * cos(phi)**3 + c4 * cos(phi)**4 + " - + "c5 * cos(phi)**5", - independent_variables="phi", + expression="c0 * cos(psi)**0 + c1 * cos(psi)**1 + " + + "c2 * cos(psi)**2 + c3 * cos(psi)**3 + c4 * cos(psi)**4 + " + + "c5 * cos(psi)**5", + independent_variables="psi", member_types=member_types, ) pmd_top_dihedraltypes[dihedraltype] = top_dihedraltype @@ -519,12 +519,12 @@ def to_parmed(top, refer_type=True): dihedral.connection_type and dihedral.connection_type.expression == parse_expr( - "c0 * cos(phi)**0 + " - + "c1 * cos(phi)**1 + " - + "c2 * cos(phi)**2 + " - + "c3 * cos(phi)**3 + " - + "c4 * cos(phi)**4 + " - + "c5 * cos(phi)**5" + "c0 * cos(psi)**0 + " + + "c1 * cos(psi)**1 + " + + "c2 * cos(psi)**2 + " + + "c3 * cos(psi)**3 + " + + "c4 * cos(psi)**4 + " + + "c5 * cos(psi)**5" ) ): structure.rb_torsions.append(pmd_dihedral) @@ -712,12 +712,12 @@ def _dihedral_types_from_gmso(top, structure, dihedral_map): # Add DihedralType to structure.dihedral_types structure.dihedral_types.append(dtype) elif dihedral_type.expression == parse_expr( - "c0 * cos(phi)**0 + " - + "c1 * cos(phi)**1 + " - + "c2 * cos(phi)**2 + " - + "c3 * cos(phi)**3 + " - + "c4 * cos(phi)**4 + " - + "c5 * cos(phi)**5" + "c0 * cos(psi)**0 + " + + "c1 * cos(psi)**1 + " + + "c2 * cos(psi)**2 + " + + "c3 * cos(psi)**3 + " + + "c4 * cos(psi)**4 + " + + "c5 * cos(psi)**5" ): dtype_c0 = float( dihedral_type.parameters["c0"].to("kcal/mol").value