Beispiel #1
0
def test_condense_linear_from_file_fmr_h_ch4_wfn():
    # expected populations of CH4 computed with HORTON
    with path('chemtools.data', 'ch4_uhf_ccpvdz.wfn') as fname:
        model1 = CondensedConceptualDFT.from_file(fname, "linear", "FMR", "h")
        model2 = CondensedConceptualDFT.from_file([fname], "linear", "FMR",
                                                  "h")
        mol = Molecule.from_file(fname)
        grid = MolecularGrid(mol.coordinates, mol.numbers, mol.pseudo_numbesr,
                             'insane', 3, False)
        model3 = CondensedConceptualDFT.from_file(fname,
                                                  "linear",
                                                  "FMR",
                                                  "h",
                                                  grid=grid)
        model4 = CondensedConceptualDFT.from_file([fname],
                                                  "linear",
                                                  "FMR",
                                                  "h",
                                                  grid=grid)
    expected = np.array(
        [6.11301651, 0.97175462, 0.97175263, 0.9717521, 0.97174353])
    # check using fname given as a string
    check_condensed_reactivity(model1, "linear", expected, None, None, 10,
                               0.736396)
    # check using fname given as a list
    check_condensed_reactivity(model2, "linear", expected, None, None, 10,
                               0.736396)
    # check using fname as a string & passing grid
    mol = Molecule.from_file(fname)
    check_condensed_reactivity(model3, "linear", expected, None, None, 10,
                               0.736396)
    # check using fname as a list & passing grid
    check_condensed_reactivity(model4, "linear", expected, None, None, 10,
                               0.736396)
Beispiel #2
0
def test_condense_quadratic_from_file_fmr_mbis_ch4_fchk():
    # expected populations of CH4 computed with HORTON
    with path('chemtools.data', 'ch4_uhf_ccpvdz.fchk') as fname:
        model1 = CondensedConceptualDFT.from_file(fname, "quadratic", "FMR",
                                                  "mbis")
        model2 = CondensedConceptualDFT.from_file([fname], "quadratic", "FMR",
                                                  "mbis")
        mol = Molecule.from_file(fname)
        grid = MolecularGrid(mol.coordinates, mol.numbers, mol.pseudo_numbesr,
                             'insane', 3, False)
        model3 = CondensedConceptualDFT.from_file(fname,
                                                  "quadratic",
                                                  "FMR",
                                                  "mbis",
                                                  grid=grid)
        model4 = CondensedConceptualDFT.from_file([fname],
                                                  "quadratic",
                                                  "FMR",
                                                  "mbis",
                                                  grid=grid)
    expected = np.array(
        [6.46038055, 0.88489494, 0.88492901, 0.88493897, 0.88492396])
    # check using fname given as a string
    check_condensed_reactivity(model1, "quadratic", expected, None, None, 10,
                               0.736396)
    # check using fname given as a list
    check_condensed_reactivity(model2, "quadratic", expected, None, None, 10,
                               0.736396)
    # check using fname as a string & passing grid
    check_condensed_reactivity(model3, "quadratic", expected, None, None, 10,
                               0.736396)
    # check using fname given as a list
    check_condensed_reactivity(model4, "quadratic", expected, None, None, 10,
                               0.736396)
Beispiel #3
0
def test_condense_quadratic_from_file_fmr_mbis_ch4_wfn():
    # expected populations of CH4 computed with HORTON
    with path('chemtools.data', 'ch4_uhf_ccpvdz.wfn') as fname:
        model1 = CondensedConceptualDFT.from_file(fname, "quadratic", "FMR", "mbis")
        model2 = CondensedConceptualDFT.from_file([fname], "quadratic", "FMR", "mbis")
    expected = np.array([6.46038055, 0.88489494, 0.88492901, 0.88493897, 0.88492396])
    # check using fname given as a string
    check_condensed_reactivity(model1, "quadratic", expected, None, None, 10)
    # check using fname given as a list
    check_condensed_reactivity(model2, "quadratic", expected, None, None, 10)
Beispiel #4
0
def test_condense_from_file_fd_rmf_mulliken_h2o_fchk():
    # expected populations of H2O from fchk file
    expected_m = np.array([8, 1, 1]) - np.array([ 3.49417097E-01, 3.25291762E-01, 3.25291141E-01])
    expected_0 = np.array([8, 1, 1]) - np.array([-4.32227787E-01, 2.16114060E-01, 2.16113727E-01])
    expected_p = np.array([8, 1, 1]) - np.array([-2.64833827E-01,-3.67583325E-01,-3.67582849E-01])
    with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1:
        with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2:
            with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3:
                fname = [file1, file2, file3]
                model1 = CondensedConceptualDFT.from_file(fname, "linear", "RMF", "mulliken")
                model2 = CondensedConceptualDFT.from_file(fname, "quadratic", "RMF", "mulliken")
    # check from_file linear
    check_condensed_reactivity(model1, "linear", expected_0, expected_p, expected_m, 10)
    # check from_file quadratic
    check_condensed_reactivity(model2, "quadratic", expected_0, expected_p, expected_m, 10)
Beispiel #5
0
def test_condense_from_file_fd_rmf_npa_h2o_fchk():
    # expected populations of H2O from fchk file
    expected_m = np.array([8, 1, 1]) - np.array([-3.64452391E-02, 5.18222784E-01, 5.18222455E-01])
    expected_0 = np.array([8, 1, 1]) - np.array([-9.00876494E-01, 4.50438267E-01, 4.50438227E-01])
    expected_p = np.array([8, 1, 1]) - np.array([-1.11332869E+00, 5.66635486E-02, 5.66651430E-02])
    with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1:
        with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2:
            with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3:
                fname = [file1, file2, file3]
                # check from_file linear
                model1 = CondensedConceptualDFT.from_file(fname, "linear", "RMF", "npa")
                model2 = CondensedConceptualDFT.from_file(fname, "quadratic", "RMF", "npa")
    check_condensed_reactivity(model1, "linear", expected_0, expected_p, expected_m, 10)
    # check from_file quadratic
    check_condensed_reactivity(model2, "quadratic", expected_0, expected_p, expected_m, 10)
Beispiel #6
0
def test_condense_from_file_fd_rmf_esp_h2o_fchk():
    # expected populations of H2O from fchk file
    expected_m = np.array([8, 1, 1]) - np.array([ 4.14233893E-02, 4.79288419E-01, 4.79288192E-01])
    expected_0 = np.array([8, 1, 1]) - np.array([-7.00779373E-01, 3.50389629E-01, 3.50389744E-01])
    expected_p = np.array([8, 1, 1]) - np.array([-5.81613550E-01,-2.09193820E-01,-2.09192630E-01])
    with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1:
        with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2:
            with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3:
                fname = [file1, file2, file3]
                # check from_file linear
                model1 = CondensedConceptualDFT.from_file(fname, "linear", "RMF", "esp")
                model2 = CondensedConceptualDFT.from_file(fname, "quadratic", "RMF", "esp")
    check_condensed_reactivity(model1, "linear", expected_0, expected_p, expected_m, 10)
    # check from_file quadratic
    check_condensed_reactivity(model2, "quadratic", expected_0, expected_p, expected_m, 10)
Beispiel #7
0
def test_condense_linear_from_file_fmr_h_ch4_fchk():
    # expected populations of CH4 computed with HORTON
    with path('chemtools.data', 'ch4_uhf_ccpvdz.fchk') as fname:
        model1 = CondensedConceptualDFT.from_file(fname, "linear", "FMR", "h")
        model2 = CondensedConceptualDFT.from_file([fname], "linear", "FMR", "h")
        mol = Molecule.from_file(fname)
        grid = MolecularGrid.from_molecule(mol, specification='insane', rotate=False)
        model3 = CondensedConceptualDFT.from_file(fname, "linear", "FMR", "h", grid=grid)
        model4 = CondensedConceptualDFT.from_file([fname], "linear", "FMR", "h", grid=grid)
    expected = np.array([6.11301651, 0.97175462, 0.97175263, 0.9717521, 0.97174353])
    # check using fname given as a string
    check_condensed_reactivity(model1, "linear", expected, None, None, 10)
    # check using fname given as a list
    check_condensed_reactivity(model2, "linear", expected, None, None, 10)
    # check using fname as a string & passing grid
    check_condensed_reactivity(model3, "linear", expected, None, None, 10)
    # check using fname as a list & passing grid
    check_condensed_reactivity(model4, "linear", expected, None, None, 10)