def test_1b(): h2o = qcdb.set_molecule(""" O H 1 0.96 H 1 0.96 2 104.5 """) qcdb.optking('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_6b(): h2 = system1() refene = test6_ene tnm = sys._getframe().f_code.co_name + " [6] MP2/cc-pV[TQ]Z Optimized R" assert compare_values(0.529177208590000 * a2a, h2.nuclear_repulsion_energy(), 9, "Nuclear repulsion energy") ene, jrec = qcdb.optking('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.get_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.get_variable('CURRENT GRADIENT')))), 4, tnm) assert compare_values(test6_R, h2.R, 4, tnm) #print(jrec['provenance']) tnm = sys._getframe().f_code.co_name + " [7] CI2/cc-pV[DT]Z Optimized R"
def test_1a(system1): h2 = system1 refene = test1_ene lbl = tnm() + " [1] SCF/cc-pVDZ Optimized R" assert compare_values(0.529177208590000 * a2a, h2.nuclear_repulsion_energy(), 9, "Nuclear repulsion energy") ene, jrec = qcdb.optking("SCF/cc-pVDZ", return_wfn=True, molecule=h2) assert compare_values(refene, ene, 6, lbl) assert compare_values(refene, jrec["qcvars"]["CURRENT ENERGY"].data, 4, lbl) assert compare_values(refene, qcdb.variable("CURRENT ENERGY"), 4, lbl) assert compare_values(0.0, np.sqrt(np.mean(np.square(jrec["qcvars"]["CURRENT GRADIENT"].data))), 4, lbl) assert compare_values(0.0, np.sqrt(np.mean(np.square(qcdb.variable("CURRENT GRADIENT")))), 4, lbl) assert compare_values(test1_R, h2.R, 4, lbl)
def test_6b(system1): h2 = system1 refene = test6_ene lbl = tnm() + " [6] MP2/cc-pV[TQ]Z Optimized R" assert compare_values(0.529177208590000 * a2a, h2.nuclear_repulsion_energy(), 9, "Nuclear repulsion energy") ene, jrec = qcdb.optking("c4-MP2/cc-pV[TQ]Z", return_wfn=True, molecule=h2) assert compare_values(refene, ene, 6, lbl) assert compare_values(refene, jrec["qcvars"]["CURRENT ENERGY"].data, 4, lbl) assert compare_values(refene, qcdb.variable("CURRENT ENERGY"), 4, lbl) assert compare_values(0.0, np.sqrt(np.mean(np.square(jrec["qcvars"]["CURRENT GRADIENT"].data))), 4, lbl) assert compare_values(0.0, np.sqrt(np.mean(np.square(qcdb.variable("CURRENT GRADIENT")))), 4, lbl) assert compare_values(test6_R, h2.R, 4, lbl) # print(jrec['provenance']) lbl = tnm() + " [7] CI2/cc-pV[DT]Z Optimized R"
def test_1a(): h2 = system1() refene = test1_ene tnm = sys._getframe().f_code.co_name + ' [1] SCF/cc-pVDZ Optimized R' assert compare_values(0.529177208590000 * a2a, h2.nuclear_repulsion_energy(), 9, "Nuclear repulsion energy") ene, jrec = qcdb.optking('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.get_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.get_variable('CURRENT GRADIENT')))), 4, tnm) assert compare_values(test1_R, h2.R, 4, tnm)