Source code for scm.input_classes.drivers.reactionsdiscovery

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 ReactionsDiscovery(DriverBlock): r""" :ivar Engine: The input for the computational engine for the MolecularDynamics and NetworkExtraction tasks. The header of the block determines the type of the engine. :vartype Engine: EngineBlock :ivar LoadSystem: Block that controls reading the chemical system from a KF file instead of the [System] block. :vartype LoadSystem: ReactionsDiscovery._LoadSystem :ivar MolecularDynamics: Settings for reactive molecular dynamics. :vartype MolecularDynamics: ReactionsDiscovery._MolecularDynamics :ivar NetworkExtraction: Options for extracting the reactive network from MD trajectories :vartype NetworkExtraction: ReactionsDiscovery._NetworkExtraction :ivar ProductRanking: Options for ranking of the intermediates by stability :vartype ProductRanking: ReactionsDiscovery._ProductRanking :ivar System: Specification of the chemical system. For some applications more than one system may be present in the input. In this case, all systems except one must have a non-empty string ID specified after the System keyword. The system without an ID is considered the main one. :vartype System: ReactionsDiscovery._System """
[docs] class _Engine(EngineBlock): r""" The input for the computational engine for the MolecularDynamics and NetworkExtraction tasks. The header of the block determines the type of the engine. """ def __post_init__(self): pass
[docs] class _LoadSystem(FixedBlock): r""" Block that controls reading the chemical system from a KF file instead of the [System] block. :ivar File: The path of the KF file from which to load the system. It may also be the results directory containing it. :vartype File: str | Path | StringKey :ivar Section: The section on the KF file from which to load the system. :vartype Section: str | StringKey """ def __post_init__(self): self.File: str | Path | StringKey = PathStringKey(name='File', comment='The path of the KF file from which to load the system. It may also be the results directory containing it.', ispath=True) self.Section: str | StringKey = StringKey(name='Section', comment='The section on the KF file from which to load the system.', default='Molecule')
[docs] class _MolecularDynamics(FixedBlock): r""" Settings for reactive molecular dynamics. :ivar Enabled: Whether to run molecular dynamics. :vartype Enabled: BoolType | BoolKey :ivar NumSimulations: Total number of MD simulations to run. :vartype NumSimulations: int | IntKey :ivar TimeStep: Molecular dynamics time step. :vartype TimeStep: float | FloatKey :ivar Type: The type of molecular dynamics. :vartype Type: Literal["NanoReactorOld", "LatticeDeformationOld", "NanoReactor", "LatticeDeformation", "Restart"] :ivar UseDeuterium: If true, all hydrogen atoms will be replaced by deuterium during the MD. This helps to slow down the motion of the hydrogen atoms. This options does *not* affect the density you should insert in BuildSystem%Density. However, it *does* affect the density on the resulting MD trajectory file. :vartype UseDeuterium: BoolType | BoolKey :ivar BondOrders: Details regarding the calculation/guessing of bond orders during Molecular Dynamics. The bond changes during the MD are later analyzed in the Network Extraction step. :vartype BondOrders: ReactionsDiscovery._MolecularDynamics._BondOrders :ivar BuildSystem: Build the initial system for molecular dynamics with packmol. If ``MolecularDynamics%Type`` is set to ``Restart``, then BuildSystem is ignored. :vartype BuildSystem: ReactionsDiscovery._MolecularDynamics._BuildSystem :ivar LatticeDeformation: Option for the reactive molecular dynamics. :vartype LatticeDeformation: ReactionsDiscovery._MolecularDynamics._LatticeDeformation :ivar NanoReactor: Option for the reactive molecular dynamics. :vartype NanoReactor: ReactionsDiscovery._MolecularDynamics._NanoReactor :ivar Restart: Settings for restarting MD simulations. :vartype Restart: ReactionsDiscovery._MolecularDynamics._Restart """
[docs] class _BondOrders(FixedBlock): r""" Details regarding the calculation/guessing of bond orders during Molecular Dynamics. The bond changes during the MD are later analyzed in the Network Extraction step. :ivar Method: How to compute the bond orders. 'Guess': Use a bond guessing algorithm based on the system's geometry. This is the same algorithm that is used by the Graphical User Interface to guess bonds. 'EngineWithGuessFallback': let the engine compute the bond orders but if the engine did not produce any bond orders, use the bond guessing algorithm as a fallback option. :vartype Method: Literal["Guess", "EngineWithGuessFallback"] """ def __post_init__(self): self.Method: Literal["Guess", "EngineWithGuessFallback"] = MultipleChoiceKey(name='Method', comment="How to compute the bond orders.\n\n'Guess': Use a bond guessing algorithm based on the system's geometry. This is the same algorithm that is used by the Graphical User Interface to guess bonds.\n\n'EngineWithGuessFallback': let the engine compute the bond orders but if the engine did not produce any bond orders, use the bond guessing algorithm as a fallback option.", default='EngineWithGuessFallback', choices=['Guess', 'EngineWithGuessFallback'])
[docs] class _BuildSystem(FixedBlock): r""" Build the initial system for molecular dynamics with packmol. If ``MolecularDynamics%Type`` is set to ``Restart``, then BuildSystem is ignored. :ivar Density: The initial density of the system. This should be the lowest density (corresponding to the largest volume) that you want the system to have. The standard atomic masses are used when building the system. :vartype Density: float | FloatKey :ivar Enabled: If True, build the initial system using packmol. If False, a System block must be provided with the initial system. :vartype Enabled: BoolType | BoolKey :ivar Equilibration: Whether to run a short 250 fs equilibration simulation on the packmol-built structure. :vartype Equilibration: BoolType | BoolKey :ivar NumAtoms: Approximate total number of atoms in each MD simulation. :vartype NumAtoms: int | IntKey :ivar Molecule: A molecule to put in the MD simulation. :vartype Molecule: ReactionsDiscovery._MolecularDynamics._BuildSystem._Molecule """
[docs] class _Molecule(FixedBlock): r""" A molecule to put in the MD simulation. :ivar MoleFraction: Mole fraction of the molecule (the mole fractions of the various molecules will be normalized, so only the relative MoleFraction values matter) :vartype MoleFraction: float | FloatKey :ivar SMILES: The SMILES string of the molecules. :vartype SMILES: str | StringKey :ivar SystemID: The ID of the corresponding System (i.e. the header of the corresponding System block). :vartype SystemID: str | StringKey """ def __post_init__(self): self.MoleFraction: float | FloatKey = FloatKey(name='MoleFraction', comment='Mole fraction of the molecule (the mole fractions of the various molecules will be normalized, so only the relative MoleFraction values matter)', gui_name='Relative mole fraction:', default=1.0) self.SMILES: str | StringKey = StringKey(name='SMILES', comment='The SMILES string of the molecules.', gui_type='smiles') self.SystemID: str | StringKey = StringKey(name='SystemID', comment='The ID of the corresponding System (i.e. the header of the corresponding System block).', gui_type='molecule')
def __post_init__(self): self.Density: float | FloatKey = FloatKey(name='Density', comment='The initial density of the system. This should be the lowest density (corresponding to the largest volume) that you want the system to have. The standard atomic masses are used when building the system.', default=1.0, unit='g/cm^3') self.Enabled: BoolType | BoolKey = BoolKey(name='Enabled', comment='If True, build the initial system using packmol. If False, a System block must be provided with the initial system.', gui_name='Build System', default=True) self.Equilibration: BoolType | BoolKey = BoolKey(name='Equilibration', comment='Whether to run a short 250 fs equilibration simulation on the packmol-built structure.', default=False) self.NumAtoms: int | IntKey = IntKey(name='NumAtoms', comment='Approximate total number of atoms in each MD simulation.', gui_name='Number of atoms:', default=200) self.Molecule: ReactionsDiscovery._MolecularDynamics._BuildSystem._Molecule = self._Molecule(name='Molecule', comment='A molecule to put in the MD simulation.', unique=False)
[docs] class _LatticeDeformation(FixedBlock): r""" Option for the reactive molecular dynamics. :ivar MinVolumeFraction: The minimum (compressed) volume of the system, as a fraction of the initial (maximum) system volume. :vartype MinVolumeFraction: float | FloatKey :ivar NumCycles: How many compression-expansion cycles to perform. :vartype NumCycles: int | IntKey :ivar Period: The period with which the lattice will oscillate in femtoseconds. :vartype Period: float | FloatKey :ivar Temperature: Thermostat temperature during the MD simulation. :vartype Temperature: float | FloatKey """ def __post_init__(self): self.MinVolumeFraction: float | FloatKey = FloatKey(name='MinVolumeFraction', comment='The minimum (compressed) volume of the system, as a fraction of the initial (maximum) system volume.', gui_name='Minimum volume fraction:', default=0.3) self.NumCycles: int | IntKey = IntKey(name='NumCycles', comment='How many compression-expansion cycles to perform.', gui_name='Number of cycles:', default=10) self.Period: float | FloatKey = FloatKey(name='Period', comment='The period with which the lattice will oscillate in femtoseconds.', default=100.0, unit='fs') self.Temperature: float | FloatKey = FloatKey(name='Temperature', comment='Thermostat temperature during the MD simulation.', default=500.0, unit='K')
[docs] class _NanoReactor(FixedBlock): r""" Option for the reactive molecular dynamics. :ivar DiffusionTime: The length of the diffusion phase in femtoseconds. :vartype DiffusionTime: float | FloatKey :ivar InitialRadius: The radius of the initial (spherical) system. If ``BuildSystem`` is used, the value is ignored (then the value is automatically determined). If ``BuildSystem`` is not used, then a guess for the ``InitialRadius`` will be made if it is not specified. :vartype InitialRadius: float | FloatKey :ivar MinVolumeFraction: The minimum (compressed) volume of the system, as a fraction of the initial (maximum) system volume. :vartype MinVolumeFraction: float | FloatKey :ivar NumCycles: How many compression-expansion cycles to perform. :vartype NumCycles: int | IntKey :ivar Temperature: Temperature during the diffusion phase. The temperature during the compression phase will be much higher as a result of the inward acceleration. :vartype Temperature: float | FloatKey """ def __post_init__(self): self.DiffusionTime: float | FloatKey = FloatKey(name='DiffusionTime', comment='The length of the diffusion phase in femtoseconds.', default=250.0, unit='fs') self.InitialRadius: float | FloatKey = FloatKey(name='InitialRadius', comment='The radius of the initial (spherical) system. If ``BuildSystem`` is used, the value is ignored (then the value is automatically determined). If ``BuildSystem`` is not used, then a guess for the ``InitialRadius`` will be made if it is not specified.', unit='angstrom') self.MinVolumeFraction: float | FloatKey = FloatKey(name='MinVolumeFraction', comment='The minimum (compressed) volume of the system, as a fraction of the initial (maximum) system volume.', gui_name='Minimum volume fraction:', default=0.6) self.NumCycles: int | IntKey = IntKey(name='NumCycles', comment='How many compression-expansion cycles to perform.', gui_name='Number of cycles:', default=10) self.Temperature: float | FloatKey = FloatKey(name='Temperature', comment='Temperature during the diffusion phase. The temperature during the compression phase will be much higher as a result of the inward acceleration.', default=500.0, unit='K')
[docs] class _Restart(FixedBlock): r""" Settings for restarting MD simulations. :ivar Directory: Directory containing a previous Reactions Discovery calculation with MD simulations that were not finished. Note: This directory will be scanned recursively for ams.rkf files! :vartype Directory: str | Path | StringKey :ivar NSteps: Number of MD steps. If left empty, the number of MD steps from the original MD trajectory will be used. Note that you need to manually increase this number if you want to continue finished simulations. :vartype NSteps: int | IntKey """ def __post_init__(self): self.Directory: str | Path | StringKey = PathStringKey(name='Directory', comment='Directory containing a previous Reactions Discovery calculation with MD simulations that were not finished. Note: This directory will be scanned recursively for ams.rkf files!', gui_name='Restart directory:', ispath=True, gui_type='directory') self.NSteps: int | IntKey = IntKey(name='NSteps', comment='Number of MD steps. If left empty, the number of MD steps from the original MD trajectory will be used. Note that you need to manually increase this number if you want to continue finished simulations.', gui_name='Number of steps:')
def __post_init__(self): self.Enabled: BoolType | BoolKey = BoolKey(name='Enabled', comment='Whether to run molecular dynamics.', gui_name='Reactive Molecular Dynamics', default=True) self.NumSimulations: int | IntKey = IntKey(name='NumSimulations', comment='Total number of MD simulations to run.', gui_name='Number of simulations:', default=4) self.TimeStep: float | FloatKey = FloatKey(name='TimeStep', comment='Molecular dynamics time step.', default=0.5, unit='fs') self.Type: Literal["NanoReactorOld", "LatticeDeformationOld", "NanoReactor", "LatticeDeformation", "Restart"] = MultipleChoiceKey(name='Type', comment='The type of molecular dynamics.', default='NanoReactor', choices=['NanoReactorOld', 'LatticeDeformationOld', 'NanoReactor', 'LatticeDeformation', 'Restart'], hiddenchoices=['NanoReactorOld', 'LatticeDeformationOld']) self.UseDeuterium: BoolType | BoolKey = BoolKey(name='UseDeuterium', comment='If true, all hydrogen atoms will be replaced by deuterium during the MD. This helps to slow down the motion of the hydrogen atoms. This options does *not* affect the density you should insert in BuildSystem%Density. However, it *does* affect the density on the resulting MD trajectory file.', default=False) self.BondOrders: ReactionsDiscovery._MolecularDynamics._BondOrders = self._BondOrders(name='BondOrders', comment='Details regarding the calculation/guessing of bond orders during Molecular Dynamics. The bond changes during the MD are later analyzed in the Network Extraction step.') self.BuildSystem: ReactionsDiscovery._MolecularDynamics._BuildSystem = self._BuildSystem(name='BuildSystem', comment='Build the initial system for molecular dynamics with packmol. If ``MolecularDynamics%Type`` is set to ``Restart``, then BuildSystem is ignored.') self.LatticeDeformation: ReactionsDiscovery._MolecularDynamics._LatticeDeformation = self._LatticeDeformation(name='LatticeDeformation', comment='Option for the reactive molecular dynamics.') self.NanoReactor: ReactionsDiscovery._MolecularDynamics._NanoReactor = self._NanoReactor(name='NanoReactor', comment='Option for the reactive molecular dynamics.') self.Restart: ReactionsDiscovery._MolecularDynamics._Restart = self._Restart(name='Restart', comment='Settings for restarting MD simulations.')
[docs] class _NetworkExtraction(FixedBlock): r""" Options for extracting the reactive network from MD trajectories :ivar Enabled: Whether to perform network extraction. :vartype Enabled: BoolType | BoolKey :ivar ExtractFromFailedMDJobs: Whether to extract from failed/crashed MD jobs (by default, only successful jobs are used) :vartype ExtractFromFailedMDJobs: BoolType | BoolKey :ivar MDTrajectories: If MolecularDynamics%Enabled is False, this directory will be recursively scanned for ams.rkf files containing MD trajectories. All found trajectories will be used for the analysis. It should typically be a Reactions Discovery results directory containing finished MD simulations. :vartype MDTrajectories: str | Path | StringKey :ivar StoreGeometryOptimizationResults: Many AMS calculations are performed to analyse whether detected molecules are stable. Enabling this option will store all those calculations on disk, which can be helpful to understand why a molecule was not considered stable or why a calculation failed, but it will make the NetworkExtraction much slower and can take up large amounts of disk space. :vartype StoreGeometryOptimizationResults: BoolType | BoolKey :ivar UseCharges: Use engine-calculated charges if they exist on the MD trajectory files for the NetworkExtraction :vartype UseCharges: BoolType | BoolKey :ivar Print: Printing details :vartype Print: ReactionsDiscovery._NetworkExtraction._Print """
[docs] class _Print(FixedBlock): r""" Printing details :ivar FilterFluctuations: If true, do not print molecules that are only part of recrossing reactions. :vartype FilterFluctuations: BoolType | BoolKey :ivar MaxReactionOrder: If the reaction order is larger than this value, the reaction will not be printed. :vartype MaxReactionOrder: int | IntKey :ivar MinReactionsThreshold: If a molecule is involved in fewer reaction than this value, skip printing the results corresponding to it. To print all molecules, set this value to 0. :vartype MinReactionsThreshold: int | IntKey :ivar SkipRareReactions: If true,reduce the output by filtering out rare reactions. If false, always print all reactions. :vartype SkipRareReactions: BoolType | BoolKey """ def __post_init__(self): self.FilterFluctuations: BoolType | BoolKey = BoolKey(name='FilterFluctuations', comment='If true, do not print molecules that are only part of recrossing reactions.', default=True) self.MaxReactionOrder: int | IntKey = IntKey(name='MaxReactionOrder', comment='If the reaction order is larger than this value, the reaction will not be printed.', default=4) self.MinReactionsThreshold: int | IntKey = IntKey(name='MinReactionsThreshold', comment='If a molecule is involved in fewer reaction than this value, skip printing the results corresponding to it. To print all molecules, set this value to 0.', default=3) self.SkipRareReactions: BoolType | BoolKey = BoolKey(name='SkipRareReactions', comment='If true,reduce the output by filtering out rare reactions. If false, always print all reactions.', default=True)
def __post_init__(self): self.Enabled: BoolType | BoolKey = BoolKey(name='Enabled', comment='Whether to perform network extraction.', gui_name='NetworkExtraction', default=True) self.ExtractFromFailedMDJobs: BoolType | BoolKey = BoolKey(name='ExtractFromFailedMDJobs', comment='Whether to extract from failed/crashed MD jobs (by default, only successful jobs are used)', gui_name='Extract from failed MD jobs:', default=False) self.MDTrajectories: str | Path | StringKey = PathStringKey(name='MDTrajectories', comment='If MolecularDynamics%Enabled is False, this directory will be recursively scanned for ams.rkf files containing MD trajectories. All found trajectories will be used for the analysis. It should typically be a Reactions Discovery results directory containing finished MD simulations.', gui_name='MD Trajectories:', ispath=True, gui_type='directory') self.StoreGeometryOptimizationResults: BoolType | BoolKey = BoolKey(name='StoreGeometryOptimizationResults', comment='Many AMS calculations are performed to analyse whether detected molecules are stable. Enabling this option will store all those calculations on disk, which can be helpful to understand why a molecule was not considered stable or why a calculation failed, but it will make the NetworkExtraction much slower and can take up large amounts of disk space.', hidden=True, default=False) self.UseCharges: BoolType | BoolKey = BoolKey(name='UseCharges', comment='Use engine-calculated charges if they exist on the MD trajectory files for the NetworkExtraction', default=True) self.Print: ReactionsDiscovery._NetworkExtraction._Print = self._Print(name='Print', comment='Printing details')
[docs] class _ProductRanking(FixedBlock): r""" Options for ranking of the intermediates by stability :ivar BalanceFromNetwork: Use the network to determine the balanced reaction from the initial reactants to each stable product. This is not the default. By default, a balanced equation is determined directly by using the other stable products as possible side products. :vartype BalanceFromNetwork: BoolType | BoolKey :ivar DiscardIons: Remove all ions from the final product list :vartype DiscardIons: BoolType | BoolKey :ivar Enabled: Whether to perform ranking of the reaction network. :vartype Enabled: BoolType | BoolKey :ivar MaxBalancedReactions: The maximum number of stable products used to find a balanced reaction equation for each one. :vartype MaxBalancedReactions: int | IntKey :ivar ReactionNetwork: Directory containing a previous Reactions Discovery calculation with 'NetworkExtraction%Enabled Yes' :vartype ReactionNetwork: str | Path | StringKey :ivar Temperature: Temperature used to compute reaction rates from reaction energies of reactions in the reaction network. :vartype Temperature: float | FloatKey :ivar WritePaths: Write full paths to the reaction network for each molecule. :vartype WritePaths: BoolType | BoolKey """ def __post_init__(self): self.BalanceFromNetwork: BoolType | BoolKey = BoolKey(name='BalanceFromNetwork', comment='Use the network to determine the balanced reaction from the initial reactants to each stable product. This is not the default. By default, a balanced equation is determined directly by using the other stable products as possible side products.', default=False) self.DiscardIons: BoolType | BoolKey = BoolKey(name='DiscardIons', comment='Remove all ions from the final product list', default=True) self.Enabled: BoolType | BoolKey = BoolKey(name='Enabled', comment='Whether to perform ranking of the reaction network.', gui_name='ProductRanking', default=True) self.MaxBalancedReactions: int | IntKey = IntKey(name='MaxBalancedReactions', comment='The maximum number of stable products used to find a balanced reaction equation for each one.', default=1000) self.ReactionNetwork: str | Path | StringKey = PathStringKey(name='ReactionNetwork', comment="Directory containing a previous Reactions Discovery calculation with 'NetworkExtraction%Enabled Yes'", ispath=True, gui_type='directory') self.Temperature: float | FloatKey = FloatKey(name='Temperature', comment='Temperature used to compute reaction rates from reaction energies of reactions in the reaction network.', default=298.0) self.WritePaths: BoolType | BoolKey = BoolKey(name='WritePaths', comment='Write full paths to the reaction network for each molecule.', default=True)
[docs] class _System(FixedBlock): r""" Specification of the chemical system. For some applications more than one system may be present in the input. In this case, all systems except one must have a non-empty string ID specified after the System keyword. The system without an ID is considered the main one. :ivar AllowCloseAtoms: No longer functional. Just here for backwards compatibility. :vartype AllowCloseAtoms: BoolType | BoolKey :ivar Charge: The system's total charge in atomic units. :vartype Charge: float | FloatKey :ivar FractionalCoords: Whether the atomic coordinates in the Atoms block are given in fractional coordinates of the lattice vectors. Requires the presence of the Lattice block. :vartype FractionalCoords: BoolType | BoolKey :ivar GeometryFile: Read the geometry from a file (instead of from Atoms and Lattice blocks). Supported formats: .xyz :vartype GeometryFile: str | Path | StringKey :ivar GuessBonds: Equivalent to 'Modify%GuessBonds'. Please update input file to use 'Modify' block instead. :vartype GuessBonds: BoolType | BoolKey :ivar LatticeStrain: Equivalent to 'Modify%LatticeStrain'. Please update input file to use 'Modify' block instead. :vartype LatticeStrain: Iterable[float] | FloatListKey :ivar MapAtomsToUnitCell: Equivalent to 'Modify%MapAtomsToUnitCell'. Please update input file to use 'Modify' block instead. :vartype MapAtomsToUnitCell: BoolType | BoolKey :ivar PerturbCoordinates: Equivalent to 'Modify%PerturbCoordinates'. Please update input file to use 'Modify' block instead. :vartype PerturbCoordinates: float | FloatKey :ivar PerturbLattice: Equivalent to 'Modify%PerturbLattice'. Please update input file to use 'Modify' block instead. :vartype PerturbLattice: float | FloatKey :ivar ShiftCoordinates: Equivalent to 'Modify%Translate', but in the unit of bohr by default. Please update input file to use 'Modify' block instead. :vartype ShiftCoordinates: Iterable[float] | FloatListKey :ivar SuperCell: Equivalent to 'Modify%SuperCell'. Please update input file to use 'Modify' block instead. :vartype SuperCell: Iterable[int] | IntListKey :ivar SuperCellTrafo: Equivalent to 'Modify%SuperCellTrafo'. Please update input file to use 'Modify' block instead. :vartype SuperCellTrafo: Iterable[int] | IntListKey :ivar Symmetrize: Equivalent to 'Modify%Symmetrize'. Please update input file to use 'Modify' block instead. :vartype Symmetrize: BoolType | BoolKey :ivar Atoms: The atom types and coordinates. Unit can be specified in the header. Default unit is Angstrom. :vartype Atoms: str | Sequence[str] | FreeBlock :ivar BondOrders: Defined bond orders. Each line should contain two atom indices, followed by the bond order (1, 1.5, 2, 3 for single, aromatic, double and triple bonds) and (optionally) the cell shifts for periodic systems. May be used by MM engines and for defining constraints. If the system is periodic and none of the bonds have the cell shift defined then AMS will attempt to determine them following the minimum image convention. :vartype BondOrders: str | Sequence[str] | FreeBlock :ivar ElectrostaticEmbedding: Container for electrostatic embedding options, which can be combined. :vartype ElectrostaticEmbedding: ReactionsDiscovery._System._ElectrostaticEmbedding :ivar Lattice: Up to three lattice vectors. Unit can be specified in the header. Default unit is Angstrom. :vartype Lattice: str | Sequence[str] | FreeBlock :ivar Modify: Modifications to make to the chemical system after construction. This block is read like a script and the modifications applied top to bottom. :vartype Modify: ReactionsDiscovery._System._Modify """
[docs] class _Atoms(FreeBlock): r""" The atom types and coordinates. Unit can be specified in the header. Default unit is Angstrom. """ def __post_init__(self): pass
[docs] class _BondOrders(FreeBlock): r""" Defined bond orders. Each line should contain two atom indices, followed by the bond order (1, 1.5, 2, 3 for single, aromatic, double and triple bonds) and (optionally) the cell shifts for periodic systems. May be used by MM engines and for defining constraints. If the system is periodic and none of the bonds have the cell shift defined then AMS will attempt to determine them following the minimum image convention. """ def __post_init__(self): pass
[docs] class _ElectrostaticEmbedding(FixedBlock): r""" Container for electrostatic embedding options, which can be combined. :ivar ElectricField: External homogeneous electric field with three Cartesian components: ex, ey, ez, the default unit being V/Å. In atomic units: Hartree/(e bohr) = 51.422 V/Angstrom; the relation to SI units is: 1 Hartree/(e bohr) = 5.14 ... e11 V/m. Supported by the engines adf, band, dftb and mopac. For periodic systems the field may only have nonzero components orthogonal to the direction(s) of periodicity (i.e. for 1D periodic system the x-component of the electric field should be zero, while for 2D periodic systems both the x and y components should be zero. This options cannot be used for 3D periodic systems. :vartype ElectricField: Iterable[float] | FloatListKey :ivar MultipolePotential: External point charges (and dipoles). :vartype MultipolePotential: ReactionsDiscovery._System._ElectrostaticEmbedding._MultipolePotential """
[docs] class _MultipolePotential(FixedBlock): r""" External point charges (and dipoles). :ivar ChargeModel: A multipole may be represented by a point (with a singular potential at its location) or by a spherical Gaussian distribution. :vartype ChargeModel: Literal["Point", "Gaussian"] :ivar ChargeWidth: The width parameter in a.u. in case a Gaussian charge model is chosen. A negative value means that the width will be chosen automatically. :vartype ChargeWidth: float | FloatKey :ivar Coordinates: Positions and values of the multipoles, one per line. Each line has the following format: x y z q, or x y z q µx µy µz. Here x, y, z are the coordinates in Å, q is the charge (in atomic units of charge) and µx, µy, µz are the (optional) dipole moment components (in atomic units, i.e. e*Bohr). Periodic systems are not supported. :vartype Coordinates: str | Sequence[str] | FreeBlock """
[docs] class _Coordinates(FreeBlock): r""" Positions and values of the multipoles, one per line. Each line has the following format: x y z q, or x y z q µx µy µz. Here x, y, z are the coordinates in Å, q is the charge (in atomic units of charge) and µx, µy, µz are the (optional) dipole moment components (in atomic units, i.e. e*Bohr). Periodic systems are not supported. """ def __post_init__(self): pass
def __post_init__(self): self.ChargeModel: Literal["Point", "Gaussian"] = MultipleChoiceKey(name='ChargeModel', comment='A multipole may be represented by a point (with a singular potential at its location) or by a spherical Gaussian distribution.', default='Point', choices=['Point', 'Gaussian']) self.ChargeWidth: float | FloatKey = FloatKey(name='ChargeWidth', comment='The width parameter in a.u. in case a Gaussian charge model is chosen. A negative value means that the width will be chosen automatically.', default=-1.0) self.Coordinates: str | Sequence[str] | FreeBlock = self._Coordinates(name='Coordinates', comment='Positions and values of the multipoles, one per line. Each line has the following format:\n\nx y z q, or\nx y z q µx µy µz.\n\nHere x, y, z are the coordinates in Å, q is the charge (in atomic units of charge) and µx, µy, µz are the (optional) dipole moment components (in atomic units, i.e. e*Bohr). \n\nPeriodic systems are not supported.', header=True)
def __post_init__(self): self.ElectricField: Iterable[float] | FloatListKey = FloatListKey(name='ElectricField', comment='External homogeneous electric field with three Cartesian components: ex, ey, ez, the default unit being V/Å.\n\nIn atomic units: Hartree/(e bohr) = 51.422 V/Angstrom; the relation to SI units is: 1 Hartree/(e bohr) = 5.14 ... e11 V/m.\n\nSupported by the engines adf, band, dftb and mopac.\n\nFor periodic systems the field may only have nonzero components orthogonal to the direction(s) of periodicity (i.e. for 1D periodic system the x-component of the electric field should be zero, while for 2D periodic systems both the x and y components should be zero. This options cannot be used for 3D periodic systems.', unit='V/Angstrom') self.MultipolePotential: ReactionsDiscovery._System._ElectrostaticEmbedding._MultipolePotential = self._MultipolePotential(name='MultipolePotential', comment='External point charges (and dipoles).')
[docs] class _Lattice(FreeBlock): r""" Up to three lattice vectors. Unit can be specified in the header. Default unit is Angstrom. """ def __post_init__(self): pass
[docs] class _Modify(FixedBlock): r""" Modifications to make to the chemical system after construction. This block is read like a script and the modifications applied top to bottom. :ivar EnableAtomicProperties: Enables an atomic property group. This is only necessary if you want a group enabled, but no atom in the input is using any property from that group. :vartype EnableAtomicProperties: Literal["gui", "adf", "band", "forcefield", "dftb", "reaxff", "qe"] :ivar GuessBonds: Guesses bonds based on the atomic elements and the geometry. Keeps existing bonds. :vartype GuessBonds: BoolType | BoolKey :ivar LatticeStrain: Deform the input system by the specified strain. The strain elements are in Voigt notation, so one should specify 6 numbers for 3D periodic system (order: xx,yy,zz,yz,xz,xy), 3 numbers for 2D periodic systems (order: xx,yy,xy) or 1 number for 1D periodic systems. :vartype LatticeStrain: Iterable[float] | FloatListKey :ivar MapAtomsToUnitCell: For periodic systems the atoms will be moved to the central unit cell where all their fractional coordinates are in the range [start_range,start_range+1). No mapping will take place along non-periodic directions. If just a single number is given, it corresponds to start_range. If multiple numbers are given, they should match the number of lattice vectors and will be used as start ranges along the individual lattice vectors. If no number is given at all, the mapping will be done to the [-0.5:0.5) cell. :vartype MapAtomsToUnitCell: Iterable[float] | FloatListKey :ivar PerturbCoordinates: Perturb the atomic coordinates by adding random numbers between [-PerturbCoordinates,PerturbCoordinates] to each Cartesian component. This can be useful if you want to break the symmetry of your system (e.g. for a geometry optimization). :vartype PerturbCoordinates: float | FloatKey :ivar PerturbLattice: Perturb the lattice vectors by applying random strain with matrix elements between [-PerturbLattice,PerturbLattice]. This can be useful if you want to deviate from an ideal symmetric geometry, for example if you look for a phase change due to high pressure. :vartype PerturbLattice: float | FloatKey :ivar SuperCell: Create a supercell of the input system (only possible for periodic systems). The integer numbers represent the diagonal elements of the supercell transformation; you should specify as many numbers as lattice vectors (i.e. 1 number for 1D, 2 numbers for 2D and 3 numbers for 3D periodic systems). :vartype SuperCell: Iterable[int] | IntListKey :ivar SuperCellTrafo: Create a supercell of the input system (only possible for periodic systems) :math:`\vec{a}_i' = \sum_j T_{ij} \vec{a}_j`. The integer numbers represent the supercell transformation :math:`T_{ij}`: 1 number for 1D PBC, 4 numbers for 2D PBC corresponding to a 2x2 matrix (order: (1,1),(1,2),(2,1),(2,2)) and 9 numbers for 3D PBC corresponding to a 3x3 matrix (order: (1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)). :vartype SuperCellTrafo: Iterable[int] | IntListKey :ivar Symmetrize: Symmetrizes the atomic coordinates to machine precision and rototranslates the molecule to the AMS standard orientation. This allows optimal use of the system's symmetry for calculations with the AMS driver and its engines. :vartype Symmetrize: BoolType | BoolKey :ivar Translate: Translate all atoms by a vector. :vartype Translate: Iterable[float] | FloatListKey """ def __post_init__(self): self.EnableAtomicProperties: Literal["gui", "adf", "band", "forcefield", "dftb", "reaxff", "qe"] = MultipleChoiceKey(name='EnableAtomicProperties', comment='Enables an atomic property group. This is only necessary if you want a group enabled, but no atom in the input is using any property from that group.', unique=False, choices=['gui', 'adf', 'band', 'forcefield', 'dftb', 'reaxff', 'qe']) self.GuessBonds: BoolType | BoolKey = BoolKey(name='GuessBonds', comment='Guesses bonds based on the atomic elements and the geometry. Keeps existing bonds.', unique=False) self.LatticeStrain: Iterable[float] | FloatListKey = FloatListKey(name='LatticeStrain', comment='Deform the input system by the specified strain. The strain elements are in Voigt notation, so one should specify 6 numbers for 3D periodic system (order: xx,yy,zz,yz,xz,xy), 3 numbers for 2D periodic systems (order: xx,yy,xy) or 1 number for 1D periodic systems.', unique=False) self.MapAtomsToUnitCell: Iterable[float] | FloatListKey = FloatListKey(name='MapAtomsToUnitCell', comment='For periodic systems the atoms will be moved to the central unit cell where all their fractional coordinates are in the range [start_range,start_range+1). No mapping will take place along non-periodic directions. If just a single number is given, it corresponds to start_range. If multiple numbers are given, they should match the number of lattice vectors and will be used as start ranges along the individual lattice vectors. If no number is given at all, the mapping will be done to the [-0.5:0.5) cell.', unique=False) self.PerturbCoordinates: float | FloatKey = FloatKey(name='PerturbCoordinates', comment='Perturb the atomic coordinates by adding random numbers between [-PerturbCoordinates,PerturbCoordinates] to each Cartesian component. This can be useful if you want to break the symmetry of your system (e.g. for a geometry optimization).', unique=False, unit='angstrom') self.PerturbLattice: float | FloatKey = FloatKey(name='PerturbLattice', comment='Perturb the lattice vectors by applying random strain with matrix elements between [-PerturbLattice,PerturbLattice]. This can be useful if you want to deviate from an ideal symmetric geometry, for example if you look for a phase change due to high pressure.', unique=False) self.SuperCell: Iterable[int] | IntListKey = IntListKey(name='SuperCell', comment='Create a supercell of the input system (only possible for periodic systems). The integer numbers represent the diagonal elements of the supercell transformation; you should specify as many numbers as lattice vectors (i.e. 1 number for 1D, 2 numbers for 2D and 3 numbers for 3D periodic systems).', unique=False) self.SuperCellTrafo: Iterable[int] | IntListKey = IntListKey(name='SuperCellTrafo', comment="Create a supercell of the input system (only possible for periodic systems) :math:`\\vec{a}_i' = \\sum_j T_{ij} \\vec{a}_j`. The integer numbers represent the supercell transformation :math:`T_{ij}`: 1 number for 1D PBC, 4 numbers for 2D PBC corresponding to a 2x2 matrix (order: (1,1),(1,2),(2,1),(2,2)) and 9 numbers for 3D PBC corresponding to a 3x3 matrix (order: (1,1),(1,2),(1,3),(2,1),(2,2),(2,3),(3,1),(3,2),(3,3)).", unique=False) self.Symmetrize: BoolType | BoolKey = BoolKey(name='Symmetrize', comment="Symmetrizes the atomic coordinates to machine precision and rototranslates the molecule to the AMS standard orientation. This allows optimal use of the system's symmetry for calculations with the AMS driver and its engines.", unique=False, default=False) self.Translate: Iterable[float] | FloatListKey = FloatListKey(name='Translate', comment='Translate all atoms by a vector.', unique=False, unit='angstrom')
def __post_init__(self): self.AllowCloseAtoms: BoolType | BoolKey = BoolKey(name='AllowCloseAtoms', comment='No longer functional. Just here for backwards compatibility.', hidden=True, default=True) self.Charge: float | FloatKey = FloatKey(name='Charge', comment="The system's total charge in atomic units.", gui_name='Total charge:', default=0.0, engines='-forcefield') self.FractionalCoords: BoolType | BoolKey = BoolKey(name='FractionalCoords', comment='Whether the atomic coordinates in the Atoms block are given in fractional coordinates of the lattice vectors. Requires the presence of the Lattice block.', default=False) self.GeometryFile: str | Path | StringKey = PathStringKey(name='GeometryFile', comment='Read the geometry from a file (instead of from Atoms and Lattice blocks). Supported formats: .xyz', ispath=True) self.GuessBonds: BoolType | BoolKey = BoolKey(name='GuessBonds', comment="Equivalent to 'Modify%GuessBonds'. Please update input file to use 'Modify' block instead.", hidden=True) self.LatticeStrain: Iterable[float] | FloatListKey = FloatListKey(name='LatticeStrain', comment="Equivalent to 'Modify%LatticeStrain'. Please update input file to use 'Modify' block instead.", hidden=True) self.MapAtomsToUnitCell: BoolType | BoolKey = BoolKey(name='MapAtomsToUnitCell', comment="Equivalent to 'Modify%MapAtomsToUnitCell'. Please update input file to use 'Modify' block instead.", hidden=True) self.PerturbCoordinates: float | FloatKey = FloatKey(name='PerturbCoordinates', comment="Equivalent to 'Modify%PerturbCoordinates'. Please update input file to use 'Modify' block instead.", hidden=True, unit='angstrom') self.PerturbLattice: float | FloatKey = FloatKey(name='PerturbLattice', comment="Equivalent to 'Modify%PerturbLattice'. Please update input file to use 'Modify' block instead.", hidden=True) self.ShiftCoordinates: Iterable[float] | FloatListKey = FloatListKey(name='ShiftCoordinates', comment="Equivalent to 'Modify%Translate', but in the unit of bohr by default. Please update input file to use 'Modify' block instead.", hidden=True, unit='bohr') self.SuperCell: Iterable[int] | IntListKey = IntListKey(name='SuperCell', comment="Equivalent to 'Modify%SuperCell'. Please update input file to use 'Modify' block instead.", hidden=True) self.SuperCellTrafo: Iterable[int] | IntListKey = IntListKey(name='SuperCellTrafo', comment="Equivalent to 'Modify%SuperCellTrafo'. Please update input file to use 'Modify' block instead.", hidden=True) self.Symmetrize: BoolType | BoolKey = BoolKey(name='Symmetrize', comment="Equivalent to 'Modify%Symmetrize'. Please update input file to use 'Modify' block instead.", hidden=True, default=False) self.Atoms: str | Sequence[str] | FreeBlock = self._Atoms(name='Atoms', comment='The atom types and coordinates. Unit can be specified in the header. Default unit is Angstrom.', header=True) self.BondOrders: str | Sequence[str] | FreeBlock = self._BondOrders(name='BondOrders', comment='Defined bond orders. Each line should contain two atom indices, followed by the bond order (1, 1.5, 2, 3 for single, aromatic, double and triple bonds) and (optionally) the cell shifts for periodic systems. May be used by MM engines and for defining constraints. If the system is periodic and none of the bonds have the cell shift defined then AMS will attempt to determine them following the minimum image convention.') self.ElectrostaticEmbedding: ReactionsDiscovery._System._ElectrostaticEmbedding = self._ElectrostaticEmbedding(name='ElectrostaticEmbedding', comment='Container for electrostatic embedding options, which can be combined.') self.Lattice: str | Sequence[str] | FreeBlock = self._Lattice(name='Lattice', comment='Up to three lattice vectors. Unit can be specified in the header. Default unit is Angstrom.', header=True) self.Modify: ReactionsDiscovery._System._Modify = self._Modify(name='Modify', comment='Modifications to make to the chemical system after construction. This block is read like a script and the modifications applied top to bottom.', ordered=True)
def __post_init__(self): self.Engine: EngineBlock = self._Engine(name='Engine', comment='The input for the computational engine for the MolecularDynamics and NetworkExtraction tasks. The header of the block determines the type of the engine.', header=True, default_engine='ReaxFF') self.LoadSystem: ReactionsDiscovery._LoadSystem = self._LoadSystem(name='LoadSystem', comment='Block that controls reading the chemical system from a KF file instead of the [System] block.', unique=False, header=True, extra_info='not_in_fragment', shared_id='AMSLoadSystem') self.MolecularDynamics: ReactionsDiscovery._MolecularDynamics = self._MolecularDynamics(name='MolecularDynamics', comment='Settings for reactive molecular dynamics.') self.NetworkExtraction: ReactionsDiscovery._NetworkExtraction = self._NetworkExtraction(name='NetworkExtraction', comment='Options for extracting the reactive network from MD trajectories') self.ProductRanking: ReactionsDiscovery._ProductRanking = self._ProductRanking(name='ProductRanking', comment='Options for ranking of the intermediates by stability') self.System: ReactionsDiscovery._System = self._System(name='System', comment='Specification of the chemical system. For some applications more than one system may be present in the input. In this case, all systems except one must have a non-empty string ID specified after the System keyword. The system without an ID is considered the main one.', unique=False, header=True, gui_type='Repeat at least once', shared_id='AMSSystem')