-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""Wrappers for functions compatible with the Parsl workflow engine""" | ||
from typing import Optional | ||
|
||
import ase | ||
|
||
from jitterbug.utils import make_calculator | ||
|
||
|
||
def get_energy(atoms: ase.Atoms, method: str, basis: Optional[str], **kwargs) -> float: | ||
"""Compute the energy of an atomic structure | ||
Keyword arguments are passed to :meth:`make_calculator`. | ||
Args: | ||
atoms: Structure to evaluate | ||
method: Name of the method to use (e.g., B3LYP) | ||
basis: Basis set to use (e.g., cc-PVTZ) | ||
Returns: | ||
Energy (units: eV) | ||
""" | ||
|
||
calc = make_calculator(method, basis, **kwargs) | ||
return calc.get_potential_energy(atoms) |
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,5 @@ | ||
3 | ||
Properties=species:S:1:pos:R:3:forces:R:3 energy=-2080.5785031368773 pbc="F F F" | ||
O 2.53690888 -0.34072954 0.00000000 0.00346641 0.00474413 0.00000000 | ||
H 3.29702983 0.24793463 0.00000000 0.00004343 -0.00355994 -0.00000000 | ||
H 1.77686228 0.24789366 -0.00000000 -0.00350905 -0.00087620 0.00000000 |
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,8 @@ | ||
from ase.io import read | ||
|
||
from jitterbug.parsl import get_energy | ||
|
||
|
||
def test_energy(xyz_path): | ||
atoms = read(xyz_path) | ||
get_energy(atoms, 'pm7', None) |