atomman package

Submodules

Classes

Functions and attributes

atomman.build_lammps_potential(pair_style: str, **kwargs)

Wrapper function for the PotentialLAMMPSBuilder subclasses.

Parameters:
  • pair_style (str) – The LAMMPS pair_style setting associated with the potential.

  • **kwargs (any) – Any keyword parameters supported by PotentialLAMMPSBuilder and the subclass that matches the pair_style.

atomman.displacement(system_0, system_1, box_reference: str = 'final') ndarray

Compute the displacement vectors between all matching atoms for two systems.

Parameters:
  • system_0 (atomman.System) – The initial system to calculate displacements from.

  • system_1 (atomman.System) – The final system to calculate displacements to.

  • box_reference (str or None) – Specifies which system’s boundary conditions to use. ‘initial’ uses system_0’s box and pbc. ‘final’ uses system_1’s box and pbc (Default) None computes the straight difference between the positions without accounting for periodic boundaries.

Returns:

The displacement vectors for all atoms.

Return type:

numpy.ndarray

Raises:

ValueError – If the systems have different numbers of atoms or for invalid box_reference values.

atomman.dmag()

Computes the shortest distance between pos_0 and pos_1 using box dimensions and accounting for periodic boundaries.

Parameters:
  • pos_0 (numpy.ndarray, list, or tuple) – Absolute Cartesian vector position(s) to use as reference point(s).

  • pos_1 (numpy.ndarray, list, or tuple) – Absolute Cartesian vector position(s) to find relative to pos_0.

  • box (atomman.Box) – Defines the system/box dimensions

  • pbc (list, tuple, or numpy.ndarray of bool.) – Three Boolean values indicating which of the three box vectors are periodic (True means periodic).

Returns:

The shortest vector magnitude from each pos_0 to pos_1 positions.

Return type:

numpy.ndarray

atomman.dump(style, system, **kwargs)

Convert a System to another format.

Parameters:
  • style (str) – Indicates the format of the content to dump the atomman.System as.

  • system (atomman.System) – The system to convert.

  • kwargs (any, optional) – Any extra keyword arguments to pass to the underlying dump methods.

Returns:

Any content returned by the underlying dump methods.

Return type:

str, object or tuple

atomman.dvect()

Computes the shortest vector between pos_0 and pos_1 using box dimensions and accounting for periodic boundaries.

Parameters:
  • pos_0 (numpy.ndarray, list, or tuple) – Absolute Cartesian vector position(s) to use as reference point(s).

  • pos_1 (numpy.ndarray, list, or tuple) – Absolute Cartesian vector position(s) to find relative to pos_0.

  • box (atomman.Box) – Defines the system/box dimensions

  • pbc (list, tuple, or numpy.ndarray of bool.) – Three Boolean values indicating which of the three box vectors are periodic (True means periodic).

Returns:

The shortest vectors from each pos_0 to pos_1 positions.

Return type:

numpy.ndarray

atomman.load(style, *args, **kwargs)

Load a System from another format.

Parameters:
  • style (str) – Indicates the format of the content to load as an atomman.System

  • args – Any positional-dependent arguments to pass to the underlying load methods.

  • kwargs – Any keyword arguments to pass to the underlying load methods.

Returns:

system – The system object associated with the data model.

Return type:

atomman.System

atomman.nlist()

Calculates a neighbor list for all atoms in a System taking periodic boundaries into account.

Parameters:
  • system (atomman.System) – The system to calculate the neighbor list for.

  • cutoff (float) – Radial cutoff distance for identifying neighbors.

  • initialsize (int, optional) – The number of neighbor positions to initially assign to each atom. Default value is 20.

  • deltasize (int, optional) – Specifies the number of extra neighbor positions to allow each atom when the number of neighbors exceeds the underlying array size. Default value is 10.

Returns:

Array listing number of neighbors and neighbor ids for each atom in System. First term in each row is the atom’s coordination number, c. The next c values are the atom’s neighbor ids.

Return type:

numpy.ndarray of int