def test_tu1_rhf_a(): """tu1-h2o-energy/input.dat global testing """ h2o = qcdb.set_molecule(""" O H 1 1.8 H 1 1.8 2 104.5 units au """) print(h2o) print(qcdb.get_active_options().print_changed()) qcdb.set_options({ 'basis': 'cc-pVDZ', 'scf_type': 'pk', 'memory': '600 mb' }) qcdb.energy('p4-hf') print(qcdb.print_variables()) assert compare_values(_ref_h2o_pk_rhf, qcdb.get_variable('HF TOTAL ENERGY'), 6, sys._getframe().f_code.co_name)
def test_tu2_uhf_nwchem(): ch2 = qcdb.set_molecule(""" 0 3 C H 1 R H 1 R 2 A R = 2.05 A = 133.93 units au """) qcdb.set_keywords({ "basis": "6-31g**", "reference": "uhf", }) print(ch2) print(qcdb.get_active_options().print_changed()) ene, wfn = qcdb.energy("nwc-scf", return_wfn=True) pprint.pprint(wfn, width=200) # debug printing assert compare_values(tu2_scf_ene, qcdb.variable("hf total energy"), 6, "energy") assert compare("NWChem", wfn["provenance"]["creator"], "harness")
def test_tu1_symmetry(): """tu1-h2o-energy/input.dat global testing """ h2o = qcdb.set_molecule(""" O H 1 1.8 H 1 1.8 2 104.5 units au """) print(h2o) print(qcdb.get_active_options().print_changed()) qcdb.set_options({'basis': 'cc-pVDZ', 'memory': '600 mb'}) qcdb.energy('gms-hf') print(qcdb.print_variables()) print(qcdb.get_variable('THE POINT GROUP OF THE MOLECULE')) # assert compare_values(_ref_h2o_pk_rhf, qcdb.get_variable('THE POINT GROUP OF THE MOLECULE'), 6, sys._getframe().f_code.co_name) assert compare_values(_ref_h2o_pk_rhf, qcdb.get_variable('HF TOTAL ENERGY'), 6, sys._getframe().f_code.co_name) assert 0
def test_tu1a(): """tu1-h2o-energy/input.dat global testing """ # import qcdb # print('qcdb', qcdb.__file__) # print(dir(qcdb)) h2o = qcdb.set_molecule(""" O H 1 0.96 H 1 0.96 2 104.5 """) print(h2o) print(qcdb.get_active_options().print_changed()) qcdb.set_options({'basis': 'cc-pVDZ', 'memory': '600 mb'}) qcdb.energy('scf') print(qcdb.print_variables()) #assert compare_values(-76.0266327341067125, get_variable('SCF TOTAL ENERGY'), 6, sys._getframe().f_code.co_name) assert compare_values(-76.0266327341067125, qcdb.get_variable('SCF TOTAL ENERGY'), 6, sys._getframe().f_code.co_name)
def test_makefp_h2o_h2o(): """makefp_h2o/input.dat global testing """ h2o = qcdb.set_molecule(""" O H 1 1.8 H 1 1.8 2 104.5 units au """) qcdb.set_options({ 'basis': 'cc-pVDZ', 'memory': '600 mb', }) #'gamess_contrl__runtyp': 'makefp'}) E, jobrec = qcdb.energy('gms-makefp', return_wfn=True) #gamess') efppot = jobrec['extras']['fragment_potential'] mysteryvalue = len(jobrec['molecule']['symbols']) h2o_h2o = qcdb.set_molecule(""" O -2.47693896 1.68753624 0.00297498 H -2.47693896 2.44253635 -0.59192497 H -2.47693896 0.93253607 -0.59192497 O 0.99148941 0.37922010 0.00256592 H 0.99148941 1.13422012 -0.59233409 H 0.99148941 -0.37577990 -0.59233409 O -3.01032066 -1.88144445 -0.01070227 H -3.01032066 -1.12644446 -0.60560226 H -3.01032066 -2.63644457 -0.60560226 O 1.24186850 -2.66617513 -0.00931387 H 1.24186850 -1.91117513 -0.60421389 H 1.24186850 -3.42117500 -0.60421389 O 3.82095551 -1.43027246 -0.00164440 H 3.82095551 -0.67527246 -0.59654438 H 3.82095551 -2.18527246 -0.59654438 units au """) # print(h2o_h2o) print(qcdb.get_active_options().print_changed()) qcdb.set_options({'basis': 'cc-pVDZ', 'memory': '600 mb'}) #'gamess_contrl__coord': 'unique'}) # E, jobrec = qcdb.energy('gms-efp', return_wfn=True, efpfrag=efppot) #gamess') E, jobrec = qcdb.energy('gms-efp', return_wfn=True, efpfrag=efppot, number_of_atoms_in_frag_x=mysteryvalue) #gamess') print(qcdb.print_variables()) # assert compare_values(_ref_h2o_pk_rhf, qcdb.get_variable('HF TOTAL ENERGY'), 6, sys._getframe().f_code.co_name) assert 0
def test_1_dipole(): qcdb.set_molecule( """ O 0 0 0 H 0 1.430 -1.107 H 0 -1.430 -1.107 units au """ ) qcdb.set_options( {"basis": "6-31g*", "nwchem_scf__rohf": True, "nwchem_scf__singlet": True, "nwchem_property__dipole": True} ) val = qcdb.properties("nwc-scf") check_dipole(val) print(qcdb.get_active_options().print_changed())
import qcdb from qcdb.driver.driver_helpers import get_active_molecule def {{ cookiecutter.main_function }}(name, **kwargs): """ Example Docstring input: molecule: Molecule instance output: molecule.esp_charges: dictionary of fitted esp charges. Modified in place return: None output files: mol_results.dat: fitting results mol_grid.dat: grid points in molecule.units mol_grid_esp.dat: QM esp valuese in a.u. """ molecule = kwargs.pop('molecule', get_active_molecule()) molecule.update_geometry() qopt = qcdb.get_active_options().scroll['{{ cookiecutter.project_slug|upper }}'] qcdb.get_active_options().require('PSI4', 'E_CONVERGENCE', 6, accession='wert') e, jrec = qcdb.energy(name, molecule=molecule, return_wfn=True) pprint.pprint(jrec) return jrec
h2o = qcdb.set_molecule(''' O 0.000000000000 0.000000000000 -0.065638538099 H 0.000000000000 -0.757480611647 0.520865616174 H 0.000000000000 0.757480611647 0.520865616174 ''') print(h2o) qcdb.set_options({ 'basis': 'cc-pvdz', 'memory': '400 mb', 'nwchem_scf': 'RHF', 'nwchem_scf_thresh': '1.0e-8', 'nwchem_scf_nopen': 0, 'nwchem_mp2_tight': True, 'nwchem_task_mp2': 'energy' }) print(qcdb.get_active_options().print_changed()) def check_mp2(return_value, is_df): if is_df: ref = -76.026760737428 one = -123.137568018334 two = 37.923473040741 mp2_total = -76.230777733733 scs_mp2_total = -76.226922314540 else: ref = -76.026760737428 one = -123.137568018334 two = 37.923473040741 mp2_total = -76.230777733733 scs_mp2_total = -76.226922314540