Usage#

Installation#

To use Atomaton, first install it using pip:

(.venv) $ pip install atomaton

Analyzer: atomaton.analyze#

atomaton.analyze.bin_data(data, std_dev_tol=1, max_bins=20)#
atomaton.analyze.create_extended_cell(atoms)#

Creates a 3x3x3 supercell of atoms, along with pseudo indicies of the new atoms which matches the index of the original atom.

N.B. this can be done natively by ase using ase.build.cut or ase.build.make_supercell, and I have a wrapper for the first function in build_structure.py. Would just need to make the pseudo_indicies list, which is trivial. Still, this was fun to write and is fast enough, so I’m leaving it, but could get a perfromance boost out of the (complied in C?) ase functions. Also, the built in functions modify the cell parameters, so these would need to be reset.

Args:

atoms (Atoms): ase Atoms object with cell parameters.

Returns:

Atoms: ase Atoms object with the atoms of the 3x3x3 cell, but the original cell parameters list[int]: index of the atom corresponding to the original unit cell

atomaton.analyze.create_extended_cell_minimal(atoms, max_bond_length=5.0)#

Creates a minimally extended cell to speed up O(N^2) bond check. This functions is O(N).

Args:

atoms (Atoms): Atoms object with cell parameters max_bond_length (float, optional): Maximum possible bond length, used to determine degree to which cell is extended. Defaults to 5.0.

Raises:

TypeError: max_bond_length must be a single value, or dictionary of bond cutoffs. ValueError: max_bond_length must be less than half the length of the shortes unit cell dimension.

Returns:

Atoms: minimally extended cell

atomaton.analyze.get_angle_properties(atoms, all_angles, all_angle_types)#
atomaton.analyze.get_bond_properties(atoms, bonds, bond_types)#
atomaton.analyze.get_bonds_on_atom(atoms, bonds)#

Gets a list of number of bonds, bond indicies, and bond types for all atoms.

Args:

atoms (Atoms): Collection of atoms bonds (list[list[int, int]]): List of bonds for that atom set

Returns:

Dict[int: int]: _description_ Dict[int: List[int, int]]: _description_ Dict[int: List[str, str]]: _description_

atomaton.analyze.guess_angles(atoms, bonds, bonds_alt)#
atomaton.analyze.guess_bonds(atoms, cutoffs={'default': [0, 1.5]})#

Finds the bonds in a cell of atoms, as defined by the cutoffs dict.

Args:

atoms (Atoms): Atoms object with cell parameters. cutoffs (dict, optional): Dictionary of bond cutoffs. Keys must match atom types, separated by a -, in alphabetically order. Defaults to {“default”: [0, 1.5]}.

Returns:

list[list[int, int]]: list of bonds, by sorted atom index. list[list[str, str]]: list of bond types, sorted alphabetically by atom type. list[list[int, int]]: list of bonds which cross the cell boundary, by sorted orignal atom index. Atoms: list of atoms outside of the cell which are part of bonds crossing the cell. list[list[int, int]]: list of bonds which cross the cell boundary, using the extended atoms index.

atomaton.analyze.guess_dihedrals_and_impropers(atoms_in, bonds, bonds_alt, angles, angles_alt, improper_tol=0.1)#
atomaton.analyze.remove_atoms_outside_cell(atoms, cell_lengths)#
atomaton.analyze.remove_duplicate_atoms(atoms, tol=0.1)#
atomaton.analyze.split_by_property(type_indicies, values, tol=5)#
atomaton.analyze.wrap_atoms_outside_cell(atoms, cell_lengths)#