linkjobparsers

One of the two core modules of pyssian. This module contains the classes and parsers for the outputs of the different types of links. Only the classes registered with the appropiate decorator are considered for parsing.

LinkJob

class pyssian.linkjobparsers.LinkJob(text, number=None, asEmpty=False)[source]

LinkJob Base class. Represents the output of a lxxxx.exe.

Parameters
  • text (list) -- text that corresponds to the output of the lxxxx.exe

  • number (int) -- Integrer that represents the type of the LinkJob (the default is None).

Register

A dict where key corresponds to an int, and value corresponds to the registered subclass class through @RegisterLinkJob

Type

dict

number
text
pyssian.linkjobparsers.RegisterLinkJob(cls)[source]

Decorator for the LinkJob subclasses, adds the class to the LinkJob.Register dictionary with the _token as key.

Parameters

cls (LinkJob) -- LinkJob subclass identified with the cls._token attribute. Which is normally an integrer between 1 and 9999.

GeneralLinkJob

class pyssian.linkjobparsers.GeneralLinkJob(text, number=None, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Subclass of Linkjob to store the information of any Link that does not have a specific parser.

Parameters
  • text (str) -- text that corresponds to the output of the lxxxx.exe

  • number (int) -- Integrer that represents the type of the LinkJob. (defaults to None)

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

number
text

Link1

class pyssian.linkjobparsers.Link1(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l1.exe,it also holds information about the InternalJob setup.

Parameters
  • text (str) -- text that corresponds to the output of the l1.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

info

tuple that contains information needed to instantiate an InternalJob.

Type

namedtuple

commandline

contains the information of the gaussian commands (defaults to an empty string).

Type

str

nprocs

contains the number of the %nprocshared link0 option

Type

int

mem

contains the right hand side of the %mem link0 option

Type

str

link0

list of lines containing the link0 specifications.

Type

list

IOps

list of lines containing the IOps that appear below the command line

Type

list

text
number
_guess_type()[source]

Guesses the type of Job depending on the keywords in the self.commandline.

Returns

{Constrained Optimization, Optimization, Frequency Calculation, Unidentified}

Return type

str

_locate_IOps()[source]

Uses regex expressions compiled as class attributes to search IOps (see Gaussian Manual). (Fails Silently).

Populates the attributes:

  • IOps

_locate_commandline()[source]

Uses regex expressions compiled as class attributes to search the gaussian commands, which start with a "#". (Fails Silently).

Populates the attributes:

  • commandline

_locate_internaljob()[source]

Uses regex expressions compiled as class attributes to search the number of the "current" internal job at the file.

Populates the attributes:

  • info (If none is found defaults to 1)

_locate_link0()[source]

Uses regex expressions compiled as class attributes to search the link0 options (specified with a % at the start of the option).

Populates the attributes:

  • nprocs (Defaults to None)

  • mem (Defaults to None)

  • link0 (If none is found defaults to an empty list)

Link101

class pyssian.linkjobparsers.Link101(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l101.exe

Parameters
  • text (str) -- text that corresponds to the output of the l101.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults is False)

charge
Type

int

spin
Type

int

_locate_charge_spin()[source]

Searches the charge and spin. (Fails Silently).

Populates the attributes:

  • charge

  • spin

Link103

class pyssian.linkjobparsers.Link103(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l103.exe. Corresponds to a single step of a Berny optimization.

Parameters
  • text (str) -- text that corresponds to the output of the l103.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

mode

'Init', 'Iteration' or 'End'

Type

str

state

Either 'Optimized', 'Non-optimized' or 'Initial'

Type

str

conversion

List of namedtuples with fields Item,Value,Threshold,Converged.

Type

list

parameters

List of namedtuples with fields Name,Definition,Value,Derivative.

Type

list

derivatives

List of namedtuples with fields Var,old,dEdX,dXl,dXq,dXt,new.

Type

list

stepnumber
scanpoint
text
number
_locate_convergence()[source]

Uses regex expressions compiled as class attributes to find the convergence parameters. (Fails Silently).

Populates the attributes:

  • conversion

_locate_mode()[source]

Uses regex expressions compiled as class attributes to find If the Link corresponds to an (Init)ialization pass, (Iteration) or (End) converged or not.

Populates the attributes:

  • mode (Iteration)

_locate_numbers()[source]

Uses regex expressions compiled as class attributes to find the current step number (of an optimization) and scan number (of an scan calculation). (Fails Silently).

Populates the attributes:

  • stepnumber

  • scanpoint

_locate_parameters()[source]

Uses regex expressions compiled as class attributes to find the parameter table if exists. (Fails Silently).

Populates the attributes:

  • state

  • parameters

print_convergence()[source]

Prints the convergence Table formatted

Link123

class pyssian.linkjobparsers.Link123(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l123.exe. Corresponds to irc predictor-corrector steps and may hold the orientation (Geometry) at a given step.

Parameters
  • text (str) -- text that corresponds to the output of the l202.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

orientation

List of namedtuples containing the geometry of the calculated compound.

Type

list

step

step number of along the irc calculation.

Type

int

direction

FORWARD or REVERSE

Type

str

reactioncoord

Value of the reaction coordinate at the current step.

Type

float

text
number
_locate_irc_step()[source]

Uses regex expressions compiled as class attributes to find the current step info of the irc path. (Fails Silently).

Populates the attributes:

  • reactioncoord

  • step

  • direction

_locate_orientation()[source]

Uses regex expressions compiled as class attributes to find the geometry of the molecule. (Fails Silently).

Populates the attributes:

  • orientation

print_orientation()[source]

Displays in console the geometry with a format similar to gaussian.

Link202

class pyssian.linkjobparsers.Link202(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l202.exe. Holds the orientation (Geometry) at a given step.

Parameters
  • text (str) -- text that corresponds to the output of the l202.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

orientation

List of namedtuples containing the geometry of the calculated compound.

Type

list

DistanceMatrix

For each item the postitions 0 and 1 correspond to the Atom ID in the structure and the Atomic Number/Symbol respectively. Position 1 holds a list with the distances with respect to all previous items.

Type

list

text
number
_locate_DistanceMatrix()[source]

Looks for the keyword 'Distance matrix' and reads the Input orientation table that follows (Fails Silently).

Populates the attributes:

  • DistanceMatrix

_locate_orientation()[source]

Uses regex expressions compiled as class attributes to find the geometry of the molecule. (Fails Silently).

Populates the attributes:

  • orientation

get_atom_mapping()[source]

Returns a dictionary that relates the atomic number with the symbol based on the information contained in the orientation and distance matrix.

Returns

Dictionary with Atomic Number to Symbol mapping

Return type

Out

print_orientation()[source]

Displays in console the geometry with a format similar to gaussian.

Link502

class pyssian.linkjobparsers.Link502(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l502.exe. Corresponds to a iterative calculation of the SCF cycles.

Parameters
  • text (str) -- text that corresponds to the output of the l502.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

energy

Final Potential Energy of the SCF cycles.

Type

float

_locate_energy()[source]

Uses regex expressions compiled as class attributes to find the Energy rported as 'SCF Done:' and reads the potential energy. (Fails Silently).

Populates the attributes:

  • energy

Link508

class pyssian.linkjobparsers.Link508(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.Link502

Representation and parser for the output of l508.exe. Corresponds to a iterative calculation of the SCF using a quadratic convergence algorithm.

Parameters
  • text (str) -- text that corresponds to the output of the l508.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

energy

Final Potential Energy of the SCF cycles.

Type

float

Link601

class pyssian.linkjobparsers.Link601(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l601.exe, each does a population analysis using SCF densities. Holds information about Mulliken Charges, {Dipole, Quadrupole, Traceless Quadrupole, Octapole and Hexadecapole} moments, spin densities... etc. (Currently only Mulliken Charges implemented)

Parameters
  • text (str) -- text that corresponds to the output of the l508.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

mulliken_heavy

list of mulliken charges condensed to H atoms. None if not properly parsed.

Type

list

mulliken

list of mulliken charges. None if not properly parsed.

Type

list

Link716

class pyssian.linkjobparsers.Link716(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l716.exe. Displays information about Forces and Frequency Calculations.

Parameters
  • text (str) -- text that corresponds to the output of the l716.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

dipole
Type

list

units
Type

list

zeropoint
Type

list

thermal_energy
Type

list

enthalpy
Type

list

gibbs
Type

list

EContribs

List of namedtuples with fields Name,Thermal,CV,S .

Type

list

IRSpectrum

Text that corresponds to the IRSpectrum

Type

str

mode

Either 'Forces', 'Freq' or 'Other'.

Type

str

_locate_IRSpectrum()[source]

Uses regex expressions compiled as class attributes to find the IR spectrum. (Fails Silently).

Populates the attributes:

  • IRSpectrum

_locate_dipole()[source]

Uses regex expressions compiled as class attributes to find the Dipole Vector. (Fails Silently).

Populates the attributes:

  • dipole

_locate_frequencies()[source]

Uses regex expressions compiled as class attributes to find the frequencies table. (Fails Silently).

Populates the attributes:

  • frequencies

_locate_thermochemistry()[source]

Uses regex expressions compiled as class attributes to find the thermochemistry computed properties. (Fails Silently).

Populates the attributes:

  • zeropoint

  • thermal_energy

  • enthalpy

  • gibbs

Link804

class pyssian.linkjobparsers.Link804(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l804.exe. Holds the information about the MP2 energy calculation

Parameters
  • text (str) -- text that corresponds to the output of the l804.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

MP2

Potential energy with MP2 method

Type

float

SpinComponents

List of namedtuples with the fields Name, T, E.

Type

list

_locate_MP2()[source]

Looks for the keyword 'EUMP2=' and reads the MP2 Potential Energy

_locate_SpinComponents()[source]

Looks for the keywords 'Spin Components' and reads the Energies of the spin Components

get_SCScorr()[source]

Calculates and returns the MP2(SCS) potential energy

Link913

class pyssian.linkjobparsers.Link913(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l913.exe. Holds information about CCSD(T) calculations including MP4 Energy.

Parameters
  • text (str) -- text that corresponds to the output of the l913.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

MP4

MP4 potential energy

Type

float

CCSDT

CCSD(T) potential energy

Type

float

_locate_CCSDT()[source]

Looks for the keywords 'Time for triples' which appears after the calculation has converged and reads the CCSD(T) Potential Energy

_locate_MP4()[source]

Looks for the First iteration and then looks for the keyword 'UMP4(SDQ)' and reads the MP4 Potential Energy

Link914

class pyssian.linkjobparsers.Link914(text, asEmpty=False)[source]

Bases: pyssian.linkjobparsers.LinkJob

Representation and parser for the output of l914.exe. Holds information about TDDFT calculations excited states.

Parameters
  • text (str) -- text that corresponds to the output of the l913.exe

  • asEmpty (bool) -- Flag to not parse and store the information of the text. (defaults to False)

excitedstates

list of excited states

Type

list

_extract_transitions(text)[source]

Given the slice of output text that corresponds to the transition contributions of a ExcitedState, returns each contribution as a TransitionData object.

Parameters

text (str) -- The slice of text that corresponds to the transition contributions of an ExcitedState.

Returns

list of TransitionData instances.

Return type

transitions

_locate_ExcitedStates()[source]

Does the logic of finding and slicing the text of the link into the different excited states (Fails Silently).

Populates the attributes:

  • excitedstates

print_excitedstates(*ESnumbers, show_transitions=False)[source]

Prints in the console the parameters in of the excited states selected in ascending ordinal order.

Parameters
  • *ESnumbers (int) -- An undefined number of integrers. Only the excited states that are within the provided set will be displayed.

  • show_transitions (bool, optional) -- Allows control over the display of the transitions, by default False