diff --git a/mosdef_gomc/utils/gmso_equation_compare.py b/mosdef_gomc/utils/gmso_equation_compare.py index 2dbbb5f4..ff5cac6a 100644 --- a/mosdef_gomc/utils/gmso_equation_compare.py +++ b/mosdef_gomc/utils/gmso_equation_compare.py @@ -4,10 +4,12 @@ # import signac import xml.etree.ElementTree as ET +import symengine import sympy import unyt as u -# Although,'symengine.sympify' from 'import symengine ' is faster, it was changed to 'sympy.nsimplify' as it changes +# Although,'symengine.sympify' from 'import symengine ' is faster, it was changed to 'sympy.nsimplify' for some +# with the 0.5 decimals in it like as it changes # improves the solving of the code by also solving 0.5 or other non-integers with integers. @@ -46,7 +48,8 @@ def evaluate_nonbonded_lj_format_with_scaler(new_lj_form, base_lj_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_lj_form) / sympy.nsimplify(base_lj_form), + - symengine.sympify(new_lj_form) + / symengine.sympify(base_lj_form), Rmin - sigma * two ** (1 / 6), two - 2, ], @@ -97,8 +100,8 @@ def evaluate_nonbonded_mie_format_with_scaler(new_mie_form, base_mie_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_mie_form) - / sympy.nsimplify(base_mie_form), + - symengine.sympify(new_mie_form) + / symengine.sympify(base_mie_form), ], [eqn_ratio], ) @@ -148,8 +151,8 @@ def evaluate_nonbonded_exp6_format_with_scaler(new_exp6_form, base_exp6_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_exp6_form) - / sympy.nsimplify(base_exp6_form), + - symengine.sympify(new_exp6_form) + / symengine.sympify(base_exp6_form), ], [eqn_ratio], ) @@ -367,8 +370,8 @@ def evaluate_harmonic_bond_format_with_scaler(new_bond_form, base_bond_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_bond_form) - / sympy.nsimplify(base_bond_form), + - symengine.sympify(new_bond_form) + / symengine.sympify(base_bond_form), ], [eqn_ratio], ) @@ -414,8 +417,8 @@ def evaluate_harmonic_angle_format_with_scaler(new_angle_form, base_angle_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_angle_form) - / sympy.nsimplify(base_angle_form), + - symengine.sympify(new_angle_form) + / symengine.sympify(base_angle_form), ], [eqn_ratio], ) @@ -461,8 +464,8 @@ def evaluate_harmonic_torsion_format_with_scaler( values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_torsion_form) - / sympy.nsimplify(base_torsion_form), + - symengine.sympify(new_torsion_form) + / symengine.sympify(base_torsion_form), ], [eqn_ratio], ) @@ -557,8 +560,8 @@ def evaluate_periodic_torsion_format_with_scaler( values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_torsion_form) - / sympy.nsimplify(base_torsion_form), + - symengine.sympify(new_torsion_form) + / symengine.sympify(base_torsion_form), ], [eqn_ratio], ) @@ -604,8 +607,8 @@ def evaluate_RB_torsion_format_with_scaler(new_torsion_form, base_torsion_form): values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_torsion_form) - / sympy.nsimplify(base_torsion_form), + - symengine.sympify(new_torsion_form) + / symengine.sympify(base_torsion_form), ], [eqn_ratio], ) @@ -651,8 +654,8 @@ def evaluate_harmonic_improper_format_with_scaler( values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_improper_form) - / sympy.nsimplify(base_improper_form), + - symengine.sympify(new_improper_form) + / symengine.sympify(base_improper_form), ], [eqn_ratio], ) @@ -698,8 +701,8 @@ def evaluate_periodic_improper_format_with_scaler( values = sympy.nonlinsolve( [ eqn_ratio - - sympy.nsimplify(new_improper_form) - / sympy.nsimplify(base_improper_form), + - symengine.sympify(new_improper_form) + / symengine.sympify(base_improper_form), ], [eqn_ratio], )