def test_psi4_driver(): """ Runs mp2/CBS for O2 and compare against psi4 """ options = { "energy_regex": PSI_SCF, "xtpl_templates": [["templates/psi_O2_mp2qz.dat", "templates/psi_O2_mp2tz.dat"], ["templates/psi_O2_mp2qz.dat", "templates/psi_O2_mp2tz.dat"]], "xtpl_names": [["mp2_qz", "mp2_tz"], ["mp2_qz", "mp2_tz"]], "xtpl_basis_sets": [[4, 3], [4, 3]], "xtpl_regexes": [[PSI_MP2], [PSI_SCF]], "xtpl_programs": "psi4", "max_force_g_convergence": 1e-6 } if 'vlogin' in socket.gethostname(): options.update({"xtpl_queues": "gen4.q"}) if 'ss-sub' in socket.gethostname(): options.update({"xtpl_queues": "batch"}) gradient, energy, molecule = optavc.run_optavc('opt', options) assert math.isclose(energy, -150.200365229198, rel_tol=0, abs_tol=1e-6)
def test_xtpl_cfour(): """cfour CCSD(T) + mp2/CBS using gradients - compare to psi4 w/cfour interface """ options = { "energy_regex": PSI_SCF, "xtpl_templates": [[ "templates/psi_O2_mp2qz_grad.dat", "templates/psi_O2_mp2tz_grad.dat" ], [ "templates/psi_O2_scfqz_grad.dat", "templates/psi_O2_scftz_grad.dat" ]], "xtpl_regexes": [[PSI_MP2], [PSI_MP2]], "xtpl_dertypes": "gradient", "xtpl_programs": "psi4", "xtpl_names": [["mp2_qz", "mp2_tz"], ["scf_qz", "scf_tz"]], "xtpl_deriv_regexes": PSI4_GRAD, "xtpl_basis_sets": [[4, 3], [4, 3]], "delta_templates": [["templates/cfour_O2_ccsdt.dat", "templates/cfour_O2_mp2.dat"]], "delta_regexes": [[C4_ENERGY, C4_ENERGY]], "delta_dertypes": "gradient", "delta_programs": [["cfour@2+mpi", "cfour@2~mpi"]], "delta_names": [["c4_grad1", "c4_grad2"]], "max_force_g_convergence": 1e-6 } if 'vlogin' in socket.gethostname(): options.update({"delta_queues": "gen4.q", "xtpl_queues": "gen4.q"}) if 'ss-sub' in socket.gethostname(): options.update({"delta_queues": "batch", "xtpl_queues": "batch"}) gradient, energy, molecule = optavc.run_optavc("opt", options) assert math.isclose(energy, -149.700965645798, rel_tol=1.e-05)
def test_xtpl_molpro(): """Run molpro CCSD(T) + mp2/CBS - no comparison """ options = { "energy_regex": PSI_SCF, "xtpl_templates": [["templates/psi_O2_mp2qz.dat", "templates/psi_O2_mp2tz.dat"], ["templates/psi_O2_mp2qz.dat", "templates/psi_O2_mp2tz.dat"]], "xtpl_regexes": [[PSI_MP2], [PSI_SCF]], "xtpl_names": [["mp2_qz", "mp2_tz"], ["mp2_qz", "mp2_tz"]], "xtpl_basis_sets": [[4, 3], [4, 3]], "xtpl_programs": "psi4", "scf_xtpl": False, "delta_templates": [["templates/molpro_O2_ccsdt.dat"]], "delta_regexes": [[MOLPRO_CCSDT, MOLPRO_MP2]], "delta_programs": "[email protected]+mpi", "max_force_g_convergence": 1e-7 } if 'vlogin' in socket.gethostname(): options.update({"delta_queues": "gen4.q", "xtpl_queues": "gen4.q"}) if 'ss-sub' in socket.gethostname(): options.update({"delta_queues": "batch", "xtpl_queues": "batch"}) gradient, energy, molecule = optavc.run_optavc('opt', options) p4mol = molecule.cast_to_psi4_molecule_object() assert math.isclose(p4mol.nuclear_repulsion_energy(), 28.028875150649082, rel_tol=0, abs_tol=1e-4)
import optavc options_kwargs = { 'template_file_path': "template.dat", 'deriv_regex': r"\s*-Total\s[Gg]radient:\n\s*Atom\s*X\s*Y\s*Z\n(\s*-*)*\n", 'energy_regex': r"\s*@DF-RHF Final Energy:\s+(-\d+\.\d+)", 'program': "psi4", 'input_name': "input.dat", 'output_name': "output.dat", 'maxiter': 20, 'dertype': 'GRADIENT' } optavc.run_optavc("OPT", options_kwargs, restart_iteration=0)
import optavc options_kwargs = { 'template_file_path': "template.dat", 'energy_regex': r"@DF-RHF Final Energy:\s+(-\d+\.\d+)", 'success_regex': r"\*\*\* P[Ss][Ii]4 exiting successfully.", 'program': "psi4", 'input_name': "input.dat", 'output_name': "output.dat" } optavc.run_optavc("FREQUENCIES", options_kwargs, sow=False)
import optavc options = { 'program': 'psi4', 'template_file_path': 'template.dat', 'energy_regex': r'Stephenergy (-\d*.\d*)', 'time_limit': '6-20:00:00', 'queue': 'batch', 'max_force_g_convergence': 1e-7, 'nslots': '12', 'memory': '5GB', 'name': 'h2o_o_cs' } optavc.run_optavc('OPT', options)
import optavc options_kwargs = { 'template_file_path': "template.dat", 'energy_regex': r"@DF-RHF Final Energy:\s+(-\d+\.\d+)", 'success_regex': r"\*\*\* P[Ss][Ii]4 exiting successfully.", 'program': "psi4", 'input_name': "input.dat", 'output_name': "output.dat" } optavc.run_optavc("HESSIAN", options_kwargs, sow=True)
import optavc options = { 'program': 'psi4', 'template_file_path': 'template.dat', 'energy_regex': r'Stephenergy (-\d*.\d*)', 'time_limit': '6-20:00:00', 'queue': 'batch', 'max_force_g_convergence': 1e-7, 'nslots': '12', 'memory': '5GB', 'name':'h2o_o' } optavc.run_optavc('HESS', options, sow = True)
'sap2test', 'nslots': 5, 'memory': '5GB', 'queue': 'batch', 'time_limit': '00:00:40', 'max_force_g_convergence': 1e-7, 'ensure_bt_convergence': True, 'xtpl_templates': ["template1.dat", "template2.dat"], 'xtpl_programs': ["psi4@master"], 'xtpl_energy': [ r"\s+\s+CCSD\scorrelation\senergy\s+=\s*(-\d*.\d*)", r"\s*MP2\/QZ\scorrelation\senergy\s*(-\d*.\d*)", r"\s*MP2\/TZ\scorrelation\senergy\s*(-\d*.\d*)", r"\s+MP2\scorrelation\senergy\s+=\s+(-\d*.\d*)", r"\s*SCF\/QZ\s+reference\senergy\s*(-\d*.\d*)" ], 'xtpl_corrections': r"\s*\(T\)\senergy\s*=\s*(-\d*.\d*)", 'xtpl_success': [r"beer"], 'xtpl_basis_sets': [4, 3], 'xtpl_input_style': [2, 2] } optavc.run_optavc('opt', options_kwargs)
import optavc options = { 'program': 'psi4', 'template_file_path': 'template.dat', 'energy_regex': r'Stephenergy (-\d*.\d*)', 'time_limit': '6-20:00:00', 'queue': 'batch', 'max_force_g_convergence': 1e-7, 'nslots': '12', 'memory': '5GB', 'name':'cs' } optavc.run_optavc('HESS', options, sow = False)
import optavc options = { 'program': 'psi4', 'template_file_path': 'template.dat', 'energy_regex': r'Stephenergy (-\d*.\d*)', 'time_limit': '6-20:00:00', 'queue': 'batch', 'max_force_g_convergence': 1e-7, 'nslots': '12', 'memory': '48GB', 'name': 'ccsd_t_tz' } optavc.run_optavc('OPT', options, restart_iteration=19)
import optavc options_kwargs = { 'template_file_path': "template.dat", 'energy_regex': r"@DF-RHF Final Energy:\s+(-\d+\.\d+)", 'success_regex': r"\*\*\* P[Ss][Ii]4 exiting successfully.", 'queue': "gen3.q", 'program': "psi4@master", 'input_name': "input.dat", 'output_name': "output.dat", 'job_array': True, 'findif': { "hessian_write": True, #ALWAYS have this on "normal_modes_write": True } } optavc.run_optavc("HESS", options_kwargs, path="HESS", sow=False)