Beispiel #1
0
def _build_molpro_template_str(ref_zma, ts_info, ts_formula, high_mul,
                               rct_ichs, rct_info, active_space,
                               mod_var_sp1_thy_info, inf_sep_ene):
    """ Write the electronic structure template file
    """

    cas_kwargs = wfn.build_wfn(ref_zma, ts_info, ts_formula, high_mul,
                               rct_ichs, rct_info, active_space,
                               mod_var_sp1_thy_info)

    tml_inp_str = wfn.wfn_string(ts_info, mod_var_sp1_thy_info, inf_sep_ene,
                                 cas_kwargs)

    return tml_inp_str
Beispiel #2
0
def calc_vrctst_flux(
        ini_zma, ts_info, hs_info, ts_formula, high_mul, active_space,
        rct_info, rct_ichs, rct_zmas, rcts_cnf_fs, grid1, grid2, coord_name,
        mod_var_scn_thy_info, mod_var_sp1_thy_info, var_sp2_thy_info,
        hs_var_sp1_thy_info, hs_var_sp2_thy_info, vscnlvl_thy_save_fs,
        vscnlvl_ts_run_fs, vscnlvl_scn_run_fs, vscnlvl_scn_save_fs,
        vscnlvl_cscn_run_fs, vscnlvl_cscn_save_fs, overwrite, update_guess):
    """ Set up n VRC-TST calculations to get the flux file
    """

    # Set vrc tst dct
    vrc_dct = _vrc_dct()

    # Set up the casscf options
    ref_zma = automol.zmatrix.set_values(ini_zma, {coord_name: grid1[0]})
    cas_kwargs = wfn.build_wfn(ref_zma, ts_info, ts_formula, high_mul,
                               rct_ichs, rct_info, active_space,
                               mod_var_scn_thy_info)
    _, script_str, _, _ = qchem_params(mod_var_sp1_thy_info[0],
                                       mod_var_sp1_thy_info[1])

    # Get indices for potentials and input
    bnd_frm_idxs = automol.zmatrix.coord_idxs(ini_zma, coord_name)
    min_idx, max_idx = min(bnd_frm_idxs), max(bnd_frm_idxs)
    bnd_frm_idxs = (bnd_frm_idxs[0] + 1, bnd_frm_idxs[1] + 1)

    # Build the VRC-TST run directory, including the needed scr dir
    vrc_path = _build_vrctst_fs(vscnlvl_ts_run_fs)

    # Calculate the correction potential along the MEP
    inf_sep_ene, npot, zma_for_inp = _build_correction_potential(
        ts_info, hs_info, ref_zma, coord_name, bnd_frm_idxs, grid1, grid2,
        rct_info, rcts_cnf_fs, rct_zmas, mod_var_scn_thy_info,
        mod_var_sp1_thy_info, hs_var_sp1_thy_info, var_sp2_thy_info,
        hs_var_sp2_thy_info, vscnlvl_scn_run_fs, vscnlvl_scn_save_fs,
        vscnlvl_cscn_run_fs, vscnlvl_cscn_save_fs, vscnlvl_thy_save_fs,
        overwrite, update_guess, vrc_dct, vrc_path, cas_kwargs)

    # Write remaining VaReCoF input files
    _write_varecof_input(zma_for_inp, ts_info, ts_formula, high_mul, rct_ichs,
                         rct_info, rct_zmas, active_space,
                         mod_var_sp1_thy_info, npot, inf_sep_ene, min_idx,
                         max_idx, vrc_dct, vrc_path, script_str)

    # Run VaReCoF to generate flux file
    _run_varecof(vrc_path)
Beispiel #3
0
def radrad_scan(
    ts_zma,
    ts_info,
    hs_info,
    ts_formula,
    high_mul,
    active_space,
    rct_info,
    rct_ichs,
    rcts_cnf_fs,
    rcts_gra,
    grid1,
    grid2,
    coord_name,
    frm_bnd_keys,
    mod_var_scn_thy_info,
    mod_var_sp1_thy_info,  # Need an unmodifie
    var_sp1_thy_info,
    var_sp2_thy_info,
    hs_var_sp1_thy_info,
    hs_var_sp2_thy_info,
    mod_thy_info,
    vscnlvl_thy_save_fs,
    vscnlvl_ts_save_fs,
    scn_run_fs,
    scn_save_fs,
    pot_thresh,
    overwrite,
    update_guess,
    constraint_dct=None,
    zma_locs=(0, )):
    """ Run the scan for VTST calculations
    """

    # Set up the casscf options
    ref_zma = automol.zmatrix.set_values(ts_zma, {coord_name: grid1[0]})
    cas_kwargs = wfn.build_wfn(ref_zma, ts_info, ts_formula, high_mul,
                               rct_ichs, rct_info, active_space,
                               mod_var_scn_thy_info)

    # Run the scan along the reaction coordinate
    scan.multiref_rscan(ts_zma=ts_zma,
                        ts_info=ts_info,
                        grid1=grid1,
                        grid2=grid2,
                        coord_name=coord_name,
                        mod_var_scn_thy_info=mod_var_scn_thy_info,
                        vscnlvl_thy_save_fs=vscnlvl_thy_save_fs,
                        scn_run_fs=scn_run_fs,
                        scn_save_fs=scn_save_fs,
                        overwrite=overwrite,
                        update_guess=update_guess,
                        constraint_dct=constraint_dct,
                        **cas_kwargs)

    # Assess the potentials to see if there is a saddle point zma
    print('above vtst max')
    sadpt_zma = rxngrid.vtst_max(list(grid1) + list(grid2),
                                 coord_name,
                                 scn_save_fs,
                                 mod_var_scn_thy_info,
                                 constraint_dct,
                                 ethresh=pot_thresh)

    print('sadpt_zma', sadpt_zma)
    if sadpt_zma is None:
        # Calculate and the energies needed for inf sep ene
        far_locs = [[coord_name], [grid1[0]]]
        ts_zma = scn_save_fs[-1].file.zmatrix.read(far_locs)
        geo = scn_save_fs[-1].file.geometry.read(far_locs)

        geo_run_path = scn_run_fs[-1].path(far_locs)
        geo_save_path = scn_save_fs[-1].path(far_locs)

        _ = scan.radrad_inf_sep_ene(hs_info,
                                    ts_zma,
                                    rct_info,
                                    rcts_cnf_fs,
                                    var_sp1_thy_info,
                                    var_sp2_thy_info,
                                    hs_var_sp1_thy_info,
                                    hs_var_sp2_thy_info,
                                    geo,
                                    geo_run_path,
                                    geo_save_path,
                                    scn_save_fs,
                                    far_locs,
                                    overwrite=overwrite,
                                    **cas_kwargs)

        # Save the vmatrix for use in reading
        _save_traj(ts_zma,
                   frm_bnd_keys,
                   rcts_gra,
                   vscnlvl_ts_save_fs,
                   zma_locs=zma_locs)

        print('\nRunning Hessians and energies...')
        _vtst_hess_ene(ts_info, coord_name, mod_var_scn_thy_info,
                       mod_var_sp1_thy_info, scn_save_fs, scn_run_fs,
                       overwrite, **cas_kwargs)