residue

A module containing the Residue class

Classes

Residue

A class for representing a residue.

QMResidue

A class for representing a QM residue.

Summary

Classes:

QMResidue

A class for representing a QM residue type (mol type).

Residue

A class for representing a residue type (mol type).

Reference

class QMResidue(
element: Element | str,
)[source]

Bases: Residue

A class for representing a QM residue type (mol type).

It is a subclass of Residue and is used to represent any atoms that are represented solely by via QM methods during a simulation, meaning that they cannot leave the QM zone and do not have any MM-like properties.

Examples

>>> QMResidue(Element('C'))
Residue(name='QM', id=0, total_charge=0.0, n_atoms=1)

Initializes the QMResidue with the given parameters.

For the initialization only the element of the QM residue is required. One QMResidue can only contain one element.

Parameters:

element (Element) – The element of the QM residue.

class Residue(
name: str,
residue_id: int,
total_charge: Real,
elements: Element | Elements | str | list[str],
atom_types: int | Np1DIntArray,
partial_charges: Real | Np1DNumberArray,
)[source]

Bases: object

A class for representing a residue type (mol type).

In general residues are used to represent the different molecules in a system. In case a QMCF based simulation is performed, the residues are defined via the moldescriptor file.

Initializes the Residue with the given parameters.

Parameters:
  • name (str) – The name of the residue.

  • residue_id (int) – The id of the residue.

  • total_charge (Real) – The total charge of the residue.

  • elements (Element | Elements | str | List[str]) – The elements of the residue.

  • atom_types (Np1DIntArray) – The atom types of the residue.

  • partial_charges (Np1DNumberArray) – The partial charges of the residue.

Raises:

MolTypeError – If the number of elements, atom_types and partial_charges are not the same.

__eq__(other: Any) bool[source]

Checks whether the Residue is equal to another Residue.

Parameters:

other (Any) – The other Residue to compare to.

Returns:

True if the Residue is equal to the other Residue, False otherwise.

Return type:

bool

__repr__() str[source]

Returns the string representation of the Residue.

Returns:

The string representation of the Residue.

Return type:

str

__str__() str[source]

Returns the string representation of the Residue.

Returns:

The string representation of the Residue.

Return type:

str

property atom_types: Np1DIntArray

Returns the atom types of the residue.

Returns:

The atom types of the residue.

Return type:

Np1DIntArray

property elements: Elements

Returns the elements of the residue.

Returns:

The elements of the residue.

Return type:

Elements

property id: int

Returns the id of the residue.

Returns:

The id of the residue.

Return type:

int

logger = <CustomLogger PQAnalysis.Residue (INFO)>
property n_atoms: int

Returns the number of atoms in the residue.

Returns:

The number of atoms in the residue.

Return type:

int

property name: str

Returns the name of the residue.

Returns:

The name of the residue.

Return type:

str

property partial_charges: Np1DNumberArray

Returns the partial charges of the residue.

Returns:

The partial charges of the residue.

Return type:

Np1DNumberArray

property total_charge: Real

Returns the total charge of the residue.

Returns:

The total charge of the residue.

Return type:

Real

class Residues

A type hint for a list of residues (mol types).

alias of TypeVar(‘Residues’, bound=list[PQAnalysis.core.Residue])