schrodinger.application.mopac.results_main module

This module parses and stores the results of a MOPAC calculation. A MopacResultsMain class is populated with data from the output files from MOPAC_MAIN using a text parser.

exception schrodinger.application.mopac.results_main.MopacPropertyError

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacNumericalError

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacBasisError1

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacBasisError2

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacBasisError3

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacBasisError4

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacBasisError5

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

exception schrodinger.application.mopac.results_main.MopacGradientParserError

Bases: Exception

__init__(*args, **kwargs)
args
with_traceback()

Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.

schrodinger.application.mopac.results_main.split_outfile(outfile)

Process .out or .aux output files, splitting them up into subfiles if more than one output deck is found per file.

Parameters

outfile (str) – name of output file to process

Returns

list containing output file names for results that were found and “None”s for results that are missing

class schrodinger.application.mopac.results_main.MopacMainTextParser(file_iter)

Bases: object

Parser for MOPAC_MAIN’s .out and .aux files. Using decorators, the callback() function below populates the “callbacks” dictionary in this class with key-value pairs of the form (regex,func) where “regex” is a regular expression to catch patterns in the output file, and “func” is the callback function which is triggered when the regex is matched.

In this way, each specific callback is triggered by a given pattern such as ‘HOMO LUMO ENERGIES (EV) =’, and the callback function processes the matched lines.

Note that multiple regex’s can be associated with a given callback function by associating it with two or more decorators. In this way, the same callback can be triggered multiple times. e.g. for both the .aux and .out files, perhaps for consistency checking etc.

Typically, however, only one regex is associated with each callback so that data for a given property is grepped from either the .out file OR the .aux file, but not both.

callbacks = OrderedDict([(re.compile('HEAT_OF_FORMATION:KCAL/MOL=(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)'), <function heat_of_formation>), (re.compile('FINAL HEAT OF FORMATION\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)'), <function heat_of_formation>), (re.compile('ETOT \\(EONE \\+ ETWO\\)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)\\s+EV'), <function total_energy>), (re.compile('FINAL  POINT  AND  DERIVATIVES'), <function func>), (re.compile('                              (.*) CALCULATION'), <function method>), (re.compile('IONIZATION_POTENTIAL:EV=(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)'), <function ionization_potential>), (re.compile('HOMO LUMO ENERGIES \\(EV\\) =(\\s*\\+?\\-?\\d+\\.\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)'), <function homo_lumo_energy>), (re.compile('ALPHA SOMO LUMO \\(EV\\)\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)'), <function alpha_somo_lumo_energy>), (re.compile('ALPHA HOMO LUMO \\(EV\\)\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)'), <function alpa_homo_lumo_energy>), (re.compile('BETA\\s+SOMO LUMO \\(EV\\)\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)'), <function beta_somo_lumo_energy>), (re.compile('BETA\\s+HOMO LUMO \\(EV\\)\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+)'), <function beta_homo_lumo_energy>), (re.compile('Parr & Pople absolute hardness:(\\s*\\+?\\-?\\d+\\.\\d+)'), <function parr_and_pople>), (re.compile('Mulliken electronegativity:(\\s*\\+?\\-?\\d+\\.\\d+)'), <function mulliken_electronegativity>), (re.compile('DIPOLE:DEBYE=(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)'), <function dipole>), (re.compile('DIP_VEC:DEBYE\\[3\\]=(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)\\s+(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)'), <function dipole_xyz>), (re.compile('DIPOLE MOMENT EVALUATED FROM THE POINT CHARGES'), <function dipole_esp>), (re.compile('ATOM_X:ANGSTROMS\\[(\\d+)\\]='), <function atom_x_angstroms>), (re.compile('ATOM_X_OPT:ANGSTROMS\\[(\\d+)\\]='), <function atom_x_opt>), (re.compile('^ ATOM_CHARGES\\[(\\d+)\\]='), <function atom_charges>), (re.compile('^ MULLIKEN_ATOM_CHARGES\\[(\\d+)\\]='), <function mulliken_charge>), (re.compile('^ ELECTOSTATIC_POTENTIAL_CHARGES\\[(\\d+)\\]='), <function esp_charge>), (re.compile('a\\s+n\\s+Dn\\(r\\)\\s+De\\(r\\)\\s+q\\(r\\) - Z\\(r\\)'), <function total_nucleophilic_superdelocalizability>), (re.compile('a\\s+n\\s+piS\\(r\\)'), <function self_polarizability>), (re.compile('^ ATOM_EL\\[(\\d+)\\]='), <function atom_el>), (re.compile('^ NUM_ELECTRONS=(\\d+)'), <function num_electrons>), (re.compile('^ AO_ATOMINDEX\\[(\\d+)\\]='), <function ao_index>), (re.compile('^ ATOM_SYMTYPE\\[(\\d+)\\]='), <function atom_symtype>), (re.compile('^ AO_ZETA\\[(\\d+)\\]='), <function ao_zeta>), (re.compile('^ ATOM_PQN\\[(\\d+)\\]='), <function atom_pqn>), (re.compile('^ EIGENVALUES\\[(\\d+)\\]='), <function eigenvalues>), (re.compile('^ MOLECULAR_ORBITAL_OCCUPANCIES\\[(\\d+)\\]='), <function mo_occupancies>), (re.compile('^ OVERLAP_MATRIX\\[(\\d+)\\]='), <function overlap_matrix>), (re.compile('^ EIGENVECTORS\\[(\\d+)\\]='), <function eigenvectors>)])
callback_minimal = OrderedDict([(re.compile('HEAT_OF_FORMATION:KCAL/MOL=(\\s*\\+?\\-?\\d+\\.\\d+D[\\+,\\-]\\d+)'), <function heat_of_formation>), (re.compile('FINAL HEAT OF FORMATION\\s+=(\\s*\\+?\\-?\\d+\\.\\d+)'), <function heat_of_formation>), (re.compile('                              (.*) CALCULATION'), <function method>)])
__init__(file_iter)
parse()

Loop over self.file_iter and trigger the callbacks.

Returns

OrderedDict of structure properties

parse_multiple_jobs(minimal=False)

Loop over self.file_iter and trigger the callbacks. This is intended for use with output files that have results from multiple jobs in them (MOPAC-224).

The optional arg <minimal> can be used to accelerate the parsing when only a few important (hard-coded) properties are required, as indicated by the @callback_minimal decorators. This is useful for large file and fast screening by energy.

Parameters

minimal (bool) – parse only a minimal subset of properties

Returns

list of OrderedDict of structure properties

schrodinger.application.mopac.results_main.fortfloat(val)

Convert a floating point number in Fortran notation to a regular float.

schrodinger.application.mopac.results_main.check_memory_use(nvals, name)

Check memory requirment for a long list of floats. Print message if size exceeds MEMORY_WARNING.

schrodinger.application.mopac.results_main.update_props(props, key, value, precision=5)

Update the props dictionary with the key-value pair, performing consistency checks if the key already exists.

schrodinger.application.mopac.results_main.callback(regex)

This decorator is just a convenient way to populate the callbacks dictionary in the MopacMainTextParser. The associated functions themselves are not actually decorated.

schrodinger.application.mopac.results_main.callback_minimal(regex)

This decorator is just a convenient way to populate the callbacks dictionary in the MopacMainTextParser. The associated functions themselves are not actually decorated.

schrodinger.application.mopac.results_main.heat_of_formation(props, match, it)
schrodinger.application.mopac.results_main.total_energy(props, match, it)
schrodinger.application.mopac.results_main.func(props, match, it)

Parse gradient data from .out

schrodinger.application.mopac.results_main.method(props, match, it)
schrodinger.application.mopac.results_main.ionization_potential(props, match, it)
schrodinger.application.mopac.results_main.homo_lumo_energy(props, match, it)
schrodinger.application.mopac.results_main.alpha_somo_lumo_energy(props, match, it)
schrodinger.application.mopac.results_main.alpa_homo_lumo_energy(props, match, it)
schrodinger.application.mopac.results_main.beta_somo_lumo_energy(props, match, it)
schrodinger.application.mopac.results_main.beta_homo_lumo_energy(props, match, it)
schrodinger.application.mopac.results_main.parr_and_pople(props, match, it)
schrodinger.application.mopac.results_main.mulliken_electronegativity(props, match, it)
schrodinger.application.mopac.results_main.dipole(props, match, it)
schrodinger.application.mopac.results_main.dipole_xyz(props, match, it)
schrodinger.application.mopac.results_main.dipole_esp(props, match, it)
schrodinger.application.mopac.results_main.atom_x_angstroms(props, match, it)
schrodinger.application.mopac.results_main.atom_x_opt(props, match, it)
schrodinger.application.mopac.results_main.atom_charges(props, match, it)
schrodinger.application.mopac.results_main.mulliken_charge(props, match, it)
schrodinger.application.mopac.results_main.esp_charge(props, match, it)
schrodinger.application.mopac.results_main.total_nucleophilic_superdelocalizability(props, match, it)
schrodinger.application.mopac.results_main.self_polarizability(props, match, it)
schrodinger.application.mopac.results_main.atom_el(props, match, it)
schrodinger.application.mopac.results_main.num_electrons(props, match, it)
schrodinger.application.mopac.results_main.ao_index(props, match, it)
schrodinger.application.mopac.results_main.atom_symtype(props, match, it)
schrodinger.application.mopac.results_main.ao_zeta(props, match, it)
schrodinger.application.mopac.results_main.atom_pqn(props, match, it)
schrodinger.application.mopac.results_main.eigenvalues(props, match, it)
schrodinger.application.mopac.results_main.mo_occupancies(props, match, it)
schrodinger.application.mopac.results_main.overlap_matrix(props, match, it)
schrodinger.application.mopac.results_main.eigenvectors(props, match, it)
class schrodinger.application.mopac.results_main.MopacResultsMain(outfile, auxfile=None, struct=None)

Bases: object

A class to parse and store the results of a calculation from MOPAC_MAIN

__init__(outfile, auxfile=None, struct=None)
Parameters
  • outfile (str) – name of .out file generated by MOPAC binary

  • auxfile (str) – name of .aux file generated by MOPAC binary

  • struct (structure.Structure) – structure instance to populate with data

property name
property structure
property method
property output_file
property statusOk
write_vis_files(nplot, gridres, gridext)

This function will call the Fortran routines to generate the 3D data and .vis files for plotting surfaces.

Parameters

nplot (int) – number of MOs to plot around HOMO/LUMO gap.