npl.utils package

Submodules

npl.utils.cutting_plane_utilities module

class npl.utils.cutting_plane_utilities.CuttingPlane(anchor, normal)[source]

Bases: object

Class that represents a cutting plane via an anchor point and a normal.

split_atom_indices(atoms)[source]

Split the given atoms into the positive and negative subspace of the plane.

Return numpy arrays of type boolean that are True if the atom with the corresponding index lays within the respective subspace.

Parameters:

atoms : Atoms

class npl.utils.cutting_plane_utilities.SphericalCuttingPlaneGenerator(max_radius, min_radius=0.0, center=0.0, normal_dir='parallel')[source]

Bases: object

Class that generates cutting planes with a spherical anchor point distribution.

The normal can be either parallel to the anchor point or point in a random direction. The former results in cuts that mainly affect the surface whereas the latter results in completely random cuts.

generate_new_cutting_plane()[source]

Generate a cutting plane by randomly choosing a normal and an anchor point.

set_center(center)[source]

Center around the anchor points will be distributed.

Parameters:

center : np.array of shape (3)

set_max_radius(max_radius)[source]

Radius of the distribution where anchor point can be generated.

Parameters:

max_radius : float

npl.utils.math_modules module

npl.utils.math_modules.find_middle_point(positions)[source]
npl.utils.math_modules.get_atom_position(atom)[source]
npl.utils.math_modules.get_bridge_perpendicular_line(positions, center_of_mass)[source]
npl.utils.math_modules.get_dot_product(v1, v2)[source]
npl.utils.math_modules.get_normal_vector(positions)[source]
npl.utils.math_modules.get_perpendicular_edge_vector(position, tolerance=0.0001)[source]
npl.utils.math_modules.get_perpendicular_vector(v, tolerance=0.0001)[source]
npl.utils.math_modules.get_plane(positions)[source]
npl.utils.math_modules.get_unit_vector(position)[source]

npl.utils.utils module

npl.utils.utils.get_crystalline_structure(atoms: Atoms, surrogate_metal: str = 'Cu') Atoms[source]

Module contents