示例#1
0
def test_hessian_unit_regression(tmpdir):
    """
    The modsem method was found to have a bug in the scaling code which caused all angles to be scaled by the same amount.
    Here we try to reproduce some reference values for methanol which has a mix of scaled and non scaled angles.
    """
    with tmpdir.as_cwd():
        # load coords at the qm geometry
        mol = Ligand.parse_file(get_data("methanol.json"))

        mod_sem = ModSeminario()
        mod_sem.run(molecule=mol)

        # check the C-O bond
        assert round(mol.BondForce[(0, 1)].length, ndigits=4) == 0.1413
        # get in kcal/mol like the reference values
        assert round(mol.BondForce[(0, 1)].k, 3) == 246439.036
        # check a O-H bond
        assert round(mol.BondForce[(1, 5)].length, 4) == 0.0957
        assert round(mol.BondForce[(1, 5)].k, 2) == 513819.18

        # check the C-O-H angle
        assert round(mol.AngleForce[(0, 1, 5)].angle, 3) == 1.899
        assert round(mol.AngleForce[(0, 1, 5)].k, 3) == 578.503

        # check a scaled H-C-H angle
        assert round(mol.AngleForce[(2, 0, 3)].angle, 3) == 1.894
        assert round(mol.AngleForce[(2, 0, 3)].k, 3) == 357.05
示例#2
0
def methanol():
    return Ligand.parse_file(get_data("methanol.json"))
示例#3
0
def coumarin():
    return Ligand.parse_file(get_data("coumarin_hess_wbo.json"))