stjames 0.0.93__tar.gz → 0.0.95__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of stjames might be problematic. Click here for more details.

Files changed (83) hide show
  1. {stjames-0.0.93/stjames.egg-info → stjames-0.0.95}/PKG-INFO +1 -1
  2. {stjames-0.0.93 → stjames-0.0.95}/pyproject.toml +1 -1
  3. {stjames-0.0.93 → stjames-0.0.95}/stjames/__init__.py +0 -3
  4. stjames-0.0.95/stjames/scf_settings.py +19 -0
  5. {stjames-0.0.93 → stjames-0.0.95}/stjames/settings.py +0 -69
  6. {stjames-0.0.93 → stjames-0.0.95}/stjames/status.py +3 -0
  7. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/__init__.py +3 -0
  8. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/ion_mobility.py +11 -6
  9. stjames-0.0.95/stjames/workflows/nmr.py +54 -0
  10. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/protein_cofolding.py +31 -1
  11. {stjames-0.0.93 → stjames-0.0.95/stjames.egg-info}/PKG-INFO +1 -1
  12. {stjames-0.0.93 → stjames-0.0.95}/stjames.egg-info/SOURCES.txt +1 -3
  13. stjames-0.0.93/stjames/diis_settings.py +0 -23
  14. stjames-0.0.93/stjames/grid_settings.py +0 -27
  15. stjames-0.0.93/stjames/int_settings.py +0 -31
  16. stjames-0.0.93/stjames/scf_settings.py +0 -77
  17. {stjames-0.0.93 → stjames-0.0.95}/LICENSE +0 -0
  18. {stjames-0.0.93 → stjames-0.0.95}/README.md +0 -0
  19. {stjames-0.0.93 → stjames-0.0.95}/setup.cfg +0 -0
  20. {stjames-0.0.93 → stjames-0.0.95}/stjames/_deprecated_solvent_settings.py +0 -0
  21. {stjames-0.0.93 → stjames-0.0.95}/stjames/atom.py +0 -0
  22. {stjames-0.0.93 → stjames-0.0.95}/stjames/atomium_stjames/__init__.py +0 -0
  23. {stjames-0.0.93 → stjames-0.0.95}/stjames/atomium_stjames/data.py +0 -0
  24. {stjames-0.0.93 → stjames-0.0.95}/stjames/atomium_stjames/mmcif.py +0 -0
  25. {stjames-0.0.93 → stjames-0.0.95}/stjames/atomium_stjames/pdb.py +0 -0
  26. {stjames-0.0.93 → stjames-0.0.95}/stjames/atomium_stjames/utilities.py +0 -0
  27. {stjames-0.0.93 → stjames-0.0.95}/stjames/base.py +0 -0
  28. {stjames-0.0.93 → stjames-0.0.95}/stjames/basis_set.py +0 -0
  29. {stjames-0.0.93 → stjames-0.0.95}/stjames/calculation.py +0 -0
  30. {stjames-0.0.93 → stjames-0.0.95}/stjames/compute_settings.py +0 -0
  31. {stjames-0.0.93 → stjames-0.0.95}/stjames/constraint.py +0 -0
  32. {stjames-0.0.93 → stjames-0.0.95}/stjames/correction.py +0 -0
  33. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/__init__.py +0 -0
  34. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/bragg_radii.json +0 -0
  35. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/elements.py +0 -0
  36. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/isotopes.json +0 -0
  37. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/nist_isotopes.json +0 -0
  38. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/read_nist_isotopes.py +0 -0
  39. {stjames-0.0.93 → stjames-0.0.95}/stjames/data/symbol_element.json +0 -0
  40. {stjames-0.0.93 → stjames-0.0.95}/stjames/engine.py +0 -0
  41. {stjames-0.0.93 → stjames-0.0.95}/stjames/message.py +0 -0
  42. {stjames-0.0.93 → stjames-0.0.95}/stjames/method.py +0 -0
  43. {stjames-0.0.93 → stjames-0.0.95}/stjames/mode.py +0 -0
  44. {stjames-0.0.93 → stjames-0.0.95}/stjames/molecule.py +0 -0
  45. {stjames-0.0.93 → stjames-0.0.95}/stjames/opt_settings.py +0 -0
  46. {stjames-0.0.93 → stjames-0.0.95}/stjames/pdb.py +0 -0
  47. {stjames-0.0.93 → stjames-0.0.95}/stjames/periodic_cell.py +0 -0
  48. {stjames-0.0.93 → stjames-0.0.95}/stjames/py.typed +0 -0
  49. {stjames-0.0.93 → stjames-0.0.95}/stjames/solvent.py +0 -0
  50. {stjames-0.0.93 → stjames-0.0.95}/stjames/task.py +0 -0
  51. {stjames-0.0.93 → stjames-0.0.95}/stjames/thermochem_settings.py +0 -0
  52. {stjames-0.0.93 → stjames-0.0.95}/stjames/types.py +0 -0
  53. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/admet.py +0 -0
  54. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/basic_calculation.py +0 -0
  55. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/bde.py +0 -0
  56. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/conformer.py +0 -0
  57. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/conformer_search.py +0 -0
  58. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/descriptors.py +0 -0
  59. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/docking.py +0 -0
  60. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/electronic_properties.py +0 -0
  61. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/fukui.py +0 -0
  62. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/hydrogen_bond_basicity.py +0 -0
  63. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/irc.py +0 -0
  64. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/macropka.py +0 -0
  65. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/molecular_dynamics.py +0 -0
  66. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/multistage_opt.py +0 -0
  67. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/pka.py +0 -0
  68. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/pose_analysis_md.py +0 -0
  69. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/redox_potential.py +0 -0
  70. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/scan.py +0 -0
  71. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/solubility.py +0 -0
  72. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/spin_states.py +0 -0
  73. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/tautomer.py +0 -0
  74. {stjames-0.0.93 → stjames-0.0.95}/stjames/workflows/workflow.py +0 -0
  75. {stjames-0.0.93 → stjames-0.0.95}/stjames.egg-info/dependency_links.txt +0 -0
  76. {stjames-0.0.93 → stjames-0.0.95}/stjames.egg-info/requires.txt +0 -0
  77. {stjames-0.0.93 → stjames-0.0.95}/stjames.egg-info/top_level.txt +0 -0
  78. {stjames-0.0.93 → stjames-0.0.95}/tests/test_constraints.py +0 -0
  79. {stjames-0.0.93 → stjames-0.0.95}/tests/test_from_extxyz.py +0 -0
  80. {stjames-0.0.93 → stjames-0.0.95}/tests/test_molecule.py +0 -0
  81. {stjames-0.0.93 → stjames-0.0.95}/tests/test_pdb.py +0 -0
  82. {stjames-0.0.93 → stjames-0.0.95}/tests/test_rounding.py +0 -0
  83. {stjames-0.0.93 → stjames-0.0.95}/tests/test_settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.93
3
+ Version: 0.0.95
4
4
  Summary: standardized JSON atom/molecule encoding scheme
5
5
  Author-email: Corin Wagen <corin@rowansci.com>
6
6
  Project-URL: Homepage, https://github.com/rowansci/stjames
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "stjames"
3
- version = "0.0.93"
3
+ version = "0.0.95"
4
4
  description = "standardized JSON atom/molecule encoding scheme"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -7,12 +7,9 @@ from .molecule import *
7
7
  from .workflows import *
8
8
 
9
9
  from .scf_settings import *
10
- from .int_settings import *
11
10
  from .opt_settings import *
12
11
  from .compute_settings import *
13
- from .diis_settings import *
14
12
  from .thermochem_settings import *
15
- from .grid_settings import *
16
13
  from .settings import *
17
14
 
18
15
  from .method import *
@@ -0,0 +1,19 @@
1
+ from .base import Base, LowercaseStrEnum
2
+
3
+
4
+ class UseSOSCF(LowercaseStrEnum):
5
+ ALWAYS = "always"
6
+ UPON_FAILURE = "upon_failure"
7
+ NEVER = "never"
8
+
9
+
10
+ class SCFSettings(Base):
11
+ """
12
+ Settings for SCF convergence.
13
+
14
+ :param max_iters: the maximum number of SCF iterations to permit
15
+ :param soscf: whether or not to use SOSCF (second-order SCF).
16
+ """
17
+
18
+ max_iters: int = 250
19
+ soscf: UseSOSCF = UseSOSCF.UPON_FAILURE
@@ -68,7 +68,6 @@ class Settings(Base):
68
68
  if self.mode == Mode.AUTO:
69
69
  self.mode = Mode.RAPID
70
70
 
71
- self.scf_settings = _assign_scf_settings_by_mode(self.mode, self.scf_settings)
72
71
  self.opt_settings = _assign_opt_settings_by_mode(self.mode, self.opt_settings)
73
72
 
74
73
  return self
@@ -115,74 +114,6 @@ class Settings(Base):
115
114
  return [c for c in v if c] if v is not None else v
116
115
 
117
116
 
118
- def _assign_scf_settings_by_mode(mode: Mode, scf_settings: SCFSettings) -> SCFSettings:
119
- """
120
- Assign SCF settings based on the mode.
121
-
122
- Values based off of the following sources:
123
- QChem:
124
- - https://manual.q-chem.com/5.2/Ch4.S3.SS2.html
125
- - https://manual.q-chem.com/5.2/Ch4.S5.SS2.html
126
-
127
- Gaussian:
128
- - https://gaussian.com/integral/
129
- - https://gaussian.com/overlay5/
130
-
131
- Orca:
132
- - manual 4.2.1, §9.6.1 and §9.7.3
133
-
134
- Psi4:
135
- - https://psicode.org/psi4manual/master/autodir_options_c/module__scf.html
136
- - https://psicode.org/psi4manual/master/autodoc_glossary_options_c.html
137
-
138
- TeraChem:
139
- - Manual, it's easy to locate everything.
140
-
141
- The below values are my best attempt at homogenizing various sources.
142
- In general, eri_threshold should be 3 OOM lower than SCF convergence.
143
- """
144
- if mode == Mode.MANUAL:
145
- return scf_settings
146
-
147
- match mode:
148
- case Mode.RECKLESS:
149
- scf_settings.energy_threshold = 1e-5
150
- scf_settings.rms_error_threshold = 1e-7
151
- scf_settings.max_error_threshold = 1e-5
152
- scf_settings.rebuild_frequency = 100
153
- scf_settings.int_settings.eri_threshold = 1e-8
154
- scf_settings.int_settings.csam_multiplier = 3.0
155
- scf_settings.int_settings.pair_overlap_threshold = 1e-8
156
- case Mode.RAPID | Mode.CAREFUL:
157
- scf_settings.energy_threshold = 1e-6
158
- scf_settings.rms_error_threshold = 1e-9
159
- scf_settings.max_error_threshold = 1e-7
160
- scf_settings.rebuild_frequency = 10
161
- scf_settings.int_settings.eri_threshold = 1e-10
162
- scf_settings.int_settings.csam_multiplier = 1.0
163
- scf_settings.int_settings.pair_overlap_threshold = 1e-10
164
- case Mode.METICULOUS:
165
- scf_settings.energy_threshold = 1e-8
166
- scf_settings.rms_error_threshold = 1e-9
167
- scf_settings.max_error_threshold = 1e-7
168
- scf_settings.rebuild_frequency = 5
169
- scf_settings.int_settings.eri_threshold = 1e-12
170
- scf_settings.int_settings.csam_multiplier = 1.0
171
- scf_settings.int_settings.pair_overlap_threshold = 1e-12
172
- case Mode.DEBUG:
173
- scf_settings.energy_threshold = 1e-9
174
- scf_settings.rms_error_threshold = 1e-10
175
- scf_settings.max_error_threshold = 1e-9
176
- scf_settings.rebuild_frequency = 1
177
- scf_settings.int_settings.eri_threshold = 1e-14
178
- scf_settings.int_settings.csam_multiplier = 1e10 # in other words, disable CSAM
179
- scf_settings.int_settings.pair_overlap_threshold = 1e-14
180
- case _:
181
- raise ValueError(f"Unknown mode ``{mode.value}``!")
182
-
183
- return scf_settings
184
-
185
-
186
117
  def _assign_opt_settings_by_mode(mode: Mode, opt_settings: OptimizationSettings) -> OptimizationSettings:
187
118
  """
188
119
  Assign optimization settings based on the mode.
@@ -19,3 +19,6 @@ class Status(int, Enum):
19
19
 
20
20
  # Status if a user has exceeded their allowed max_concurrency
21
21
  AWAITING_QUEUE = 5
22
+
23
+ # Job is not yet submitted
24
+ DRAFT = 6
@@ -17,6 +17,7 @@ from .irc import *
17
17
  from .macropka import *
18
18
  from .molecular_dynamics import *
19
19
  from .multistage_opt import *
20
+ from .nmr import *
20
21
  from .pka import *
21
22
  from .pose_analysis_md import *
22
23
  from .protein_cofolding import *
@@ -43,6 +44,7 @@ WORKFLOW_NAME = Literal[
43
44
  "macropka",
44
45
  "molecular_dynamics",
45
46
  "multistage_opt",
47
+ "nmr",
46
48
  "pka",
47
49
  "pose_analysis_md",
48
50
  "protein_cofolding",
@@ -69,6 +71,7 @@ WORKFLOW_MAPPING: dict[WORKFLOW_NAME, Workflow] = {
69
71
  "macropka": MacropKaWorkflow, # type: ignore [dict-item]
70
72
  "molecular_dynamics": MolecularDynamicsWorkflow, # type: ignore [dict-item]
71
73
  "multistage_opt": MultiStageOptWorkflow, # type: ignore [dict-item]
74
+ "nmr": NMRSpectroscopyWorkflow, # type: ignore [dict-item]
72
75
  "pka": pKaWorkflow, # type: ignore [dict-item]
73
76
  "pose_analysis_md": PoseAnalysisMolecularDynamicsWorkflow, # type: ignore [dict-item]
74
77
  "protein_cofolding": ProteinCofoldingWorkflow, # type: ignore [dict-item]
@@ -1,6 +1,11 @@
1
1
  """Ion mobility workflow."""
2
2
 
3
- from ..types import UUID
3
+ from typing import Annotated
4
+
5
+ from pydantic import AfterValidator
6
+
7
+ from ..base import round_optional_float
8
+ from ..types import UUID, round_list
4
9
  from .workflow import MoleculeWorkflow
5
10
 
6
11
 
@@ -34,9 +39,9 @@ class IonMobilityWorkflow(MoleculeWorkflow):
34
39
 
35
40
  conformers: list[UUID] = []
36
41
 
37
- conformer_ccs: list[float] = []
38
- conformer_ccs_stdev: list[float] = []
39
- boltzmann_weights: list[float] = []
42
+ conformer_ccs: Annotated[list[float], AfterValidator(round_list(3))] = []
43
+ conformer_ccs_stdev: Annotated[list[float], AfterValidator(round_list(3))] = []
44
+ boltzmann_weights: Annotated[list[float], AfterValidator(round_list(3))] = []
40
45
 
41
- average_ccs: float | None = None
42
- average_ccs_stdev: float | None = None
46
+ average_ccs: Annotated[float | None, AfterValidator(round_optional_float(3))] = None
47
+ average_ccs_stdev: Annotated[float | None, AfterValidator(round_optional_float(3))] = None
@@ -0,0 +1,54 @@
1
+ """Nuclear-magnetic-resonance spectroscopy workflow."""
2
+
3
+ from typing import Annotated
4
+
5
+ from pydantic import AfterValidator
6
+
7
+ from ..base import LowercaseStrEnum
8
+ from ..mode import Mode
9
+ from ..settings import Settings
10
+ from ..solvent import Solvent
11
+ from ..types import UUID, round_list
12
+ from .conformer_search import ConformerGenSettings, iMTDSettings
13
+ from .multistage_opt import MultiStageOptSettings
14
+ from .workflow import MoleculeWorkflow
15
+
16
+
17
+ class NMRMethod(LowercaseStrEnum):
18
+ MAGNETZERO = "magnet-zero"
19
+
20
+
21
+ class NMRSpectroscopyWorkflow(MoleculeWorkflow):
22
+ """
23
+ Workflow for calculating NMR spectra.
24
+
25
+ Inherited:
26
+ :param initial_molecule: Molecule of interest
27
+ :param mode: Mode for workflow (currently unused)
28
+
29
+ New:
30
+ :param nmr_method: how to run the NMR calculations
31
+ :param solvent: the solvent in which to run the calculations
32
+ :param conf_gen_settings : the conformer-search settings. if `None`, no conformer search will be performed
33
+ :param multistage_opt_settings: the optimization settings. if `None`, no optimization will be performed
34
+
35
+ Results:
36
+ :param conformers: list of conformer UUIDs
37
+ :param boltzmann_weights: the boltzmann weights for each conformer
38
+ :param per_conformer_isotopic_shieldings: the per-atom shieldings for each conformer
39
+ :param isotopic_shieldings: the per-atom shieldings
40
+ """
41
+
42
+ nmr_method: NMRMethod = NMRMethod.MAGNETZERO
43
+ solvent: Solvent = Solvent.CHLOROFORM
44
+
45
+ conf_gen_settings: ConformerGenSettings | None = iMTDSettings(mode="careful")
46
+ multistage_opt_settings: MultiStageOptSettings | None = MultiStageOptSettings(
47
+ mode=Mode.MANUAL,
48
+ optimization_settings=[Settings(method="aimnet2_wb97md3")],
49
+ )
50
+
51
+ conformers: list[UUID] = []
52
+ boltzmann_weights: Annotated[list[float], AfterValidator(round_list(3))] = []
53
+ per_conformer_isotropic_shieldings: list[Annotated[list[float], AfterValidator(round_list(3))]] = []
54
+ isotropic_shieldings: Annotated[list[float], AfterValidator(round_list(3))] = []
@@ -1,6 +1,6 @@
1
1
  """Protein Cofolding Workflow."""
2
2
 
3
- from typing import Annotated
3
+ from typing import Annotated, Literal
4
4
 
5
5
  from pydantic import AfterValidator, BaseModel, ConfigDict
6
6
 
@@ -17,6 +17,33 @@ class CofoldingModel(LowercaseStrEnum):
17
17
  BOLTZ_2 = "boltz_2"
18
18
 
19
19
 
20
+ class Token(BaseModel):
21
+ """Either a atom in a ligand or a residue in a protein."""
22
+
23
+ input_type: Literal["ligand", "protein"]
24
+ input_index: int
25
+ token_index: int
26
+
27
+
28
+ class ContactConstraint(BaseModel):
29
+ """Contact constraint to be used for prediction."""
30
+
31
+ token_1: Token
32
+ token_2: Token
33
+ max_distance: float # Angstroms
34
+ force: bool = False # Whether to use potentials to enforce the constraint
35
+
36
+
37
+ class PocketConstraint(BaseModel):
38
+ """Pocket constraint to be used for prediction."""
39
+
40
+ input_type: Literal["ligand", "protein"]
41
+ input_index: int
42
+ contacts: list[Token]
43
+ max_distance: float # Angstroms
44
+ force: bool = False # Whether to use potentials to enforce the constraint
45
+
46
+
20
47
  class CofoldingScores(BaseModel):
21
48
  confidence_score: Annotated[float, AfterValidator(round_float(3))]
22
49
  ptm: Annotated[float, AfterValidator(round_float(3))] # predicted template modeling score
@@ -52,6 +79,9 @@ class ProteinCofoldingWorkflow(FASTAWorkflow):
52
79
  use_msa_server: bool = False
53
80
  use_templates_server: bool = False
54
81
  use_potentials: bool = False
82
+ contact_constraints: list[ContactConstraint] = []
83
+ pocket_constraints: list[PocketConstraint] = []
84
+
55
85
  predicted_structure_uuid: UUID | None = None
56
86
  scores: CofoldingScores | None = None
57
87
  model: CofoldingModel = CofoldingModel.BOLTZ_2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.93
3
+ Version: 0.0.95
4
4
  Summary: standardized JSON atom/molecule encoding scheme
5
5
  Author-email: Corin Wagen <corin@rowansci.com>
6
6
  Project-URL: Homepage, https://github.com/rowansci/stjames
@@ -10,10 +10,7 @@ stjames/calculation.py
10
10
  stjames/compute_settings.py
11
11
  stjames/constraint.py
12
12
  stjames/correction.py
13
- stjames/diis_settings.py
14
13
  stjames/engine.py
15
- stjames/grid_settings.py
16
- stjames/int_settings.py
17
14
  stjames/message.py
18
15
  stjames/method.py
19
16
  stjames/mode.py
@@ -62,6 +59,7 @@ stjames/workflows/irc.py
62
59
  stjames/workflows/macropka.py
63
60
  stjames/workflows/molecular_dynamics.py
64
61
  stjames/workflows/multistage_opt.py
62
+ stjames/workflows/nmr.py
65
63
  stjames/workflows/pka.py
66
64
  stjames/workflows/pose_analysis_md.py
67
65
  stjames/workflows/protein_cofolding.py
@@ -1,23 +0,0 @@
1
- import pydantic
2
-
3
- from .base import Base, LowercaseStrEnum
4
-
5
-
6
- class DIISStrategy(LowercaseStrEnum):
7
- # regular Pulay DIIS
8
- DIIS = "diis"
9
-
10
- # Hu/Yang JCP 2010 - ADIIS
11
- ADIIS = "adiis"
12
-
13
- # first ADIIS, then DIIS
14
- ADIIS_DIIS = "adiis_diis"
15
-
16
-
17
- class DIISSettings(Base):
18
- strategy: DIISStrategy = DIISStrategy.ADIIS_DIIS
19
- subspace_size: pydantic.PositiveInt = 12
20
-
21
- # if it's a hybrid strategy, where do we transition?
22
- adiis_diis_blend_start: pydantic.PositiveFloat = 1e-1
23
- adiis_diis_blend_stop: pydantic.PositiveFloat = 1e-4
@@ -1,27 +0,0 @@
1
- import pydantic
2
-
3
- from .base import Base, LowercaseStrEnum
4
-
5
-
6
- class RadialGridType(LowercaseStrEnum):
7
- """What sort of radial grid (only one option for now)"""
8
-
9
- KRACK_KOSTER = "krack_koster"
10
- LMG = "lmg"
11
-
12
-
13
- class GridSettings(Base):
14
- radial_grid_type: RadialGridType = RadialGridType.LMG
15
- angular_num_points: pydantic.PositiveInt = 434
16
-
17
- weight_cutoff: pydantic.PositiveFloat = 1e-11
18
-
19
- # for LMG
20
- radial_precision: pydantic.PositiveFloat = 1e-11
21
-
22
- # for other schemes, like KK
23
- radial_num_points: pydantic.PositiveInt = 75
24
-
25
- # pruning?
26
- prune: bool = True
27
- min_angular_points: pydantic.PositiveInt = 50
@@ -1,31 +0,0 @@
1
- import pydantic
2
-
3
- from .base import Base, LowercaseStrEnum
4
-
5
-
6
- class ERIStrategy(LowercaseStrEnum):
7
- # direct SCF, as per Almlof/Faegri/Korsell
8
- DIRECT = "direct"
9
-
10
- # Raffinetti-style supermatrix
11
- SUPERMATRIX = "supermatrix"
12
-
13
- # let the software choose between direct and supermatrix based on size
14
- AUTO = "auto"
15
-
16
- # resolution of the identity for J and K
17
- RIJK = "rijk"
18
-
19
-
20
- class IntSettings(Base):
21
- strategy: ERIStrategy = ERIStrategy.AUTO
22
-
23
- # these will get overwritten by ``mode`` anyway, for the most part
24
- eri_threshold: pydantic.PositiveFloat = 1e-9
25
- csam_multiplier: pydantic.PositiveFloat = pydantic.Field(default=1, ge=1)
26
- pair_overlap_threshold: pydantic.PositiveFloat = 1e-10
27
-
28
- @property
29
- def resolution_of_the_identity(self) -> bool:
30
- """Abstracting in case we add RIJCOSX, etc later"""
31
- return self.strategy == ERIStrategy.RIJK
@@ -1,77 +0,0 @@
1
- from typing import Any, Optional
2
-
3
- import pydantic
4
- from pydantic import PositiveFloat, PositiveInt
5
-
6
- from .base import Base, LowercaseStrEnum
7
- from .diis_settings import DIISSettings
8
- from .grid_settings import GridSettings
9
- from .int_settings import IntSettings
10
-
11
-
12
- class SCFInitMethod(LowercaseStrEnum):
13
- # (See https://manual.q-chem.com/5.2/Ch4.S4.SS2.html for a nice overview here.)
14
- SAD = "sad"
15
- CORE = "core"
16
- # GWH = "gwh"
17
- READ = "read"
18
-
19
-
20
- class OrthonormalizationMethod(LowercaseStrEnum):
21
- SYMMETRIC = "symmetric"
22
- CANONICAL = "canonical"
23
- # Cholesky, in future?
24
-
25
-
26
- class SCFSettings(Base):
27
- max_iters: int = 100
28
- init_method: SCFInitMethod = SCFInitMethod.SAD
29
-
30
- int_settings: IntSettings = IntSettings()
31
- grid_settings: GridSettings = GridSettings()
32
- diis_settings: DIISSettings = DIISSettings()
33
-
34
- #### orthonormalization
35
- orthonormalization: OrthonormalizationMethod = OrthonormalizationMethod.CANONICAL
36
-
37
- #### damping
38
- do_damping: bool = True
39
- # when should we stop damping?
40
- end_damping_error: PositiveFloat = 0.1
41
- # what damping factor should we use?
42
- damping_factor: float = pydantic.Field(ge=0, le=1, default=0.7)
43
-
44
- #### level shifting
45
- do_level_shift: bool = True
46
- # how much? (Eh)
47
- level_shift_magnitude: PositiveFloat = 0.25
48
- # when should we stop?
49
- end_level_shift_error: PositiveFloat = 0.1
50
-
51
- #### incremental
52
- # do incremental fock build?
53
- do_incremental: bool = True
54
- # reset incremental fock build
55
- rebuild_frequency: PositiveInt = 20
56
-
57
- #### when are we converged?
58
- energy_threshold: PositiveFloat = 1e-6
59
- rms_error_threshold: PositiveFloat = 1e-8
60
- max_error_threshold: PositiveFloat = 1e-5
61
-
62
- #### DIIS
63
- do_diis: bool = True
64
- # error below which we'll start DIIS
65
- start_diis_max_error: pydantic.PositiveFloat = 0.2
66
- # first iteration we'll consider starting DIIS
67
- start_diis_iter: PositiveInt = 3
68
- # iteration past which we'll start DIIS even if error is high
69
- start_diis_anyway: PositiveInt = 7
70
-
71
- # if ``read`` initialization is selected
72
- initial_density_matrix_guess: Optional[list[list[float]]] = None
73
-
74
- def model_post_init(self, __context: Any) -> None:
75
- # disable incremental Fock for RI
76
- if self.int_settings.resolution_of_the_identity:
77
- self.do_incremental = False
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes