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 NMR(DriverBlock):
r"""
:ivar ADFFile: Path to TAPE21 file from which nmr reads data and to which nmr writes data
:vartype ADFFile: str | StringKey
:ivar AllInOne: Tensor in one step
:vartype AllInOne: BoolType | BoolKey
:ivar Allow:
:vartype Allow: str | StringKey
:ivar DBGNMR:
:vartype DBGNMR: int | IntKey
:ivar Debug:
:vartype Debug: str | StringKey
:ivar FakeSO:
:vartype FakeSO: BoolType | BoolKey
:ivar Fractional:
:vartype Fractional: BoolType | BoolKey
:ivar HFAtomsPerPass: Memory usage option for old HF scheme
:vartype HFAtomsPerPass: int | IntKey
:ivar HFMaxMemory: Memory usage option for old HF scheme
:vartype HFMaxMemory: int | IntKey
:ivar Logfile:
:vartype Logfile: str | StringKey
:ivar NBO:
:vartype NBO: BoolType | BoolKey
:ivar NoScale:
:vartype NoScale: BoolType | BoolKey
:ivar PNMRFile: Path to file that contains pNMR data
:vartype PNMRFile: str | StringKey
:ivar Print:
:vartype Print: str | StringKey
:ivar Programmer:
:vartype Programmer: str | StringKey
:ivar RecalculateTAPE10:
:vartype RecalculateTAPE10: BoolType | BoolKey
:ivar Save:
:vartype Save: str | StringKey
:ivar Scaled:
:vartype Scaled: BoolType | BoolKey
:ivar Skip:
:vartype Skip: str | StringKey
:ivar TAPE10File: Path to the TAPE10 file from which nmr reads data
:vartype TAPE10File: str | StringKey
:ivar Temperature: Temperature (Kelvin) for temperature dependent part shielding tensor.
:vartype Temperature: float | FloatKey
:ivar Analysis: Block for analysis options.
:vartype Analysis: NMR._Analysis
:ivar NMR: Main NMR options.
:vartype NMR: NMR._NMR
"""
[docs] class _Analysis(FixedBlock):
r"""
Block for analysis options.
:ivar Components: The components keyword is optional and enables an analysis not only of the isotropic shielding but also of the diagonal Cartesian components of the tensor XX, YY, and ZZ). In order to analyze the principal shielding tensor components with canonical MOs you can calculate the shielding tensor first with the NMR code, rotate the molecule such that the principal axes system aligns with the Cartesian coordinate system, and then repeat the NMR calculation with the analysis features switched on.
:vartype Components: BoolType | BoolKey
:ivar FakeSO:
:vartype FakeSO: BoolType | BoolKey
:ivar NoPrincipal: Do not transform to principal axes for analysis
:vartype NoPrincipal: BoolType | BoolKey
:ivar Print: The print keyword selects printout of contributions relative to the total diamagnetic, paramagnetic. For example in case of print 0.01 only contributions greater than 1% are printed. Set to zero to print ALL contributions.
:vartype Print: float | FloatKey
:ivar ZSOAO2007:
:vartype ZSOAO2007: BoolType | BoolKey
:ivar canonical: It enables an analysis of the shielding in terms of the canonical MOs.
:vartype canonical: BoolType | BoolKey
:ivar nbo:
:vartype nbo: BoolType | BoolKey
"""
def __post_init__(self):
self.Components: BoolType | BoolKey = BoolKey(name='Components', comment='The components keyword is optional and enables an analysis not only of the isotropic shielding but also of the diagonal Cartesian components of the tensor XX, YY, and ZZ). In order to analyze the principal shielding tensor components with canonical MOs you can calculate the shielding tensor first with the NMR code, rotate the molecule such that the principal axes system aligns with the Cartesian coordinate system, and then repeat the NMR calculation with the analysis features switched on.', default=False)
self.FakeSO: BoolType | BoolKey = BoolKey(name='FakeSO', default=False)
self.NoPrincipal: BoolType | BoolKey = BoolKey(name='NoPrincipal', comment='Do not transform to principal axes for analysis', default=False)
self.Print: float | FloatKey = FloatKey(name='Print', comment='The print keyword selects printout of contributions relative to the total diamagnetic, paramagnetic. For example in case of print 0.01 only contributions greater than 1% are printed. Set to zero to print ALL contributions.', default=0.001)
self.ZSOAO2007: BoolType | BoolKey = BoolKey(name='ZSOAO2007', default=False)
self.canonical: BoolType | BoolKey = BoolKey(name='canonical', comment='It enables an analysis of the shielding in terms of the canonical MOs.', default=False)
self.nbo: BoolType | BoolKey = BoolKey(name='nbo', default=False)
[docs] class _NMR(FixedBlock):
r"""
Main NMR options.
:ivar ADFGUI:
:vartype ADFGUI: BoolType | BoolKey
:ivar AllAtomsOfType: Space separated list of type of nuclei (like H, C, P) for which the NMR shielding should be calculated. In addition to Nuc or Atoms.
:vartype AllAtomsOfType: str | StringKey
:ivar Analysis: This key controls the MO analysis. Its value should be an integer, which then specifies that the first so many MOs are to be analyzed.
Default no Analysis.
The value of this analysis subkey in the block key NMR is somewhat limited. The separate ANALYSIS block key can give more analysis of the NMR chemical shielding.
:vartype Analysis: int | IntKey
:ivar Atoms: This subkey ATOMS specifies for which nuclei the NMR shielding is calculated. Default all nuclei are calculated, i.e. as for omitting the subkeys ATOMS and NUC. The numbers refer to the input ordering in the ADF calculation. Use the subkey NUC to specify the nuclei according to the internal NMR numbers of the atoms.
:vartype Atoms: Iterable[int] | IntListKey
:ivar Calc: The sub key Calc controls what is actually calculated. All: Implies all of the other options to this key. Para: The paramagnetic part, Dia: The diamagnetic part, FC: The Fermi-contact part in case of the Pauli Hamiltonian, SO: The Fermi-contact part in case of the ZORA Hamiltonian.
:vartype Calc: str | StringKey
:ivar GFactors: Calculate g-factors
:vartype GFactors: BoolType | BoolKey
:ivar Nuc: This subkey NUC specifies for which nuclei the NMR shielding is calculated. Default all nuclei are calculated, i.e. as for omitting the subkeys ATOMS and NUC. Else you may use this options by simply typing Nuc in the NMR block (without any further data); this means: for no nuclei at all. Alternatively you may type the index of the atom(s) you want to see analyzed. Default all nuclei are calculated, i.e. as for omitting this subkey. The numbers refer to the internal numbering of the nuclei as it appears somewhere early in the general ADF output. This internal numbering is also the internal NMR numbering, but it is not necessarily the same as the input ordering. Use the subkey ATOMS to specify the nuclei according to this input ordering in the ADF calculation. Note that the number of nuclei has a significant consequence for the total CPU time.
:vartype Nuc: Iterable[int] | IntListKey
:ivar Out: Controls printed output. Options: All: All the other options, ISO: Isotropic shielding constants, Tens: Shielding tensors, Eig: Eigenvectors, U1: The U1 Matrix, F1: The first order change in the Fock matrix, S1: The first order change in the Overlap matrix, AOP: The paramagnetic AO matrix (= the matrix in the representation of elementary atomic basis functions), AOD: The diamagnetic AO matrix, AOF: The Fermi-contact AO matrix, Refs: Literature references, INFO: General information.
:vartype Out: str | StringKey
:ivar SCF: Convergence threshold for CPKS cycle
:vartype SCF: float | FloatKey
:ivar U1K: Determines which terms are included in the calculation of the U1 matrix (first order changes in MO coefficients). Best: The best (recommended) options for each relativistic option are included for this subkey. Implies None for non-relativistic and scalar relativistic ZORA, SO + SOFULL for spin-orbit coupled ZORA, and MV + Dar for the Pauli Hamiltonian. None: Implies none of the other options to this key. All: Implies all the other options to this key. MV: The mass-velocity term. Dar: The Darwin term. ZMAN: The Spin-Zeeman term (can be included only in case of spin-orbit coupled Pauli Hamiltonian). SO: ZORA spin-orbit part. SOFULL: ZORA spin-orbit part.
:vartype U1K: str | StringKey
:ivar Use: The subkey Use controls some optional options. FXC: Improves the exchange-correlation kernel used, as was implemented by J. Autschbach [http://dx.doi.org/10.1080/00268976.2013.796415]. Important only in case of spin-orbit coupled calculations. This may give some (small) gauge dependent results when using this. Important option that should be seriously considered and has been advocated in Ref [http://dx.doi.org/10.1080/00268976.2013.796415]. SCALED: Implies the scaled ZORA method, which gives (slightly) gauge dependent results. Note that in case of the ZORA Hamiltonian default the unscaled ZORA method is used. For chemical shifts, only compare results with the same options. SO1C: Before ADF2008.01 in the the spin-orbit term a 1-center approximation was used, which does not suffer from gauge dependence. This 1-center approximation can be used with USE SO1C.
:vartype Use: str | StringKey
:ivar Ghosts: The subkey GHOSTS is a block type subkey. The format is Ghosts | xx1 yy1 zz1 | xx2 yy2 zz2 | ... | SubEnd
:vartype Ghosts: str | Sequence[str] | FreeBlock
"""
[docs] class _Ghosts(FreeBlock):
r"""
The subkey GHOSTS is a block type subkey. The format is Ghosts | xx1 yy1 zz1 | xx2 yy2 zz2 | ... | SubEnd
"""
def __post_init__(self):
pass
def __post_init__(self):
self.ADFGUI: BoolType | BoolKey = BoolKey(name='ADFGUI', default=False)
self.AllAtomsOfType: str | StringKey = StringKey(name='AllAtomsOfType', comment='Space separated list of type of nuclei (like H, C, P) for which the NMR shielding should be calculated. In addition to Nuc or Atoms.')
self.Analysis: int | IntKey = IntKey(name='Analysis', comment='This key controls the MO analysis. Its value should be an integer, which then specifies that the first so many MOs are to be analyzed.\n\nDefault no Analysis.\n\nThe value of this analysis subkey in the block key NMR is somewhat limited. The separate ANALYSIS block key can give more analysis of the NMR chemical shielding.', gui_name='Number of MOs in analysis:')
self.Atoms: Iterable[int] | IntListKey = IntListKey(name='Atoms', comment='This subkey ATOMS specifies for which nuclei the NMR shielding is calculated. Default all nuclei are calculated, i.e. as for omitting the subkeys ATOMS and NUC. The numbers refer to the input ordering in the ADF calculation. Use the subkey NUC to specify the nuclei according to the internal NMR numbers of the atoms.', unique=False)
self.Calc: str | StringKey = StringKey(name='Calc', comment='The sub key Calc controls what is actually calculated. All: Implies all of the other options to this key. Para: The paramagnetic part, Dia: The diamagnetic part, FC: The Fermi-contact part in case of the Pauli Hamiltonian, SO: The Fermi-contact part in case of the ZORA Hamiltonian.', default='All')
self.GFactors: BoolType | BoolKey = BoolKey(name='GFactors', comment='Calculate g-factors', default=False)
self.Nuc: Iterable[int] | IntListKey = IntListKey(name='Nuc', comment='This subkey NUC specifies for which nuclei the NMR shielding is calculated. Default all nuclei are calculated, i.e. as for omitting the subkeys ATOMS and NUC. Else you may use this options by simply typing Nuc in the NMR block (without any further data); this means: for no nuclei at all. Alternatively you may type the index of the atom(s) you want to see analyzed. Default all nuclei are calculated, i.e. as for omitting this subkey. The numbers refer to the internal numbering of the nuclei as it appears somewhere early in the general ADF output. This internal numbering is also the internal NMR numbering, but it is not necessarily the same as the input ordering. Use the subkey ATOMS to specify the nuclei according to this input ordering in the ADF calculation. Note that the number of nuclei has a significant consequence for the total CPU time.')
self.Out: str | StringKey = StringKey(name='Out', comment='Controls printed output. Options: All: All the other options, ISO: Isotropic shielding constants, Tens: Shielding tensors, Eig: Eigenvectors, U1: The U1 Matrix, F1: The first order change in the Fock matrix, S1: The first order change in the Overlap matrix, AOP: The paramagnetic AO matrix (= the matrix in the representation of elementary atomic basis functions), AOD: The diamagnetic AO matrix, AOF: The Fermi-contact AO matrix, Refs: Literature references, INFO: General information.', default='ISO TENS')
self.SCF: float | FloatKey = FloatKey(name='SCF', comment='Convergence threshold for CPKS cycle', default=1e-06)
self.U1K: str | StringKey = StringKey(name='U1K', comment='Determines which terms are included in the calculation of the U1 matrix (first order changes in MO coefficients). Best: The best (recommended) options for each relativistic option are included for this subkey. Implies None for non-relativistic and scalar relativistic ZORA, SO + SOFULL for spin-orbit coupled ZORA, and MV + Dar for the Pauli Hamiltonian. None: Implies none of the other options to this key. All: Implies all the other options to this key. MV: The mass-velocity term. Dar: The Darwin term. ZMAN: The Spin-Zeeman term (can be included only in case of spin-orbit coupled Pauli Hamiltonian). SO: ZORA spin-orbit part. SOFULL: ZORA spin-orbit part. ', default='Best')
self.Use: str | StringKey = StringKey(name='Use', comment='The subkey Use controls some optional options. FXC: Improves the exchange-correlation kernel used, as was implemented by J. Autschbach [http://dx.doi.org/10.1080/00268976.2013.796415]. Important only in case of spin-orbit coupled calculations. This may give some (small) gauge dependent results when using this. Important option that should be seriously considered and has been advocated in Ref [http://dx.doi.org/10.1080/00268976.2013.796415]. SCALED: Implies the scaled ZORA method, which gives (slightly) gauge dependent results. Note that in case of the ZORA Hamiltonian default the unscaled ZORA method is used. For chemical shifts, only compare results with the same options. SO1C: Before ADF2008.01 in the the spin-orbit term a 1-center approximation was used, which does not suffer from gauge dependence. This 1-center approximation can be used with USE SO1C.')
self.Ghosts: str | Sequence[str] | FreeBlock = self._Ghosts(name='Ghosts', comment='The subkey GHOSTS is a block type subkey. The format is Ghosts | xx1 yy1 zz1 | xx2 yy2 zz2 | ... | SubEnd')
def __post_init__(self):
self.ADFFile: str | StringKey = StringKey(name='ADFFile', comment='Path to TAPE21 file from which nmr reads data and to which nmr writes data', default='TAPE21')
self.AllInOne: BoolType | BoolKey = BoolKey(name='AllInOne', comment='Tensor in one step')
self.Allow: str | StringKey = StringKey(name='Allow', comment=' ', hidden=True, unique=False)
self.DBGNMR: int | IntKey = IntKey(name='DBGNMR', hidden=True, default=0)
self.Debug: str | StringKey = StringKey(name='Debug', hidden=True, unique=False)
self.FakeSO: BoolType | BoolKey = BoolKey(name='FakeSO', default=False)
self.Fractional: BoolType | BoolKey = BoolKey(name='Fractional', default=False)
self.HFAtomsPerPass: int | IntKey = IntKey(name='HFAtomsPerPass', comment='Memory usage option for old HF scheme')
self.HFMaxMemory: int | IntKey = IntKey(name='HFMaxMemory', comment='Memory usage option for old HF scheme')
self.Logfile: str | StringKey = StringKey(name='Logfile', default='Flush')
self.NBO: BoolType | BoolKey = BoolKey(name='NBO')
self.NoScale: BoolType | BoolKey = BoolKey(name='NoScale')
self.PNMRFile: str | StringKey = StringKey(name='PNMRFile', comment='Path to file that contains pNMR data', default='')
self.Print: str | StringKey = StringKey(name='Print', hidden=True, unique=False)
self.Programmer: str | StringKey = StringKey(name='Programmer', hidden=True, unique=False)
self.RecalculateTAPE10: BoolType | BoolKey = BoolKey(name='RecalculateTAPE10', default=False)
self.Save: str | StringKey = StringKey(name='Save', unique=False)
self.Scaled: BoolType | BoolKey = BoolKey(name='Scaled')
self.Skip: str | StringKey = StringKey(name='Skip', hidden=True, unique=False)
self.TAPE10File: str | StringKey = StringKey(name='TAPE10File', comment='Path to the TAPE10 file from which nmr reads data', default='TAPE10')
self.Temperature: float | FloatKey = FloatKey(name='Temperature', comment='Temperature (Kelvin) for temperature dependent part shielding tensor.', default=298.15)
self.Analysis: NMR._Analysis = self._Analysis(name='Analysis', comment='Block for analysis options.')
self.NMR: NMR._NMR = self._NMR(name='NMR', comment='Main NMR options.')