You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If one downloads the .zip file from the github, then the default folder of source code would be `deepmd-kit-master` rather than `deepmd-kit`. For convenience, you may want to record the location of source to a variable, saying `deepmd_source_dir` by
156
157
```bash
@@ -553,6 +554,30 @@ The option **`graph_file`** provides the file name of the frozen model.
553
554
554
555
The `dp_ipi` gets the atom names from an [XYZ file](https://en.wikipedia.org/wiki/XYZ_file_format) provided by **`coord_file`** (meanwhile ignores all coordinates in it), and translates the names to atom types by rules provided by **`atom_type`**.
555
556
557
+
## Use deep potential with ASE
558
+
559
+
Deep potential can be set up as a calculator with ASE to obtain potential energies and forces.
560
+
```python
561
+
from ase import Atoms
562
+
from deepmd.calculator importDP
563
+
564
+
water = Atoms('H2O',
565
+
positions=[(0.7601, 1.9270, 1),
566
+
(1.9575, 1, 1),
567
+
(1., 1., 1.)],
568
+
cell=[100, 100, 100],
569
+
calculator=DP(model="frozen_model.pb"))
570
+
print(water.get_potential_energy())
571
+
print(water.get_forces())
572
+
```
573
+
574
+
Optimization is also available:
575
+
```python
576
+
from ase.optimize importBFGS
577
+
dyn = BFGS(water)
578
+
dyn.run(fmax=1e-6)
579
+
print(water.get_positions())
580
+
```
556
581
557
582
# Troubleshooting
558
583
In consequence of various differences of computers or systems, problems may occur. Some common circumstances are listed as follows.
0 commit comments