alframework.builders.builders module
- TiAl_builder_task(moleculeid, target_num_atoms, min_distance, box_length_range)
Atomic system task that will be fed to the sampler.
- Args:
moleculeid (str): Unique identifier of the atomic system in the database. target_num_atoms (int): Targeted total number of atoms in the system. min_distance (float): Minimum absolute distance between any two atoms [Angstroms]. box_length_range (list): A list containing the minimum and maximum simulation box length [Angstroms].
- Returns:
(MoleculesObject): A MoleculesObject representing the system.
- atomic_system_builder(atom_charges, target_num_atoms, min_distance, box_length, 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 [Angstroms]. box_length (float): Length of the box [Angstroms] 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.
- atomic_system_task(moleculeid, atom_charges, target_num_atoms, min_distance, box_length_range)
Atomic system task that will be fed to the sampler.
- Args:
moleculeid (str): Unique identifier of the atomic system in the database. atom_charges (dict): A dictionary where the keys are the atom types in the system and the corresponding
values are 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 [Angstroms]. box_length_range (list): A list containing the minimum and maximum simulation box length [Angstroms].
- Returns:
(MoleculesObject): A MoleculesObject representing the system.
- condensed_phase_builder(start_system, molecule_library, solute_molecules=[], solvent_molecules=[], density=1.0, min_dist=1.2, max_patience=200, max_atoms=None, center_first_molecule=False, shake=0.05, early_stop_probability=0.0)[source]
Builder for condensed phase systems.
- Args:
start_system (MoleculesObject): An object from the class MoleculesObject. molecule_library (dict): Dictionary whose keys are the molecules present in the system and values are
ase.Atoms objects representing that molecule.
solute_molecules (list): List of the solute molecules. solvent_molecules (list or dict): List of dict storing the solvent molecules. If it is a dict, then the
keys are the molecules and the vales the relative probability of selecting that molecule.
density (float): Density of the system. min_dist (float): Minimum distance between atoms. max_patience (int): Number of max tries before giving up on a given system. max_atoms (int): Maximum number of atoms allowed. center_first_molecule (bool): If True the first molecules will be placed with no rotation nor translation. shake (float): Amount of random perturbation added to each molecule on the x-, y-, z-axes independently. early_stop_probability (float): After successfully adding a molecule, prabability of stopping. For generating more smaller systems.
- Returns:
(MoleculesObject): An updated MoleculesObject representing the 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.
- readMolFiles(molecule_sample_path)[source]
Reads MOL files.
- Args:
molecule_sample_path (str): Path of the directory that stores the MOL files to be read.
- Returns:
(tuple): Tuple (moldict, mols) where the first element stores the MOL files as a dict and the second as a list.
- simple_cfg_loader_task(moleculeid, builder_config, shake=0.05)
Loads an atomic configuration from cfg file to be used by the sampler.
- Args:
moleculeid (str): System unique identifier in the database. builder_config (dict): Dictionary containing the builder parameters. shake (float): Amount of random pertubation added to each atom coordinate.
- Returns:
(MoleculesObject): A MoleculesObject representing the system.
- simple_condensed_phase_builder_task(moleculeid, builder_config, molecule_library_dir, cell_range, solute_molecule_options, Rrange)
Condensed phase builder task that will be fed to the sampler.
- Args:
moleculeid (str): String that uniquely identifies a system in the database. builder_config (dict): Dictionary that stores the config parameters of the builder. molecule_library_dir (str): Path of the molecule library directory. cell_range (list): A (3,2) list with the x, y, and z ranges for the cell size [min, max]. solute_molecule_options (list): List of lists detailing sets of solutes. Rrange (list): Density range [density_min, density_max].
- Returns:
(MoleculesObject): A MoleculesObject representing the system.
- simple_multi_condensed_phase_builder_task(moleculeids, builder_config, molecule_library_dir, cell_range, solute_molecule_options, Rrange)
Multi condensed phase builder task that will be fed to the sampler.
- Args:
moleculeids (str): List of strings that uniquely identifies a system in the database. builder_config (dict): Dictionary that stores the config parameters of the builder. molecule_library_dir (str): Path of the molecule library directory. cell_range (list): A (3,2) list with the x, y, and z ranges for the cell size [min, max]. solute_molecule_options (list): List of lists detailing sets of solutes. Rrange (list): Density range [density_min, density_max].
- Returns:
(list): A list of objects from MoleculesObject.
- 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.