repESP.esp_util module

Parsing and writing .esp file format describing molecular ESP field

class GaussianEspData(charge: int, multiplicity: int, molecule: repESP.types.Molecule[repESP.charges.AtomWithCoordsAndCharge][repESP.charges.AtomWithCoordsAndCharge], dipole_moment: repESP.charges.DipoleMoment, quadrupole_moment: repESP.charges.QuadrupoleMoment, field: repESP.fields.Field[repESP.fields.Esp][repESP.fields.Esp])[source]

Bases: object

Dataclass representing the .esp file in the Gaussian format

Parameters:
  • charge (int) – The total charge of the molecule.
  • multiplicity (int) – The multiplicity of the molecule’s electron configuration.
  • molecule (Molecule[AtomWithCoordsAndCharge]) – The molecule with atom coordinates and partial charges specified.
  • dipole_moment (DipoleMoment) – The dipole moment of the molecule.
  • quadrupole_moment (QuadrupoleMoment) – The quadrupole moment of the molecule.
  • field (Field[Esp]) – The ESP field described by the file.
charge

See initialization parameter

multiplicity

See initialization parameter

molecule

See initialization parameter

dipole_moment

See initialization parameter

quadrupole_moment

See initialization parameter

field

See initialization parameter

class EspData(atoms_coords: List[repESP.types.Coords], field: repESP.fields.Field[repESP.fields.Esp][repESP.fields.Esp])[source]

Bases: object

Dataclass representing the .esp file in the resp format

Parameters:
  • atoms_coords (typing.List[Coords]) – The positions of atoms in space. Note that the identities of the atoms are not known and thus this member cannot be described with the Atom class.
  • field (Field[Esp]) – The ESP field around the molecule.
atoms_coords

See initialization parameter

field

See initialization parameter

classmethod from_gaussian(gaussian_esp_data: repESP.esp_util.GaussianEspData) → EspDataT[source]

Alternative initialization from .esp file in Gaussian format

Note that the conversion in the opposite direction is not possible as the conversion is lossy.

Parameters:gaussian_esp_data (GaussianEspData) – A dataclass representing an .esp file in the Gaussian format.
parse_gaussian_esp(f: TextIO) → repESP.esp_util.GaussianEspData[source]

Parse a file in the Gaussian .esp file format

Parameters:f (TextIO) – File object opened in read mode containing the .esp file to be parsed. The file can be generated with Gaussian by specifying the IOp(6/50=1) override.
Raises:InputFormatError – Raised when the file does not follow the expected format. Note that this function has only been tested with the output of Gaussian 09.
Returns:A dataclass representing the information in the given .esp file.
Return type:GaussianEspData
parse_resp_esp(f: TextIO) → repESP.esp_util.EspData[source]

Parse a file in the .esp file format defined by resp

Parameters:f (TextIO) – File object opened in read mode containing the .esp file to be parsed.
Raises:InputFormatError – Raised when the file does not follow the expected format.
Returns:A dataclass representing the information in the given .esp file.
Return type:EspData
write_resp_esp(f: TextIO, esp_data: repESP.esp_util.EspData) → None[source]

Write a resp .esp file described by the given input data

Parameters:
  • f (TextIO) – File object to which the supplied data is to be saved. Must be opened in write mode.
  • esp_data (EspData) – The dataclass containing the information needed to create a .esp file.