def test__hessian(): """ test the hessian pipeline """ basis = 'sto-3g' geom = (('O', (0.0, 0.0, -0.110)), ('H', (0.0, -1.635, 0.876)), ('H', (-0.0, 1.635, 0.876))) mult_vals = [1, 2] charge_vals = [0, 1] for prog in elstruct.writer.hessian_programs(): methods = list(elstruct.program_nondft_methods(prog)) dft_methods = list(elstruct.program_dft_methods(prog)) if dft_methods: methods.append(numpy.random.choice(dft_methods)) for method in methods: for mult, charge in zip(mult_vals, charge_vals): for orb_restricted in ( elstruct.program_method_orbital_restrictions( prog, method, singlet=(mult == 1))): vals = _test_pipeline( script_str=SCRIPT_DCT[prog], writer=elstruct.writer.hessian, readers=( elstruct.reader.energy_(prog, method), elstruct.reader.hessian_(prog), ), args=(geom, charge, mult, method, basis, prog), kwargs={'orb_restricted': orb_restricted}, ) print(vals)
def test__energy(): """ test the energy pipeline """ basis = '6-31g' geom = (('O', (0.0, 0.0, -0.110)), ('H', (0.0, -1.635, 0.876)), ('H', (-0.0, 1.635, 0.876))) mult_vals = [1, 2] charge_vals = [0, 1] for prog in elstruct.writer.programs(): for method in elstruct.program_methods(prog): for mult, charge in zip(mult_vals, charge_vals): for orb_restricted in ( elstruct.program_method_orbital_restrictions( prog, method, singlet=(mult == 1))): vals = _test_pipeline( script_str=SCRIPT_DCT[prog], writer=elstruct.writer.energy, readers=(elstruct.reader.energy_(prog, method), ), args=(geom, charge, mult, method, basis, prog), kwargs={'orb_restricted': orb_restricted}, error=elstruct.Error.SCF_NOCONV, error_kwargs={ 'scf_options': [ elstruct.option.specify( elstruct.Option.Scf.MAXITER_, 2) ] }, ) print(vals)