Skip to content

Commit

Permalink
Merge pull request #7 from molssi-seamm/dev
Browse files Browse the repository at this point in the history
Added nsteps optimization to results
  • Loading branch information
paulsaxe authored May 27, 2024
2 parents 65eb315 + 1a3073b commit fa97fa0
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
=======
History
=======
2024.5.27: Added number of optimization steps to results
* Added the number of steps for the optimizations to the results that can be output
to tables, variables, etc.

2024.5.8 General enhancements
* Updated to new calculation handling, with ~/SEAMM/gaussian.ini controlling access
to the installed version of Gaussian on the machine.
Expand Down
23 changes: 15 additions & 8 deletions gaussian_step/energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,16 +248,23 @@ def run(self, keywords=set()):
keywords.add(f"ROHF/{basis}")
else:
keywords.add(f"UHF/{basis}")
# keywords.add("Guess=Mix")
elif method[0:2] == "MP":
if restricted and multiplicity != 1 and isinstance(self, Energy):
keywords.add(f"RO{method}/{basis}")
if restricted:
if multiplicity == 1:
keywords.add(f"R{method}/{basis}")
else:
keywords.add(f"RO{method}/{basis}")
else:
keywords.add(f"{method}/{basis}")
keywords.add(f"U{method}/{basis}")
elif method in ("CCSD", "CCSD(T)"):
if restricted and multiplicity != 1 and isinstance(self, Energy):
keywords.add(f"RO{method}/{basis}")
if restricted:
if multiplicity == 1:
keywords.add(f"R{method}/{basis}")
else:
keywords.add(f"RO{method}/{basis}")
else:
keywords.add(f"{method}/{basis}")
keywords.add(f"U{method}/{basis}")
elif method in ("CBS-4M", "CBS-QB3"):
if isinstance(self, Energy):
if restricted and multiplicity != 1:
Expand Down Expand Up @@ -320,12 +327,12 @@ def analyze(self, indent="", data={}, table=None):
}

metadata = gaussian_step.metadata["results"]
if "Total Energy" not in data:
if "energy" not in data:
text += "Gaussian did not produce the energy. Something is wrong!"
printer.normal(__(text, indent=self.indent + 4 * " "))

for key in (
"Total Energy",
"energy",
"Virial Ratio",
"RMS Density",
"Cluster Energy with triples",
Expand Down
6 changes: 6 additions & 0 deletions gaussian_step/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@
"units": "E_h/a0",
"format": ".6f",
},
"nsteps": {
"calculation": ["optimization"],
"description": "optimization nsteps",
"dimensionality": "scalar",
"type": "integer",
},
"model": {
"description": "The model string",
"dimensionality": "scalar",
Expand Down
1 change: 1 addition & 0 deletions gaussian_step/optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def analyze(self, indent="", data={}, out=[], table=None):
else:
# Information about the optimization
n_steps = data["Optimization Number of geometries"][0]
data["nsteps"] = n_steps
if data["Geometry Optimization Converged"]:
text += f"The geometry optimization converged in {n_steps} steps."
else:
Expand Down

0 comments on commit fa97fa0

Please sign in to comment.