pydft_qmmm.system package

Submodules

pydft_qmmm.system.system module

A container for all atom and residue data in a given system.

class pydft_qmmm.system.system.System(atoms, box=array([[0., 0., 0.], [0., 0., 0.], [0., 0., 0.]]))[source]

Bases: Sequence[_SystemAtom]

A container for all atom and residue data in a given system.

Parameters:
  • atoms (list[Atom]) – The list of atoms that will comprise the system.

  • box (NDArray[np.float64]) – The lattice vectors (\(\mathrm{\mathring{A}}\)) of the box containing the system.

_positions

The positions (\(\mathrm{\mathring{A}}\)) of the atoms within the system.

Type:

ObservedArray[Any, array_float]

_velocities

The velocities (\(\mathrm{\mathring{A}\;fs^{-1}}\)) of the atoms.

Type:

ObservedArray[Any, array_float]

_forces

The forces (\(\mathrm{kJ\;mol^{-1}\;\mathring{A}^{-1}}\)) acting on the atoms.

Type:

ObservedArray[Any, array_float]

_masses

The masses (\(\mathrm{AMU}\)) of the atoms.

Type:

ObservedArray[Any, array_float]

_charges

The partial charges (\(e\)) of the atoms.

Type:

ObservedArray[Any, array_float]

_residues

The indices of residues to which the atoms belong.

Type:

ObservedArray[Any, array_int]

_box

The lattice vectors (\(\mathrm{\mathring{A}}\)) of the box containing the system.

Type:

ObservedArray[Any, array_float]

_elements

The element symbols of the atoms.

Type:

ObservedArray[Any, array_str]

_names

The names (type) of the atoms, as in a PDB file.

Type:

ObservedArray[Any, array_str]

_residue_names

The names of the residues to which the atom belongs.

Type:

ObservedArray[Any, array_str]

_subsystems

The subsystems of which the atoms are a part.

Type:

ObservedArray[Any, array_obj]

property box: ObservedArray[Any, array_float]

The lattice vectors (\(\mathrm{\mathring{A}}\)) of the system.

property charges: ObservedArray[Any, array_float]

The partial charges (\(e\)) of the atoms.

property elements: ObservedArray[Any, array_str]

The element symbols of the atoms.

property forces: ObservedArray[Any, array_float]

The forces (\(\mathrm{kJ\;mol^{-1}\;\mathring{A}^{-1}}\)) on the atoms.

index(atom, start=0, stop=-1)[source]

Find the first index where the atom object is found.

Parameters:
  • atom (Any) – An atom object.

  • start (int) – The index at which to begin the search.

  • stop (int) – The index at which to conclude the search.

Return type:

int

static load(*args)[source]

Load a system from PDB and FF XML files.

Parameters:

*args (str) – The directory or list of directories containing PDB files with position, element, name, residue, residue name, and lattice vector data.

Returns:

The system generated from the data in the PDB and FF XML files.

Return type:

System

property masses: ObservedArray[Any, array_float]

The masses (\(\mathrm{AMU}\)) of the atoms.

property names: ObservedArray[Any, array_str]

The names (type) of the atoms, as in a PDB file.

property positions: ObservedArray[Any, array_float]

The positions (\(\mathrm{\mathring{A}}\)) of the atoms.

property residue_map: dict[int, frozenset[int]]

The set of atom indices corresponding to a residue index.

property residue_names: ObservedArray[Any, array_str]

The names of residues to which atoms belong.

property residues: ObservedArray[Any, array_int]

The indices of the residues to which atoms belong.

select(query)[source]

Convert a VMD-like selection query into a set of atom indices.

Parameters:

query (str) – The VMD-like selection query.

Returns:

A set of indices of atoms in the system representing the query.

Return type:

frozenset[int]

property subsystems: ObservedArray[Any, array_obj]

The subsystems of which atoms are a part.

property velocities: ObservedArray[Any, array_float]

The velocities (\(\mathrm{\mathring{A}\;fs^{-1}}\)) of the atoms.

pydft_qmmm.system.system_atom module

The atom data container.

pydft_qmmm.system.variable module

Data container classes for implementing the observer pattern.

class pydft_qmmm.system.variable.ArrayValue(_array, _key)[source]

Bases: Generic[T]

A wrapper for single values from observed arrays.

Parameters:
  • _array (ObservedArray[Any, dtype[float64] | dtype[int32] | dtype[str_] | dtype[object_]]) – The observed array containing the value.

  • _key (int) – The index for the value in the observed array.

update(value)[source]

Update the value in the observed array.

Parameters:

value (T) – The new value for the array element corresponding to the index.

Return type:

None

value()[source]

Return the observed array value.

Returns:

The value of the array element corresponding to the index.

Return type:

T

class pydft_qmmm.system.variable.ObservedArray(array)[source]

Bases: ndarray[ST, DT]

A data container for arrays implementing the observer pattern.

Parameters:

array (np.ndarray[ST, DT])

Return type:

ObservedArray[ST, DT]

base

The actual array data

Type:

np.ndarray[ST, DT]

_notifiers

Functions that are called when a value of the array is changed.

Type:

list[Callable[[np.ndarray[ST, DT]], None]]

register_notifier(notifier)[source]

Register observers to be notified when array data is edited.

Parameters:

notifier (Callable[[np.ndarray[ST, DT]], None]) – A function which will be called when array data is edited.

Return type:

None

Module contents

A sub-package for managing system data.