opan.output

Module implementing parsing of output data from external computations.

Warning

This module will be refactored at some point, to introduce a superclass in the same vein as SuperOpanGrad and SuperOpanHess. This is necessary because automated execution of external computation softwares will require some unified mechanism for indicating whether a particular computation completed successfully, independent of the identify of the software package that was executed.

Warning

Further refactoring is also planned for OrcaOutput generally. Beware relying heavily on the behavior of this class & module.

Superclass

To be implemented


Implemented Subclasses

Note

Not yet actually a subclass of anything

OrcaOutput – Imports output files from ORCA


Subclasses

class opan.output.OrcaOutput(file_path)

Container for parsed textual output generated by ORCA.

All implemented results that are found in the indicated output are stored in the OrcaOutput instance. If a given quantity was not detectable, it is stored as None in the corresponding instance variable.

Note

In particular, thermochemistry from single atom/ion computations should work, with None or zero/negligible values returned for rotational and vibrational quantities.

The verbose contents of the output file are not generally retained within the OrcaOutput instance due to the potential for such to involve a tremendously large string. Exceptions include, if present:

  • THERMOCHEMISTRY section

Contents

Methods

__init__(file_path)

Initialize OrcaOutput object.

Imports the data found in the output file found at file_path.

Warning

THIS CLASS PRESENTLY ONLY WORKS ON A VERY SMALL SUBSET OF COMPUTATION TYPES, currently HF, LDA-DFT, GGA-DFT, and mGGA-DFT. MAY work on some double-hybrid or range-separated DFT.

Available data includes:

  • SCF energies (incl D3BJ, gCP, COSMO outlying charge corrections)
  • Thermochemistry
  • Spin expectation values (actual, ideal, and deviation)

Success indicators include:

  • completed

    Checks for the ‘ORCA TERMINATED NORMALLY’ report at the end of the file

  • converged

    Checks for any occurrence of successful SCF convergence in the file (questionable for anything but single-point calculations)

  • optimized

    Checks for any occurrence of “OPTIMIZATION HAS CONVERGED” in the file (questionable for anything but a standalone OPT – i.e., not useful for a mode or internal coordinate scan)

Parameters:file_pathstr – Full path to the output file to be parsed.
Raises:OutputError – (various typecodes) If indicated output is un-parseably malformed in some fashion
en_last()

Report the energies from the last SCF present in the output.

Returns a dict providing the various energy values from the last SCF cycle performed in the output. Keys are those of p_en. Any energy value not relevant to the parsed output is assigned as None.

Returns:last_ensdict of np.float_– Energies from the last SCF present in the output.

Class Variables

Enumerations

class EN

OpanEnum for the energies reported at the end of SCF cycles.


D3

Grimme’s D3BJ dispersion correction [Gri10]. May or may not play nicely with D3ZERO. Likely non-functional with DFT-NL dispersion.

GCP

Grimme’s geometric counterpose (gCP) correction [Kru12]

OCC

COSMO outlying charge correction

Todo

Need COSMO reference

SCFFINAL

SCF energy including gCP and D3 corrections

SCFFINALOCC

SCFFINAL energy, but also with COSMO outlying charge correction

SCFOCC

SCF energy with only the COSMO outlying charge correction (no dispersion or gCP corrections)

class SPINCONT

OpanEnum for the spin contamination values reported after each unrestricted SCF cycle.


ACTUAL

Calculated \(\left<S^2\right>\) expectation value

DEV

Deviation of \(\left<S^2\right>\) (calculated minus ideal)

IDEAL

Ideal \(\left<S^2\right>\) expectation value

class THERMO

OpanEnum for the quantities reported in the THERMOCHEMISTRY block.


BLOCK

Entire THERMOCHEMISTRY block (as str)

E_EL

Electronic energy from the thermochemistry block, often slightly different than the last EN.SCFFINAL value \(\left(\mathrm{E_h}\right)\)

E_ROT

Thermal rotational internal energy correction \(\left(\mathrm{E_h}\right)\)

E_TRANS

Thermal translational internal energy correction \(\left(\mathrm{E_h}\right)\)

E_VIB

Thermal vibrational internal energy correction \(\left(\mathrm{E_h}\right)\)

E_ZPE

Zero-point energy correction \(\left(\mathrm{E_h}\right)\)

H_IG

Ideal-gas \(\left(k_\mathrm{B} T\right)\) enthalpy contribution \(\left(\mathrm{E_h}\right)\)

PRESS

Simulated pressure \(\left(\mathrm{atm}\right)\)

QROT

Rotational partition function (unitless)

TEMP

Simulated temperature \(\left(\mathrm K\right)\)

TS_EL

Electronic \(TS\) entropy contribution \(\left(\mathrm{E_h}\right)\)

TS_TRANS

Translational \(TS\) entropy contribution \(\left(\mathrm{E_h}\right)\)

TS_VIB

Vibrational \(TS\) entropy contribution \(\left(\mathrm{E_h}\right)\)

Regular Expression Patterns

p_en

dict of re.compile() for the energies reported at the end of SCF cycles. Keys are in EN.

p_spincont

dict of re.compile() for the spin contamination block values. Keys are in SPINCONT.

p_thermo

dict of re.compile() for the quantities extracted from the THERMOCHEMISTRY block. Keys are in THERMO.


Instance Variables

completed

boolTrue if ORCA output reports normal termination, False otherwise.

converged

boolTrue if SCF converged ANYWHERE in run.

Todo

Update oo.converged with any robustifications

en

dict of list of np.float_– Lists of the various energy values from the parsed output. Dict keys are those of EN, above. Any energy type not found in the output is assigned as an empty list.

optimized

boolTrue if any OPT converged ANYWHERE in run. Fine for OPT, but ambiguous for scans.

Todo

Update oo.optimized with any robustifications

spincont

dict of list of np.float_– Lists of the various values from the spin contamination calculations in the output, if present. Empty lists if absent. Dict keys are those of SPINCONT, above.

src_path

str – Full path to the associated output file

thermo

dict of np.float_– Values from the thermochemistry block of the parsed output. Dict keys are those of THERMO, above.

thermo_block

str – Full text of the thermochemistry block, if found.