-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CalcType.optimization support for TeraChem.
- Loading branch information
Showing
10 changed files
with
121 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
## geomeTRIC | ||
|
||
```python | ||
{!examples/geometric.py!} | ||
``` | ||
``` | ||
|
||
## TeraChem | ||
|
||
```python | ||
{!examples/terachem_opt.py!} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
::: qcop.adapters.terachem.TeraChemAdapter | ||
::: qcop.adapters.terachem.TeraChemAdapter | ||
|
||
::: qcop.adapters.terachem_fe.TeraChemFEAdapter | ||
|
||
::: qcop.adapters.terachem_pbs.TeraChemPBSAdapter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
"""Example of how to run an optimization calculation with TeraChem using qcop.""" | ||
|
||
from qcio import ProgramInput, Structure | ||
|
||
from qcop import compute, exceptions | ||
|
||
# Create the structure | ||
# Can also open a structure from a file | ||
# structure = Structure.open("path/to/h2o.xyz") | ||
structure = Structure( | ||
symbols=["O", "H", "H"], | ||
geometry=[ # type: ignore | ||
[0.0, 0.0, 0.0], | ||
[0.52421003, 1.68733646, 0.48074633], | ||
[1.14668581, -0.45032174, -1.35474466], | ||
], | ||
) | ||
|
||
# Define the program input | ||
prog_input = ProgramInput( | ||
structure=structure, | ||
# Can be "energy", "gradient", "hessian", "optimization", "transition_state" | ||
calctype="optimization", # type: ignore | ||
model={"method": "hf", "basis": "sto-3g"}, # type: ignore | ||
keywords={"purify": "no", "new_minimizer": "yes"}, # new_minimizer yes is required | ||
) | ||
|
||
# Run the calculation | ||
try: | ||
# prog_output is instance of ProgramOutput | ||
prog_output = compute("terachem", prog_input, collect_files=True) | ||
except exceptions.QCOPBaseError as e: | ||
prog_output = e.program_output | ||
print(prog_output.stdout) # or output.pstdout for short | ||
print(f"Success: {prog_output.success}") # False | ||
print(prog_output.input_data) # Input data used to generate the calculation | ||
print(prog_output.provenance) # Provenance of generated calculation | ||
print(prog_output.traceback) # or output.ptraceback for short | ||
raise | ||
|
||
else: | ||
# Check results | ||
print(prog_output.stdout) # or output.pstdout for short | ||
print(f"Success: {prog_output.success}") # True | ||
print("output.results: ", prog_output.results) | ||
print("output.results.energies:", prog_output.results.energies) | ||
print("output.results.structures:", prog_output.results.structures) | ||
print("output.results.final_structure:", prog_output.results.final_structure) | ||
print(prog_output.input_data) # Input data used to generate the calculation | ||
print(prog_output.provenance) # Provenance of generated calculation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters