MOPAC (standalone program)

Technical

Starting from AMS2019, MOPAC is fully integrated as an AMS engine. If you want to use the MOPAC engine in AMS2019, you should use AMSJob (and not MOPACJob). This page documents the interface to the standalone MOPAC program.

MOPAC (Molecular Orbital PACkage) is a semiempirical quantum chemistry program based on NDDO approximation. More information about the standalone MOPAC program can be found on its official website.

PLAMS features a basic interface to standalone MOPAC program via the classes MOPACJob and MOPACResults.

Preparing input

Preparing an instance of MOPACJob follows general principles for SingleJob. Information adjusting input file is stored in myjob.settings.input branch, whereas a runscript is created based on contents of myjob.settings.runscript. The geometry of your system is supplied in the standard way: with the molecule attribute.

The input format of the standalone MOPAC program is simple and straightforward: all the keywords adjusting parameters of your calculation are placed in the first line of the input file. Next two lines are left for user’s comments and then geometry of the system follows.

Since blocks and subblocks are not present in MOPAC’s input, the `myjob.settings.input branch needs to have a flat structure, just like a regular dictionary, without any nested Settings instances. The value of a particular key adjusts the way in which keywords are printed in the first line of the input file:

  • myjob.settings.input.keyword = True will print keyword

  • myjob.settings.input.keyword = value will print keyword=value (with value being casted to str if needed)

  • myjob.settings.input.keyword = (val1, val2, ...) will print keyword=(val1,val2,...) (when value is a tuple)

  • myjob.settings.input.keyword = [val1, val2, ...] will print keyword(val1,val2,...) (when value is a list)

Moreover, if the keyword AUX is not supplied by the user, it is automatically inserted in the form AUX(0,PRECISION=9) (for compatibility with AMSSuite GUI).

The standalone MOPAC program allows to freeze each coordinate of each atom separately. This information is extracted from mopac_freeze key in each atom’s properties. If present, this key should contain a string with all axes that you wish to freeze for a particular atom:

mol = Molecule('system.xyz')
mol[1].properties.mopac_freeze = 'x'    #freeze x coordinate of atom 1
mol[2].properties.mopac_freeze = 'yz'   #freeze y and z coordinates of atom 2
mol[3].properties.mopac_freeze = 'xyz'  #freeze atom 3

API

class MOPACJob(molecule=None, name='plamsjob', settings=None, depend=None)[source]

A class representing a single computational job with MOPAC.

get_input()[source]

Transform the contents of input branch of settings into the first line of MOPAC input. Print the molecular coordinates together with frozen coordinate flags.

get_runscript()[source]

Generate a MOPAC runscript.

The name of the MOPAC executable is taken from class attribute MOPACJob._command. If you experience problems running MOPAC, check if that value corresponds to the name of the executable and this executable is visible in your $PATH (in case of AMSuite it’s in $AMSBIN). Note that a bare MOPAC executable should be used here, please avoid using any wrappers.

The execution of MOPAC binary is followed by calling a simple command line tool tokf which reads various output text files produced by MOPAC and collects all the data in a binary KF file. See KF files for details.

check()[source]

Grep standard output for * JOB ENDED NORMALLY *.

class MOPACResults(job)[source]

A class for results of computation done with MOPAC.

This class inherits all methods from SCMResults.

Technical

In case of a MOPAC job, preparation is much different from other programs of AMSuite, but the result handling is quite similar due to presence of KF files. Therefore MOPACResults is a subclass of SCMResults, but MOPACJob is not a subclass of SCMJob.

_atomic_numbers_input_order()[source]

Return a list of atomic numbers, in the input order. Abstract method.