Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update example scripts (#4)
Browse files- Update example scripts (228c014815015c013486f16e5dc206ed3e2f5ea2)
- simulation_scripts.py +6 -4
simulation_scripts.py
CHANGED
@@ -233,7 +233,7 @@ from ase.optimize import LBFGS
|
|
233 |
from ase.io.trajectory import Trajectory
|
234 |
from ase.md import MDLogger
|
235 |
from ase import units
|
236 |
-
from fairchem.core
|
237 |
|
238 |
# Read the atoms object from ASE read-able file
|
239 |
atoms = ase.io.read('input_file.traj')
|
@@ -243,7 +243,8 @@ atoms.info["charge"] = {total_charge}
|
|
243 |
atoms.info["spin"] = {spin_multiplicity}
|
244 |
|
245 |
# Set up the calculator
|
246 |
-
|
|
|
247 |
|
248 |
# Do a quick pre-relaxation to make sure the system is stable
|
249 |
opt = LBFGS(atoms, trajectory="relaxation_output.traj")
|
@@ -360,7 +361,7 @@ def run_relaxation_simulation(
|
|
360 |
import ase.io
|
361 |
from ase.optimize import LBFGS
|
362 |
from ase.filters import FrechetCellFilter
|
363 |
-
from fairchem.core
|
364 |
|
365 |
# Read the atoms object from ASE read-able file
|
366 |
atoms = ase.io.read('input_file.traj')
|
@@ -370,7 +371,8 @@ atoms.info["charge"] = {total_charge}
|
|
370 |
atoms.info["spin"] = {spin_multiplicity}
|
371 |
|
372 |
# Set up the calculator
|
373 |
-
|
|
|
374 |
|
375 |
# Initialize the optimizer from ASE
|
376 |
relax_unit_cell = {relax_unit_cell}
|
|
|
233 |
from ase.io.trajectory import Trajectory
|
234 |
from ase.md import MDLogger
|
235 |
from ase import units
|
236 |
+
from fairchem.core import pretrained_mlip, FAIRChemCalculator
|
237 |
|
238 |
# Read the atoms object from ASE read-able file
|
239 |
atoms = ase.io.read('input_file.traj')
|
|
|
243 |
atoms.info["spin"] = {spin_multiplicity}
|
244 |
|
245 |
# Set up the calculator
|
246 |
+
predictor = pretrained_mlip.get_predict_unit('uma-sm', device='cuda')
|
247 |
+
atoms.calc = FAIRChemCalculator(predictor, task_name='{task_name}')
|
248 |
|
249 |
# Do a quick pre-relaxation to make sure the system is stable
|
250 |
opt = LBFGS(atoms, trajectory="relaxation_output.traj")
|
|
|
361 |
import ase.io
|
362 |
from ase.optimize import LBFGS
|
363 |
from ase.filters import FrechetCellFilter
|
364 |
+
from fairchem.core import pretrained_mlip, FAIRChemCalculator
|
365 |
|
366 |
# Read the atoms object from ASE read-able file
|
367 |
atoms = ase.io.read('input_file.traj')
|
|
|
371 |
atoms.info["spin"] = {spin_multiplicity}
|
372 |
|
373 |
# Set up the calculator
|
374 |
+
predictor = pretrained_mlip.get_predict_unit('uma-sm', device='cuda')
|
375 |
+
atoms.calc = FAIRChemCalculator(predictor, task_name='{task_name}')
|
376 |
|
377 |
# Initialize the optimizer from ASE
|
378 |
relax_unit_cell = {relax_unit_cell}
|