Source code for scm.input_classes.engines.mopac

from __future__ import annotations
from pathlib import Path
from typing import Iterable, Literal, Sequence
from scm.pisa.block import DriverBlock,EngineBlock,FixedBlock,FreeBlock,InputBlock
from scm.pisa.key import BoolKey,FloatKey,FloatListKey,IntKey,IntListKey,MultipleChoiceKey,PathStringKey,StringKey,BoolType

[docs]class Mopac(EngineBlock): r""" :ivar CalcLocalOrbitals: Compute and print the localized orbitals, also known as Natural Bond Orbitals (NBO). This is equivalent to the LOCAL mopac keyword. :vartype CalcLocalOrbitals: BoolType | BoolKey :ivar Debug: Extra debug printing. :vartype Debug: BoolType | BoolKey :ivar Keywords: A string containing all the desired custom MOPAC keywords. Basically for anything not directly supported through AMS. :vartype Keywords: str | StringKey :ivar Model: Selects the model Hamiltonian to use in the calculation. AM1: Use the AM1 Hamiltonian. MNDO: Use the MNDO Hamiltonian. MNDOD: Use the MNDO-d Hamiltonian. RM1: Use the RM1 Hamiltonian. PM3: Use the MNDO-PM3 Hamiltonian. PM6: Use the PM6 Hamiltonian. PM6-D3: Use the PM6 Hamiltonian with Grimme's D3 corrections for dispersion. PM6-DH+: Use the PM6 Hamiltonian with corrections for dispersion and hydrogen-bonding. PM6-DH2: Use the PM6 Hamiltonian with corrections for dispersion and hydrogen-bonding. PM6-DH2X: Use PM6 with corrections for dispersion and hydrogen and halogen bonding. PM6-D3H4: Use PM6 with Rezac and Hobza's D3H4 correction. PM6-D3H4X: Use PM6 with Brahmkshatriya, et al.'s D3H4X correction. PM7: Use the PM7 Hamiltonian. PM7-TS: Use the PM7-TS Hamiltonian (only for barrier heights) :vartype Model: Literal["AM1", "MNDO", "MNDOD", "PM3", "RM1", "PM6", "PM6-D3", "PM6-DH+", "PM6-DH2", "PM6-DH2X", "PM6-D3H4X", "PM7"] :ivar Mozyme: Replace the standard SCF procedure with a localized molecular orbital (LMO) method. The time required for an SCF cycle when Mozyme is used scales linearly with system size. :vartype Mozyme: BoolType | BoolKey :ivar Sparkles: Represent lanthanides by their fully ionized 3+ sparkles. That is, they have no basis set, and therefore cannot have a charge different from +3. When using sparkles, the geometries of the lanthanides are reproduced with good accuracy, but the heats of formation and electronic properties are not accurate. :vartype Sparkles: BoolType | BoolKey :ivar UnpairedElectrons: If this key is present, a spin-unrestricted calculation with the specified number of unpaired electrons is performed. If this key is not present the number of unpaired electrons is determined automatically (0 for systems with an even number of electrons, 1 for radicals), and a restricted or unrestricted calculation is performed accordingly. :vartype UnpairedElectrons: int | IntKey :ivar Properties: MOPAC can calculate various properties of the simulated system. This block configures which properties will be calculated. :vartype Properties: Mopac._Properties :ivar SCF: Options for the self-consistent field procedure. :vartype SCF: Mopac._SCF :ivar Solvation: Options for the COSMO (Conductor like Screening Model) solvation model. :vartype Solvation: Mopac._Solvation """
[docs] class _Properties(FixedBlock): r""" MOPAC can calculate various properties of the simulated system. This block configures which properties will be calculated. :ivar StaticPolarizability: Calculate the static polarizability. An electric field gradient is applied to the system, and the response is calculated. The dipole and polarizability are calculated two different ways, from the change in heat of formation and from the change in dipole. A measure of the imprecision of the calculation can be obtained by comparing the two quantities. :vartype StaticPolarizability: BoolType | BoolKey :ivar pKa: If requested, the pKa of hydrogen atoms attached to oxygen atoms is calculated and printed. :vartype pKa: BoolType | BoolKey """ def __post_init__(self): self.StaticPolarizability: BoolType | BoolKey = BoolKey(name='StaticPolarizability', comment='Calculate the static polarizability. An electric field gradient is applied to the system, and the response is calculated. The dipole and polarizability are calculated two different ways, from the change in heat of formation and from the change in dipole. A measure of the imprecision of the calculation can be obtained by comparing the two quantities.', default=False) self.pKa: BoolType | BoolKey = BoolKey(name='pKa', comment='If requested, the pKa of hydrogen atoms attached to oxygen atoms is calculated and printed.', gui_name='pKa:', default=False)
[docs] class _SCF(FixedBlock): r""" Options for the self-consistent field procedure. :ivar CampKingConverger: Use the Camp-King SCF converger. This is a very powerful, but CPU intensive, SCF converger. :vartype CampKingConverger: BoolType | BoolKey :ivar ConvergenceThreshold: If the difference in energy between two successive SCF iterations is smaller than this value, the SCF procedure is considered converged. :vartype ConvergenceThreshold: float | FloatKey :ivar MaxIterations: Maximum number of SCF iterations. :vartype MaxIterations: int | IntKey """ def __post_init__(self): self.CampKingConverger: BoolType | BoolKey = BoolKey(name='CampKingConverger', comment='Use the Camp-King SCF converger. This is a very powerful, but CPU intensive, SCF converger.', gui_name='Use Camp-King:', default=False) self.ConvergenceThreshold: float | FloatKey = FloatKey(name='ConvergenceThreshold', comment='If the difference in energy between two successive SCF iterations is smaller than this value, the SCF procedure is considered converged.', default=0.0001, unit='kcal/mol') self.MaxIterations: int | IntKey = IntKey(name='MaxIterations', comment='Maximum number of SCF iterations.', default=2000)
[docs] class _Solvation(FixedBlock): r""" Options for the COSMO (Conductor like Screening Model) solvation model. :ivar Enabled: Use the Conductor like Screening Model (COSMO) to include solvent effects. :vartype Enabled: BoolType | BoolKey :ivar NSPA: Maximum number of COSMO surface points per atom. :vartype NSPA: Literal["12", "32", "42", "92", "122", "162", "252", "272", "362", "482", "492", "642", "752"] :ivar Solvent: Solvent details :vartype Solvent: Mopac._Solvation._Solvent """
[docs] class _Solvent(FixedBlock): r""" Solvent details :ivar Eps: User-defined dielectric constant of the solvent (overrides the Eps value of the solvent defined in 'Name') :vartype Eps: float | FloatKey :ivar Name: Name of a pre-defined solvent. A solvent is characterized by the dielectric constant (Eps) and the solvent radius (Rad). :vartype Name: Literal["CRS", "AceticAcid", "Acetone", "Acetonitrile", "Ammonia", "Aniline", "Benzene", "BenzylAlcohol", "Bromoform", "Butanol", "isoButanol", "tertButanol", "CarbonDisulfide", "CarbonTetrachloride", "Chloroform", "Cyclohexane", "Cyclohexanone", "Dichlorobenzene", "DiethylEther", "Dioxane", "DMFA", "DMSO", "Ethanol", "EthylAcetate", "Dichloroethane", "EthyleneGlycol", "Formamide", "FormicAcid", "Glycerol", "HexamethylPhosphoramide", "Hexane", "Hydrazine", "Methanol", "MethylEthylKetone", "Dichloromethane", "Methylformamide", "Methypyrrolidinone", "Nitrobenzene", "Nitrogen", "Nitromethane", "PhosphorylChloride", "IsoPropanol", "Pyridine", "Sulfolane", "Tetrahydrofuran", "Toluene", "Triethylamine", "TrifluoroaceticAcid", "Water"] :ivar Rad: User-defined radius of the solvent molecule (overrides the Rad value of the solvent defined in 'Name'). :vartype Rad: float | FloatKey """ def __post_init__(self): self.Eps: float | FloatKey = FloatKey(name='Eps', comment="User-defined dielectric constant of the solvent (overrides the Eps value of the solvent defined in 'Name')", gui_name='Dielectric constant:') self.Name: Literal["CRS", "AceticAcid", "Acetone", "Acetonitrile", "Ammonia", "Aniline", "Benzene", "BenzylAlcohol", "Bromoform", "Butanol", "isoButanol", "tertButanol", "CarbonDisulfide", "CarbonTetrachloride", "Chloroform", "Cyclohexane", "Cyclohexanone", "Dichlorobenzene", "DiethylEther", "Dioxane", "DMFA", "DMSO", "Ethanol", "EthylAcetate", "Dichloroethane", "EthyleneGlycol", "Formamide", "FormicAcid", "Glycerol", "HexamethylPhosphoramide", "Hexane", "Hydrazine", "Methanol", "MethylEthylKetone", "Dichloromethane", "Methylformamide", "Methypyrrolidinone", "Nitrobenzene", "Nitrogen", "Nitromethane", "PhosphorylChloride", "IsoPropanol", "Pyridine", "Sulfolane", "Tetrahydrofuran", "Toluene", "Triethylamine", "TrifluoroaceticAcid", "Water"] = MultipleChoiceKey(name='Name', comment='Name of a pre-defined solvent. A solvent is characterized by the dielectric constant (Eps) and the solvent radius (Rad).', gui_name='Solvent:', default='Water', choices=['CRS', 'AceticAcid', 'Acetone', 'Acetonitrile', 'Ammonia', 'Aniline', 'Benzene', 'BenzylAlcohol', 'Bromoform', 'Butanol', 'isoButanol', 'tertButanol', 'CarbonDisulfide', 'CarbonTetrachloride', 'Chloroform', 'Cyclohexane', 'Cyclohexanone', 'Dichlorobenzene', 'DiethylEther', 'Dioxane', 'DMFA', 'DMSO', 'Ethanol', 'EthylAcetate', 'Dichloroethane', 'EthyleneGlycol', 'Formamide', 'FormicAcid', 'Glycerol', 'HexamethylPhosphoramide', 'Hexane', 'Hydrazine', 'Methanol', 'MethylEthylKetone', 'Dichloromethane', 'Methylformamide', 'Methypyrrolidinone', 'Nitrobenzene', 'Nitrogen', 'Nitromethane', 'PhosphorylChloride', 'IsoPropanol', 'Pyridine', 'Sulfolane', 'Tetrahydrofuran', 'Toluene', 'Triethylamine', 'TrifluoroaceticAcid', 'Water']) self.Rad: float | FloatKey = FloatKey(name='Rad', comment="User-defined radius of the solvent molecule (overrides the Rad value of the solvent defined in 'Name').", gui_name='Radius:', unit='Angstrom')
def __post_init__(self): self.Enabled: BoolType | BoolKey = BoolKey(name='Enabled', comment='Use the Conductor like Screening Model (COSMO) to include solvent effects.', gui_name='Use COSMO:', default=False) self.NSPA: Literal["12", "32", "42", "92", "122", "162", "252", "272", "362", "482", "492", "642", "752"] = MultipleChoiceKey(name='NSPA', comment='Maximum number of COSMO surface points per atom.', gui_name='NSPA:', default='42', choices=['12', '32', '42', '92', '122', '162', '252', '272', '362', '482', '492', '642', '752']) self.Solvent: Mopac._Solvation._Solvent = self._Solvent(name='Solvent', comment='Solvent details')
def __post_init__(self): self.CalcLocalOrbitals: BoolType | BoolKey = BoolKey(name='CalcLocalOrbitals', comment='Compute and print the localized orbitals, also known as Natural Bond Orbitals (NBO). This is equivalent to the LOCAL mopac keyword.', default=False) self.Debug: BoolType | BoolKey = BoolKey(name='Debug', comment='Extra debug printing.', hidden=True, default=False) self.Keywords: str | StringKey = StringKey(name='Keywords', comment='A string containing all the desired custom MOPAC keywords. Basically for anything not directly supported through AMS.') self.Model: Literal["AM1", "MNDO", "MNDOD", "PM3", "RM1", "PM6", "PM6-D3", "PM6-DH+", "PM6-DH2", "PM6-DH2X", "PM6-D3H4X", "PM7"] = MultipleChoiceKey(name='Model', comment="Selects the model Hamiltonian to use in the calculation.\n\n AM1: Use the AM1 Hamiltonian.\n MNDO: Use the MNDO Hamiltonian.\n MNDOD: Use the MNDO-d Hamiltonian.\n RM1: Use the RM1 Hamiltonian.\n PM3: Use the MNDO-PM3 Hamiltonian.\n PM6: Use the PM6 Hamiltonian.\n PM6-D3: Use the PM6 Hamiltonian with Grimme's D3 corrections for dispersion.\n PM6-DH+: Use the PM6 Hamiltonian with corrections for dispersion and hydrogen-bonding.\n PM6-DH2: Use the PM6 Hamiltonian with corrections for dispersion and hydrogen-bonding.\n PM6-DH2X: Use PM6 with corrections for dispersion and hydrogen and halogen bonding.\n PM6-D3H4: Use PM6 with Rezac and Hobza's D3H4 correction.\n PM6-D3H4X: Use PM6 with Brahmkshatriya, et al.'s D3H4X correction.\n PM7: Use the PM7 Hamiltonian.\n PM7-TS: Use the PM7-TS Hamiltonian (only for barrier heights)", gui_name='Method:', default='PM7', choices=['AM1', 'MNDO', 'MNDOD', 'PM3', 'RM1', 'PM6', 'PM6-D3', 'PM6-DH+', 'PM6-DH2', 'PM6-DH2X', 'PM6-D3H4X', 'PM7']) self.Mozyme: BoolType | BoolKey = BoolKey(name='Mozyme', comment='Replace the standard SCF procedure with a localized molecular orbital (LMO) method. The time required for an SCF cycle when Mozyme is used scales linearly with system size.', default=False) self.Sparkles: BoolType | BoolKey = BoolKey(name='Sparkles', comment='Represent lanthanides by their fully ionized 3+ sparkles. That is, they have no basis set, and therefore cannot have a charge different from +3. When using sparkles, the geometries of the lanthanides are reproduced with good accuracy, but the heats of formation and electronic properties are not accurate.', default=False) self.UnpairedElectrons: int | IntKey = IntKey(name='UnpairedElectrons', comment='If this key is present, a spin-unrestricted calculation with the specified number of unpaired electrons is performed. If this key is not present the number of unpaired electrons is determined automatically (0 for systems with an even number of electrons, 1 for radicals), and a restricted or unrestricted calculation is performed accordingly.', gui_name='Spin polarization:') self.Properties: Mopac._Properties = self._Properties(name='Properties', comment='MOPAC can calculate various properties of the simulated system. This block configures which properties will be calculated.') self.SCF: Mopac._SCF = self._SCF(name='SCF', comment='Options for the self-consistent field procedure.') self.Solvation: Mopac._Solvation = self._Solvation(name='Solvation', comment='Options for the COSMO (Conductor like Screening Model) solvation model.')