aiida_orca.parsers.cclib package

Submodules

aiida_orca.parsers.cclib.ccio module

Tools for identifying, reading and writing files and streams.

aiida_orca.parsers.cclib.ccio.ccread(source)[source]

Attempt to open and read computational chemistry data from a file.

If the file is not appropriate for cclib parsers, a fallback mechanism will try to recognize some common chemistry formats and read those using the appropriate bridge such as Open Babel.

Inputs:
source - a single logfile, a list of logfiles (for a single job),

an input stream, or an URL pointing to a log file.

*args, **kwargs - arguments and keyword arguments passed to ccopen

Returns:

a ccData object containing cclib data attributes

aiida_orca.parsers.cclib.data module

Classes and tools for storing and handling parsed data

class aiida_orca.parsers.cclib.data.Attribute(type, json_key, attribute_path)

Bases: tuple

__getnewargs__()

Return self as a plain tuple. Used by copy and pickle.

__module__ = 'aiida_orca.parsers.cclib.data'
static __new__(_cls, type, json_key, attribute_path)

Create new instance of Attribute(type, json_key, attribute_path)

__repr__()

Return a nicely formatted representation string

__slots__ = ()
_asdict()

Return a new dict which maps field names to their values.

_field_defaults = {}
_fields = ('type', 'json_key', 'attribute_path')
_fields_defaults = {}
classmethod _make(iterable)

Make a new Attribute object from a sequence or iterable

_replace(**kwds)

Return a new Attribute object replacing specified fields with new values

attribute_path

Alias for field number 2

json_key

Alias for field number 1

type

Alias for field number 0

class aiida_orca.parsers.cclib.data.ccData(attributes={})[source]

Bases: object

Stores data extracted by cclib parsers

Description of cclib attributes:

aonames – atomic orbital names (list of strings) aooverlaps – atomic orbital overlap matrix (array[2]) atombasis – indices of atomic orbitals on each atom (list of lists) atomcharges – atomic partial charges (dict of arrays[1]) atomcoords – atom coordinates (array[3], angstroms) atommasses – atom masses (array[1], daltons) atomnos – atomic numbers (array[1]) atomspins – atomic spin densities (dict of arrays[1]) ccenergies – molecular energies with Coupled-Cluster corrections (array[2], eV) charge – net charge of the system (integer) coreelectrons – number of core electrons in atom pseudopotentials (array[1]) dispersionenergies – dispersion energy corrections (array[1], eV) enthalpy – sum of electronic and thermal enthalpies (float, hartree/particle) entropy – entropy (float, hartree/(particle*kelvin)) etenergies – energies of electronic transitions (array[1], 1/cm) etoscs – oscillator strengths of electronic transitions (array[1]) etdips – electric transition dipoles of electronic transitions (array[2], ebohr) etveldips – velocity-gauge electric transition dipoles of electronic transitions (array[2], ebohr) etmagdips – magnetic transition dipoles of electronic transitions (array[2], ebohr) etrotats – rotatory strengths of electronic transitions (array[1], ??) etsecs – singly-excited configurations for electronic transitions (list of lists) etsyms – symmetries of electronic transitions (list of string) freeenergy – sum of electronic and thermal free energies (float, hartree/particle) fonames – fragment orbital names (list of strings) fooverlaps – fragment orbital overlap matrix (array[2]) fragnames – names of fragments (list of strings) frags – indices of atoms in a fragment (list of lists) gbasis – coefficients and exponents of Gaussian basis functions (PyQuante format) geotargets – targets for convergence of geometry optimization (array[1]) geovalues – current values for convergence of geometry optmization (array[1]) grads – current values of forces (gradients) in geometry optimization (array[3]) hessian – elements of the force constant matrix (array[1]) homos – molecular orbital indices of HOMO(s) (array[1]) metadata – various metadata about the package and computation (dict) mocoeffs – molecular orbital coefficients (list of arrays[2]) moenergies – molecular orbital energies (list of arrays[1], eV) moments – molecular multipole moments (list of arrays[], a.u.) mosyms – orbital symmetries (list of lists) mpenergies – molecular electronic energies with Møller-Plesset corrections (array[2], eV) mult – multiplicity of the system (integer) natom – number of atoms (integer) nbasis – number of basis functions (integer) nmo – number of molecular orbitals (integer) nmrtensors – Nuclear magnetic resonance chemical shielding tensors (dict of dicts of array[2]) nocoeffs – natural orbital coefficients (array[2]) nooccnos – natural orbital occupation numbers (array[1]) nsocoeffs – natural spin orbital coefficients (list of array[2]) nsooccnos – natural spin orbital occupation numbers (list of array[1]) optdone – flags whether an optimization has converged (Boolean) optstatus – optimization status for each set of atomic coordinates (array[1]) polarizabilities – (dipole) polarizabilities, static or dynamic (list of arrays[2]) pressure – pressure used for Thermochemistry (float, atm) scancoords – geometries of each scan step (array[3], angstroms) scanenergies – energies of potential energy surface (list) scannames – names of variables scanned (list of strings) scanparm – values of parameters in potential energy surface (list of tuples) scfenergies – molecular electronic energies after SCF (Hartree-Fock, DFT) (array[1], eV) scftargets – targets for convergence of the SCF (array[2]) scfvalues – current values for convergence of the SCF (list of arrays[2]) temperature – temperature used for Thermochemistry (float, kelvin) time – time in molecular dynamics and other trajectories (array[1], fs) transprop – all absorption and emission spectra (dictionary {name:(etenergies, etoscs)})

WARNING: this attribute is not standardized and is liable to change in cclib 2.0

vibanharms – vibrational anharmonicity constants (array[2], 1/cm) vibdisps – cartesian displacement vectors (array[3], delta angstrom) vibfreqs – vibrational frequencies (array[1], 1/cm) vibfconsts – force constants of vibrations (array[1], mDyne/angstrom) vibirs – IR intensities (array[1], km/mol) vibramans – Raman activities (array[1], A^4/Da) vibrmasses – reduced masses of vibrations (array[1], daltons) vibsyms – symmetries of vibrations (list of strings) zpve – zero-point vibrational energy correction (float, hartree/particle)

  1. The term ‘array’ refers to a numpy array

  2. The number of dimensions of an array is given in square brackets

  3. Python indexes arrays/lists starting at zero, so if homos==[10], then

    the 11th molecular orbital is the HOMO

OPT_DONE = 4
OPT_NEW = 1
OPT_UNCONVERGED = 2
OPT_UNKNOWN = 0
__dict__ = mappingproxy({'__module__': 'aiida_orca.parsers.cclib.data', '__doc__': "Stores data extracted by cclib parsers\n\n    Description of cclib attributes:\n        aonames -- atomic orbital names (list of strings)\n        aooverlaps -- atomic orbital overlap matrix (array[2])\n        atombasis -- indices of atomic orbitals on each atom (list of lists)\n        atomcharges -- atomic partial charges (dict of arrays[1])\n        atomcoords -- atom coordinates (array[3], angstroms)\n        atommasses -- atom masses (array[1], daltons)\n        atomnos -- atomic numbers (array[1])\n        atomspins -- atomic spin densities (dict of arrays[1])\n        ccenergies -- molecular energies with Coupled-Cluster corrections (array[2], eV)\n        charge -- net charge of the system (integer)\n        coreelectrons -- number of core electrons in atom pseudopotentials (array[1])\n        dispersionenergies -- dispersion energy corrections (array[1], eV)\n        enthalpy -- sum of electronic and thermal enthalpies (float, hartree/particle)\n        entropy -- entropy (float, hartree/(particle*kelvin))\n        etenergies -- energies of electronic transitions (array[1], 1/cm)\n        etoscs -- oscillator strengths of electronic transitions (array[1])\n        etdips -- electric transition dipoles of electronic transitions (array[2], ebohr)\n        etveldips -- velocity-gauge electric transition dipoles of electronic transitions (array[2], ebohr)\n        etmagdips -- magnetic transition dipoles of electronic transitions (array[2], ebohr)\n        etrotats -- rotatory strengths of electronic transitions (array[1], ??)\n        etsecs -- singly-excited configurations for electronic transitions (list of lists)\n        etsyms -- symmetries of electronic transitions (list of string)\n        freeenergy -- sum of electronic and thermal free energies (float, hartree/particle)\n        fonames -- fragment orbital names (list of strings)\n        fooverlaps -- fragment orbital overlap matrix (array[2])\n        fragnames -- names of fragments (list of strings)\n        frags -- indices of atoms in a fragment (list of lists)\n        gbasis -- coefficients and exponents of Gaussian basis functions (PyQuante format)\n        geotargets -- targets for convergence of geometry optimization (array[1])\n        geovalues -- current values for convergence of geometry optmization (array[1])\n        grads -- current values of forces (gradients) in geometry optimization (array[3])\n        hessian -- elements of the force constant matrix (array[1])\n        homos -- molecular orbital indices of HOMO(s) (array[1])\n        metadata -- various metadata about the package and computation (dict)\n        mocoeffs -- molecular orbital coefficients (list of arrays[2])\n        moenergies -- molecular orbital energies (list of arrays[1], eV)\n        moments -- molecular multipole moments (list of arrays[], a.u.)\n        mosyms -- orbital symmetries (list of lists)\n        mpenergies -- molecular electronic energies with Møller-Plesset corrections (array[2], eV)\n        mult -- multiplicity of the system (integer)\n        natom -- number of atoms (integer)\n        nbasis -- number of basis functions (integer)\n        nmo -- number of molecular orbitals (integer)\n        nmrtensors -- Nuclear magnetic resonance chemical shielding tensors (dict of dicts of array[2])\n        nocoeffs -- natural orbital coefficients (array[2])\n        nooccnos -- natural orbital occupation numbers (array[1])\n        nsocoeffs -- natural spin orbital coefficients (list of array[2])\n        nsooccnos -- natural spin orbital occupation numbers (list of array[1])\n        optdone -- flags whether an optimization has converged (Boolean)\n        optstatus -- optimization status for each set of atomic coordinates (array[1])\n        polarizabilities -- (dipole) polarizabilities, static or dynamic (list of arrays[2])\n        pressure -- pressure used for Thermochemistry (float, atm)\n        scancoords -- geometries of each scan step (array[3], angstroms)\n        scanenergies -- energies of potential energy surface (list)\n        scannames -- names of variables scanned (list of strings)\n        scanparm -- values of parameters in potential energy surface (list of tuples)\n        scfenergies -- molecular electronic energies after SCF (Hartree-Fock, DFT) (array[1], eV)\n        scftargets -- targets for convergence of the SCF (array[2])\n        scfvalues -- current values for convergence of the SCF (list of arrays[2])\n        temperature -- temperature used for Thermochemistry (float, kelvin)\n        time -- time in molecular dynamics and other trajectories (array[1], fs)\n        transprop -- all absorption and emission spectra (dictionary {name:(etenergies, etoscs)})\n            WARNING: this attribute is not standardized and is liable to change in cclib 2.0\n        vibanharms -- vibrational anharmonicity constants (array[2], 1/cm)\n        vibdisps -- cartesian displacement vectors (array[3], delta angstrom)\n        vibfreqs -- vibrational frequencies (array[1], 1/cm)\n        vibfconsts -- force constants of vibrations (array[1], mDyne/angstrom)\n        vibirs -- IR intensities (array[1], km/mol)\n        vibramans -- Raman activities (array[1], A^4/Da)\n        vibrmasses -- reduced masses of vibrations (array[1], daltons)\n        vibsyms -- symmetries of vibrations (list of strings)\n        zpve -- zero-point vibrational energy correction (float, hartree/particle)\n    (1) The term 'array' refers to a numpy array\n    (2) The number of dimensions of an array is given in square brackets\n    (3) Python indexes arrays/lists starting at zero, so if homos==[10], then\n            the 11th molecular orbital is the HOMO\n    ", '_attributes': {'aonames': Attribute(type=<class 'list'>, json_key='names', attribute_path='atoms:orbitals'), 'aooverlaps': Attribute(type=<class 'numpy.ndarray'>, json_key='overlaps', attribute_path='properties:orbitals'), 'atombasis': Attribute(type=<class 'list'>, json_key='indices', attribute_path='atoms:orbitals'), 'atomcharges': Attribute(type=<class 'dict'>, json_key='partial charges', attribute_path='properties'), 'atomcoords': Attribute(type=<class 'numpy.ndarray'>, json_key='coords', attribute_path='atoms:coords:3d'), 'atommasses': Attribute(type=<class 'numpy.ndarray'>, json_key='mass', attribute_path='atoms'), 'atomnos': Attribute(type=<class 'numpy.ndarray'>, json_key='number', attribute_path='atoms:elements'), 'atomspins': Attribute(type=<class 'dict'>, json_key='spins', attribute_path='atoms'), 'ccenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='coupled cluster', attribute_path='properties:energy'), 'charge': Attribute(type=<class 'int'>, json_key='charge', attribute_path='properties'), 'coreelectrons': Attribute(type=<class 'numpy.ndarray'>, json_key='core electrons', attribute_path='atoms'), 'dispersionenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='dispersion correction', attribute_path='properties:energy'), 'enthalpy': Attribute(type=<class 'float'>, json_key='enthalpy', attribute_path='properties'), 'entropy': Attribute(type=<class 'float'>, json_key='entropy', attribute_path='properties'), 'etenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='electronic transitions', attribute_path='transitions'), 'etoscs': Attribute(type=<class 'numpy.ndarray'>, json_key='oscillator strength', attribute_path='transitions'), 'etdips': Attribute(type=<class 'numpy.ndarray'>, json_key='electic transition dipoles', attribute_path='transitions'), 'etveldips': Attribute(type=<class 'numpy.ndarray'>, json_key='velocity-gauge electric transition dipoles', attribute_path='transitions'), 'etmagdips': Attribute(type=<class 'numpy.ndarray'>, json_key='magnetic transition dipoles', attribute_path='transitions'), 'etrotats': Attribute(type=<class 'numpy.ndarray'>, json_key='rotatory strength', attribute_path='transitions'), 'etsecs': Attribute(type=<class 'list'>, json_key='one excited config', attribute_path='transitions'), 'etsyms': Attribute(type=<class 'list'>, json_key='symmetry', attribute_path='transitions'), 'freeenergy': Attribute(type=<class 'float'>, json_key='free energy', attribute_path='properties:energy'), 'fonames': Attribute(type=<class 'list'>, json_key='orbital names', attribute_path='fragments'), 'fooverlaps': Attribute(type=<class 'numpy.ndarray'>, json_key='orbital overlap', attribute_path='fragments'), 'fragnames': Attribute(type=<class 'list'>, json_key='fragment names', attribute_path='fragments'), 'frags': Attribute(type=<class 'list'>, json_key='atom indices', attribute_path='fragments'), 'gbasis': Attribute(type=<class 'list'>, json_key='basis functions', attribute_path='atoms:orbitals'), 'geotargets': Attribute(type=<class 'numpy.ndarray'>, json_key='geometric targets', attribute_path='optimization'), 'geovalues': Attribute(type=<class 'numpy.ndarray'>, json_key='geometric values', attribute_path='optimization'), 'grads': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'hessian': Attribute(type=<class 'numpy.ndarray'>, json_key='hessian matrix', attribute_path='vibrations'), 'homos': Attribute(type=<class 'numpy.ndarray'>, json_key='homos', attribute_path='properties:orbitals'), 'metadata': Attribute(type=<class 'dict'>, json_key='TBD', attribute_path='N/A'), 'mocoeffs': Attribute(type=<class 'list'>, json_key='coeffs', attribute_path='properties:orbitals'), 'moenergies': Attribute(type=<class 'list'>, json_key='energies', attribute_path='properties:orbitals'), 'moments': Attribute(type=<class 'list'>, json_key='total dipole moment', attribute_path='properties'), 'mosyms': Attribute(type=<class 'list'>, json_key='molecular orbital symmetry', attribute_path='properties:orbitals'), 'mpenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='moller plesset', attribute_path='properties:energy'), 'mult': Attribute(type=<class 'int'>, json_key='multiplicity', attribute_path='properties'), 'natom': Attribute(type=<class 'int'>, json_key='number of atoms', attribute_path='properties'), 'nbasis': Attribute(type=<class 'int'>, json_key='basis number', attribute_path='properties:orbitals'), 'nmo': Attribute(type=<class 'int'>, json_key='MO number', attribute_path='properties:orbitals'), 'nmrtensors': Attribute(type=<class 'dict'>, json_key='NMR chemical shielding tensors', attribute_path='properties:nmr'), 'nocoeffs': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'nooccnos': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'nsocoeffs': Attribute(type=<class 'list'>, json_key='TBD', attribute_path='N/A'), 'nsooccnos': Attribute(type=<class 'list'>, json_key='TBD', attribute_path='N/A'), 'optdone': Attribute(type=<class 'list'>, json_key='done', attribute_path='optimization'), 'optstatus': Attribute(type=<class 'numpy.ndarray'>, json_key='status', attribute_path='optimization'), 'polarizabilities': Attribute(type=<class 'list'>, json_key='polarizabilities', attribute_path='N/A'), 'pressure': Attribute(type=<class 'float'>, json_key='pressure', attribute_path='properties'), 'scancoords': Attribute(type=<class 'numpy.ndarray'>, json_key='step geometry', attribute_path='optimization:scan'), 'scanenergies': Attribute(type=<class 'list'>, json_key='PES energies', attribute_path='optimization:scan'), 'scannames': Attribute(type=<class 'list'>, json_key='variable names', attribute_path='optimization:scan'), 'scanparm': Attribute(type=<class 'list'>, json_key='PES parameter values', attribute_path='optimization:scan'), 'scfenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='scf energies', attribute_path='optimization:scf'), 'scftargets': Attribute(type=<class 'numpy.ndarray'>, json_key='targets', attribute_path='optimization:scf'), 'scfvalues': Attribute(type=<class 'list'>, json_key='values', attribute_path='optimization:scf'), 'temperature': Attribute(type=<class 'float'>, json_key='temperature', attribute_path='properties'), 'time': Attribute(type=<class 'numpy.ndarray'>, json_key='time', attribute_path='N/A'), 'transprop': Attribute(type=<class 'dict'>, json_key='electronic transitions', attribute_path='transitions'), 'vibanharms': Attribute(type=<class 'numpy.ndarray'>, json_key='anharmonicity constants', attribute_path='vibrations'), 'vibdisps': Attribute(type=<class 'numpy.ndarray'>, json_key='displacement', attribute_path='vibrations'), 'vibfreqs': Attribute(type=<class 'numpy.ndarray'>, json_key='frequencies', attribute_path='vibrations'), 'vibfconsts': Attribute(type=<class 'numpy.ndarray'>, json_key='force constants', attribute_path='vibrations'), 'vibirs': Attribute(type=<class 'numpy.ndarray'>, json_key='IR', attribute_path='vibrations:intensities'), 'vibramans': Attribute(type=<class 'numpy.ndarray'>, json_key='raman', attribute_path='vibrations:intensities'), 'vibrmasses': Attribute(type=<class 'numpy.ndarray'>, json_key='reduced masses', attribute_path='vibrations'), 'vibsyms': Attribute(type=<class 'list'>, json_key='vibration symmetry', attribute_path='vibrations'), 'zpve': Attribute(type=<class 'float'>, json_key='zero-point correction', attribute_path='properties:energies')}, '_attrlist': ['aonames', 'aooverlaps', 'atombasis', 'atomcharges', 'atomcoords', 'atommasses', 'atomnos', 'atomspins', 'ccenergies', 'charge', 'coreelectrons', 'dispersionenergies', 'enthalpy', 'entropy', 'etdips', 'etenergies', 'etmagdips', 'etoscs', 'etrotats', 'etsecs', 'etsyms', 'etveldips', 'fonames', 'fooverlaps', 'fragnames', 'frags', 'freeenergy', 'gbasis', 'geotargets', 'geovalues', 'grads', 'hessian', 'homos', 'metadata', 'mocoeffs', 'moenergies', 'moments', 'mosyms', 'mpenergies', 'mult', 'natom', 'nbasis', 'nmo', 'nmrtensors', 'nocoeffs', 'nooccnos', 'nsocoeffs', 'nsooccnos', 'optdone', 'optstatus', 'polarizabilities', 'pressure', 'scancoords', 'scanenergies', 'scannames', 'scanparm', 'scfenergies', 'scftargets', 'scfvalues', 'temperature', 'time', 'transprop', 'vibanharms', 'vibdisps', 'vibfconsts', 'vibfreqs', 'vibirs', 'vibramans', 'vibrmasses', 'vibsyms', 'zpve'], '_intarrays': ['atomnos', 'coreelectrons', 'homos', 'optstatus'], '_listsofarrays': ['mocoeffs', 'moenergies', 'moments', 'polarizabilities', 'scfvalues'], '_dictsofarrays': ['atomcharges', 'atomspins'], 'OPT_UNKNOWN': 0, 'OPT_NEW': 1, 'OPT_UNCONVERGED': 2, 'OPT_DONE': 4, '__init__': <function ccData.__init__>, 'listify': <function ccData.listify>, 'arrayify': <function ccData.arrayify>, 'getattributes': <function ccData.getattributes>, 'setattributes': <function ccData.setattributes>, 'typecheck': <function ccData.typecheck>, 'check_values': <function ccData.check_values>, 'converged_geometries': <property object>, 'new_geometries': <property object>, 'unknown_geometries': <property object>, 'unconverged_geometries': <property object>, '__dict__': <attribute '__dict__' of 'ccData' objects>, '__weakref__': <attribute '__weakref__' of 'ccData' objects>, '__annotations__': {}})
__init__(attributes={})[source]

Initialize the cclibData object.

Normally called in the parse() method of a Logfile subclass.

Inputs:

attributes - optional dictionary of attributes to load as data

__module__ = 'aiida_orca.parsers.cclib.data'
__weakref__

list of weak references to the object (if defined)

_attributes = {'aonames': Attribute(type=<class 'list'>, json_key='names', attribute_path='atoms:orbitals'), 'aooverlaps': Attribute(type=<class 'numpy.ndarray'>, json_key='overlaps', attribute_path='properties:orbitals'), 'atombasis': Attribute(type=<class 'list'>, json_key='indices', attribute_path='atoms:orbitals'), 'atomcharges': Attribute(type=<class 'dict'>, json_key='partial charges', attribute_path='properties'), 'atomcoords': Attribute(type=<class 'numpy.ndarray'>, json_key='coords', attribute_path='atoms:coords:3d'), 'atommasses': Attribute(type=<class 'numpy.ndarray'>, json_key='mass', attribute_path='atoms'), 'atomnos': Attribute(type=<class 'numpy.ndarray'>, json_key='number', attribute_path='atoms:elements'), 'atomspins': Attribute(type=<class 'dict'>, json_key='spins', attribute_path='atoms'), 'ccenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='coupled cluster', attribute_path='properties:energy'), 'charge': Attribute(type=<class 'int'>, json_key='charge', attribute_path='properties'), 'coreelectrons': Attribute(type=<class 'numpy.ndarray'>, json_key='core electrons', attribute_path='atoms'), 'dispersionenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='dispersion correction', attribute_path='properties:energy'), 'enthalpy': Attribute(type=<class 'float'>, json_key='enthalpy', attribute_path='properties'), 'entropy': Attribute(type=<class 'float'>, json_key='entropy', attribute_path='properties'), 'etdips': Attribute(type=<class 'numpy.ndarray'>, json_key='electic transition dipoles', attribute_path='transitions'), 'etenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='electronic transitions', attribute_path='transitions'), 'etmagdips': Attribute(type=<class 'numpy.ndarray'>, json_key='magnetic transition dipoles', attribute_path='transitions'), 'etoscs': Attribute(type=<class 'numpy.ndarray'>, json_key='oscillator strength', attribute_path='transitions'), 'etrotats': Attribute(type=<class 'numpy.ndarray'>, json_key='rotatory strength', attribute_path='transitions'), 'etsecs': Attribute(type=<class 'list'>, json_key='one excited config', attribute_path='transitions'), 'etsyms': Attribute(type=<class 'list'>, json_key='symmetry', attribute_path='transitions'), 'etveldips': Attribute(type=<class 'numpy.ndarray'>, json_key='velocity-gauge electric transition dipoles', attribute_path='transitions'), 'fonames': Attribute(type=<class 'list'>, json_key='orbital names', attribute_path='fragments'), 'fooverlaps': Attribute(type=<class 'numpy.ndarray'>, json_key='orbital overlap', attribute_path='fragments'), 'fragnames': Attribute(type=<class 'list'>, json_key='fragment names', attribute_path='fragments'), 'frags': Attribute(type=<class 'list'>, json_key='atom indices', attribute_path='fragments'), 'freeenergy': Attribute(type=<class 'float'>, json_key='free energy', attribute_path='properties:energy'), 'gbasis': Attribute(type=<class 'list'>, json_key='basis functions', attribute_path='atoms:orbitals'), 'geotargets': Attribute(type=<class 'numpy.ndarray'>, json_key='geometric targets', attribute_path='optimization'), 'geovalues': Attribute(type=<class 'numpy.ndarray'>, json_key='geometric values', attribute_path='optimization'), 'grads': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'hessian': Attribute(type=<class 'numpy.ndarray'>, json_key='hessian matrix', attribute_path='vibrations'), 'homos': Attribute(type=<class 'numpy.ndarray'>, json_key='homos', attribute_path='properties:orbitals'), 'metadata': Attribute(type=<class 'dict'>, json_key='TBD', attribute_path='N/A'), 'mocoeffs': Attribute(type=<class 'list'>, json_key='coeffs', attribute_path='properties:orbitals'), 'moenergies': Attribute(type=<class 'list'>, json_key='energies', attribute_path='properties:orbitals'), 'moments': Attribute(type=<class 'list'>, json_key='total dipole moment', attribute_path='properties'), 'mosyms': Attribute(type=<class 'list'>, json_key='molecular orbital symmetry', attribute_path='properties:orbitals'), 'mpenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='moller plesset', attribute_path='properties:energy'), 'mult': Attribute(type=<class 'int'>, json_key='multiplicity', attribute_path='properties'), 'natom': Attribute(type=<class 'int'>, json_key='number of atoms', attribute_path='properties'), 'nbasis': Attribute(type=<class 'int'>, json_key='basis number', attribute_path='properties:orbitals'), 'nmo': Attribute(type=<class 'int'>, json_key='MO number', attribute_path='properties:orbitals'), 'nmrtensors': Attribute(type=<class 'dict'>, json_key='NMR chemical shielding tensors', attribute_path='properties:nmr'), 'nocoeffs': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'nooccnos': Attribute(type=<class 'numpy.ndarray'>, json_key='TBD', attribute_path='N/A'), 'nsocoeffs': Attribute(type=<class 'list'>, json_key='TBD', attribute_path='N/A'), 'nsooccnos': Attribute(type=<class 'list'>, json_key='TBD', attribute_path='N/A'), 'optdone': Attribute(type=<class 'list'>, json_key='done', attribute_path='optimization'), 'optstatus': Attribute(type=<class 'numpy.ndarray'>, json_key='status', attribute_path='optimization'), 'polarizabilities': Attribute(type=<class 'list'>, json_key='polarizabilities', attribute_path='N/A'), 'pressure': Attribute(type=<class 'float'>, json_key='pressure', attribute_path='properties'), 'scancoords': Attribute(type=<class 'numpy.ndarray'>, json_key='step geometry', attribute_path='optimization:scan'), 'scanenergies': Attribute(type=<class 'list'>, json_key='PES energies', attribute_path='optimization:scan'), 'scannames': Attribute(type=<class 'list'>, json_key='variable names', attribute_path='optimization:scan'), 'scanparm': Attribute(type=<class 'list'>, json_key='PES parameter values', attribute_path='optimization:scan'), 'scfenergies': Attribute(type=<class 'numpy.ndarray'>, json_key='scf energies', attribute_path='optimization:scf'), 'scftargets': Attribute(type=<class 'numpy.ndarray'>, json_key='targets', attribute_path='optimization:scf'), 'scfvalues': Attribute(type=<class 'list'>, json_key='values', attribute_path='optimization:scf'), 'temperature': Attribute(type=<class 'float'>, json_key='temperature', attribute_path='properties'), 'time': Attribute(type=<class 'numpy.ndarray'>, json_key='time', attribute_path='N/A'), 'transprop': Attribute(type=<class 'dict'>, json_key='electronic transitions', attribute_path='transitions'), 'vibanharms': Attribute(type=<class 'numpy.ndarray'>, json_key='anharmonicity constants', attribute_path='vibrations'), 'vibdisps': Attribute(type=<class 'numpy.ndarray'>, json_key='displacement', attribute_path='vibrations'), 'vibfconsts': Attribute(type=<class 'numpy.ndarray'>, json_key='force constants', attribute_path='vibrations'), 'vibfreqs': Attribute(type=<class 'numpy.ndarray'>, json_key='frequencies', attribute_path='vibrations'), 'vibirs': Attribute(type=<class 'numpy.ndarray'>, json_key='IR', attribute_path='vibrations:intensities'), 'vibramans': Attribute(type=<class 'numpy.ndarray'>, json_key='raman', attribute_path='vibrations:intensities'), 'vibrmasses': Attribute(type=<class 'numpy.ndarray'>, json_key='reduced masses', attribute_path='vibrations'), 'vibsyms': Attribute(type=<class 'list'>, json_key='vibration symmetry', attribute_path='vibrations'), 'zpve': Attribute(type=<class 'float'>, json_key='zero-point correction', attribute_path='properties:energies')}
_attrlist = ['aonames', 'aooverlaps', 'atombasis', 'atomcharges', 'atomcoords', 'atommasses', 'atomnos', 'atomspins', 'ccenergies', 'charge', 'coreelectrons', 'dispersionenergies', 'enthalpy', 'entropy', 'etdips', 'etenergies', 'etmagdips', 'etoscs', 'etrotats', 'etsecs', 'etsyms', 'etveldips', 'fonames', 'fooverlaps', 'fragnames', 'frags', 'freeenergy', 'gbasis', 'geotargets', 'geovalues', 'grads', 'hessian', 'homos', 'metadata', 'mocoeffs', 'moenergies', 'moments', 'mosyms', 'mpenergies', 'mult', 'natom', 'nbasis', 'nmo', 'nmrtensors', 'nocoeffs', 'nooccnos', 'nsocoeffs', 'nsooccnos', 'optdone', 'optstatus', 'polarizabilities', 'pressure', 'scancoords', 'scanenergies', 'scannames', 'scanparm', 'scfenergies', 'scftargets', 'scfvalues', 'temperature', 'time', 'transprop', 'vibanharms', 'vibdisps', 'vibfconsts', 'vibfreqs', 'vibirs', 'vibramans', 'vibrmasses', 'vibsyms', 'zpve']
_dictsofarrays = ['atomcharges', 'atomspins']
_intarrays = ['atomnos', 'coreelectrons', 'homos', 'optstatus']
_listsofarrays = ['mocoeffs', 'moenergies', 'moments', 'polarizabilities', 'scfvalues']
arrayify()[source]

Converts appropriate attributes to arrays or lists/dicts of arrays.

check_values(logger=<module 'logging' from '/home/docs/.pyenv/versions/3.8.6/lib/python3.8/logging/__init__.py'>)[source]

Perform custom checks on the values of attributes.

property converged_geometries

Return all converged geometries.

An array containing only the converged geometries, e.g.:
  • For PES or IRCs, return all geometries for which optstatus matches OPT_DONE

  • The converged geometry for simple optimisations

  • The input geometry for single points

getattributes(tolists=False)[source]

Returns a dictionary of existing data attributes.

Inputs:

tolists - flag to convert attributes to lists where applicable

listify()[source]

Converts all attributes that are arrays or lists/dicts of arrays to lists.

property new_geometries

Return all starting geometries.

An array containing only the starting geometries, e.g.:
  • For PES or IRCs, return all geometries for which optstatus matches OPT_NEW

  • The input geometry for simple optimisations or single points

setattributes(attributes)[source]

Sets data attributes given in a dictionary.

Inputs:

attributes - dictionary of attributes to set

Outputs:
invalid - list of attributes names that were not set, which

means they are not specified in self._attrlist

typecheck()[source]

Check the types of all attributes.

If an attribute does not match the expected type, then attempt to convert; if that fails, only then raise a TypeError.

property unconverged_geometries

Return all unconverged geometries.

An array containing only the starting geometries, e.g.:
  • For PES or IRCs, return all geometries for which optstatus matches OPT_UNCONVERGED

  • The input geometry for simple optimisations or single points

property unknown_geometries

Return all OPT_UNKNOWN geometries.

An array containing only the starting geometries, e.g.:
  • For PES or IRCs, return all geometries for which optstatus matches OPT_UNKNOWN

  • The input geometry for simple optimisations or single points

class aiida_orca.parsers.cclib.data.ccData_optdone_bool(*args, **kwargs)[source]

Bases: ccData

This is the version of ccData where optdone is a Boolean.

__init__(*args, **kwargs)[source]

Initialize the cclibData object.

Normally called in the parse() method of a Logfile subclass.

Inputs:

attributes - optional dictionary of attributes to load as data

__module__ = 'aiida_orca.parsers.cclib.data'
setattributes(*args, **kwargs)[source]

Sets data attributes given in a dictionary.

Inputs:

attributes - dictionary of attributes to set

Outputs:
invalid - list of attributes names that were not set, which

means they are not specified in self._attrlist

aiida_orca.parsers.cclib.logfileparser module

Generic output file parser and related tools

class aiida_orca.parsers.cclib.logfileparser.FileWrapper(source, pos=0)[source]

Bases: object

Wrap a file-like object or stream with some custom tweaks

__dict__ = mappingproxy({'__module__': 'aiida_orca.parsers.cclib.logfileparser', '__doc__': 'Wrap a file-like object or stream with some custom tweaks', '__init__': <function FileWrapper.__init__>, 'next': <function FileWrapper.next>, '__next__': <function FileWrapper.__next__>, '__iter__': <function FileWrapper.__iter__>, 'close': <function FileWrapper.close>, 'seek': <function FileWrapper.seek>, '__dict__': <attribute '__dict__' of 'FileWrapper' objects>, '__weakref__': <attribute '__weakref__' of 'FileWrapper' objects>, '__annotations__': {}})
__init__(source, pos=0)[source]
__iter__()[source]
__module__ = 'aiida_orca.parsers.cclib.logfileparser'
__next__()[source]
__weakref__

list of weak references to the object (if defined)

close()[source]
next()[source]
seek(pos, ref)[source]
class aiida_orca.parsers.cclib.logfileparser.Logfile(source, loglevel=40, logname='Log', logstream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, datatype=<class 'aiida_orca.parsers.cclib.data.ccData_optdone_bool'>, **kwds)[source]

Bases: ABC

Abstract class for logfile objects.

Subclasses defined by cclib:

ADF, DALTON, GAMESS, GAMESSUK, Gaussian, Jaguar, Molpro, MOPAC, NWChem, ORCA, Psi, Q-Chem

__abstractmethods__ = frozenset({'normalisesym'})
__dict__ = mappingproxy({'__module__': 'aiida_orca.parsers.cclib.logfileparser', '__doc__': 'Abstract class for logfile objects.\n\n    Subclasses defined by cclib:\n        ADF, DALTON, GAMESS, GAMESSUK, Gaussian, Jaguar, Molpro, MOPAC,\n        NWChem, ORCA, Psi, Q-Chem\n    ', '__init__': <function Logfile.__init__>, '__setattr__': <function Logfile.__setattr__>, 'parse': <function Logfile.parse>, 'before_parsing': <function Logfile.before_parsing>, 'after_parsing': <function Logfile.after_parsing>, 'updateprogress': <function Logfile.updateprogress>, 'normalisesym': <function Logfile.normalisesym>, 'new_internal_job': <function Logfile.new_internal_job>, 'set_attribute': <function Logfile.set_attribute>, 'append_attribute': <function Logfile.append_attribute>, 'extend_attribute': <function Logfile.extend_attribute>, '_assign_coreelectrons_to_element': <function Logfile._assign_coreelectrons_to_element>, 'skip_lines': <function Logfile.skip_lines>, 'skip_line': <function Logfile.<lambda>>, '__dict__': <attribute '__dict__' of 'Logfile' objects>, '__weakref__': <attribute '__weakref__' of 'Logfile' objects>, '__abstractmethods__': frozenset({'normalisesym'}), '_abc_impl': <_abc_data object>, '__annotations__': {}})
__init__(source, loglevel=40, logname='Log', logstream=<_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>, datatype=<class 'aiida_orca.parsers.cclib.data.ccData_optdone_bool'>, **kwds)[source]

Initialise the Logfile object.

This should be called by a subclass in its own __init__ method.

Inputs:

source - a logfile, list of logfiles, or stream with at least a read method loglevel - integer corresponding to a log level from the logging module logname - name of the source logfile passed to this constructor logstream - where to output the logging information datatype - class to use for gathering data attributes

__module__ = 'aiida_orca.parsers.cclib.logfileparser'
__setattr__(name, value)[source]

Implement setattr(self, name, value).

__weakref__

list of weak references to the object (if defined)

_abc_impl = <_abc_data object>
_assign_coreelectrons_to_element(element, ncore, ncore_is_total_count=False)[source]

Assign core electrons to all instances of the element.

It’s usually reasonable to do this for all atoms of a given element, because mixed usage isn’t normally allowed within elements.

Parameters

element: str

the chemical element to set coreelectrons for

ncore: int

the number of core electrons

ncore_is_total_count: bool

whether the ncore argument is the total count, in which case it is divided by the number of atoms of this element

after_parsing()[source]

Correct data or do parser-specific validation after parsing is finished.

append_attribute(name, value)[source]

Appends a value to an attribute.

before_parsing()[source]

Set parser-specific variables and do other initial things here.

extend_attribute(name, values)[source]

Appends an iterable of values to an attribute.

new_internal_job()[source]

Delete attributes that can be problematic in multistep jobs.

TODO: instead of this hack, parse each job in a multistep comptation as a different ccData object (this is for 2.x).

Some computations are actually sequences of several jobs, and some attributes won’t work well if parsed across jobs. There include:

mpenergies: if different jobs go to different orders then

these won’t be consistent and can’t be converted to an array easily

abstract normalisesym(symlabel)[source]

Standardise the symmetry labels between parsers.

parse(progress=None, fupdate=0.05, cupdate=0.002)[source]

Parse the logfile, using the assumed extract method of the child.

set_attribute(name, value, check_change=True)[source]

Set an attribute and perform an optional check when it already exists.

Note that this can be used for scalars and lists alike, whenever we want to set a value for an attribute.

Parameters

name: str

The name of the attribute.

value: str

The value for the attribute.

check_change: bool

By default we want to check that the value does not change if the attribute already exists.

skip_line(inputfile, expected)
skip_lines(inputfile, sequence)[source]

Read trivial line types and check they are what they are supposed to be.

This function will read len(sequence) lines and do certain checks on them, when the elements of sequence have the appropriate values. Currently the following elements trigger checks:

‘blank’ or ‘b’ - the line should be blank ‘dashes’ or ‘d’ - the line should contain only dashes (or spaces) ‘equals’ or ‘e’ - the line should contain only equal signs (or spaces) ‘stars’ or ‘s’ - the line should contain only stars (or spaces)

updateprogress(inputfile, msg, xupdate=0.05)[source]

Update progress.

aiida_orca.parsers.cclib.logfileparser.openlogfile(filename, object=None)[source]

Return a file object given a filename or if object specified decompresses it if needed and wrap it up.

Given the filename or file object of a log file or a gzipped, zipped, or bzipped log file, this function returns a file-like object.

Given a list of filenames, this function returns a FileInput object, which can be used for seamless iteration without concatenation.

aiida_orca.parsers.cclib.orcaparser module

Parser for ORCA output files

class aiida_orca.parsers.cclib.orcaparser.ORCA(*args, **kwargs)[source]

Bases: Logfile

An ORCA log file.

__abstractmethods__ = frozenset({})
__init__(*args, **kwargs)[source]

Initialise the Logfile object.

This should be called by a subclass in its own __init__ method.

Inputs:

source - a logfile, list of logfiles, or stream with at least a read method loglevel - integer corresponding to a log level from the logging module logname - name of the source logfile passed to this constructor logstream - where to output the logging information datatype - class to use for gathering data attributes

__module__ = 'aiida_orca.parsers.cclib.orcaparser'
__repr__()[source]

Return a representation of the object.

__str__()[source]

Return a string representation of the object.

_abc_impl = <_abc_data object>
_append_scfvalues_scftargets(inputfile, line)[source]
after_parsing()[source]

Correct data or do parser-specific validation after parsing is finished.

before_parsing()[source]

Set parser-specific variables and do other initial things here.

extract(inputfile, line)[source]

Extract information from the file object inputfile.

normalisesym(label)[source]

ORCA does not require normalizing symmetry labels.

parse_charge_section(line, inputfile, chargestype)[source]

Parse a charge section, modifies class in place

Parameters

linestr

the line which triggered entry here

inputfilefile

handle to file object

chargestypestr

what type of charge we’re dealing with, must be one of ‘mulliken’, ‘lowdin’ or ‘chelpg’

parse_scf_condensed_format(inputfile, line)[source]

Parse the SCF convergence information in condensed format

parse_scf_expanded_format(inputfile, line)[source]

Parse SCF convergence when in expanded format.

aiida_orca.parsers.cclib.utils module

Utilities often used by cclib parsers and scripts

class aiida_orca.parsers.cclib.utils.PeriodicTable[source]

Bases: object

Allows conversion between element name and atomic no.

__dict__ = mappingproxy({'__module__': 'aiida_orca.parsers.cclib.utils', '__doc__': 'Allows conversion between element name and atomic no.', '__init__': <function PeriodicTable.__init__>, '__dict__': <attribute '__dict__' of 'PeriodicTable' objects>, '__weakref__': <attribute '__weakref__' of 'PeriodicTable' objects>, '__annotations__': {}})
__init__()[source]
__module__ = 'aiida_orca.parsers.cclib.utils'
__weakref__

list of weak references to the object (if defined)

aiida_orca.parsers.cclib.utils.convertor(value, fromunits, tounits)[source]

Convert from one set of units to another.

Sources:

NIST 2010 CODATA (http://physics.nist.gov/cuu/Constants/index.html) Documentation of GAMESS-US or other programs as noted

aiida_orca.parsers.cclib.utils.float(number)[source]

Convert a string to a float.

This method should perform certain checks that are specific to cclib, including avoiding the problem with Ds instead of Es in scientific notation. Another point is converting string signifying numerical problems (*) to something we can manage (Numpy’s NaN).

aiida_orca.parsers.cclib.utils.skip_until_no_match(inputfile, regex)[source]

Skip lines that match a regex. First non-matching line is returned.

This method allows to skip a variable number of lines, allowing for example, to parse sections that might have different whitespace/spurious lines for different versions of the software.

aiida_orca.parsers.cclib.utils.str_contains_only(string, chars)[source]

Checks if string contains only the specified characters.

Module contents

cclib parser