stjames 0.0.92__tar.gz → 0.0.94__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 (82) hide show
  1. {stjames-0.0.92/stjames.egg-info → stjames-0.0.94}/PKG-INFO +1 -1
  2. {stjames-0.0.92 → stjames-0.0.94}/pyproject.toml +1 -1
  3. {stjames-0.0.92 → stjames-0.0.94}/stjames/__init__.py +0 -3
  4. {stjames-0.0.92 → stjames-0.0.94}/stjames/pdb.py +2 -1
  5. stjames-0.0.94/stjames/scf_settings.py +7 -0
  6. {stjames-0.0.92 → stjames-0.0.94}/stjames/settings.py +0 -69
  7. {stjames-0.0.92 → stjames-0.0.94}/stjames/status.py +3 -0
  8. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/docking.py +38 -8
  9. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/protein_cofolding.py +31 -1
  10. {stjames-0.0.92 → stjames-0.0.94/stjames.egg-info}/PKG-INFO +1 -1
  11. {stjames-0.0.92 → stjames-0.0.94}/stjames.egg-info/SOURCES.txt +0 -3
  12. stjames-0.0.92/stjames/diis_settings.py +0 -23
  13. stjames-0.0.92/stjames/grid_settings.py +0 -27
  14. stjames-0.0.92/stjames/int_settings.py +0 -31
  15. stjames-0.0.92/stjames/scf_settings.py +0 -77
  16. {stjames-0.0.92 → stjames-0.0.94}/LICENSE +0 -0
  17. {stjames-0.0.92 → stjames-0.0.94}/README.md +0 -0
  18. {stjames-0.0.92 → stjames-0.0.94}/setup.cfg +0 -0
  19. {stjames-0.0.92 → stjames-0.0.94}/stjames/_deprecated_solvent_settings.py +0 -0
  20. {stjames-0.0.92 → stjames-0.0.94}/stjames/atom.py +0 -0
  21. {stjames-0.0.92 → stjames-0.0.94}/stjames/atomium_stjames/__init__.py +0 -0
  22. {stjames-0.0.92 → stjames-0.0.94}/stjames/atomium_stjames/data.py +0 -0
  23. {stjames-0.0.92 → stjames-0.0.94}/stjames/atomium_stjames/mmcif.py +0 -0
  24. {stjames-0.0.92 → stjames-0.0.94}/stjames/atomium_stjames/pdb.py +0 -0
  25. {stjames-0.0.92 → stjames-0.0.94}/stjames/atomium_stjames/utilities.py +0 -0
  26. {stjames-0.0.92 → stjames-0.0.94}/stjames/base.py +0 -0
  27. {stjames-0.0.92 → stjames-0.0.94}/stjames/basis_set.py +0 -0
  28. {stjames-0.0.92 → stjames-0.0.94}/stjames/calculation.py +0 -0
  29. {stjames-0.0.92 → stjames-0.0.94}/stjames/compute_settings.py +0 -0
  30. {stjames-0.0.92 → stjames-0.0.94}/stjames/constraint.py +0 -0
  31. {stjames-0.0.92 → stjames-0.0.94}/stjames/correction.py +0 -0
  32. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/__init__.py +0 -0
  33. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/bragg_radii.json +0 -0
  34. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/elements.py +0 -0
  35. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/isotopes.json +0 -0
  36. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/nist_isotopes.json +0 -0
  37. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/read_nist_isotopes.py +0 -0
  38. {stjames-0.0.92 → stjames-0.0.94}/stjames/data/symbol_element.json +0 -0
  39. {stjames-0.0.92 → stjames-0.0.94}/stjames/engine.py +0 -0
  40. {stjames-0.0.92 → stjames-0.0.94}/stjames/message.py +0 -0
  41. {stjames-0.0.92 → stjames-0.0.94}/stjames/method.py +0 -0
  42. {stjames-0.0.92 → stjames-0.0.94}/stjames/mode.py +0 -0
  43. {stjames-0.0.92 → stjames-0.0.94}/stjames/molecule.py +0 -0
  44. {stjames-0.0.92 → stjames-0.0.94}/stjames/opt_settings.py +0 -0
  45. {stjames-0.0.92 → stjames-0.0.94}/stjames/periodic_cell.py +0 -0
  46. {stjames-0.0.92 → stjames-0.0.94}/stjames/py.typed +0 -0
  47. {stjames-0.0.92 → stjames-0.0.94}/stjames/solvent.py +0 -0
  48. {stjames-0.0.92 → stjames-0.0.94}/stjames/task.py +0 -0
  49. {stjames-0.0.92 → stjames-0.0.94}/stjames/thermochem_settings.py +0 -0
  50. {stjames-0.0.92 → stjames-0.0.94}/stjames/types.py +0 -0
  51. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/__init__.py +0 -0
  52. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/admet.py +0 -0
  53. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/basic_calculation.py +0 -0
  54. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/bde.py +0 -0
  55. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/conformer.py +0 -0
  56. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/conformer_search.py +0 -0
  57. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/descriptors.py +0 -0
  58. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/electronic_properties.py +0 -0
  59. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/fukui.py +0 -0
  60. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/hydrogen_bond_basicity.py +0 -0
  61. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/ion_mobility.py +0 -0
  62. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/irc.py +0 -0
  63. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/macropka.py +0 -0
  64. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/molecular_dynamics.py +0 -0
  65. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/multistage_opt.py +0 -0
  66. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/pka.py +0 -0
  67. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/pose_analysis_md.py +0 -0
  68. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/redox_potential.py +0 -0
  69. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/scan.py +0 -0
  70. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/solubility.py +0 -0
  71. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/spin_states.py +0 -0
  72. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/tautomer.py +0 -0
  73. {stjames-0.0.92 → stjames-0.0.94}/stjames/workflows/workflow.py +0 -0
  74. {stjames-0.0.92 → stjames-0.0.94}/stjames.egg-info/dependency_links.txt +0 -0
  75. {stjames-0.0.92 → stjames-0.0.94}/stjames.egg-info/requires.txt +0 -0
  76. {stjames-0.0.92 → stjames-0.0.94}/stjames.egg-info/top_level.txt +0 -0
  77. {stjames-0.0.92 → stjames-0.0.94}/tests/test_constraints.py +0 -0
  78. {stjames-0.0.92 → stjames-0.0.94}/tests/test_from_extxyz.py +0 -0
  79. {stjames-0.0.92 → stjames-0.0.94}/tests/test_molecule.py +0 -0
  80. {stjames-0.0.92 → stjames-0.0.94}/tests/test_pdb.py +0 -0
  81. {stjames-0.0.92 → stjames-0.0.94}/tests/test_rounding.py +0 -0
  82. {stjames-0.0.92 → stjames-0.0.94}/tests/test_settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stjames
3
- Version: 0.0.92
3
+ Version: 0.0.94
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.92"
3
+ version = "0.0.94"
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 *
@@ -448,6 +448,7 @@ def _format_atom_line(
448
448
  chg = " "
449
449
 
450
450
  atom_name = atom.name if atom.name else atom.element
451
+
451
452
  occupancy = atom.occupancy if atom.occupancy else 1.0
452
453
 
453
454
  # Construct the line.
@@ -455,7 +456,7 @@ def _format_atom_line(
455
456
  line = (
456
457
  f"{record_type}"
457
458
  f"{serial:5d} " # atom serial number (columns 7-11)
458
- f"{atom_name:<4}" # atom name (columns 13-16, left-justified in this snippet)
459
+ f"{(' ' + atom_name if len(atom_name) < 4 else atom_name):<4}" # atom name (columns 13-16, left-justified in this snippet)
459
460
  f"{alt_loc_char}" # altLoc (column 17)
460
461
  f"{residue_name:>3}" # residue name (columns 18-20)
461
462
  f" {chain_char}" # chain ID (column 22)
@@ -0,0 +1,7 @@
1
+ from pydantic import BaseModel
2
+
3
+
4
+ class SCFSettings(BaseModel):
5
+ max_iters: int = 250
6
+
7
+ soscf: bool = False
@@ -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
@@ -7,6 +7,7 @@ from pydantic import AfterValidator, ConfigDict, field_validator, model_validato
7
7
  from ..base import Base, round_float
8
8
  from ..pdb import PDB
9
9
  from ..types import UUID, Vector3D
10
+ from .conformer_search import ConformerGenSettings, ETKDGSettings
10
11
  from .workflow import MoleculeWorkflow
11
12
 
12
13
 
@@ -20,6 +21,28 @@ class Score(Base):
20
21
 
21
22
  pose: UUID | None # for calculation
22
23
  score: Annotated[float, AfterValidator(round_float(3))]
24
+ posebusters_valid: bool
25
+
26
+
27
+ class DockingSettings(Base):
28
+ """
29
+ Base class for controlling how docked poses are generated.
30
+
31
+ :param max_poses: the maximum number of poses generated per input molecule
32
+ """
33
+
34
+ max_poses: int = 4
35
+
36
+
37
+ class VinaSettings(DockingSettings):
38
+ """
39
+ Controls how AutoDock Vina is run.
40
+
41
+ :param exhaustiveness: how many times Vina attempts to find a pose.
42
+ 8 is typical, 32 is considered relatively careful.
43
+ """
44
+
45
+ exhaustiveness: int = 8
23
46
 
24
47
 
25
48
  class DockingWorkflow(MoleculeWorkflow):
@@ -35,31 +58,38 @@ class DockingWorkflow(MoleculeWorkflow):
35
58
  :param mode: Mode for workflow (currently unused)
36
59
 
37
60
  New:
38
- :param molecules: Molecules to dock (optional)
39
- :param smiles: SMILES strings of the ligands (optional)
61
+ :param docking_engine: which docking method to use
40
62
  :param do_csearch: whether to csearch starting structures
63
+ :param csearch_settings: settings for initial conformer search.
41
64
  :param do_optimization: whether to optimize starting structures
65
+ :param opt_settings: settings for conformer optimization.
42
66
  :param do_pose_refinement: whether to optimize non-rotatable bonds in output poses
43
- :param conformers: UUIDs of optimized conformers
44
67
  :param target: PDB of the protein.
45
68
  :param target_uuid: UUID of the protein.
46
69
  :param pocket: center (x, y, z) and size (x, y, z) of the pocket
47
70
 
48
71
  Results:
72
+ :param conformers: UUIDs of optimized conformers
49
73
  :param scores: docked poses sorted by score
50
74
  """
51
75
 
52
76
  model_config = ConfigDict(arbitrary_types_allowed=True)
53
77
 
54
- do_csearch: bool = True
55
- do_optimization: bool = True
56
- conformers: list[UUID] = []
57
-
58
78
  target: PDB | None = None
59
79
  target_uuid: UUID | None = None
60
80
  pocket: tuple[Vector3D, Vector3D]
61
81
 
82
+ do_csearch: bool = True
83
+ conformer_gen_settings: ConformerGenSettings = ETKDGSettings(mode="reckless")
84
+
85
+ do_optimization: bool = True
86
+ # optimization_settings - here in future once we have a cleaner mode sol'n, ccw 7.9.25
87
+
88
+ docking_settings: DockingSettings = VinaSettings()
89
+
62
90
  do_pose_refinement: bool = True
91
+
92
+ conformers: list[UUID] = []
63
93
  scores: list[Score] = []
64
94
 
65
95
  def __str__(self) -> str:
@@ -80,7 +110,7 @@ class DockingWorkflow(MoleculeWorkflow):
80
110
  def check_protein(self) -> Self:
81
111
  """Check if protein is provided."""
82
112
  if not self.target and not self.target_uuid:
83
- raise ValueError("Must provide either molecules or smiles")
113
+ raise ValueError("Must provide either target or target_uuid")
84
114
  return self
85
115
 
86
116
  @field_validator("pocket", mode="after")
@@ -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.92
3
+ Version: 0.0.94
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
@@ -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