def test_2b(): h2o = qcdb.set_molecule(""" O H 1 0.96 H 1 0.96 2 104.5 """) qcdb.geometric('c4-scf/cc-pvdz') assert compare_values(nucenergy, h2o.nuclear_repulsion_energy(), 3, "Nuclear repulsion energy") assert compare_values(refenergy, qcdb.get_variable("CURRENT ENERGY"), 4, "Reference energy")
def test_2d(): h2o = qcdb.set_molecule(""" O 0. 0. -0.12 H 0. -1.52 1.04 H 0. 1.52 1.04 units au """) qcdb.geometric('c4-scf/cc-pvdz') assert compare_values(nucenergy, h2o.nuclear_repulsion_energy(), 3, "Nuclear repulsion energy") assert compare_values(refenergy, qcdb.get_variable("CURRENT ENERGY"), 4, "Reference energy")
def test_1a(): h2 = system1() refene = test1_ene tnm = tnm() + " [1] SCF/cc-pVDZ Optimized R" ene, jrec = qcdb.geometric("SCF/cc-pVDZ", return_wfn=True, molecule=h2) assert compare_values(refene, ene, 6, tnm) assert compare_values(refene, jrec["qcvars"]["CURRENT ENERGY"].data, 4, tnm) assert compare_values(refene, qcdb.variable("CURRENT ENERGY"), 4, tnm) assert compare_values( 0.0, np.sqrt(np.mean(np.square(jrec["qcvars"]["CURRENT GRADIENT"].data))), 4, tnm) assert compare_values( 0.0, np.sqrt(np.mean(np.square(qcdb.variable("CURRENT GRADIENT")))), 4, tnm) assert compare_values(test1_R, h2.R, 4, tnm)
def test_6b(): h2 = system1() refene = test6_ene tnm = tnm() + " [6] MP2/cc-pV[TQ]Z Optimized R" ene, jrec = qcdb.geometric("c4-MP2/cc-pV[TQ]Z", return_wfn=True, molecule=h2) assert compare_values(refene, ene, 6, tnm) assert compare_values(refene, jrec["qcvars"]["CURRENT ENERGY"].data, 4, tnm) assert compare_values(refene, qcdb.variable("CURRENT ENERGY"), 4, tnm) assert compare_values( 0.0, np.sqrt(np.mean(np.square(jrec["qcvars"]["CURRENT GRADIENT"].data))), 4, tnm) assert compare_values( 0.0, np.sqrt(np.mean(np.square(qcdb.variable("CURRENT GRADIENT")))), 4, tnm) assert compare_values(test6_R, h2.R, 4, tnm) # print(jrec['provenance']) tnm = tnm() + " [7] CI2/cc-pV[DT]Z Optimized R"