Skip to content

Commit d735223

Browse files
authored
Merge pull request #116 from deepmodeling/devel
merge devel into master
2 parents d73927d + 7f8afdd commit d735223

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1482
-390
lines changed

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ matrix:
3131
- CC=gcc-4.8
3232
- CXX=g++-4.8
3333
- TENSORFLOW_VERSION=1.14
34+
- python: 3.6
35+
env:
36+
- CC=gcc-5
37+
- CXX=g++-5
38+
- TENSORFLOW_VERSION=1.14
39+
- python: 3.6
40+
env:
41+
- CC=gcc-8
42+
- CXX=g++-8
43+
- TENSORFLOW_VERSION=1.14
3444
- python: 3.7
3545
env:
3646
- CC=gcc-5

README.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
- [License and credits](#license-and-credits)
1010
- [Deep Potential in a nutshell](#deep-potential-in-a-nutshell)
1111
- [Download and install](#download-and-install)
12+
- [Easy installation methods](#easy-installation-methods)
13+
- [With Docker](#with-docker)
14+
- [With conda](#with-conda)
15+
- [Offline packages](#offline-packages)
1216
- [Install the python interaction](#install-the-python-interface)
13-
- [Easy installation methods](#easy-installation-methods)
1417
- [Install the Tensorflow's python interface](#install-the-tensorflows-python-interface)
1518
- [Install the DeePMD-kit's python interface](#install-the-deepmd-kits-python-interface)
1619
- [Install the C++ interface](#install-the-c-interface)
@@ -83,11 +86,29 @@ In addition to building up potential energy models, DeePMD-kit can also be used
8386

8487
Please follow our [github](https://github.com/deepmodeling/deepmd-kit) webpage to see the latest released version and development version.
8588

86-
## Install the python interface
89+
## Easy installation methods
90+
There various easy methods to install DeePMD-kit. Choose one that you prefer. If you want to build by yourself, jump to the next two sections.
91+
92+
### With Docker
93+
A docker for installing the DeePMD-kit on CentOS 7 is available [here](https://github.com/frankhan91/deepmd-kit_docker).
94+
95+
### With conda
96+
DeePMD-kit is avaiable with [conda](https://github.com/conda/conda). Install [Anaconda](https://www.anaconda.com/distribution/#download-section) or [Miniconda](https://docs.conda.io/en/latest/miniconda.html) first.
97+
98+
To install the CPU version:
99+
```bash
100+
conda install deepmd-kit=*=*cpu lammps-dp=*=*cpu -c deepmodeling
101+
```
102+
103+
To install the GPU version containing [CUDA 10.0](https://docs.nvidia.com/deploy/cuda-compatibility/index.html#binary-compatibility__table-toolkit-driver):
104+
```bash
105+
conda install deepmd-kit=*=*gpu lammps-dp=*=*gpu -c deepmodeling
106+
```
87107

88-
### Easy installation methods
89-
A docker for installing the DeePMD-kit on CentOS 7 is available [here](https://github.com/frankhan91/deepmd-kit_docker). We are currently working on installation methods using the `conda` package management system and `pip` tools. Hope these will come out soon.
108+
### Offline packages
109+
Both CPU and GPU version offline package are avaiable in [the Releases page](https://github.com/deepmodeling/deepmd-kit/releases).
90110

111+
## Install the python interface
91112
### Install the Tensorflow's python interface
92113
First, check the python version and compiler version on your machine
93114
```bash
@@ -102,6 +123,14 @@ source $tensorflow_venv/bin/activate
102123
pip install --upgrade pip
103124
pip install --upgrade tensorflow==1.14.0
104125
```
126+
It is notice that everytime a new shell is started and one wants to use `DeePMD-kit`, the virtual environment should be activated by
127+
```bash
128+
source $tensorflow_venv/bin/activate
129+
```
130+
if one wants to skip out of the virtual environment, he/she can do
131+
```bash
132+
deactivate
133+
```
105134
If one has multiple python interpreters named like python3.x, it can be specified by, for example
106135
```bash
107136
virtualenv -p python3.7 $tensorflow_venv
@@ -483,7 +512,7 @@ Running an MD simulation with LAMMPS is simpler. In the LAMMPS input file, one n
483512
pair_style deepmd graph.pb
484513
pair_coeff
485514
```
486-
where `graph.pb` is the file name of the frozen model. The `pair_coeff` should be left blank. It should be noted that LAMMPS counts atom types starting from 1, therefore, all LAMMPS atom type will be firstly subtracted by 1, and then passed into the DeePMD-kit engine to compute the interactions. A detailed documentation of this pair style is [here](doc/lammps-pair-style-deepmd.md).
515+
where `graph.pb` is the file name of the frozen model. The `pair_coeff` should be left blank. It should be noted that LAMMPS counts atom types starting from 1, therefore, all LAMMPS atom type will be firstly subtracted by 1, and then passed into the DeePMD-kit engine to compute the interactions. [A detailed documentation of this pair style is available.](doc/lammps-pair-style-deepmd.md).
487516

488517
### Long-range interaction
489518
The reciprocal space part of the long-range interaction can be calculated by LAMMPS command `kspace_style`. To use it with DeePMD-kit, one writes
@@ -533,11 +562,7 @@ If other unexpected problems occur, you're welcome to contact us for help.
533562

534563
When the version of DeePMD-kit used to training model is different from the that of DeePMD-kit running MDs, one has the problem of model compatability.
535564

536-
DeePMD-kit guarantees that the codes with the same major and minor revisions are compatible. That is to say v0.12.5 is compatible to v0.12.0, but is not compatible to v0.11.0. When way of fixing it is to restart the training with the new revisions and a slightly increased `stop_batch`, say 1,000,000 to 1,001,000 if the `save_freq` was set to 1,000. Typically one runs
537-
```bash
538-
dp train --restart model.ckpt revised_input.json
539-
```
540-
and freeze the new model.
565+
DeePMD-kit guarantees that the codes with the same major and minor revisions are compatible. That is to say v0.12.5 is compatible to v0.12.0, but is not compatible to v0.11.0 nor v1.0.0.
541566

542567
## Installation: inadequate versions of gcc/g++
543568
Sometimes you may use a gcc/g++ of version <4.9. If you have a gcc/g++ of version > 4.9, say, 7.2.0, you may choose to use it by doing

deepmd/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
from .env import set_mkl
2-
from .DeepEval import DeepEval
3-
from .DeepPot import DeepPot
4-
from .DeepPolar import DeepPolar
5-
from .DeepWFC import DeepWFC
2+
from .DeepEval import DeepEval
3+
from .DeepPot import DeepPot
4+
from .DeepDipole import DeepDipole
5+
from .DeepPolar import DeepPolar
6+
from .DeepWFC import DeepWFC
67

78
set_mkl()
89

doc/lammps-pair-style-deepmd.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ This pair style takes the deep potential defined in a model file that usually ha
3535

3636
The model deviation evalulate the consistency of the force predictions from multiple models. By default, only the maximal, minimal and averge model deviations are output. If the key `atomic` is set, then the model deviation of force prediction of each atom will be output.
3737

38-
By default, the model deviation is output in absolute value. If the keyword `relative` is set, then the relative model deviation will be output, which is defined by
38+
By default, the model deviation is output in absolute value. If the keyword `relative` is set, then the relative model deviation will be output. The relative model deviation of the force on atom `i` is defined by
3939
```math
40-
|Df|
41-
Ef = -------------
42-
|f| + level
40+
|Df_i|
41+
Ef_i = -------------
42+
|f_i| + level
4343
```
44-
where `Df` is the model deviation of a force, `|f|` is the norm of the force and `level` is provided as the parameter of the keyword `relative`.
44+
where `Df_i` is the absolute model deviation of the force on atom `i`, `|f_i|` is the norm of the the force and `level` is provided as the parameter of the keyword `relative`.
4545

4646

4747
## Restrictions
@@ -50,6 +50,8 @@ where `Df` is the model deviation of a force, `|f|` is the norm of the force and
5050

5151
- The `atom_style` of the system should be `atomic`.
5252

53+
- When using the `atomic` key word of `deepmd` is set, one should not use this pair style with MPI parallelization.
54+
5355

5456
[DP]:https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.120.143001
5557
[DP-SE]:https://arxiv.org/abs/1805.09003

examples/fparam/data/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
*raw
2-
1+
*.raw
2+
convert_aparam.py
21.2 KB
Binary file not shown.
21.2 KB
Binary file not shown.
21.2 KB
Binary file not shown.
21.2 KB
Binary file not shown.
21.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)