iodata.iodata module

Module for handling input/output from different file formats.

class IOData(atcharges=NOTHING, atcoords=None, atcorenums=None, atffparams=NOTHING, atfrozen=None, atgradient=None, athessian=None, atmasses=None, atnums=None, basisdef=None, bonds=None, cellvecs=None, charge=None, core_energy=None, cube=None, energy=None, extcharges=None, extra=NOTHING, g_rot=None, lot=None, mo=None, moments=NOTHING, nelec=None, obasis=None, obasis_name=None, one_ints=NOTHING, one_rdms=NOTHING, run_type=None, spinpol=None, title=None, two_ints=NOTHING, two_rdms=NOTHING)[source]

Bases: object

A container class for data loaded from (or to be written to) a file.

__init__(atcharges=NOTHING, atcoords=None, atcorenums=None, atffparams=NOTHING, atfrozen=None, atgradient=None, athessian=None, atmasses=None, atnums=None, basisdef=None, bonds=None, cellvecs=None, charge=None, core_energy=None, cube=None, energy=None, extcharges=None, extra=NOTHING, g_rot=None, lot=None, mo=None, moments=NOTHING, nelec=None, obasis=None, obasis_name=None, one_ints=NOTHING, one_rdms=NOTHING, run_type=None, spinpol=None, title=None, two_ints=NOTHING, two_rdms=NOTHING)

Method generated by attrs for class IOData.

atcharges: dict

A dictionary where keys are names of charge definitions and values are arrays with atomic charges (size N).

atcoords: Optional[ndarray[Any, dtype[float]]]

A (N, 3) float array with Cartesian coordinates of the atoms.

property atcorenums: ndarray[Any, dtype[float]]

Effective core charges.

atffparams: dict

A dictionary with arrays of atomic force field parameters (typically non-bonded). Keys include ‘charges’, ‘vdw_radii’, ‘sigmas’, ‘epsilons’, ‘alphas’ (atomic polarizabilities), ‘c6s’, ‘c8s’, ‘c10s’, ‘buck_as’, ‘buck_bs’, ‘lj_as’, ‘core_charges’, ‘valence_charges’, ‘valence_widths’, etc. Not all of them have to be present, depending on the use case.

atfrozen: Optional[ndarray[Any, dtype[bool]]]

A (N,) bool array with frozen atoms. (All atoms are free if thisattribute is not set.)

atgradient: Optional[ndarray[Any, dtype[float]]]

A (N, 3) float array with the first derivatives of the energy w.r.t. Cartesian atomic displacements.

athessian: Optional[ndarray[Any, dtype[float]]]

A (3*N, 3*N) array containing the energy Hessian w.r.t Cartesian atomic displacements.

atmasses: Optional[ndarray[Any, dtype[float]]]

A (N,) float array with atomic masses.

atnums: Optional[ndarray[Any, dtype[int]]]

A (N,) int vector with the atomic numbers.

basisdef: Optional[str]

A basis set definition, i.e. a dictionary whose keys are symbols (of chemical elements), atomic numbers (similar to previous, str to make distinction with following) or an atom index (integer referring to a specific atom in a molecule). The format of the values is to be decided when implementing a load function for basis set definitions.

bonds: Optional[ndarray[Any, dtype[int]]]

An (nbond, 3) array with the list of covalent bonds. Each row represents one bond and consists of three integers: first atom index (starting from zero), second atom index & an optional bond type. Numerical values of bond types are defined in iodata.periodic.

cellvecs: Optional[ndarray[Any, dtype[float]]]

A (NP, 3) array with (real-space) cell vectors describing periodic boundary conditions. A single vector corresponds to a 1D cell, e.g. for a wire. Two vectors describe a 2D cell, e.g. for a membrane. Three vectors describe a 3D cell, e.g. a crystalline solid.

property charge: float

Return the net charge of the system.

core_energy: Optional[float]

The Hartree-Fock energy due to the core orbitals.

cube: Optional[Cube]

An instance of Cube, describing the volumetric data from a cube (or similar) file.

energy: Optional[float]

The total energy (electronic + nn).

extcharges: ndarray[Any, dtype[float]]

Array with values of external charges, with shape (nextcharge, 4). First three columns for Cartesian X, Y and Z coordinates, last column for the actual charge.

extra: dict

A dictionary with additional data loaded from a file. Any data which cannot be assigned to the other attributes belongs here. It may be decided in future to move some of the results from this dictionary to IOData attributes, with a more final name.

g_rot: Optional[float]

The rotational symmetry number of the molecule.

lot: Optional[str]

The level of theory used to compute the orbitals (and other properties).

mo: Optional[MolecularOrbitals]

The molecular orbitals.

moments: dict

A dictionary with electrostatic multipole moments. Keys are (angmom, kind) tuples where angmom is an integer for the angular momentum and kind is ‘c’ for Cartesian or ‘p’ for pure functions (only for angmom >= 2). The corresponding values are 1D numpy arrays. The order of the components of the multipole moments follows the HORTON2_CONVENTIONS defined in iodata.basis.

property natom: int

Return the number of atoms.

property nelec: float

Return the number of electrons.

obasis: Optional[MolecularBasis]

An OrderedDict containing parameters to instantiate a GOBasis class.

obasis_name: Optional[str]

A name or DOI describing the basis set used for the orbitals in the mo attribute (if defined). The name should be consistent with those defined the Basis Set Exchange.

one_ints: dict

Dictionary where keys are names and values are numpy arrays with one-body operators, typically integrals of a one-body operator with a pair of (Gaussian) basis functions. Names can start with olp (overlap), kin (kinetic energy), na (nuclear attraction), core (core hamiltonian), etc., or one (general one-electron integral). When relevant, these names must have a suffix _ao or _mo to clarify in which basis the integrals are computed. _ao is used to denote integrals in a non-orthogonal (atomic orbital) basis. _mo is used to denote an orthogonal (molecular orbital) basis. For the overlap integrals, this suffix can be omitted because it is only useful to compute them in the atomic-orbital basis.

one_rdms: dict

Dictionary where keys are names and values are one-particle density matrices. Names can be scf, post_scf, scf_spin, post_scf_spin. When relevant, these names must have a suffix _ao or _mo to clarify in which basis the RDMs are computed. _ao is used to denote a non-orthogonal (atomic orbital) basis. _mo is used to denote an orthogonal (molecular orbital) basis. For the SCF RDMs, this suffix can be omitted because it is only useful to compute them in the atomic-orbital basis.

run_type: Optional[str]

The type of calculation that lead to the results stored in IOData, which must be one of the following: ‘energy’, ‘energy_force’, ‘opt’, ‘scan’, ‘freq’ or None.

property spinpol: float

Return the spin polarization.

Warning: for restricted wavefunctions, it is assumed that an occupation number in ]0, 2[ implies spin polarizaiton, which may not always be a valid assumption.

title: Optional[str]

A suitable name for the data.

two_ints: dict

Dictionary where keys are names and values are numpy arrays with two-body operators, typically integrals of two-body operator with four of (Gaussian) basis functions. Names can start with er (electron repulsion) or two (general pairswise interaction). When relevant, these names must have a suffix _ao or _mo to clarify in which basis the integrals are computed. See one_ints for more details. Array indexes are in physicist’s notation.

two_rdms: dict

Dictionary where keys are names and values are two-particle density matrices. Names can be post_scf or post_scf_spin. When relevant, these names must have a suffix _ao or _mo to clarify in which basis the RDMs are computed. See one_rdms for more details. Array indexes are in physicist’s notation.