alframework.builders.moltensalt_builder module
- atomic_system_builder(atom_charges, target_num_atoms, min_distance, box_length_range, max_tries=25, scale_coords=False)[source]
Builds the atomic system
- Args:
- atom_charges (dict): A dictionary where the keys are the atom types in the system and the corresponding values
the charge of each atom type.
target_num_atoms (int): Targeted total number of atoms in the system. min_distance (float): Minimum absolute distance between any two atoms in Angstroms. box_length_range (list): A list containing the minimum and maximum simulation box length [L_min, L_max]. max_tries (int): Maximum number of cycles in the atom placing algorithm scale_coords (bool): Determines whether to scale the coordinates by the box length or not.
- Returns:
(ase.Atoms): ASE atoms object representing a random configuration of the atomic system.
- construct_simulation_box(atomic_system, min_distance, box_length=None, density=None, scale_coords=True, max_iter=30, max_tries=25)[source]
Constructs a initial configuration for the given atomic system respecting the imposed constraints.
Given a dictionary containing the atomic species and their charges, a random configuration of the system is constructed respecting the constraints (desired density (g/cm^3), box length, minimum distance between atoms). The atoms are randomly placed in the simulation box.
- Args:
- atomic_system (dict): A dictionary where the keys are the atom types and the values the corresponding number
of this atom type to be placed in the box.
min_distance (float): Minimum absolute distance between any two atoms in Angstroms. box_length (float): Length of the cubic box. density (float): Density of the atomic system in g/cm^3. scale_coords (bool): Scales distances by the box length such that all coordinates are now between [0,1]. max_iter (int): Maximum number of tries to place an atom in a specific grid. max_tries (int): Maximum number of tries to rerun the algorithm and try to fit the atoms that are missing to
reach the desired number of atoms.
- Returns:
(ndarray): A (N,3) array where ‘N’ is the total number of atoms in the system.
- create_atomic_system(atom_charges, target_num_atoms)[source]
Create a neutral atomic system.
Sometimes it will be impossible to have the exact number ‘taget_num_atoms’ in the system due to the random way in which the atoms were chosen. This isn’t a problem because the box volume can be adjusted to yield the desired density.
- Args:
atom_charges (dict): Contains the atom type as key and its valence as values. target_num_atoms (int): Targeted number of atoms to have in the system.
- Returns:
- (dict): A dictionary where the keys are the atom types in the system and the corresponding values the number of
each atom type in the system.
- to_mic(r_ij, box_length)[source]
Impose minimum image convention (MIC) on the array containing the distances between atoms.
- Args:
r_ij (ndarray): A (n_atoms, 3) matrix r_ij = r_i - r, or a (n_atoms, n_atoms, 3) array containing all r_i - r. box_length (float): Length of cubic cell.
- Returns:
(ndarray): Distances under MIC