Geometry Tools

Module for tools pertaining to geometry of atoms and cells.

clease.geometry.cell_wall_distances(cell: ndarray) ndarray[source]

Get the distances from each cell wall to the opposite cell wall of the cell. Returns the distances in the order of the distances between the (b, c), (a, c) and (a, b) planes, such that the shorest vector corresponds to being limited by the a, b or c vector, respectively.

Parameters:

cell (np.ndarray) – A (3 x 3) matrix which defines the cell parameters. Raises a ValueError if the cell shape is wrong.

Returns:

The distance to each of the three cell walls.

Return type:

np.ndarray

clease.geometry.max_sphere_dia_in_cell(cell: ndarray) float[source]

Find the diameter of the largest possible sphere which can be placed inside a cell.

For example, how large of a Death Star could be built inside a given atoms object?

Parameters:

cell (np.ndarray) – A (3 x 3) matrix which defines the cell parameters. Raises a ValueError if the cell shape is wrong.

Returns:

The diameter of the largest sphere which can fit within the cell.

Return type:

float

clease.geometry.supercell_which_contains_sphere(atoms: Atoms, diameter: float) Atoms[source]

Find the smallest supercell of an atoms object which can contain a sphere, using only repetitions of (nx, ny, nz) (i.e. a diagonal P matrix).

The number of repetitions is stored in the info dictionary of the supercell under the “repeats” keyword, i.e. sc.info[“repeats”] is the number of times the supercell was repeated.

Parameters:
  • atoms (Atoms) – The atoms object to be enlarged.

  • diameter (float) – The diameter of the sphere which should be contained within the supercell.

Returns:

The supercell which can contain a sphere of the given diameter.

Return type:

Atoms