Skip to content

Commit 355f8ed

Browse files
authored
Merge devel into master (#1059)
2 parents 8dea29e + 572fbfd commit 355f8ed

File tree

291 files changed

+89154
-2374
lines changed

Some content is hidden

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

291 files changed

+89154
-2374
lines changed

.github/workflows/mirror_gitee.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ concurrency:
99
jobs:
1010
git-mirror:
1111
runs-on: ubuntu-latest
12+
if: github.repository_owner == 'deepmodeling'
1213
steps:
1314
- uses: wearerequired/git-mirror-action@v1
1415
env:

.github/workflows/test.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.7, 3.8]
13-
PYMATGEN_VERSION: [2019.1.13, 2019.7.30]
12+
python-version: [3.8, 3.9]
13+
PYMATGEN_VERSION: [2022.7.19]
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -19,7 +19,12 @@ jobs:
1919
with:
2020
python-version: ${{ matrix.python-version }}
2121
- name: Install dependencies
22-
run: pip install coverage codecov pymatgen==${{ matrix.PYMATGEN_VERSION }} .
22+
run: pip install coverage pymatgen==${{ matrix.PYMATGEN_VERSION }} -e .
2323
- name: Test
2424
run: coverage run --source=./dpgen -m unittest -v && coverage report
25-
- run: codecov
25+
- uses: codecov/codecov-action@v3
26+
pass:
27+
needs: [build]
28+
runs-on: ubuntu-latest
29+
steps:
30+
- run: echo "All jobs passed"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ dbconfig.json
4242
_build
4343
tests/generator/calypso_test_path
4444
doc/api/
45+

.readthedocs.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .readthedocs.yaml
2+
# Read the Docs configuration file
3+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4+
5+
# Required
6+
version: 2
7+
8+
# Set the version of Python and other tools you might need
9+
build:
10+
os: ubuntu-22.04
11+
tools:
12+
python: "3.10"
13+
14+
# Build documentation in the docs/ directory with Sphinx
15+
sphinx:
16+
configuration: doc/conf.py
17+
18+
# If using Sphinx, optionally build your docs in additional formats such as PDF
19+
formats: all
20+
21+
# Optionally declare the Python requirements required to build your docs
22+
python:
23+
install:
24+
- requirements: doc/requirements.txt

README.md

Lines changed: 27 additions & 1308 deletions
Large diffs are not rendered by default.

doc/CONTRIBUTING.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

doc/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

doc/autotest/Auto-test.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
## Autotest Overview: Autotest for Deep Generator
2+
Suppose that we have a potential (can be DFT, DP, MEAM ...), `autotest` helps us automatically calculate M properties on N configurations. The folder where the `autotest` runs is called the working directory of `autotest`. Different potentials should be tested in different working directories.
3+
4+
A property is tested in three steps: `make`, `run` and `post`. `make` prepares all computational tasks that are needed to calculate the property. For example to calculate EOS, `make` prepares a series of tasks, each of which has a scaled configuration with certain volume, and all necessary input files necessary for starting a VASP, ABACUS, or LAMMPS calculations. `run` sends all the computational tasks to remote computational resources defined in a machine configuration file like `machine.json`, and automatically collects the results when remote calculations finish. `post` calculates the desired property from the collected results.
5+
6+
### Relaxation
7+
8+
The relaxation of a structure should be carried out before calculating all other properties:
9+
```bash
10+
dpgen autotest make relax.json
11+
dpgen autotest run relax.json machine.json
12+
dpgen autotest post relax.json
13+
```
14+
If, for some reasons, the main program terminated at stage `run`, one can easily restart with the same command.
15+
`relax.json` is the parameter file. An example for `deepmd` relaxation is given as:
16+
```json
17+
{
18+
"structures": "confs/mp-*",
19+
"interaction": {
20+
"type": "deepmd",
21+
"model": "frozen_model.pb",
22+
"type_map": {"Al": 0, "Mg": 1}
23+
},
24+
"relaxation": {}
25+
}
26+
```
27+
28+
where the key `structures` provides the structures to relax. `interaction` is provided with `deepmd`, and other options are `vasp`, `abacus`, `meam`...
29+
30+
### Task type
31+
There are now six task types implemented in the package: `vasp`, `abacus`, `deepmd`, `meam`, `eam_fs`, and `eam_alloy`. An `inter.json` file in json format containing the interaction parameters will be written in the directory of each task after `make`. We give input examples of the `interaction` part for each type below:
32+
33+
**VASP**:
34+
35+
The default of `potcar_prefix` is "".
36+
```json
37+
"interaction": {
38+
"type": "vasp",
39+
"incar": "vasp_input/INCAR",
40+
"potcar_prefix":"vasp_input",
41+
"potcars": {"Al": "POTCAR.al", "Mg": "POTCAR.mg"}
42+
}
43+
```
44+
**ABACUS**:
45+
46+
The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc is `potcar_prefix` + `potcars`/`orb_files`/`deepks_desc`.
47+
```json
48+
"interaction": {
49+
"type": "abacus",
50+
"incar": "abacus_input/INPUT",
51+
"potcar_prefix":"abacus_input",
52+
"potcars": {"Al": "pseudo_potential.al", "Mg": "pseudo_potential.mg"},
53+
"orb_files": {"Al": "numerical_orb.al", "Mg": "numerical_orb.mg"},
54+
"atom_masses": {"Al": 26.9815, "Mg":24.305},
55+
"deepks_desc": "jle.orb"
56+
}
57+
```
58+
**deepmd**:
59+
60+
**Only 1** model can be used in autotest in one working directory.
61+
62+
```json
63+
"interaction": {
64+
"type": "deepmd",
65+
"model": "frozen_model.pb",
66+
"type_map": {"Al": 0, "Mg": 1}
67+
}
68+
```
69+
**meam**:
70+
71+
Please make sure the [USER-MEAMC package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-user-meamc) has already been installed in LAMMPS.
72+
```json
73+
"interaction": {
74+
"type": "meam",
75+
"model": ["meam.lib","AlMg.meam"],
76+
"type_map": {"Al": 1, "Mg": 2}
77+
}
78+
```
79+
**eam_fs & eam_alloy**:
80+
81+
Please make sure the [MANYBODY package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-manybody) has already been installed in LAMMPS
82+
```json
83+
"interaction": {
84+
"type": "eam_fs (eam_alloy)",
85+
"model": "AlMg.eam.fs (AlMg.eam.alloy)",
86+
"type_map": {"Al": 1, "Mg": 2}
87+
}
88+
```
89+
90+
### Property type
91+
92+
Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, `surface`, and `gamma`. Before property tests, `relaxation` should be done first or the relaxation results should be present in the corresponding directory `confs/mp-*/relaxation/relax_task`. A file named `task.json` in json format containing the property parameter will be written in the directory of each task after `make` step. Multiple property tests can be performed simultaneously.
93+
94+
## Make run and post
95+
96+
There are three operations in auto test package, namely `make`, `run`, and `post`. Here we take `eos` property as an example for property type.
97+
98+
### Make
99+
The `INCAR`, `POSCAR`, `POTCAR` input files for VASP or `in.lammps`, `conf.lmp`, and the interatomic potential files for LAMMPS will be generated in the directory `confs/mp-*/relaxation/relax_task` for relaxation or `confs/mp-*/eos_00/task.[0-9]*[0-9]` for EOS. The `machine.json` file is not needed for `make`. Example:
100+
```bash
101+
dpgen autotest make relaxation.json
102+
```
103+
104+
### Run
105+
The jobs would be dispatched according to the parameter in `machine.json` file and the calculation results would be sent back. Example:
106+
```bash
107+
dpgen autotest run relaxation.json machine.json
108+
```
109+
110+
### Post
111+
The post process of calculation results would be performed. `result.json` in json format will be generated in `confs/mp-*/relaxation/relax_task` for relaxation and `result.json` in json format and `result.out` in txt format in `confs/mp-*/eos_00` for EOS. The `machine.json` file is also not needed for `post`. Example:
112+
```bash
113+
dpgen autotest post relaxation.json
114+
```

doc/autotest/index.rst

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
==========================
2+
Auto test
3+
==========================
4+
5+
.. _Guidelines::
6+
7+
.. toctree::
8+
:maxdepth: 2
9+
:caption: Guidelines
10+
11+
Auto-test
12+
13+
.. _Main-components::
14+
15+
.. toctree::
16+
:maxdepth: 2
17+
:caption: Main components
18+
19+
Task-type
20+
Property-type
21+
Make-run-and-post
22+
23+
.. _Structure-relaxation::
24+
25+
.. toctree::
26+
:maxdepth: 2
27+
:caption: Structure relaxation
28+
29+
relaxation/index.rst
30+
31+
.. _Property::
32+
33+
.. toctree::
34+
:maxdepth: 2
35+
:caption: Property
36+
37+
property/index.rst
38+
39+
.. _Refine::
40+
41+
.. toctree::
42+
:maxdepth: 2
43+
:caption: Refine
44+
45+
refine/index.rst
46+
47+
.. _Reproduce::
48+
49+
.. toctree::
50+
:maxdepth: 2
51+
:caption: Reproduce
52+
53+
reproduce/index.rst
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
## Property get started and input examples
2+
3+
Here we take deepmd for example and the input file for other task types is similar.
4+
5+
```json
6+
{
7+
"structures": ["confs/std-*"],
8+
"interaction": {
9+
"type": "deepmd",
10+
"model": "frozen_model.pb",
11+
"type_map": {"Al": 0}
12+
},
13+
"properties": [
14+
{
15+
"type": "eos",
16+
"vol_start": 0.9,
17+
"vol_end": 1.1,
18+
"vol_step": 0.01
19+
},
20+
{
21+
"type": "elastic",
22+
"norm_deform": 1e-2,
23+
"shear_deform": 1e-2
24+
},
25+
{
26+
"type": "vacancy",
27+
"supercell": [3, 3, 3],
28+
"start_confs_path": "../vasp/confs"
29+
},
30+
{
31+
"type": "interstitial",
32+
"supercell": [3, 3, 3],
33+
"insert_ele": ["Al"],
34+
"conf_filters":{"min_dist": 1.5},
35+
"cal_setting": {"input_prop": "lammps_input/lammps_high"}
36+
},
37+
{
38+
"type": "surface",
39+
"min_slab_size": 10,
40+
"min_vacuum_size":11,
41+
"max_miller": 2,
42+
"cal_type": "static"
43+
},
44+
{
45+
"type": "gamma",
46+
"lattice_type": "fcc",
47+
"miller_index": [1, 1, 1],
48+
"displace_direction": [1, 1, 0],
49+
"supercell_size": [1, 1, 10],
50+
"min_vacuum_size": 10,
51+
"add_fix": ["true", "true", "false"],
52+
"n_steps": 20
53+
}
54+
]
55+
}
56+
```
57+
Universal key words for properties
58+
59+
Key words | data structure | example | description
60+
---|---|---|---
61+
**type** | String | "eos" | property type
62+
skip | Boolean | true | whether to skip current property or not
63+
start_confs_path | String | "../vasp/confs" | start from the equilibrium configuration in other path only for the current property type
64+
cal_setting["input_prop"] | String | "lammps_input/lammps_high" |input commands file
65+
cal_setting["overwrite_interaction"] | Dict | | overwrite the interaction in the `interaction` part only for the current property type
66+
67+
other parameters in `cal_setting` and `cal_type` in `relaxation` also apply in `property`.
68+
69+
Key words for **EOS**
70+
71+
Key words | data structure | example | description
72+
---|---|---|---
73+
**vol_start** | Float | 0.9 | the starting volume related to the equilibrium structure
74+
**vol_end** | Float | 1.1 | the biggest volume related to the equilibrium structure
75+
**vol_step** | Float | 0.01 | the volume increment related to the equilibrium structure
76+
vol_abs | Boolean | false | whether to treat vol_start, vol_end and vol_step as absolute volume or not (as relative volume), default = false
77+
78+
Key words for **Elastic**
79+
80+
Key words | data structure | example | description
81+
---|---|---|---
82+
norm_deform | Float | 1e-2 | deformation in xx, yy, zz, default = 1e-2
83+
shear_deform | Float | 1e-2 | deformation in other directions, default = 1e-2
84+
85+
Key words for **Vacancy**
86+
87+
Key words | data structure | example | description
88+
---|---|---|---
89+
supercell | List of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1]
90+
91+
Key words for **Interstitial**
92+
93+
Key words | data structure | example | description
94+
---|---|---|---
95+
**insert_ele** | List of String | ["Al"] | the element to be inserted
96+
supercell | List of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1]
97+
conf_filters | Dict | "min_dist": 1.5 | filter out the undesirable configuration
98+
bcc_self | Boolean | false | whether to do the self-interstitial calculations for bcc structures, default = false
99+
100+
Key words for **Surface**
101+
102+
Key words | data structure | example | description
103+
---|---|---|---
104+
**min_slab_size** | Int | 10 | minimum size of slab thickness
105+
**min_vacuum_size** | Int | 11 | minimum size of vacuum width
106+
pert_xz | Float | 0.01 | perturbation through xz direction used to compute surface energy, default = 0.01
107+
max_miller | Int | 2 | the maximum miller index, default = 2
108+
109+
Key words for **Gamma**
110+
111+
Key words | data structure | example | description
112+
---|---|---|---
113+
**lattice_type** | String | "fcc" | "bcc" or "fcc" at this stage
114+
**miller_index** | List of Int | [1,1,1] | slip plane for gamma-line calculation
115+
**displace_direction** | List of Int | [1,1,0] | slip direction for gamma-line calculation
116+
supercell_size | List of Int | [1,1,10] | the supercell to be constructed, default = [1,1,5]
117+
min_vacuum_size | Int or Float | 10 | minimum size of vacuum width, default = 20
118+
add_fix | List of String | ['true','true','false'] | whether to fix atoms in the direction, default = ['true','true','false'] (standard method)
119+
n_steps | Int | 20 | Number of points for gamma-line calculation, default = 10

0 commit comments

Comments
 (0)