def ads_av(self, atoms=None): """Function that takes an atoms objects and returns a fingerprint vector with averages of the atomic properties of the adsorbate. Parameters ---------- atoms : object ASE Atoms object. Returns ---------- features : list If None was passed, the elements are strings, naming the feature. """ ads_params = default_params + ['econf', 'ionenergies'] labels = make_labels(ads_params, '', '_ads_av') labels.append('ground_state_magmom_ads_av') if atoms is None: return labels else: numbers = [atoms[j].number for j in atoms.subsets['ads_atoms']] dat = list_mendeleev_params(numbers, params=ads_params) result = list(np.nanmean(dat, axis=0)) result += [np.nanmean([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result
def term(self, atoms=None): """Return a fingerprint vector with propeties averaged over the termination atoms. Parameters ---------- atoms : object """ labels = make_labels(self.slab_params, '', '_term') labels.append('ground_state_magmom_term') if atoms is None: return labels else: if ('key_value_pairs' in atoms.info and 'term' in atoms.info['key_value_pairs']): term = atoms.info['key_value_pairs']['term'] numbers = [atomic_numbers[s] for s in string2symbols(term)] elif 'termination_atoms' in atoms.subsets: term = atoms.subsets['termination_atoms'] numbers = atoms.numbers[term] else: raise NotImplementedError("termination fingerprint.") dat = list_mendeleev_params(numbers, params=self.slab_params) result = list(np.nanmean(dat, axis=0)) result += [np.nanmean([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result
def mean_surf_ligands(self, atoms=None): """Function that takes an atoms objects and returns a fingerprint vector containing the count of nearest neighbors and properties of the nearest neighbors. Parameters ---------- atoms : object ASE Atoms object. Returns ---------- features : list If None was passed, the elements are strings, naming the feature. """ labels = ['nn_surf_ligands', 'identnn_surf_ligands'] labels += make_labels(self.slab_params, '', '_surf_ligands') labels.append('ground_state_magmom_surf_ligands') if atoms is None: return labels else: ligand_atoms = atoms.subsets['ligand_atoms'] numbers = atoms.numbers[ligand_atoms] # Import CatLearn data on that element. dat = list_mendeleev_params(numbers, params=self.slab_params) result = list(np.nanmean(dat, axis=0)) result += [np.nanmean([gs_magmom[z] for z in numbers])] # Append count of ligand atoms. result = [len(ligand_atoms), len(np.unique(numbers))] + result check_labels(labels, result, atoms) return result
def sum_site(self, atoms=None): """Function that takes an atoms objects and returns a fingerprint vector with properties summed over the surface metal atoms closest to an add atom. Parameters ---------- atoms : object ASE Atoms object. Returns ---------- features : list If None was passed, the elements are strings, naming the feature. """ labels = make_labels(self.slab_params, '', '_site_sum') labels.append('ground_state_magmom_site_sum') if atoms is None: return labels else: numbers = [atoms[j].number for j in atoms.subsets['site_atoms']] dat = list_mendeleev_params(numbers, params=self.slab_params) result = list(np.nansum(dat, axis=0)) result += [np.nansum([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result
def mean_chemisorbed_atoms(self, atoms=None): """Function that takes an atoms objects and returns a fingerprint vector containing properties of the closest add atom to a surface metal atom. Parameters ---------- atoms : object ASE Atoms object. Returns ---------- features : list If None was passed, the elements are strings, naming the feature. """ extra_ads_params = ['atomic_radius', 'heat_of_formation', 'oxistates', 'block', 'econf', 'ionenergies'] labels = make_labels(default_params + extra_ads_params, '', '_ads1') labels.append('ground_state_magmom_ads1') if atoms is None: return labels else: # Get atomic number of alpha adsorbate atom. chemisorbed_atoms = atoms.subsets['chemisorbed_atoms'] numbers = atoms.numbers[chemisorbed_atoms] # Import CatLearn data on that element. dat = list_mendeleev_params(numbers, params=default_params + extra_ads_params) result = list(np.nanmean(dat, axis=0)) result += [np.nanmean([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result
def bulk(self, atoms=None): """Return a fingerprint vector with propeties averaged over the bulk atoms. Parameters ---------- atoms : object ASE Atoms object. Returns ---------- features : list If None was passed, the elements are strings, naming the feature. """ labels = make_labels(self.slab_params, '', '_bulk') labels.append('ground_state_magmom_bulk') if atoms is None: return labels else: if ('key_value_pairs' in atoms.info and 'bulk' in atoms.info['key_value_pairs']): bulk = atoms.info['key_value_pairs']['bulk'] numbers = [atomic_numbers[s] for s in string2symbols(bulk)] elif 'bulk_atoms' in atoms.subsets: bulk = atoms.subsets['bulk_atoms'] numbers = atoms.numbers[bulk] else: raise NotImplementedError("bulk fingerprint.") dat = list_mendeleev_params(numbers, params=self.slab_params) result = list(np.nanmean(dat, axis=0)) result += [np.nanmean([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result
def median_site(self, atoms=None): """Function that takes an atoms objects and returns a fingerprint vector with properties averaged over the surface metal atoms closest to an add atom. Parameters ---------- atoms : object """ labels = make_labels(self.slab_params, '', '_site_med') labels.append('ground_state_magmom_site_med') if atoms is None: return labels else: numbers = [atoms[j].number for j in atoms.subsets['site_atoms']] dat = list_mendeleev_params(numbers, params=self.slab_params) result = list(np.nanmedian(dat, axis=0)) result += [np.nanmedian([gs_magmom[z] for z in numbers])] check_labels(labels, result, atoms) return result