def test_condense_from_molecule_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]) molecule = [] with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1: molecule.append(Molecule.from_file(file1)) with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2: molecule.append(Molecule.from_file(file2)) with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3: molecule.append(Molecule.from_file(file3)) # check from_molecule linear model = CondensedConceptualDFT.from_molecule(molecule, "linear", "RMF", "mulliken") check_condensed_reactivity(model, "linear", expected_0, expected_p, expected_m, 10, 0.572546) # check from_molecule quadratic model = CondensedConceptualDFT.from_molecule(molecule, "quadratic", "RMF", "mulliken") check_condensed_reactivity(model, "quadratic", expected_0, expected_p, expected_m, 10, 0.572546)
def test_condense_from_molecule_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]) molecule = [] with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1: molecule.append(Molecule.from_file(file1)) with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2: molecule.append(Molecule.from_file(file2)) with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3: molecule.append(Molecule.from_file(file3)) # check from_molecule linear model = CondensedConceptualDFT.from_molecule(molecule, "linear", "RMF", "npa") check_condensed_reactivity(model, "linear", expected_0, expected_p, expected_m, 10, 0.572546) # check from_molecule quadratic model = CondensedConceptualDFT.from_molecule(molecule, "quadratic", "RMF", "npa") check_condensed_reactivity(model, "quadratic", expected_0, expected_p, expected_m, 10, 0.572546)
def test_condense_from_molecule_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]) molecule = [] with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as file1: molecule.append(Molecule.from_file(file1)) with path('chemtools.data', 'h2o_q-1_ub3lyp_ccpvtz.fchk') as file2: molecule.append(Molecule.from_file(file2)) with path('chemtools.data', 'h2o_q+1_ub3lyp_ccpvtz.fchk') as file3: molecule.append(Molecule.from_file(file3)) # check from_molecule linear model = CondensedConceptualDFT.from_molecule(molecule, "linear", "RMF", "esp") check_condensed_reactivity(model, "linear", expected_0, expected_p, expected_m, 10, 0.572546) # check from_molecule quadratic model = CondensedConceptualDFT.from_molecule(molecule, "quadratic", "RMF", "esp") check_condensed_reactivity(model, "quadratic", expected_0, expected_p, expected_m, 10, 0.572546)
def test_condense_quadratic_from_molecule_fmr_mbis_ch4_fchk(): # expected populations of CH4 computed with HORTON with path('chemtools.data', 'ch4_uhf_ccpvdz.fchk') as fname: mol = Molecule.from_file(fname) expected = np.array( [6.46038055, 0.88489494, 0.88492901, 0.88493897, 0.88492396]) # check from_molecule model = CondensedConceptualDFT.from_molecule(mol, "quadratic", "FMR", "mbis") check_condensed_reactivity(model, "quadratic", expected, None, None, 10, 0.736396) # check from_molecule given as a list model = CondensedConceptualDFT.from_molecule([mol], "quadratic", "FMR", "mbis") check_condensed_reactivity(model, "quadratic", expected, None, None, 10, 0.736396) # check from_molecule & passing grid grid = MolecularGrid(mol.coordinates, mol.numbers, mol.pseudo_numbesr, 'insane', 3, False) model = CondensedConceptualDFT.from_molecule(mol, "quadratic", "FMR", "mbis", grid=grid) check_condensed_reactivity(model, "quadratic", expected, None, None, 10, 0.736396) # check from_molecule given as a list & passing grid model = CondensedConceptualDFT.from_molecule([mol], "quadratic", "FMR", "mbis", grid=grid) check_condensed_reactivity(model, "quadratic", expected, None, None, 10, 0.736396)
def test_condense_linear_from_molecule_fmr_h_ch4_wfn(): # expected populations of CH4 computed with HORTON with path('chemtools.data', 'ch4_uhf_ccpvdz.wfn') as fname: mol = Molecule.from_file(fname) expected = np.array( [6.11301651, 0.97175462, 0.97175263, 0.9717521, 0.97174353]) # check from_molecule model = CondensedConceptualDFT.from_molecule(mol, "linear", "FMR", "h") check_condensed_reactivity(model, "linear", expected, None, None, 10, 0.736396) # check from_molecule given as a list model = CondensedConceptualDFT.from_molecule([mol], "linear", "FMR", "h") check_condensed_reactivity(model, "linear", expected, None, None, 10, 0.736396) # check from_molecule & passing grid grid = MolecularGrid(mol.coordinates, mol.numbers, mol.pseudo_numbesr, 'insane', 3, False) model = CondensedConceptualDFT.from_molecule(mol, "linear", "FMR", "h", grid=grid) check_condensed_reactivity(model, "linear", expected, None, None, 10, 0.736396) # check from_molecule given as a list & passing grid model = CondensedConceptualDFT.from_molecule([mol], "linear", "FMR", "h", grid=grid) check_condensed_reactivity(model, "linear", expected, None, None, 10, 0.736396)
def test_condense_quadratic_from_molecule_fmr_mbis_ch4_wfn(): # expected populations of CH4 computed with HORTON with path('chemtools.data', 'ch4_uhf_ccpvdz.wfn') as fname: molecule = Molecule.from_file(fname) expected = np.array([6.46038055, 0.88489494, 0.88492901, 0.88493897, 0.88492396]) # check from_molecule given as a string model = CondensedConceptualDFT.from_molecule(molecule, "quadratic", "FMR", "mbis") check_condensed_reactivity(model, "quadratic", expected, None, None, 10) # check from_molecule given as a list model = CondensedConceptualDFT.from_molecule([molecule], "quadratic", "FMR", "mbis") check_condensed_reactivity(model, "quadratic", expected, None, None, 10)