ai4materials.utils.utils_binaries module¶
-
ai4materials.utils.utils_binaries.
get_binaries_dict_delta_e
(chemical_formula_list, energy_list, label_list, equiv_spgroups)[source]¶
-
ai4materials.utils.utils_binaries.
get_energy_diff_by_spacegroup
(ase_atoms_list, target='energy_total', equiv_spgroups=None)[source]¶
-
ai4materials.utils.utils_binaries.
get_target_diff_dic
(df, sample_key=None, energy=None, spacegroup=None)[source]¶ Get a dictionary of dictionaries: samples -> space group tuples -> energy differences.
Dropping all rows which do not correspond to the minimum energy per sample AND space group, then making a new data frame with space groups as columns. Finally constructing the dictionary of dictionaries.
Parameters:
- df: pandas data frame
- with columns=[samples_title, energies_title, SG_title]
- sample_key: string
- Needs to be column title of samples of input df
- energy: string
- Needs to be column title of energies of input df
- spacegroup : string
- Needs to be column title of space groups of input df
Returns:
- dic_out: dictionary of dictionaries:
- In the form: { sample_a: { (SG_1,SG_2):E_diff_a12, (SG_1,SG_3):E_diff_a13,…}, sample_b: { (SG_1,SG_2):E_diff_b12, (SG_1,SG_3):E_diff_b13,… }, … } E_diff_a12 = energy_SG_1 - energy_SG_2 of sample a. Both (SG_1,SG_2) and (SG_2,SG_1) are considered. If SG_1 or SG_2 is NaN, energy difference to it is ignored.
-
ai4materials.utils.utils_binaries.
select_diff_from_dic
(dic, spacegroup_tuples, sample_key='Mat', drop_nan=None)[source]¶ Get data frame of selected spacegroup_tuples from dictionary of dictionaries.
Creating a pandas data frame with columns of samples and selected space group tuples (energy differnces).
Parameters:
dic: dict {samples -> space group tuples -> energy differences.}
- spacegroup_tuples: tuple, list of tuples, tuples of tuples
- Each tuple has to contain two space groups numbers, to be looked up in the input dic.
- sample_key: string
- Will be the column title of the samples of the created data frame
- drop_nan: string, optional {‘rows’, ‘SG_tuples’}
- Drops all rows or columns (SG_tuples) containing NaN.