def test_kinetic_from_molecule_ch4_uhf_ccpvdz(): # load data computed with Fortran code with path("chemtools.data", "data_fortran_ch4_uhf_ccpvdz.npz") as fname: data = np.load(str(fname)) # test from_molecule initialization with exp_beta & check against Fortran code with path("chemtools.data", "ch4_uhf_ccpvdz.fchk") as fname: molecule = Molecule.from_file(fname) tool = KED.from_molecule(molecule, data['points']) print('tool = ', tool) check_kinetic_energy_density(tool, data) # test from_molecule initialization without exp_beta & check against Fortran code del molecule._exp_beta with path("chemtools.data", "ch4_uhf_ccpvdz.fchk") as fname: molecule = Molecule.from_file(fname) tool = KED.from_molecule(molecule, data['points']) check_kinetic_energy_density(tool, data)
def test_kinetic_from_molecule_h2o_nuclei(): # test against multiwfn 3.6 dev src with path('chemtools.data', 'data_multiwfn36_fchk_h2o_q+0_ub3lyp_ccpvtz.npz') as fname: data = np.load(str(fname)) with path('chemtools.data', 'h2o_q+0_ub3lyp_ccpvtz.fchk') as fname: molecule = Molecule.from_file(fname) tool = KED.from_molecule(molecule, data['coords']) # check attributes assert_allclose(tool.density, data['nuc_dens'], rtol=1.e-6, atol=0.) assert_allclose(tool.gradient, data['nuc_grad'], rtol=1.e-6, atol=0.) assert_allclose(tool.laplacian, data['nuc_lap'], rtol=1.e-6, atol=0.) # check ked at the position of nuclei assert_allclose(tool.ked_positive_definite, data['nuc_ked_pd'], rtol=1.e-5, atol=0.) assert_allclose(tool.ked_hamiltonian, data['nuc_ked_ham'], rtol=1.e-5, atol=0.) assert_allclose(tool.ked_general(alpha=0.), data['nuc_ked_ham'], rtol=1.e-5, atol=0.)
def test_kinetic_from_molecule_ch4_rhf_ccpvdz(): # load data computed with Fortran code with path("chemtools.data", "data_orbitalbased_fortran_ch4_uhf_ccpvdz.npz") as fname: data = np.load(str(fname)) # test from_file initialization & check against Fortran code with path("chemtools.data", "ch4_rhf_ccpvdz.fchk") as fname: molecule = Molecule.from_file(fname) tool = KED.from_molecule(molecule, data['points']) check_kinetic_energy_density(tool, data)