def test_kinetic_from_file_ch4_rhf_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_file initialization & check against Fortran code with path("chemtools.data", "ch4_uhf_ccpvdz.fchk") as fname: tool = KED.from_file(fname, data['points']) check_kinetic_energy_density(tool, data)
def test_kinetic_from_file_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: tool = KED.from_file(fname, 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.)