Example #1
0
    def get_barrier_all(self) -> Dict[str, Dict[str, str]]:
        ''' Get barrier heights for all rxn_names and facetpaths

        Returns
        -------
        ts_ener : Dict[str,Dict[str,str]]
            a dictionary with all barrier heights (kj/mol)
            in a format like below

            >>> ts_ener = {'Cu_111_OH_O+H':
                    {'TS_00': '155.27', 'TS_01': '157.97'}}

        '''
        ts_ener = {}
        for facetpath, slab_path in zip(self.facetpaths, self.slab_paths):
            minima_path = os.path.join(facetpath, 'minima')
            for rxn in self.reactions:
                r_name_list, p_name_list = IO.get_reactants_and_products(rxn)
                rxn_name = IO.get_rxn_name(rxn)
                ts_path = os.path.join(self.current_dir, facetpath, rxn_name,
                                       'TS_estimate_unique')
                ts_ener[facetpath + '_' + rxn_name] = self.get_barrier(
                    minima_path, ts_path, facetpath, r_name_list, p_name_list,
                    slab_path)
        return ts_ener
Example #2
0
File: ts.py Project: zadorlab/pynta
    def prepare_ts_estimate(self, rxn: Dict[str, str], scfactor: float,
                            scfactor_surface: float, pytemplate_xtb: str,
                            species_list: List[str],
                            reacting_atoms: Dict[str, int], metal_atom: str,
                            scaled1: bool, scaled2: bool) -> None:
        ''' Prepare TS estimates for subsequent xTB calculations

        Parameters
        ___________

        rxn : dict(yaml[str:str])
            a dictionary with info about the paricular reaction. This can be
            view as a splitted many reaction .yaml file to a single reaction
            .yaml file
        scfator : float
            a scaling factor to scale a bond distance between
            atoms taking part in the reaction
            e.g. 1.4
        scfactor_surface : float
            a scaling factor to scale the target bond distance, i.e.
            the average distance between adsorbed atom and the nearest
            surface atom. Helpful e.g. when H is far away form the surface
            in TS, whereas for minima it is close to the surface
            e.g. 1.0
        pytemplate_xtb : python script
            a template file for penalty function minimization job
        species_list : List[str]
            a list of species which atoms take part in the reaction,
            i.e. for ['CO2'] ['C'] is taking part in reaction
            e.g. ['O', 'H'] or ['CO2', 'H']
        reacting_atoms : Dict[str, int]
            keys are sybols of atoms that takes part in reaction whereas,
            values are their indicies
        metal_atom : str
            a checmical symbol for the surface atoms (only metallic surfaces
            are allowed)
        scaled1 : bool
            specify whether use the optional scfactor_surface
            for the species 1 (sp1)
        scaled2 : bool
            specify whether use the optional scfactor_surface
            for the species 2 (sp2)

        '''
        r_name_list, p_name_list = IO.get_reactants_and_products(rxn)
        rxn_name = IO.get_rxn_name(rxn)

        ts_estimate_path = os.path.join(self.creation_dir, self.facetpath,
                                        rxn_name, self.ts_estimate_dir)

        self.TS_placer(ts_estimate_path, scfactor, rxn, rxn_name, r_name_list,
                       p_name_list, reacting_atoms)

        self.filtered_out_equiv_ts_estimates(ts_estimate_path, rxn_name)

        self.set_up_penalty_xtb(ts_estimate_path, pytemplate_xtb, species_list,
                                reacting_atoms, metal_atom, scaled1,
                                scfactor_surface)
Example #3
0
    def get_reaction_energies_all(self) -> None:
        ''' Get reactiom energy (kj/mol) for all facetpaths and reactions

        Returns
        -------
        reaction_energies : Dict[str:float]
            a dictionary with reaction energies for a given facetpath and
            rxn_name, e.g.

            >>> reaction_energies = {'Cu_111_OH_O+H': 70.81}

        '''
        reaction_energies = {}
        for facetpath, slab_path in zip(self.facetpaths, self.slab_paths):
            minima_path = os.path.join(facetpath, 'minima')
            for rxn in self.reactions:
                r_name_list, p_name_list = IO.get_reactants_and_products(rxn)
                rxn_name = IO.get_rxn_name(rxn)
                key = facetpath + '_' + rxn_name
                reaction_energies[key] = float(
                    self.get_reaction_energy(minima_path, facetpath,
                                             r_name_list, p_name_list,
                                             slab_path))
        return reaction_energies