trajectory

Module for Configuration and related classes

class MDMC.trajectory_analysis.trajectory.AtomCollection[source]

Base class for Configurations

property dimensions: ndarray

Get the dimensions of the Universe in which the AtomCollection exists

Returns:

array – The dimensions of the Universe

Return type:

numpy.ndarray

property universe: Universe | None

Get or set the Universe in which the AtomCollection exists

Returns:

The Universe in which the AtomCollection exists, or None if it has not been set

Return type:

Universe

class MDMC.trajectory_analysis.trajectory.Configuration(*structures: Structure, **settings: dict)[source]

A Configuration stores Atom objects and their positions and velocities

Parameters:
  • *structures – Zero or more Structure objects to be added to the Configuration

  • **settings

    universe (Universe)

    The Universe of the Configuration

element_set

set of the elements in the Configuration

Type:

set

universe
Type:

Universe or None

data
Type:

*structures

add_structure(structures: Structure) None[source]

Adds the Atom objects from a Structure to the data

Parameters:

structures (Structure) – The Structure to add

property atom_positions: list

Get the list of Atom.position which belong to the Configuration

Returns:

A list of Atom.position

Return type:

list

property atom_velocities: list

Get the list of Atom.velocity which belong to the Configuration

Returns:

A list of ``Atom.velocity`

Return type:

list

property atoms: list[Atom]

Get the list of Atom which belong to the Configuration

Returns:

A list of Atom

Return type:

list

property data: ndarray

Get or set the Atom, Atom.position, and Atom.velocity which belong to the Configuration

Returns:

A structured NumPy array with 'atom', 'position', and 'velocity' fields

Return type:

numpy.ndarray

property element_list: list

Get the list of Atom.element.symbol which belong to the Configuration

Returns:

A list of str for the elements

Return type:

list

filter_atoms(predicate: function) list[Atom][source]

Filters the list of Atom using the predicate

Parameters:

predicate (function) – A function which returns a bool when passed an Atom

Returns:

A list of Atom which are True for the given predicate

Return type:

list

filter_by_element(element: str) list[Atom][source]

Filter the Configuration using an element

Parameters:

element (str) – An elemental symbol of the same format as is used for creating Atom objects

Returns:

A list of Atom of the specified element

Return type:

list

filter_structures(predicate: function) list[Structure][source]

Filters the list of Structures using the predicate

Parameters:

predicate (function) – A function which returns a bool when passed a Structure

Returns:

A list of Structures which are True for the given predicate

Return type:

list

property molecule_list: list[Molecule]

Get the list of Molecule which belong to the Configuration

Returns:

A list of Molecule

Return type:

list

scale(factor: float, vectors: str = 'positions') None[source]

Scales either atom_positions or atom_velocities by a factor

Parameters:
  • factor (float) – Factor by which the vector is scaled

  • vectors (str, optional) – 'positions' (default) or 'velocities'

Raises:

NotImplementedError – THIS IS NOT IMPEMENTED

property structure_list: list[Structure]

Get the list of Structure which belong to the Configuration

Returns:

A list of Structure

Return type:

list

validate_structure(structure: Structure) None[source]

Validates the structure by testing that it belongs to the same Universe as the Configuration

Parameters:

structure (Structure) – The Structure to validate

Raises:

AssertionError – If the Structure does not belong to the same Universe as the Configuration

class MDMC.trajectory_analysis.trajectory.TemporalConfiguration(time: float, *structures: Structure, **settings: dict)[source]

A configuration which has a time associated with it

Parameters:
  • time (float) – The time of the TemporalConfiguration in fs

  • *structure_units – Zero or more Structures