porems.matrix.
Matrix
(bonds)¶The aim of this class is preserving all information of the grid bonds.
Although the search can be parallelized, still multiple iterations are needed to cover the surface preparations. Additionally, due to machine inaccuracy there is the risk of bonds not being detected as such, leading to artefacts. Also, it is not possible to ensure that all bonds were found when deleting atoms, because all systems are shaped differently. Therefore, another optimization, or rather supporting algorithm, was implemented to bypass these issues.
The idea was reducing the number of iterations to a single search by creating a connectivity matrix of all grid atoms. The result is a dictionary that has atoms \(1\dots n\) as keys and their corresponding value is a list of bonded atoms \(1\dots m\)
Using this implementation, it is no longer required to physically delete atoms when carving out a structure, it is enough to remove binding partners from the matrix. For example, conditions for the surface preparation only need to consider the number of bonds remaining in each entry and thereby determine whether an atom needs to be removed or not, resulting into a negligible computational effort scaling linear with the number of atoms
Parameters: |
|
---|
Management
add (self, atom_a, atom_b) |
Add atom between given atom ids. |
bound (self, num_bonds[, logic]) |
Return a list of atoms with the specified number of bonds. |
split (self, atom_a, atom_b) |
Remove the bond between two atoms from the connectivity matrix. |
strip (self, atoms) |
Remove all bonds of a specified atom from the connection matrix. |
Getter Methods
get_matrix (self) |
Return the connectivity matrix. |