alframework.tools.molecules_class module
- class MoleculesObject(atoms, moleculeid)[source]
Bases:
objectClass to create molecule objects
- append_atoms(new_atoms)[source]
Append atoms to the existing atomic system.
- Args:
new_atoms (ase.Atoms): ase.Atoms object to append to the current system.
- check_convergence()[source]
True if converged, False otherwise, and None if no QM calculation was performed yet
- get_system_signature()[source]
Returns the system signature as a string.
- Returns:
(str): String representing the system cell and the atoms types and coordinates.
- #TODO: Compute system moments of inertia and rotate the system so that the highest order moment points along
the x-axis, midde moment point along y-axis and last moment points along z-axis.
- set_converged_flag(convergence_flag)[source]
Set the convergence flag.
- Args:
convergence_flag (bool): Bool indicating whether the calculation converged or not.
- store_results(results, replace=True)[source]
Stores the QM results
- Args:
results (dict): Dictionary containing the results of the QM calculations that we wish to store replace (bool): If True completely update self.qm_results including values of common keys, but if False only
the keys in ‘results’ that doesn’t exist in self.qm_results are added.
- update_atoms(new_atoms)[source]
Update the atoms attribute
This is necessary because when running MLMD we may find a new configuration of the system that the NNs disagree. Thus, we want to store this configuration to run QM. When we update to None it means that there was no configuration during the MLMD in which the ensemble of NNs disagreed.
- Args:
new_atoms (ase.Atoms): Atoms object representing the new configuration or system.
- update_metadata(new_metadata, replace=True)[source]
Updates the object metadata
- Args:
new_metadata (dict): New metadata to be added. replace (bool): If True completely update self.metadata including values of common keys, but if False only
the keys in ‘new_metadata’ that doesn’t exist in self.metadata are added.
- compare_chemical_composition(system1, system2)[source]
Check if two MoleculesObject instances have the same chemical composition
- Args:
system1 (MoleculesObject): First object to be compared. system2 (MoleculesObject): Second object to be compared.
- Returns:
(bool): True if the two systems have the same chemical composition.