schrodinger.application.mopac.mopac_launchers module

This module contains classes for launching different MOPAC versions.

exception schrodinger.application.mopac.mopac_launchers.MopacLicenseError

Bases: Exception

__init__

Initialize self. See help(type(self)) for accurate signature.

args
with_traceback()

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

class schrodinger.application.mopac.mopac_launchers.MopacLauncher

Bases: object

This abstract base class (ABC) is designed to guide developers writing code to support future MOPAC releases. It shouldn’t be instantiated.

The intention is that a new release will require a new MopacLauncher subclass and this ABC documents the required interface to be automatically compliant with the legacy code.

There are currently two subclasses:
  1. MopacLauncher71 - launches a customized open source Mopac 7.1
  2. MopacLauncherMain - launches the currently supported version of Mopac
default_method
valid_methods
method_synonyms
extra_keywords
results
run(inputfile, structures=())

Run a MOPAC calculation in the local directory. The optional Structure object is updated with the output data.

Parameters:
  • inputfile (str) – name of MOPAC .mop input file
  • structures (list) – list of Structure objects
Returns:

list(job status), outfile

write_mop_file(cts, mopfile, method=None, geopt=True, keywords='', plotMO=None, gridres=None, gridext=None)

Write a new .mop MOPAC input file based on a list of Structure objects and input keywords and settings to be applied to all structures.

Parameters:
  • cts (list of schrodinger.structure.Structure) – structures to use in writing the file.
  • mopfile (str) – name of .mop file to write.
  • method (str) – The semi-empirical method to use for the calculation.
  • geopt (bool) – If True, find the minimum energy geometry.
  • keywords (str) – Space-separated keywords to use in MOPAC input file.
  • plotMO (int) – Plot <n> MOs around the HOMO/LUMO gap.
  • gridres (float) – Grid resolution for plots.
  • gridext (float) – Grid size beyond the nuclei.
__init__

Initialize self. See help(type(self)) for accurate signature.

class schrodinger.application.mopac.mopac_launchers.MopacLauncher71(energy_only=False)

Bases: schrodinger.application.mopac.mopac_launchers.MopacLauncher

This is the API for executing the MOPAC7.1 backend compiled from source, where we link to a shared library.

__init__(energy_only=False)
Parameters:energy_only (bool) – parse only energies from the MOPAC jobs.
default_method
valid_methods
method_synonyms
extra_keywords
results
write_mop_file(cts, mopfile, method='MNDO', geopt=True, keywords='', plotMO=None, gridres=None, gridext=None)

Write a new .mop MOPAC input file based on a list of Structure objects and input keywords and settings to be applied to all structures.

Parameters:
  • cts (list of schrodinger.structure.Structure) – structures to use in writing the file.
  • mopfile (str) – name of .mop file to write.
  • method (str) – The semi-empirical method to use for the calculation.
  • geopt (bool) – If True, find the minimum energy geometry.
  • keywords (str) – Space-separated keywords to use in MOPAC input file.
  • plotMO (int) – Plot <n> MOs around the HOMO/LUMO gap.
  • gridres (float) – Grid resolution for plots.
  • gridext (float) – Grid size beyond the nuclei.
run(mopfile, structures=())

Run a MOPAC calculation in the local directory with a .mop input file.

Simple support for multiple structures in the input file is provided. It is important that the number of jobs in the input file matches the number of structures in the “structures” argument, as structure properties will be updated assuming a 1:1 mapping. Currently only total energies are updated when running with multiple structures.

Parameters:
  • mopfile (str) – name of .mop input file (without the suffix)
  • structures (list) – list of Structure objects
Returns:

list(job status), outfile

class schrodinger.application.mopac.mopac_launchers.MopacLauncherMain(energy_only=False)

Bases: schrodinger.application.mopac.mopac_launchers.MopacLauncher

This is the API for executing the backend of the currently supported version of MOPAC as an external binary.

MOPAC_EXEC = 'MOPAC2016.exe'
__init__(energy_only=False)
Parameters:energy_only (bool) – parse only energies from the MOPAC jobs.
default_method
valid_methods
method_synonyms
extra_keywords
results
write_mop_file(cts, mopfile, method='RM1', geopt=True, keywords='', plotMO=None, gridres=None, gridext=None)

Write a new .mop MOPAC input file based on a list of Structure objects and input keywords and settings to be applied to all structures.

Parameters:
  • cts (list of schrodinger.structure.Structure) – Structures to use in writing the file.
  • mopfile (str) – name of .mop file to write.
  • method (str) – The semi-empirical method to use for the calculation.
  • geopt (bool) – If True, find the minimum energy geometry.
  • keywords (str) – Space-separated keywords to use in MOPAC input file.
  • plotMO (int) – Plot <n> MOs around the HOMO/LUMO gap.
  • gridres (float) – Grid resolution for plots.
  • gridext (float) – Grid size beyond the nuclei.
run(mopfile, structures=())

Run a MOPAC calculation in the local directory with a .mop input file. If optional list of Structure instances is given, then parse the output files for data with which to populate the structure properties.

Support for multiple structures in the input file is provided. It is important that the number of jobs in the input file matches the number of structures in the “structures” argument, as structure properties will be updated assuming a 1:1 mapping.

Parameters:
  • mopfile (str) – name of .mop input file (without the suffix)
  • structures (list) – list of Structure objects
Returns:

list(job status), outfile

schrodinger.application.mopac.mopac_launchers.get_mopac_launcher(version, energy_only=False)

Return a MopacLauncher object for the requested MOPAC version.

The optional argument <energy_only> may be used to tell the launcher to only parse energies from the MOPAC job when populating any structure objects that might be provided.

Parameters:
  • version (str) – MOPAC version number
  • energy_only (bool) – parse only energies from the MOPAC jobs.