Shells¶
- class MagInt.Shells.shells(general_par, filename=None, interacting_types=None, interact_sites=None, interact_basis=None, max_n_shells=3, print_vecs='Translation', R_arr=None, R_arr_site=None, R_arr_origin=None, run_only=False, calc_all_sites=False)¶
Initialize the class for analyzing interacting shells in various DFT software outputs.
- __init__(general_par, filename=None, interacting_types=None, interact_sites=None, interact_basis=None, max_n_shells=3, print_vecs='Translation', R_arr=None, R_arr_site=None, R_arr_origin=None, run_only=False, calc_all_sites=False)¶
Initialize the class for analyzing interacting shells in various DFT software outputs.
Parameters:¶
- general_pardict
General parameters dictionary containing:
‘dft_exec’ (str): Specifies the DFT software (‘Wien2k’, ‘Vasp’, etc.).
‘verbosity’ (int): Specifies the verbosity level.
- ‘tol_shells’ (int): tollerance N for vectors length difference 10^(-N)
in sorting them between coordination shells
- filenamestr, optional
File name for the data. Defaults to None.
- interacting_typeslist, optional
List of two atom types that are interacting. Defaults to None.
- interact_siteslist, optional
List of interacting sites. Defaults to None.
- interact_basislist, optional
Basis for the interaction. Defaults to None.
- max_n_shellsint, optional
Maximum number of shells to consider. Defaults to 3.
- R_arrlist, optional
Custom array of interaction vectors. Defaults to None.
- R_arr_sitelist, optional
Sites associated with R_arr. Defaults to None.
- R_arr_originlist, optional
Origin points for R_arr. Defaults to None.
- calc_all_sitesbool
True: lattice vectors connecting all sites of given types are calculated False : only lattice vectors connecting the representative sites with all other sites are calculated
Notes:¶
This method initializes the class based on the DFT software specified in general_par[‘dft_exec’]. Currently supported DFT software are ‘Wien2k’ and ‘Vasp’. Support for ‘QuantumEspresso’ may be added in the future.
- calc_d_origin(verbosity=1)¶
Computes the minimal connecting vectors between the interaction sites of two atoms.
- Parameters:
verbosity (int, optional) – Determines the amount of output information. Higher values produce more verbose output. Default value is 1.
- Returns:
d_origin – A dictionary storing minimal connecting vectors between interaction sites for the specified atom pairs. Keys are tuples in the form (atom_type1, site1, atom_type2, site2), and the corresponding values are the minimal connecting vectors. This dictionary is also set as an attribute of the object.
- Return type:
dict
Notes
The function uses R_arr_set to determine if lattice vectors have been read from an output file. If not, R_origins are assumed to be [0,0,0]. The function also uses the method __shift_vec_ to correct for vectors crossing periodic boundaries.
- find_nn(max_n_shells, direct, tol)¶
Finds the nearest neighbors, next nearest neighbors, and so on from the POSCAR file in VASP or case.outputnn in Wien2k. It also initializes the structural data necessary for MagInt.
- Parameters:
max_n_shells (int) – Maximum number of shells to be considered when finding neighbors.
direct (bool) – If True, returns the basis vector. If False, returns the dot product of the a_brav.T matrix and the basis vector.
- Returns:
nshells (int) – Number of shells found.
R_shell (list of floats) – Sorted list of unique distances, indicating the radial distances for each shell.
R_vec (dict) – Dictionary mapping each shell and coordinate number to the corresponding vector. The keys are strings in the format “nshell_coorNum”.
R_site (dict) – Dictionary similar to R_vec, but the values are initialized to 0.
coor_num (list of ints) – A list indicating the coordination number for each shell.
Notes
The function uses the atom_list attribute to determine if only one atom type is present. It employs a brute-force approach, computing distances for all possible shell combinations up to max_n_shells, and then sorts and filters the results to extract the relevant shells and coordination numbers.