Spaces:
Running
Running
Yuan (Cyrus) Chiang
commited on
Return equilibrium volume and energy from EOS task (#29)
Browse files* refactor eos into task
* task name and cache
* avoid duplicate test on PR branches
* more returned data in eos
* return b1
* minor md test change
- mlip_arena/tasks/eos.py +5 -1
- tests/test_eos.py +1 -1
- tests/test_md.py +2 -1
mlip_arena/tasks/eos.py
CHANGED
@@ -71,7 +71,7 @@ def run(
|
|
71 |
npoints: The number of points to sample.
|
72 |
|
73 |
Returns:
|
74 |
-
A dictionary containing the EOS data and
|
75 |
"""
|
76 |
first_relax = OPT(
|
77 |
atoms=atoms,
|
@@ -138,4 +138,8 @@ def run(
|
|
138 |
return {
|
139 |
"eos": {"volumes": volumes, "energies": energies},
|
140 |
"K": bm.b0_GPa,
|
|
|
|
|
|
|
|
|
141 |
}
|
|
|
71 |
npoints: The number of points to sample.
|
72 |
|
73 |
Returns:
|
74 |
+
A dictionary containing the EOS data, bulk modulus, equilibrium volume, and equilibrium energy.
|
75 |
"""
|
76 |
first_relax = OPT(
|
77 |
atoms=atoms,
|
|
|
138 |
return {
|
139 |
"eos": {"volumes": volumes, "energies": energies},
|
140 |
"K": bm.b0_GPa,
|
141 |
+
"b0": bm.b0,
|
142 |
+
"b1": bm.b1,
|
143 |
+
"e0": bm.e0,
|
144 |
+
"v0": bm.v0,
|
145 |
}
|
tests/test_eos.py
CHANGED
@@ -45,4 +45,4 @@ def test_eos(model: MLIPEnum):
|
|
45 |
calculator_name=model.name,
|
46 |
)
|
47 |
|
48 |
-
assert isinstance(result["
|
|
|
45 |
calculator_name=model.name,
|
46 |
)
|
47 |
|
48 |
+
assert isinstance(result["b0"], float)
|
tests/test_md.py
CHANGED
@@ -19,7 +19,8 @@ def test_nve(model: MLIPEnum):
|
|
19 |
calculator_kwargs={},
|
20 |
ensemble="nve",
|
21 |
dynamics="velocityverlet",
|
22 |
-
total_time=
|
|
|
23 |
)
|
24 |
|
25 |
assert isinstance(result["atoms"].get_potential_energy(), float)
|
|
|
19 |
calculator_kwargs={},
|
20 |
ensemble="nve",
|
21 |
dynamics="velocityverlet",
|
22 |
+
total_time=10,
|
23 |
+
time_step=2,
|
24 |
)
|
25 |
|
26 |
assert isinstance(result["atoms"].get_potential_energy(), float)
|