From a8d59fc23dfa97534e35be7580182f98ce802438 Mon Sep 17 00:00:00 2001 From: minj001 <16723041@bjtu.edu.cn> Date: Sat, 20 Aug 2022 21:58:44 +0800 Subject: [PATCH 1/7] new README.md --- README.md | 586 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 362 insertions(+), 224 deletions(-) diff --git a/README.md b/README.md index fbd6007bb..d9786a0ba 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,12 @@ * [Init_surf](#init_surf) * [Run: Main Process of Generator](#run-main-process-of-generator) * [Test: Auto-test for Deep Generator](#test-auto-test-for-deep-generator) + * [Task type](#task-type) + * [Property type](#property-type) + * [Relaxation calculations](#relaxation-calculations) + * [Property calculations](#property-calculations) + * [Refine the calculation of a property](#refine-the-calculation-of-a-property) + * [Reproduce the calculation of a property](#reproduce-the-calculation-of-a-property) * [Set up machine](#set-up-machine) * [Troubleshooting](#troubleshooting) * [License](#license) @@ -689,296 +695,428 @@ the following essential section should be provided in user template ``` ## Test: Auto-test for Deep Generator -### configure and param.json -At this step, we assume that you have prepared some graph files like `graph.*.pb` and the particular pseudopotential `POTCAR`. +Suppose that we have a potential (can be DFT, DP, MEAM ...), `autotest` helps us automatically calculate M porperties on N configurations. The folder where the `autotest` runs is called the `autotest`'s working directory. Different potentials should be tested in different working directories. -The main code of this step is -``` -dpgen autotest PARAM MACHINE -``` -where `PARAM` and `MACHINE` are both json files. `MACHINE` is the same as above. +A property is tested in three stages: `make`, `run` and `post`. `make` prepare all computational tasks that are needed to calculate the property. For example to calculate EOS, `autotest` prepare a series of tasks, each of which has a scaled configuration with certain volume, and all necessary input files necessary for starting a VASP or LAMMPS relaxation. `run` sends all the computational tasks to remote computational resources defined in a machine configuration file like `machine.json`, and automatically collect the results when remote calculations finish. `post` calculates the desired property from the collected results. -The whole program contains a series of tasks shown as follows. In each task, there are three stages of work, generate, run and compute. -+ `00.equi`:(default task) the equilibrium state +### Task type -+ `01.eos`: the equation of state +Above all, before introducing relaxation and property calculations, every calculation need to define task type in `interaction` part, which would be included by input file (`relaxation.json` or `properties.json`). There are now six task types implemented in the package: `vasp`, `abacus`, `deepmd`, `meam`, `eam_fs`, and `eam_alloy`. The input examples of the `interaction` part of each type can be found below: -+ `02.elastic`: the elasticity like Young's module +**VASP**: + +The default of `potcar_prefix` is "". +```json + "interaction": { + "type": "vasp", + "incar": "vasp_input/INCAR", + "potcar_prefix":"vasp_input", + "potcars": {"Al": "POTCAR.al", "Mg": "POTCAR.mg"} + } +``` +**ABACUS**: + +The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc is `potcar_prefix` + `potcars`/`orb_files`/`deepks_desc`. +```json + "interaction": { + "type": "abacus", + "incar": "abacus_input/INPUT", + "potcar_prefix":"abacus_input", + "potcars": {"Al": "pseudo_potential.al", "Mg": "pseudo_potential.mg"}, + "orb_files": {"Al": "numerical_orb.al", "Mg": "numerical_orb.mg"}, + "atom_masses": {"Al": 26.9815, "Mg":24.305}, + "deepks_desc": "jle.orb" + } +``` +**deepmd**: -+ `03.vacancy`: the vacancy formation energy +**Only 1** model can be used in autotest in one working directory and the default `"deepmd_version"` is **1.2.0**. -+ `04.interstitial`: the interstitial formation energy +```json + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "type_map": {"Al": 0, "Mg": 1}, + "deepmd_version":"1.2.0" + } +``` +**meam**: -+ `05.surf`: the surface formation energy +Please make sure the [USER-MEAMC package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-user-meamc) has already been installed in LAMMPS. +```json + "interaction": { + "type": "meam", + "model": ["meam.lib","AlMg.meam"], + "type_map": {"Al": 1, "Mg": 2} + } +``` +**eam_fs & eam_alloy**: -Dpgen auto_test will auto make dir for each task it tests, the dir name is the same as the dir name. And the test results will in a plain text file named result. For example `cat ./01.eos/Al/std-fcc/deepmd/result` +Please make sure the [MANYBODY package](https://lammps.sandia.gov/doc/Packages_details.html#pkg-manybody) has already been installed in LAMMPS +```json + "interaction": { + "type": "eam_fs (eam_alloy)", + "model": "AlMg.eam.fs (AlMg.eam.alloy)", + "type_map": {"Al": 1, "Mg": 2} + } +``` +### Property type -We take Al as an example to show the parameter settings of `param.json`. -The first part is the fundamental setting for particular alloy system. +Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, and `surface`. 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. Multiple property tests can be performed simultaneously and are written in the `"properties"` part of the input file. An example of `EOS` and `Elastic` tests can be given as follows (please refer to [Property](https://github.com/deepmodeling/dpgen/wiki/Property:-get-started-and-input-examples) for further information of the property parameters): ```json - "_comment": "models", - "potcar_map" : { - "Al" : "/somewhere/POTCAR" - }, - "conf_dir":"confs/Al/std-fcc", - "key_id":"API key of Material project", - "task_type":"deepmd", - "task":"eos", +"properties": [ + { + "type": "eos", + "vol_start": 0.8, + "vol_end": 1.2, + "vol_step": 0.01 + }, + { + "type": "elastic", + "norm_deform": 2e-2, + "shear_deform": 5e-2 + } + ] ``` -You need to add the specified paths of necessary `POTCAR` files in "potcar_map". The different `POTCAR` paths are separated by commas. -Then you also need to add the folder path of particular configuration, which contains `POSCAR` file. -``` -"confs/[element or alloy]/[std-* or mp-**]" -std-*: standard structures, * can be fcc, bcc, hcp and so on. -mp-**: ** means Material id from Material Project. -``` -Usually, if you add the relative path of POSCAR as the above format, -`dpgen autotest` will check the existence of such file and automatically downloads the standard and existed configurations of the given element or alloy from Materials Project and stores them in **confs** folder, which needs the API key of Materials project. +### Relaxation calculations + +The relaxation of a structure should be carried out before calculating all other properties. Then, we will introduce every step in details. + +#### Get started and input examples -+ `task_type` contains 3 optional types for testing, i.e. **vasp**, **deepmd** and **meam**. -+ `task` contains 7 options, **equi**, **eos**, **elastic**, **vacancy**, **interstitial**, **surf** and **all**. The option **all** can do all the tasks. +First, we need establish input file that: `relaxation.json`. For different task types, we need different `relaxation.json` file. All the relaxation calculations should be taken either by `VASP` or `LAMMPS`. So there are two input examples introducing `VASP` and `LAMMPS` respectively. -It is worth noting that the subsequent tasks need to rely on the calculation results of the equilibrium state, so it is necessary to give priority to the calculation of the equilibrium state while testing. And due to the stable consideration, we recommand you to test the equilibrium state of **vasp** before other tests. +An example of the input file for relaxation by VASP: -The second part is the computational settings for vasp and lammps. According to your actual needs, you can choose to add the paths of specific INCAR or use the simplified INCAR by setting `vasp_params`. The priority of specified INCAR is higher than using `vasp_params`. The most important setting is to add the folder path `model_dir` of **deepmd** model and supply the corresponding element type map. Besides, `dpgen autotest` also is able to call common lammps packages, such as **meam**. ```json -"relax_incar":"somewhere/relax_incar", -"scf_incar":"somewhere/scf_incar", -"vasp_params": { - "ecut": 650, - "ediff": 1e-6, - "kspacing": 0.1, - "kgamma": false, - "npar": 1, - "kpar": 1, - "_comment": " that's all " - }, - "lammps_params": { - "model_dir":"somewhere/example/Al_model", - "type_map":["Al"], - "model_name":false, - "model_param_type":false - }, +{ + "structures": ["confs/std-*"], + "interaction": { + "type": "vasp", + "incar": "vasp_input/INCAR", + "potcar_prefix": "vasp_input", + "potcars": {"Al": "POTCAR.al"} + }, + "relaxation": { + "cal_type": "relaxation", + "cal_setting": {"relax_pos": true, + "relax_shape": true, + "relax_vol": true, + "ediff": 1e-6, + "ediffg": -0.01, + "encut": 650, + "kspacing": 0.1, + "kgamma": false} + } +} ``` -The last part is the optional settings for various tasks mentioned above. You can change the parameters according to actual needs. +Key words | data structure | example | description +---|---|---|--- +**structures** | List of String | ["confs/std-*"] | path of different structures +**interaction** | Dict | See above | description of the task type and atomic interaction +**type** | String | "vasp" | task type +**incar** | String | "vasp_input/INCAR" | the path for INCAR file in vasp +potcar_prefix | String | "vasp_input" | the prefix of path for POTCAR file in vasp, default = "" +**potcars** | Dict | {"Al": "POTCAR.al"} | key is element type and value is potcar name +**relaxation** | Dict | See above | the calculation type and setting for relaxation +cal_type | String | "relaxation" or "static" | calculation type +cal_setting | Dict | See above | calculation setting +relax_pos | Boolean | true | relax atomic position or not, default = true for relaxation +relax_shape | Boolean | true | relax box shape or not, default = true for relaxation +relax_vol | Boolean | true | relax box volume or not, default = true for relaxation +ediff | Float | 1e-6 | set `EDIFF` parameter in INCAR files +ediffg | Float | -0.01 | set `EDIFFG` parameter in INCAR files +encut | Int | 650 | set `encut` parameter in INCAR files +kspacing | Float | 0.1 | set `KSPACING` parameter in INCAR files +kgamma | Boolean | false | set `KGAMMA` parameter in INCAR files + +An example of the input file for relaxation by LAMMPS: -param.json in a dictionary. +```json +{ + "structures": ["confs/std-*"], + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "in_lammps": "lammps_input/in.lammps", + "type_map": {"Al": 0} + }, + "relaxation": { + "cal_setting":{"etol": 1e-12, + "ftol": 1e-6, + "maxiter": 5000, + "maximal": 500000} + } +} +``` +**Other key words different from vasp:** -| Fields | Type | Example | Discription | -| :---------------- | :--------------------- | :------------- | :----------------| -| potcar_map | dict | {"Al": "example/POTCAR"} |a dict like { "element" : "position of POTCAR" } | -| conf_dir | path like string | "confs/Al/std-fcc" | the dir which contains vasp's POSCAR | -| key_id | string| "DZIwdXCXg1fiXXXXXX" |the API key of Material project| -| task_type | string | "vasp" | task type, one of deepmd vasp meam | -| task | string or list | "equi" | task, one or several tasks from { equi, eos, elastic, vacancy, interstitial, surf } or all stands for all tasks | -| vasp_params| dict | seeing below | params relating to vasp INCAR| -| lammps_params | dict| seeing below| params relating to lammps | +Key words | data structure | example | description +---|---|---|--- +**model** | String or List of String | "frozen_model.pb" | model file for atomic interaction +in_lammps | String | "lammps_input/in.lammps" | input file for lammps commands +**type_map** | Dict | {"Al": 0} | key is element type and value is type number. DP starts from 0, others starts from 1 +etol | Float | 1e-12 | stopping tolerance for energy +ftol | Float | 1e-6 | stopping tolerance for force +maxiter | Int | 5000 | max iterations of minimizer +maxeval | Int | 500000 | max number of force/energy evaluations -The keys in param["vasp_params"] is shown below. +#### Relaxation: make -| Fields | Type | Example | Discription | -| :---------------- | :--------------------- | :---------------- | :----------------| -| ecut | real number | 650 | the plane wave cutoff for grid. | -| ediff | real number | 1e-6 |Tolerance of Density Matrix | -| kspacing | real number | 0.1 | Sample factor in Brillouin zones | -| kgamma | boolen | false | whether generate a Gamma centered grid | -| npar | positive integer | 1 | the number of k-points that are to be treated in parallel | -| kpar | positive integer | 1 | the number of bands that are treated in parallel | +After the preparation of `relaxation.json` file, do `make` step as follows: -the keys in param["lammps_params"]. +**VASP relaxation:** -| Key | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| model_dir | path like string | "example/Al_model" | the model dir which contains .pb file | -| type_map | list of string | ["Al"] | a list contains the element, usually useful for multiple element situation | -| model_name | boolean | false | | -| model_param_type | boolean | false | | +```bash +dpgen autotest make relaxation.json +tree confs/std-fcc/relaxation/ +``` -### auto_test tasks -#### 00.equi -```json - "_comment":"00.equi", - "store_stable":true, +**LAMMPS relaxation:** +```bash +dpgen autotest make relaxation.json +tree confs/std-fcc/ ``` -+ `store_stable`:(boolean) whether to store the stable energy and volume -param.json. +#### Relaxation: run -| Field | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| EpA(eV) | real number | -3.7468 | the potential energy of a atom| -| VpA(A^3)| real number | 16.511| theEquilibrium volume of a atom | +After the `make` step, we should do `run` step. The `machine.json` file should be applied in this process and the machine parameters (eg. GPU or CPU) are determined according to the task type (VASP or LAMMPS). -test results +Take `LAMMPS` run for example (`VASP` run is similar): +```bash +nohup dpgen autotest run relaxation.json machine-ali.json > run.result 2>&1 & +tree confs/std-fcc/relaxation/ ``` -conf_dir: EpA(eV) VpA(A^3) -confs/Al/std-fcc -3.7468 16.511 + +#### Relaxation: post + +After `run` step, we should do `post` step. Take `LAMMPS` post for example: +```bash +dpgen autotest post relaxation.json +tree confs/std-fcc/relaxation/ ``` -| Field | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| EpA(eV) | real number | -3.7468 | the potential energy of a atom| -| VpA(A^3)| real number | 16.511| theEquilibrium volume of a atom | +### Property calculations + +Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, and `surface`. A file named `properties.json` in json format containing the property parameter will be written in the directory of each task. Properties can be computed in parallel. Then, we will introduce every step of property calculations in details. + +#### Get started and input examples + +Here we take deepmd for example and the input file for other task types is similar. -#### 01.eos ```json - "_comment": "01.eos", - "vol_start": 12, - "vol_end": 22, - "vol_step": 0.5, +{ + "structures": ["confs/std-*"], + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "deepmd_version":"1.2.0", + "type_map": {"Al": 0} + }, + "properties": [ + { + "type": "eos", + "vol_start": 0.9, + "vol_end": 1.1, + "vol_step": 0.01 + }, + { + "type": "elastic", + "norm_deform": 2e-2, + "shear_deform": 5e-2 + }, + { + "type": "vacancy", + "supercell": [3, 3, 3], + "start_confs_path": "../vasp/confs" + }, + { + "type": "interstitial", + "supercell": [3, 3, 3], + "insert_ele": ["Al"], + "conf_filters":{"min_dist": 1.5}, + "cal_setting": {"input_prop": "lammps_input/lammps_high"} + }, + { + "type": "surface", + "min_slab_size": 10, + "min_vacuum_size":11, + "max_miller": 2, + "cal_type": "static" + } + ] +} ``` -+ `vol_start`, `vol_end` and `vol_step` determine the volumetric range and accuracy of the **eos**. +Universal key words for properties -test results -``` -conf_dir:confs/Al/std-fcc -VpA(A^3) EpA(eV) -15.500 -3.7306 -16.000 -3.7429 -16.500 -3.7468 -17.000 -3.7430 -``` +Key words | data structure | example | description +---|---|---|--- +**type** | String | "eos" | specifying the property type +skip | Boolean | true | whether to skip current property or not +start_confs_path | String | "../vasp/confs" | starting from the equilibrium configuration in other path only for the current property type +cal_setting["input_prop"] | String | "lammps_input/lammps_high" |input commands file for lammps +cal_setting["overwrite_interaction"] | Dict | | overwrite the interaction in the `interaction` part only for the current property type +other parameters in `cal_setting` and `cal_type` in `relaxation` also apply in `property`. -| Field | Type| Example| Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| EpA(eV) | list of real number | [15.5,16.0,16.5,17.0] | the potential energy of a atom in quilibrium state| -| VpA(A^3)| list of real number |[-3.7306, -3.7429, -3.746762, -3.7430] | the equilibrium volume of a atom | +Key words for **EOS** -#### 02.elastic -```json - "_comment": "02.elastic", - "norm_deform": 2e-2, - "shear_deform": 5e-2, +Key words | data structure | example | description +---|---|---|--- +**vol_start** | Float | 0.9 | the starting volume related to the equilibrium structure +**vol_end** | Float | 1.1 | the biggest volume related to the equilibrium structure +**vol_step** | Float | 0.01 | the volume increment related to the equilibrium structure +**vol_abs** | Boolean | false | whether to treat vol_start and vol_end as absolute volume or not (as relative volume), default = false + +Key words for **Elastic** + +Key words | data structure | example | description +---|---|---|--- +norm_deform | Float | 2e-2 | specifying the deformation in xx, yy, zz, default = 2e-3 +shear_deform | Float | 5e-2 | specifying the deformation in other directions, default = 5e-3 + +Key words for **Vacancy** + +Key words | data structure | example | description +---|---|---|--- +supercell | Lisf of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] + +Key words for **Interstitial** + +Key words | data structure | example | description +---|---|---|--- +**insert_ele** | Lisf of String | ["Al"] | the element to be inserted +supercell | Lisf of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] +conf_filters | Dict | "min_dist": 1.5 | filter out the undesirable configuration + +Key words for **Surface** + +Key words | data structure | example | description +---|---|---|--- +**min_slab_size** | Int | 10 | minimum size of slab thickness +**min_vacuum_size** | Int | 11 | minimum size of vacuum width +pert_xz | Float | 0.01 | perturbation through xz direction used to compute surface energy, default = 0.01 +max_miller | Int | 2 | the maximum miller index + +#### Property: make + +```bash +dpgen autotest make property.json ``` -+ `norm_deform` and `shear_deform` are the scales of material deformation. -This task uses the stress-strain relationship to calculate the elastic constant. -|Key | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| norm_deform | real number | 0.02 | uniaxial deformation range | -| shear_deform | real number | 0.05| shear deformation range | +#### Property: run -test results +```bash +nohup dpgen autotest run property.json machine-ali.json > run.result 2>&1 & ``` -conf_dir:confs/Al/std-fcc -130.50 57.45 54.45 4.24 0.00 0.00 -57.61 130.31 54.45 -4.29 -0.00 -0.00 -54.48 54.48 133.32 -0.00 -0.00 -0.00 -4.49 -4.02 -0.89 33.78 0.00 -0.00 --0.00 -0.00 -0.00 -0.00 33.77 4.29 -0.00 -0.00 -0.00 -0.00 4.62 36.86 -# Bulk Modulus BV = 80.78 GPa -# Shear Modulus GV = 36.07 GPa -# Youngs Modulus EV = 94.19 GPa -# Poission Ratio uV = 0.31 +the result file `log.lammps`, `dump.relax`, and `outlog` would be sent back. + +#### Property: post + +```bash +dpgen autotest post property.json ``` -| Field | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| elastic module(GPa)| 6*6 matrix of real number| [[130.50 57.45 54.45 4.24 0.00 0.00] [57.61 130.31 54.45 -4.29 -0.00 -0.00] [54.48 54.48 133.32 -0.00 -0.00 -0.00] [4.49 -4.02 -0.89 33.78 0.00 -0.00] [-0.00 -0.00 -0.00 -0.00 33.77 4.29] [0.00 -0.00 -0.00 -0.00 4.62 36.86]]| Voigt-notation elastic module;sequence of row and column is (xx, yy, zz, yz, zx, xy)| -| bulk modulus(GPa) | real number | 80.78 | bulk modulus | -| shear modulus(GPa) | real number | 36.07 | shear modulus | -| Youngs Modulus(GPa) | real number | 94.19 | Youngs Modulus| -| Poission Ratio | real number | 0.31 | Poission Ratio | +### Refine the calculation of a property + +Some times we want to refine the calculation of a property from previous results. For example, when higher convergence criteria `EDIFF` and `EDIFFG` are necessary, and the new VASP calculation is desired to start from the previous output configration, rather than starting from scratch. +#### Get started and input examples +An example of the input file `refine.json` is given below: -#### 03.vacancy ```json - "_comment":"03.vacancy", - "supercell":[3,3,3], +{ + "structures": ["confs/std-*"], + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "deepmd_version":"1.2.0", + "type_map": {"Al": 0} + }, + "properties": [ + { + "type": "vacancy", + "init_from_suffix": "00", + "output_suffix": "01", + "cal_setting": {"input_prop": "lammps_input/lammps_high"} + } + ] +} ``` -+ `supercell`:(list of integer) the supercell size used to generate vacancy defect and interstitial defect +In this example, `refine` would output the results to `vacancy_01` based on the previous results in `vacancy_00` by using a different input commands file for lammps. -|Key | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| supercell | list of integer | [3,3,3] | the supercell size used to generate vacancy defect and interstitial defect | +#### Refine: make -test result -``` -conf_dir:confs/Al/std-fcc -Structure: Vac_E(eV) E(eV) equi_E(eV) -struct-3x3x3-000: 0.859 -96.557 -97.416 +```bash +dpgen autotest make refine.json +tree confs/std-fcc/vacancy_01/ ``` -| Field | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -|Structure| list of string |['struct-3x3x3-000'] | structure name| -| Vac_E(eV) | real number |0.723 | the vacancy formation energy | -| E(eV) | real number | -96.684 | potential energy of the vacancy configuration | -| equi_E(eV) | real number |-97.407 | potential energy of the equilibrium state| -#### 04.interstitial -```json - "_comment":"04.interstitial", - "insert_ele":["Al"], - "reprod-opt":false, +#### Refine: run + +```bash +nohup dpgen autotest run refine.json machine-ali.json > run.result 2>&1 & ``` -+ `insert_ele`:(list of string) the elements used to generate point interstitial defect -+ `repord-opt`:(boolean) whether to reproduce trajectories of interstitial defect -|Key | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| insert_ele | list of string | ["Al"] | the elements used to generate point interstitial defect | -| reprod-opt | boolean | false | whether to reproduce trajectories of interstitial defect| +#### Refine: post -test result -``` -conf_dir:confs/Al/std-fcc -Insert_ele-Struct: Inter_E(eV) E(eV) equi_E(eV) -struct-Al-3x3x3-000: 3.919 -100.991 -104.909 -struct-Al-3x3x3-001: 2.681 -102.229 -104.909 +```bash +dpgen autotest post refine.json ``` -| Field | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -|Structure| string |'struct-Al-3x3x3-000' | structure name| -| Inter_E(eV) | real number |0.723 | the interstitial formation energy | -| E(eV) | real number | -96.684 | potential energy of the interstitial configuration | -| equi_E(eV) | real number |-97.407 | potential energy of the equilibrium state| -#### 05.surface +### Reproduce the calculation of a property + +Some times we want to reproduce the initial results with the same configurations for cross validation. This version of auto-test package can accomplish this successfully in all property types except for `Elastic`. An input example for using `deepmd` to reproduce the `VASP` Interstitial results is given as below: ```json - "_comment": "05.surface", - "min_slab_size": 10, - "min_vacuum_size": 11, - "_comment": "pert xz to work around vasp bug...", - "pert_xz": 0.01, - "max_miller": 2, - "static-opt":false, - "relax_box":false, +{ + "structures": ["confs/std-*"], + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "deepmd_version":"1.2.0", + "type_map": {"Al": 0} + }, + "properties": [ + { + "type": "interstitial", + "reproduce": true, + "init_from_suffix": "00", + "init_data_path": "../vasp/confs", + "reprod_last_frame": false + } + ] +} ``` -+ `min_slab_size` and `min_vacuum_size` are the minimum size of slab thickness and the vacuume width. -+ `pert_xz` is the perturbation through xz direction used to compute surface energy. -+ `max_miller` (integer) is the maximum miller index -+ `static-opt`:(boolean) whether to use atomic relaxation to compute surface energy. if false, the structure will be relaxed. -+ `relax_box`:(boolean) set true if the box is relaxed, otherwise only relax atom positions. -|Key | Type | Example | Discription | -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -| min_slab_size| real number| 10 | the minimum size of slab thickness | -|min_vacuum_size | real number| 11 | the minimum size of the vacuume width | -|pert_xz | real number| 0.01 | the perturbation through xz direction used to compute surface energy | -|max_miller | integer| 2 | the maximum miller index | -|static-opt|boolean| false | whether to use atomic relaxation to compute surface energy. if false, the structure will be relaxed. | -|relax_box | boolean | false | set true if the box is relaxed, otherwise only relax atom positions | - -test result +`reproduce` denotes whether to do `reproduce` or not and the default value is False. + +`init_data_path` is the path of VASP or LAMMPS initial data to be reproduced. `init_from_suffix` is the suffix of the initial data and the default value is "00". In this case, the VASP Interstitial results are stored in `../vasp/confs/std-*/interstitial_00` and the reproduced Interstitial results would be in `deepmd/confs/std-*/interstitial_reprod`. + +`reprod_last_frame` denotes if only the last frame is used in reproduce. The default value is True for eos and surface, but is False for vacancy and interstitial. + +#### Reproduce: make + +```bash +dpgen autotest make reproduce.json +tree confs/std-fcc/interstitial_reprod/ +``` + +#### Reproduce: run + +```bash +nohup dpgen autotest run reproduce.json machine-ali.json > run.result 2>&1 & ``` -conf_dir:confs/Al/std-fcc -Miller_Indices: Surf_E(J/m^2) EpA(eV) equi_EpA(eV) -struct-000-m1.1.1m: 0.673 -3.628 -3.747 -struct-001-m2.2.1m: 0.917 -3.592 -3.747 + +#### Reproduce: post + +```bash +dpgen autotest post reproduce.json ``` -| Field | Type | Example| Discription| -| :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| -|Miller_Indices| string | struct-000-m1.1.1m | Miller Indices| -|Surf_E(J/m^2)| real number | 0.673 | the surface formation energy | -| EpA(eV) | real number | -3.628 | potential energy of the surface configuration | -| equi_EpA | real number | -3.747 | potential energy of the equilibrium state| ### The content of the auto_test To know what actually will dpgen autotest do, including the lammps and vasp script, the input file and atom configuration file auto_test will generate, please refer to https://hackmd.io/@yeql5ephQLaGJGgFgpvIDw/rJY1FO92B From 2ec080cee853bd8c8dcf9807bb3c930cc6255811 Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Sat, 20 Aug 2022 23:56:22 +0800 Subject: [PATCH 2/7] Optimize autotest part in README and change the default deformation parameters in Elastic --- README.md | 213 +++++++++++++------------------------ dpgen/auto_test/Elastic.py | 4 +- 2 files changed, 78 insertions(+), 139 deletions(-) diff --git a/README.md b/README.md index d9786a0ba..cca72bfe7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ * [Init_bulk](#init_bulk) * [Init_surf](#init_surf) * [Run: Main Process of Generator](#run-main-process-of-generator) - * [Test: Auto-test for Deep Generator](#test-auto-test-for-deep-generator) + * [Autotest: Autotest for Deep Generator](#autotest-for-deep-generator) * [Task type](#task-type) * [Property type](#property-type) * [Relaxation calculations](#relaxation-calculations) @@ -40,7 +40,7 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and ### Highlighted features + **Accurate and efficient**: DP-GEN is capable to sample more than tens of million structures and select only a few for first principles calculation. DP-GEN will finally obtain a uniformly accurate model. -+ **User-friendly and automatic**: Users may install and run DP-GEN easily. Once succusefully running, DP-GEN can dispatch and handle all jobs on HPCs, and thus there's no need for any personal effort. ++ **User-friendly and automatic**: Users may install and run DP-GEN easily. Once successfully running, DP-GEN can dispatch and handle all jobs on HPCs, and thus there's no need for any personal effort. + **Highly scalable**: With modularized code structures, users and developers can easily extend DP-GEN for their most relevant needs. DP-GEN currently supports for HPC systems (Slurm, PBS, LSF and cloud machines ), Deep Potential interface with DeePMD-kit, MD interface with [LAMMPS](https://www.lammps.org/), [Gromacs](http://www.gromacs.org/) and *ab-initio* calculation interface with VASP, PWSCF, CP2K, SIESTA and Gaussian, Abacus, PWMAT, etc . We're sincerely welcome and embraced to users' contributions, with more possibilities and cases to use DP-GEN. ### Code structure and interface @@ -50,8 +50,8 @@ Yuzhi Zhang, Haidi Wang, Weijie Chen, Jinzhe Zeng, Linfeng Zhang, Han Wang, and * generator: source codes for main process of deep generator. * auto_test : source code for undertaking materials property analysis. - * remote and dispatcher : source code for automatically submiting scripts,maintaining job queues and collecting results. - Notice this part hase been integrated into [dpdispatcher](https://github.com/deepmodeling/dpdispatcher) + * remote and dispatcher : source code for automatically submitting scripts,maintaining job queues and collecting results. + Notice this part has been integrated into [dpdispatcher](https://github.com/deepmodeling/dpdispatcher) * database : source code for collecting data generated by DP-GEN and interface with database. + examples : providing example JSON files. @@ -68,7 +68,7 @@ Options for TASK: * `init_bulk` : Generating initial data for bulk systems. * `init_surf` : Generating initial data for surface systems. * `run` : Main process of Deep Generator. -* `test`: Auto-test for Deep Potential. +* `autotest`: Autotest for Deep Potential. * `db`: Collecting data from DP-GEN. @@ -694,14 +694,38 @@ the following essential section should be provided in user template &END FORCE_EVAL ``` -## Test: Auto-test for Deep Generator -Suppose that we have a potential (can be DFT, DP, MEAM ...), `autotest` helps us automatically calculate M porperties on N configurations. The folder where the `autotest` runs is called the `autotest`'s working directory. Different potentials should be tested in different working directories. +## Autotest: Autotest for Deep Generator +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. -A property is tested in three stages: `make`, `run` and `post`. `make` prepare all computational tasks that are needed to calculate the property. For example to calculate EOS, `autotest` prepare a series of tasks, each of which has a scaled configuration with certain volume, and all necessary input files necessary for starting a VASP or LAMMPS relaxation. `run` sends all the computational tasks to remote computational resources defined in a machine configuration file like `machine.json`, and automatically collect the results when remote calculations finish. `post` calculates the desired property from the collected results. +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 collect the results when remote calculations finish. `post` calculates the desired property from the collected results. + +### Relaxation + +The relaxation of a structure should be carried out before calculating all other properties: +```bash +dpgen autotest make equi.json +dpgen autotest run relax.json machine.json +dpgen autotest post equi.json +``` +If, for some reasons, the main program terminated at stage `run`, one can easily restart with the same command. +`relax.json` is the parameter file. An example for `deepmd` relaxation is given as: +```json +{ + "structures": "confs/mp-*", + "interaction": { + "type": "deepmd", + "model": "frozen_model.pb", + "type_map": {"Al": 0, "Mg": 1} + }, + "relaxation": {} +} +``` + +where the key `structures` provides the structures to relax. `interaction` is provided with `deepmd`, and other options are `vasp`, `abacus`, `meam`... ### Task type -Above all, before introducing relaxation and property calculations, every calculation need to define task type in `interaction` part, which would be included by input file (`relaxation.json` or `properties.json`). There are now six task types implemented in the package: `vasp`, `abacus`, `deepmd`, `meam`, `eam_fs`, and `eam_alloy`. The input examples of the `interaction` part of each type can be found below: +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`. The input examples of the `interaction` part of each type can be found below: **VASP**: @@ -730,14 +754,13 @@ The default of `potcar_prefix` is "". The path of potcars/orb_files/deepks_desc ``` **deepmd**: -**Only 1** model can be used in autotest in one working directory and the default `"deepmd_version"` is **1.2.0**. +**Only 1** model can be used in autotest in one working directory. ```json "interaction": { "type": "deepmd", "model": "frozen_model.pb", - "type_map": {"Al": 0, "Mg": 1}, - "deepmd_version":"1.2.0" + "type_map": {"Al": 0, "Mg": 1} } ``` **meam**: @@ -763,30 +786,15 @@ Please make sure the [MANYBODY package](https://lammps.sandia.gov/doc/Packages_d ### Property type -Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, and `surface`. 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. Multiple property tests can be performed simultaneously and are written in the `"properties"` part of the input file. An example of `EOS` and `Elastic` tests can be given as follows (please refer to [Property](https://github.com/deepmodeling/dpgen/wiki/Property:-get-started-and-input-examples) for further information of the property parameters): -```json -"properties": [ - { - "type": "eos", - "vol_start": 0.8, - "vol_end": 1.2, - "vol_step": 0.01 - }, - { - "type": "elastic", - "norm_deform": 2e-2, - "shear_deform": 5e-2 - } - ] -``` +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. -### Relaxation calculations +### Here we start to introduce the relaxation, property, refine, and reproduce calculations in `autotest` in details. -The relaxation of a structure should be carried out before calculating all other properties. Then, we will introduce every step in details. +### Relaxation calculations -#### Get started and input examples +The relaxation of a structure should be carried out before calculating all other properties. -First, we need establish input file that: `relaxation.json`. For different task types, we need different `relaxation.json` file. All the relaxation calculations should be taken either by `VASP` or `LAMMPS`. So there are two input examples introducing `VASP` and `LAMMPS` respectively. +First, we need input parameter file and we name it `relaxation.json` here. All the relaxation calculations should be taken either by `VASP`, `ABACUS`, or `LAMMPS`. Here are two input examples for `VASP` and `LAMMPS` respectively. An example of the input file for relaxation by VASP: @@ -864,47 +872,8 @@ ftol | Float | 1e-6 | stopping tolerance for force maxiter | Int | 5000 | max iterations of minimizer maxeval | Int | 500000 | max number of force/energy evaluations -#### Relaxation: make - -After the preparation of `relaxation.json` file, do `make` step as follows: - -**VASP relaxation:** - -```bash -dpgen autotest make relaxation.json -tree confs/std-fcc/relaxation/ -``` - -**LAMMPS relaxation:** -```bash -dpgen autotest make relaxation.json -tree confs/std-fcc/ -``` - -#### Relaxation: run - -After the `make` step, we should do `run` step. The `machine.json` file should be applied in this process and the machine parameters (eg. GPU or CPU) are determined according to the task type (VASP or LAMMPS). - -Take `LAMMPS` run for example (`VASP` run is similar): -```bash -nohup dpgen autotest run relaxation.json machine-ali.json > run.result 2>&1 & -tree confs/std-fcc/relaxation/ -``` - -#### Relaxation: post - -After `run` step, we should do `post` step. Take `LAMMPS` post for example: -```bash -dpgen autotest post relaxation.json -tree confs/std-fcc/relaxation/ -``` - ### Property calculations -Now the supported property types are `eos`, `elastic`, `vacancy`, `interstitial`, and `surface`. A file named `properties.json` in json format containing the property parameter will be written in the directory of each task. Properties can be computed in parallel. Then, we will introduce every step of property calculations in details. - -#### Get started and input examples - Here we take deepmd for example and the input file for other task types is similar. ```json @@ -925,8 +894,8 @@ Here we take deepmd for example and the input file for other task types is simil }, { "type": "elastic", - "norm_deform": 2e-2, - "shear_deform": 5e-2 + "norm_deform": 1e-2, + "shear_deform": 1e-2 }, { "type": "vacancy", @@ -946,6 +915,16 @@ Here we take deepmd for example and the input file for other task types is simil "min_vacuum_size":11, "max_miller": 2, "cal_type": "static" + }, + { + "type": "gamma", + "lattice_type": "fcc", + "miller_index": [1, 1, 1], + "displace_direction": [1, 1, 0], + "supercell_size": [1, 1, 10], + "min_vacuum_size": 10, + "add_fix": ["true", "true", "false"], + "n_steps": 20 } ] } @@ -969,28 +948,29 @@ Key words | data structure | example | description **vol_start** | Float | 0.9 | the starting volume related to the equilibrium structure **vol_end** | Float | 1.1 | the biggest volume related to the equilibrium structure **vol_step** | Float | 0.01 | the volume increment related to the equilibrium structure -**vol_abs** | Boolean | false | whether to treat vol_start and vol_end as absolute volume or not (as relative volume), default = false +**vol_abs** | Boolean | false | whether to treat vol_start, vol_end and vol_step as absolute volume or not (as relative volume), default = false Key words for **Elastic** Key words | data structure | example | description ---|---|---|--- -norm_deform | Float | 2e-2 | specifying the deformation in xx, yy, zz, default = 2e-3 -shear_deform | Float | 5e-2 | specifying the deformation in other directions, default = 5e-3 +norm_deform | Float | 1e-2 | specifying the deformation in xx, yy, zz, default = 1e-2 +shear_deform | Float | 1e-2 | specifying the deformation in other directions, default = 1e-2 Key words for **Vacancy** Key words | data structure | example | description ---|---|---|--- -supercell | Lisf of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] +supercell | List of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] Key words for **Interstitial** Key words | data structure | example | description ---|---|---|--- -**insert_ele** | Lisf of String | ["Al"] | the element to be inserted -supercell | Lisf of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] +**insert_ele** | List of String | ["Al"] | the element to be inserted +supercell | List of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] conf_filters | Dict | "min_dist": 1.5 | filter out the undesirable configuration +"bcc_self" | Boolean | false | whether to do the self-interstitial calculations for bcc structures, default = false Key words for **Surface** @@ -1001,30 +981,24 @@ Key words | data structure | example | description pert_xz | Float | 0.01 | perturbation through xz direction used to compute surface energy, default = 0.01 max_miller | Int | 2 | the maximum miller index -#### Property: make - -```bash -dpgen autotest make property.json -``` - -#### Property: run +Key words for **Gamma** -```bash -nohup dpgen autotest run property.json machine-ali.json > run.result 2>&1 & -``` -the result file `log.lammps`, `dump.relax`, and `outlog` would be sent back. - -#### Property: post +Key words | data structure | example | description +---|---|---|--- +**lattice_type** | String | "fcc" | "bcc" or "fcc" at this stage +**miller_index** | List of Int | [1,1,1] | slip plane for gamma-line calculation +**displace_direction** | List of Int | [1,1,0] | slip direction for gamma-line calculation +**supercell_size** | List of Int | [1,1,10] | the supercell to be constructed, default = [1,1,5] +**min_vacuum_size** | Int or Float | 10 | minimum size of vacuum width, default = 20 +**add_fix** | List of String | ['true','true','false'] | whether to do relaxation in the direction, default = ['true','true','false'] (standard method) +**n_steps** | Int | 20 | Number of points for gamma-line calculation, default = 10 -```bash -dpgen autotest post property.json -``` +Three steps for property calculations are also `make`, `run`, and `post`. ### Refine the calculation of a property -Some times we want to refine the calculation of a property from previous results. For example, when higher convergence criteria `EDIFF` and `EDIFFG` are necessary, and the new VASP calculation is desired to start from the previous output configration, rather than starting from scratch. +Sometimes we want to refine the calculation of a property from previous results. For example, when higher convergence criteria `EDIFF` and `EDIFFG` are necessary in VASP, the new VASP calculation is desired to start from the previous output configuration, rather than starting from scratch. -#### Get started and input examples An example of the input file `refine.json` is given below: @@ -1049,28 +1023,11 @@ An example of the input file `refine.json` is given below: ``` In this example, `refine` would output the results to `vacancy_01` based on the previous results in `vacancy_00` by using a different input commands file for lammps. -#### Refine: make - -```bash -dpgen autotest make refine.json -tree confs/std-fcc/vacancy_01/ -``` - -#### Refine: run - -```bash -nohup dpgen autotest run refine.json machine-ali.json > run.result 2>&1 & -``` - -#### Refine: post - -```bash -dpgen autotest post refine.json -``` +Three steps for refine calculations are also `make`, `run`, and `post`. ### Reproduce the calculation of a property -Some times we want to reproduce the initial results with the same configurations for cross validation. This version of auto-test package can accomplish this successfully in all property types except for `Elastic`. An input example for using `deepmd` to reproduce the `VASP` Interstitial results is given as below: +Sometimes we want to reproduce the initial results with the same configurations for cross validation. This version of autotest package can accomplish this successfully in all property types except for `Elastic`. An input example for using `deepmd` to reproduce the `VASP` Interstitial results is given as below: ```json { @@ -1078,7 +1035,6 @@ Some times we want to reproduce the initial results with the same configurations "interaction": { "type": "deepmd", "model": "frozen_model.pb", - "deepmd_version":"1.2.0", "type_map": {"Al": 0} }, "properties": [ @@ -1099,27 +1055,10 @@ Some times we want to reproduce the initial results with the same configurations `reprod_last_frame` denotes if only the last frame is used in reproduce. The default value is True for eos and surface, but is False for vacancy and interstitial. -#### Reproduce: make - -```bash -dpgen autotest make reproduce.json -tree confs/std-fcc/interstitial_reprod/ -``` - -#### Reproduce: run - -```bash -nohup dpgen autotest run reproduce.json machine-ali.json > run.result 2>&1 & -``` - -#### Reproduce: post - -```bash -dpgen autotest post reproduce.json -``` +Three steps for reproduce calculations are also `make`, `run`, and `post`. -### The content of the auto_test -To know what actually will dpgen autotest do, including the lammps and vasp script, the input file and atom configuration file auto_test will generate, please refer to https://hackmd.io/@yeql5ephQLaGJGgFgpvIDw/rJY1FO92B +### More Information of Autotest +For more information of atutotest, please refer to [dpgen wiki](https://github.com/deepmodeling/dpgen/wiki). ## Simplify When you have a dataset containing lots of repeated data, this step will help you simplify your dataset. The workflow contains three stages: train, model_devi, and fp. The train stage and the fp stage are as the same as the run step, and the model_devi stage will calculate model deviations of the rest data that has not been confirmed accurate. Data with small model deviations will be confirmed accurate, while the program will pick data from those with large model deviations to the new dataset. diff --git a/dpgen/auto_test/Elastic.py b/dpgen/auto_test/Elastic.py index 1eeb7a8ba..f96b1f812 100644 --- a/dpgen/auto_test/Elastic.py +++ b/dpgen/auto_test/Elastic.py @@ -23,8 +23,8 @@ class Elastic(Property): def __init__(self, parameter,inter_param=None): if not ('init_from_suffix' in parameter and 'output_suffix' in parameter): - default_norm_def = 2e-3 - default_shear_def = 5e-3 + default_norm_def = 1e-2 + default_shear_def = 1e-2 parameter['norm_deform'] = parameter.get('norm_deform', default_norm_def) self.norm_deform = parameter['norm_deform'] parameter['shear_deform'] = parameter.get('shear_deform', default_shear_def) From 0d5463cd5bce5588ff9c4c2f226ffd83ee372f26 Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Sun, 21 Aug 2022 17:32:18 +0800 Subject: [PATCH 3/7] fix typos and optimize autotest part in README --- README.md | 70 +++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index cca72bfe7..bc4559d6b 100644 --- a/README.md +++ b/README.md @@ -112,15 +112,15 @@ dpgen init_bulk PARAM [MACHINE] The MACHINE configure file is optional. If this parameter exists, then the optimization tasks or MD tasks will be submitted automatically according to MACHINE.json. -Basically `init_bulk` can be devided into four parts , denoted as `stages` in `PARAM`: +Basically `init_bulk` can be divided into four parts , denoted as `stages` in `PARAM`: 1. Relax in folder `00.place_ele` 2. Perturb and scale in folder `01.scale_pert` -3. Run a shor AIMD in folder `02.md` +3. Run a short AIMD in folder `02.md` 4. Collect data in folder `02.md`. All stages must be **in order**. One doesn't need to run all stages. For example, you may run stage 1 and 2, generating supercells as starting point of exploration in `dpgen run`. -If MACHINE is None, there should be only one stage in stages. Corresponding tasks will be generated, but user's intervention should be involved in, to manunally run the scripts. +If MACHINE is None, there should be only one stage in stages. Corresponding tasks will be generated, but user's intervention should be involved in, to manually run the scripts. Following is an example for `PARAM`, which generates data from a typical structure hcp. ```json @@ -153,13 +153,13 @@ If you want to specify a structure as starting point for `init_bulk`, you may se ``` `init_bulk` support both VASP and ABACUS for first-principle calculation. You can choose the software by specifying the key `init_fp_style`. If `init_fp_style` is not specified, the default software will be VASP. -When using ABACUS for `init_fp_style`, the keys of the paths of `INPUT` files for relaxation and MD simulations are the same as `INCAR` for VASP, which are `relax_incar` and `md_incar` respectively. Use `relax_kpt` and `md_kpt` for the relative path for `KPT` files of relaxation and MD simulations. They two can be ommited if `kspacing` (in unit of 1/Bohr) or `gamma_only` has been set in corresponding INPUT files. If `from_poscar` is set to `false`, you have to specify `atom_masses` in the same order as `elements`. +When using ABACUS for `init_fp_style`, the keys of the paths of `INPUT` files for relaxation and MD simulations are the same as `INCAR` for VASP, which are `relax_incar` and `md_incar` respectively. Use `relax_kpt` and `md_kpt` for the relative path for `KPT` files of relaxation and MD simulations. They two can be omitted if `kspacing` (in unit of 1/Bohr) or `gamma_only` has been set in corresponding INPUT files. If `from_poscar` is set to `false`, you have to specify `atom_masses` in the same order as `elements`. The following table gives explicit descriptions on keys in `PARAM`. The bold notation of key (such as **Elements**) means that it's a necessary key. - Key | Type | Example | Discription | + Key | Type | Example | Description | | :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| | **stages** | List of Integer | [1,2,3,4] | Stages for `init_bulk` | **Elements** | List of String | ["Mg"] | Atom types @@ -177,7 +177,7 @@ The bold notation of key (such as **Elements**) means that it's a necessary key. | **md_nstep** | Integer | 10 | Steps of AIMD in stage 3. If it's not equal to settings via `NSW` in `md_incar`, DP-GEN will follow `NSW`. | **coll_ndata** | Integer | 5000 | Maximal number of collected data. | type_map | List | [ "Mg", "Al"] | The indices of elements in deepmd formats will be set in this order. -| init_fp_style | String | "ABACUS" or "VASP" | First-principle software. If this key is abscent, the default value will be "VASP". +| init_fp_style | String | "ABACUS" or "VASP" | First-principle software. If this key is absent, the default value will be "VASP". | relax_kpt | String | "....../KPT" | Path of `KPT` file for relaxation in stage 1. Only useful if `init_fp_style` is "ABACUS". | md_kpt | String | "....../KPT" | Path of `KPT` file for MD simulations in stage 3. Only useful if `init_fp_style` is "ABACUS". | atom_masses | List of float | [24] | List of atomic masses of elements. The order should be the same as `Elements`. Only useful if `init_fp_style` is "ABACUS". @@ -192,7 +192,7 @@ dpgen init_surf PARAM [MACHINE] The MACHINE configure file is optional. If this parameter exists, then the optimization tasks or MD tasks will be submitted automatically according to MACHINE.json. -Basically `init_surf` can be devided into two parts , denoted as `stages` in `PARAM`: +Basically `init_surf` can be divided into two parts , denoted as `stages` in `PARAM`: 1. Build specific surface in folder `00.place_ele` 2. Perturb and scale in folder `01.scale_pert` @@ -304,17 +304,17 @@ The following table gives explicit descriptions on keys in `PARAM`. The bold notation of key (such as **Elements**) means that it's a necessary key. - Key | Type | Example | Discription | + Key | Type | Example | Description | | :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| | **stages** | List of Integer | [1,2,3,4] | Stages for `init_surf` | **Elements** | List of String | ["Mg"] | Atom types | **cell_type** | String | "hcp" | Specifying which typical structure to be generated. **Options** include fcc, hcp, bcc, sc, diamond. | **latt** | Float | 4.479 | Lattice constant for single cell. -| **layer_numb** | Integer | 3 | Number of equavilent layers of slab. -| **z__min** | Float | 9.0 | Thickness of slab without vacuum (Angstrom). If the `layer_numb` and `z_min` are all setted, the `z_min` value will be ignored. +| **layer_numb** | Integer | 3 | Number of equivalent layers of slab. +| **z__min** | Float | 9.0 | Thickness of slab without vacuum (Angstrom). If the `layer_numb` and `z_min` are all set, the `z_min` value will be ignored. | **vacuum_max** | Float | 9 | Maximal thickness of vacuum (Angstrom). | vacuum_min | Float | 3.0 | Minimal thickness of vacuum (Angstrom). Default value is 2 times atomic radius. -| **vacuum_resol** | List of float | [0.5, 1 ] | Interval of thichness of vacuum. If size of `vacuum_resol` is 1, the interval is fixed to its value. If size of `vacuum_resol` is 2, the interval is `vacuum_resol[0]` before `mid_point`, otherwise `vacuum_resol[1]` after `mid_point`. +| **vacuum_resol** | List of float | [0.5, 1 ] | Interval of thickness of vacuum. If size of `vacuum_resol` is 1, the interval is fixed to its value. If size of `vacuum_resol` is 2, the interval is `vacuum_resol[0]` before `mid_point`, otherwise `vacuum_resol[1]` after `mid_point`. | **millers** | List of list of Integer | [[1,0,0]] | Miller indices. | relax_incar | String | "....../INCAR" | Path of INCAR for relaxation in VASP. **Necessary** if `stages` include 1. | **scale** | List of float | [0.980, 1.000, 1.020] | Scales for transforming cells. @@ -332,7 +332,7 @@ You may call the main process by: `dpgen run PARAM MACHINE`. -The whole process of generator will contain a series of iterations, succussively undertaken in order such as heating the system to certain temperature. +The whole process of generator will contain a series of iterations, successively undertaken in order such as heating the system to certain temperature. In each iteration, there are three stages of work, namely, `00.train 01.model_devi 02.fp`. @@ -491,26 +491,26 @@ In `PARAM`, you can specialize the task as you expect. The following table gives explicit descriptions on keys in `PARAM`. -The bold notation of key (such aas **type_map**) means that it's a necessary key. +The bold notation of key (such as **type_map**) means that it's a necessary key. - Key | Type | Example | Discription | + Key | Type | Example | Description | | :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| | *#Basics* | **type_map** | List of string | ["H", "C"] | Atom types | **mass_map** | List of float | [1, 12] | Standard atom weights. -| **use_ele_temp** | int | 0 | Currently only support fp_style vasp. 0(default): no electron temperature. 1: eletron temperature as frame parameter. 2: electron temperature as atom parameter. +| **use_ele_temp** | int | 0 | Currently only support fp_style vasp. 0(default): no electron temperature. 1: electron temperature as frame parameter. 2: electron temperature as atom parameter. | *#Data* | init_data_prefix | String | "/sharedext4/.../data/" | Prefix of initial data directories | ***init_data_sys*** | List of string|["CH4.POSCAR.01x01x01/.../deepmd"] |Directories of initial data. You may use either absolute or relative path here. Systems will be detected recursively in the directories. | ***sys_format*** | String | "vasp/poscar" | Format of initial data. It will be `vasp/poscar` if not set. - | init_batch_size | String of integer | [8] | Each number is the batch_size of corresponding system for training in `init_data_sys`. One recommended rule for setting the `sys_batch_size` and `init_batch_size` is that `batch_size` mutiply number of atoms ot the stucture should be larger than 32. If set to `auto`, batch size will be 32 divided by number of atoms. | + | init_batch_size | String of integer | [8] | Each number is the batch_size of corresponding system for training in `init_data_sys`. One recommended rule for setting the `sys_batch_size` and `init_batch_size` is that `batch_size` multiply number of atoms in the structure should be larger than 32. If set to `auto`, batch size will be 32 divided by number of atoms. | | sys_configs_prefix | String | "/sharedext4/.../data/" | Prefix of `sys_configs` - | **sys_configs** | List of list of string | [
["/sharedext4/.../POSCAR"],
["....../POSCAR"]
] | Containing directories of structures to be explored in iterations.Wildcard characters are supported here. | + | **sys_configs** | List of list of string | [
["/sharedext4/.../POSCAR"],
["....../POSCAR"]
] | Containing directories of structures to be explored in iterations. Wildcard characters are supported here. | | sys_batch_size | List of integer | [8, 8] | Each number is the batch_size for training of corresponding system in `sys_configs`. If set to `auto`, batch size will be 32 divided by number of atoms. | | *#Training* | **numb_models** | Integer | 4 (recommend) | Number of models to be trained in `00.train`. | | training_iter0_model_path | list of string | ["/path/to/model0_ckpt/", ...] | The model used to init the first iter training. Number of element should be equal to `numb_models` | -| training_init_model | bool | False | Iteration > 0, the model parameters will be initilized from the model trained at the previous iteration. Iteration == 0, the model parameters will be initialized from `training_iter0_model_path`. | +| training_init_model | bool | False | Iteration > 0, the model parameters will be initialized from the model trained at the previous iteration. Iteration == 0, the model parameters will be initialized from `training_iter0_model_path`. | | **default_training_param** | Dict | | Training parameters for `deepmd-kit` in `00.train`.
You can find instructions from here: (https://github.com/deepmodeling/deepmd-kit)..
| | dp_compress | bool | false | Use `dp compress` to compress the model. Default is false. | | *#Exploration* @@ -528,12 +528,12 @@ The bold notation of key (such aas **type_map**) means that it's a necessary key | model_devi_f_avg_relative | Boolean | False | Normalized the force model deviations by the RMS force magnitude along the trajectory. This key should not be used with `use_relative`. | | **model_devi_clean_traj** | Boolean or Int | true | If type of model_devi_clean_traj is boolean type then it denote whether to clean traj folders in MD since they are too large. If it is Int type, then the most recent n iterations of traj folders will be retained, others will be removed. | | **model_devi_nopbc** | Boolean | False | Assume open boundary condition in MD simulations. | -| model_devi_activation_func | List of list of string | [["tanh","tanh"],["tanh","gelu"],["gelu","tanh"],["gelu","gelu"]] | Set activation functions for models, length of the List should be the same as `numb_models`, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. *Backward compatibility*: the orginal "List of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the List should be the same as `numb_models`| +| model_devi_activation_func | List of list of string | [["tanh","tanh"],["tanh","gelu"],["gelu","tanh"],["gelu","gelu"]] | Set activation functions for models, length of the List should be the same as `numb_models`, and two elements in the list of string respectively assign activation functions to the embedding and fitting nets within each model. *Backward compatibility*: the original "List of String" format is still supported, where embedding and fitting nets of one model use the same activation function, and the length of the List should be the same as `numb_models`| | **model_devi_jobs** | [
{
"sys_idx": [0],
"temps":
[100],
"press":
[1],
"trj_freq":
10,
"nsteps":
1000,
"ensemble":
"nvt"
},
...
] | List of dict | Settings for exploration in `01.model_devi`. Each dict in the list corresponds to one iteration. The index of `model_devi_jobs` exactly accord with index of iterations | | **model_devi_jobs["sys_idx"]** | List of integer | [0] | Systems to be selected as the initial structure of MD and be explored. The index corresponds exactly to the `sys_configs`. | | **model_devi_jobs["temps"]** | List of integer | [50, 300] | Temperature (**K**) in MD | **model_devi_jobs["press"]** | List of integer | [1,10] | Pressure (**Bar**) in MD -| **model_devi_jobs["trj_freq"]** | Integer | 10 | Frequecy of trajectory saved in MD. | +| **model_devi_jobs["trj_freq"]** | Integer | 10 | Frequency of trajectory saved in MD. | | **model_devi_jobs["nsteps"]** | Integer | 3000 | Running steps of MD. | | **model_devi_jobs["ensemble"]** | String | "nvt" | Determining which ensemble used in MD, **options** include “npt” and “nvt”. | | model_devi_jobs["neidelay"] | Integer | "10" | delay building until this many steps since last build | @@ -586,7 +586,7 @@ There are some new keys needed to be added into `param` and `machine` if CALYPSO The bold notation of key (such as **calypso_path**) means that it's a necessary key. - Key | Type | Example | Discription | + Key | Type | Example | Description | | :---------------- | :--------------------- | :-------------------------------------- | :-------------------------------------------------------------| | *in param file* | **model_devi_engine** | string | "calypso" | CALYPSO as model-deviation engine.| @@ -616,7 +616,7 @@ The bold notation of key (such as **calypso_path**) means that it's a necessary - replace `keyword` in cp2k as `keyword` in dict. - replace `keyword parameter` in cp2k as `value` in dict. - replace `section name` in cp2k as `keyword` in dict. . The corresponding value is a `dict`. -- repalce `section parameter` in cp2k as `value` with dict. keyword `"_"` +- replace `section parameter` in cp2k as `value` with dict. keyword `"_"` - `repeat section` in cp2k just need to be written once with repeat parameter as list. If you want to use your own paramter, just write a corresponding dictionary. The `COORD` section will be filled by dpgen automatically, therefore do not include this in dictionary. The `OT` or `Diagonalization` section is require for semiconductor or metal system. For specific example, have a look on `example` directory. @@ -882,7 +882,6 @@ Here we take deepmd for example and the input file for other task types is simil "interaction": { "type": "deepmd", "model": "frozen_model.pb", - "deepmd_version":"1.2.0", "type_map": {"Al": 0} }, "properties": [ @@ -948,7 +947,7 @@ Key words | data structure | example | description **vol_start** | Float | 0.9 | the starting volume related to the equilibrium structure **vol_end** | Float | 1.1 | the biggest volume related to the equilibrium structure **vol_step** | Float | 0.01 | the volume increment related to the equilibrium structure -**vol_abs** | Boolean | false | whether to treat vol_start, vol_end and vol_step as absolute volume or not (as relative volume), default = false +vol_abs | Boolean | false | whether to treat vol_start, vol_end and vol_step as absolute volume or not (as relative volume), default = false Key words for **Elastic** @@ -970,7 +969,7 @@ Key words | data structure | example | description **insert_ele** | List of String | ["Al"] | the element to be inserted supercell | List of Int | [3,3,3] | the supercell to be constructed, default = [1,1,1] conf_filters | Dict | "min_dist": 1.5 | filter out the undesirable configuration -"bcc_self" | Boolean | false | whether to do the self-interstitial calculations for bcc structures, default = false +bcc_self | Boolean | false | whether to do the self-interstitial calculations for bcc structures, default = false Key words for **Surface** @@ -979,7 +978,7 @@ Key words | data structure | example | description **min_slab_size** | Int | 10 | minimum size of slab thickness **min_vacuum_size** | Int | 11 | minimum size of vacuum width pert_xz | Float | 0.01 | perturbation through xz direction used to compute surface energy, default = 0.01 -max_miller | Int | 2 | the maximum miller index +max_miller | Int | 2 | the maximum miller index, default = 2 Key words for **Gamma** @@ -988,10 +987,10 @@ Key words | data structure | example | description **lattice_type** | String | "fcc" | "bcc" or "fcc" at this stage **miller_index** | List of Int | [1,1,1] | slip plane for gamma-line calculation **displace_direction** | List of Int | [1,1,0] | slip direction for gamma-line calculation -**supercell_size** | List of Int | [1,1,10] | the supercell to be constructed, default = [1,1,5] -**min_vacuum_size** | Int or Float | 10 | minimum size of vacuum width, default = 20 -**add_fix** | List of String | ['true','true','false'] | whether to do relaxation in the direction, default = ['true','true','false'] (standard method) -**n_steps** | Int | 20 | Number of points for gamma-line calculation, default = 10 +supercell_size | List of Int | [1,1,10] | the supercell to be constructed, default = [1,1,5] +min_vacuum_size | Int or Float | 10 | minimum size of vacuum width, default = 20 +add_fix | List of String | ['true','true','false'] | whether to do relaxation in the direction, default = ['true','true','false'] (standard method) +n_steps | Int | 20 | Number of points for gamma-line calculation, default = 10 Three steps for property calculations are also `make`, `run`, and `post`. @@ -1008,7 +1007,6 @@ An example of the input file `refine.json` is given below: "interaction": { "type": "deepmd", "model": "frozen_model.pb", - "deepmd_version":"1.2.0", "type_map": {"Al": 0} }, "properties": [ @@ -1058,7 +1056,7 @@ Sometimes we want to reproduce the initial results with the same configurations Three steps for reproduce calculations are also `make`, `run`, and `post`. ### More Information of Autotest -For more information of atutotest, please refer to [dpgen wiki](https://github.com/deepmodeling/dpgen/wiki). +For more information of autotest, please refer to [dpgen wiki](https://github.com/deepmodeling/dpgen/wiki). ## Simplify When you have a dataset containing lots of repeated data, this step will help you simplify your dataset. The workflow contains three stages: train, model_devi, and fp. The train stage and the fp stage are as the same as the run step, and the model_devi stage will calculate model deviations of the rest data that has not been confirmed accurate. Data with small model deviations will be confirmed accurate, while the program will pick data from those with large model deviations to the new dataset. @@ -1192,9 +1190,9 @@ dpdispatcher has updated and the api of `machine.json` is changed. dpgen will use new dpdispatcher if the key `api_version` in dpgen's `machine.json`'s value is equal or large than `1.0`. And dpgen will use old dpdispatcher if the key `api_version` is not specified in `machine.json` or the `api_version` is smaller than `1.0`. -This gurantees that the old `machine.json`s still work. +This guarantees that the old `machine.json`s still work. -And for now dpdispatcher is maintained on a seperate repo. +And for now dpdispatcher is maintained on a separate repo. The repo link: https://github.com/deepmodeling/dpdispatcher The api of new dpdispatcher is close to old one except for a few changes. @@ -1293,9 +1291,9 @@ note1: the key "local_root" in dpgen's machine.json is always `./` - Size of `sel_a` and actual types of atoms in your system. - Index of `sys_configs` and `sys_idx` -2. Please verify the directories of `sys_configs`. If there isnt's any POSCAR for `01.model_devi` in one iteration, it may happen that you write the false path of `sys_configs`. +2. Please verify the directories of `sys_configs`. If there isn't any POSCAR for `01.model_devi` in one iteration, it may happen that you write the false path of `sys_configs`. 3. Correct format of JSON file. -4. In `02.fp`, total cores you require through `task_per_node` should be devided by `npar` times `kpar`. +4. In `02.fp`, total cores you require through `task_per_node` should be divided by `npar` times `kpar`. 5. The frames of one system should be larger than `batch_size` and `numb_test` in `default_training_param`. It happens that one iteration adds only a few structures and causes error in next iteration's training. In this condition, you may let `fp_task_min` be larger than `numb_test`. ## License The project dpgen is licensed under [GNU LGPLv3.0](./LICENSE). From 78b106d164a2fb01b726eef35fa405f18e97b72d Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Sun, 21 Aug 2022 17:53:49 +0800 Subject: [PATCH 4/7] fix typos and optimize autotest part in README --- README.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index bc4559d6b..776b80618 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ Basically `init_surf` can be divided into two parts , denoted as `stages` in `PA All stages must be **in order**. -Following is an example for `PARAM`, which generates data from a typical structure hcp. +Following is an example for `PARAM`, which generates data from a typical structure fcc. ```json { "stages": [ @@ -546,7 +546,7 @@ The bold notation of key (such as **type_map**) means that it's a necessary key. | **fp_task_min** | Integer | 5 | Minimum of structures to calculate in `02.fp` of each iteration. | | fp_accurate_threshold | Float | 0.9999 | If the accurate ratio is larger than this number, no fp calculation will be performed, i.e. fp_task_max = 0. | | fp_accurate_soft_threshold | Float | 0.9999 | If the accurate ratio is between this number and `fp_accurate_threshold`, the fp_task_max linearly decays to zero. | -| fp_cluster_vacuum | Float | None | If the vacuum size is smaller than this value, this cluster will not be choosen for labeling | +| fp_cluster_vacuum | Float | None | If the vacuum size is smaller than this value, this cluster will not be chosen for labeling | | *fp_style == VASP* | **fp_pp_path** | String | "/sharedext4/.../ch4/" | Directory of psuedo-potential file to be used for 02.fp exists. | | **fp_pp_files** | List of string | ["POTCAR"] | Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in `type_map`. | @@ -619,7 +619,7 @@ The bold notation of key (such as **calypso_path**) means that it's a necessary - replace `section parameter` in cp2k as `value` with dict. keyword `"_"` - `repeat section` in cp2k just need to be written once with repeat parameter as list. -If you want to use your own paramter, just write a corresponding dictionary. The `COORD` section will be filled by dpgen automatically, therefore do not include this in dictionary. The `OT` or `Diagonalization` section is require for semiconductor or metal system. For specific example, have a look on `example` directory. +If you want to use your own parameter, just write a corresponding dictionary. The `COORD` section will be filled by dpgen automatically, therefore do not include this in dictionary. The `OT` or `Diagonalization` section is require for semiconductor or metal system. For specific example, have a look on `example` directory. Here are examples for setting: ```python @@ -697,15 +697,15 @@ the following essential section should be provided in user template ## Autotest: Autotest for Deep Generator 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. -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 collect the results when remote calculations finish. `post` calculates the desired property from the collected results. +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. ### Relaxation The relaxation of a structure should be carried out before calculating all other properties: ```bash -dpgen autotest make equi.json +dpgen autotest make relax.json dpgen autotest run relax.json machine.json -dpgen autotest post equi.json +dpgen autotest post relax.json ``` If, for some reasons, the main program terminated at stage `run`, one can easily restart with the same command. `relax.json` is the parameter file. An example for `deepmd` relaxation is given as: @@ -725,7 +725,7 @@ where the key `structures` provides the structures to relax. `interaction` is pr ### Task type -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`. The input examples of the `interaction` part of each type can be found below: +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: **VASP**: @@ -788,13 +788,13 @@ Please make sure the [MANYBODY package](https://lammps.sandia.gov/doc/Packages_d 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. -### Here we start to introduce the relaxation, property, refine, and reproduce calculations in `autotest` in details. +### Below we start to introduce the relaxation, property, refine, and reproduce calculations in `autotest` in details. ### Relaxation calculations The relaxation of a structure should be carried out before calculating all other properties. -First, we need input parameter file and we name it `relaxation.json` here. All the relaxation calculations should be taken either by `VASP`, `ABACUS`, or `LAMMPS`. Here are two input examples for `VASP` and `LAMMPS` respectively. +First, we need input parameter file and we name it `relax.json` here. All the relaxation calculations should be taken either by `VASP`, `ABACUS`, or `LAMMPS`. Here are two input examples for `VASP` and `LAMMPS` respectively. An example of the input file for relaxation by VASP: @@ -826,8 +826,8 @@ Key words | data structure | example | description **structures** | List of String | ["confs/std-*"] | path of different structures **interaction** | Dict | See above | description of the task type and atomic interaction **type** | String | "vasp" | task type -**incar** | String | "vasp_input/INCAR" | the path for INCAR file in vasp -potcar_prefix | String | "vasp_input" | the prefix of path for POTCAR file in vasp, default = "" +**incar** | String | "vasp_input/INCAR" | path for INCAR file in vasp +potcar_prefix | String | "vasp_input" | prefix of path for POTCAR file in vasp, default = "" **potcars** | Dict | {"Al": "POTCAR.al"} | key is element type and value is potcar name **relaxation** | Dict | See above | the calculation type and setting for relaxation cal_type | String | "relaxation" or "static" | calculation type @@ -932,10 +932,10 @@ Universal key words for properties Key words | data structure | example | description ---|---|---|--- -**type** | String | "eos" | specifying the property type +**type** | String | "eos" | specifying property type skip | Boolean | true | whether to skip current property or not start_confs_path | String | "../vasp/confs" | starting from the equilibrium configuration in other path only for the current property type -cal_setting["input_prop"] | String | "lammps_input/lammps_high" |input commands file for lammps +cal_setting["input_prop"] | String | "lammps_input/lammps_high" |input commands file cal_setting["overwrite_interaction"] | Dict | | overwrite the interaction in the `interaction` part only for the current property type other parameters in `cal_setting` and `cal_type` in `relaxation` also apply in `property`. From 08cb537b2b08ce0ae7ef1b16819cf7c421034964 Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Sun, 21 Aug 2022 18:08:16 +0800 Subject: [PATCH 5/7] fix typos and optimize autotest part in README --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 776b80618..7995d23a1 100644 --- a/README.md +++ b/README.md @@ -829,7 +829,7 @@ Key words | data structure | example | description **incar** | String | "vasp_input/INCAR" | path for INCAR file in vasp potcar_prefix | String | "vasp_input" | prefix of path for POTCAR file in vasp, default = "" **potcars** | Dict | {"Al": "POTCAR.al"} | key is element type and value is potcar name -**relaxation** | Dict | See above | the calculation type and setting for relaxation +**relaxation** | Dict | See above | calculation type and setting for relaxation cal_type | String | "relaxation" or "static" | calculation type cal_setting | Dict | See above | calculation setting relax_pos | Boolean | true | relax atomic position or not, default = true for relaxation @@ -932,9 +932,9 @@ Universal key words for properties Key words | data structure | example | description ---|---|---|--- -**type** | String | "eos" | specifying property type +**type** | String | "eos" | property type skip | Boolean | true | whether to skip current property or not -start_confs_path | String | "../vasp/confs" | starting from the equilibrium configuration in other path only for the current property type +start_confs_path | String | "../vasp/confs" | start from the equilibrium configuration in other path only for the current property type cal_setting["input_prop"] | String | "lammps_input/lammps_high" |input commands file cal_setting["overwrite_interaction"] | Dict | | overwrite the interaction in the `interaction` part only for the current property type @@ -953,8 +953,8 @@ Key words for **Elastic** Key words | data structure | example | description ---|---|---|--- -norm_deform | Float | 1e-2 | specifying the deformation in xx, yy, zz, default = 1e-2 -shear_deform | Float | 1e-2 | specifying the deformation in other directions, default = 1e-2 +norm_deform | Float | 1e-2 | deformation in xx, yy, zz, default = 1e-2 +shear_deform | Float | 1e-2 | deformation in other directions, default = 1e-2 Key words for **Vacancy** @@ -1025,7 +1025,7 @@ Three steps for refine calculations are also `make`, `run`, and `post`. ### Reproduce the calculation of a property -Sometimes we want to reproduce the initial results with the same configurations for cross validation. This version of autotest package can accomplish this successfully in all property types except for `Elastic`. An input example for using `deepmd` to reproduce the `VASP` Interstitial results is given as below: +Sometimes we want to reproduce the initial results with the same configurations for cross validation. This version of autotest package can accomplish this successfully in all property types except for `Elastic`. An input example for using `deepmd` to reproduce the `VASP` Interstitial results is given below: ```json { From 693989c30883cd5c69a5d5352c64d1340ed7661b Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Sun, 21 Aug 2022 18:18:26 +0800 Subject: [PATCH 6/7] optimize autotest part in README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7995d23a1..db11fb505 100644 --- a/README.md +++ b/README.md @@ -853,8 +853,8 @@ An example of the input file for relaxation by LAMMPS: "type_map": {"Al": 0} }, "relaxation": { - "cal_setting":{"etol": 1e-12, - "ftol": 1e-6, + "cal_setting":{"etol": 0, + "ftol": 1e-10, "maxiter": 5000, "maximal": 500000} } @@ -867,8 +867,8 @@ Key words | data structure | example | description **model** | String or List of String | "frozen_model.pb" | model file for atomic interaction in_lammps | String | "lammps_input/in.lammps" | input file for lammps commands **type_map** | Dict | {"Al": 0} | key is element type and value is type number. DP starts from 0, others starts from 1 -etol | Float | 1e-12 | stopping tolerance for energy -ftol | Float | 1e-6 | stopping tolerance for force +etol | Float | 0 | stopping tolerance for energy +ftol | Float | 1e-10 | stopping tolerance for force maxiter | Int | 5000 | max iterations of minimizer maxeval | Int | 500000 | max number of force/energy evaluations @@ -989,7 +989,7 @@ Key words | data structure | example | description **displace_direction** | List of Int | [1,1,0] | slip direction for gamma-line calculation supercell_size | List of Int | [1,1,10] | the supercell to be constructed, default = [1,1,5] min_vacuum_size | Int or Float | 10 | minimum size of vacuum width, default = 20 -add_fix | List of String | ['true','true','false'] | whether to do relaxation in the direction, default = ['true','true','false'] (standard method) +add_fix | List of String | ['true','true','false'] | whether to fix atoms in the direction, default = ['true','true','false'] (standard method) n_steps | Int | 20 | Number of points for gamma-line calculation, default = 10 Three steps for property calculations are also `make`, `run`, and `post`. From 285f6ceb7f334ce6806c54ae86a168d0daa9cca3 Mon Sep 17 00:00:00 2001 From: kevinwenminion Date: Mon, 22 Aug 2022 15:42:32 +0800 Subject: [PATCH 7/7] delete the citation of wiki in README --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index db11fb505..3d73cfcb1 100644 --- a/README.md +++ b/README.md @@ -1055,9 +1055,6 @@ Sometimes we want to reproduce the initial results with the same configurations Three steps for reproduce calculations are also `make`, `run`, and `post`. -### More Information of Autotest -For more information of autotest, please refer to [dpgen wiki](https://github.com/deepmodeling/dpgen/wiki). - ## Simplify When you have a dataset containing lots of repeated data, this step will help you simplify your dataset. The workflow contains three stages: train, model_devi, and fp. The train stage and the fp stage are as the same as the run step, and the model_devi stage will calculate model deviations of the rest data that has not been confirmed accurate. Data with small model deviations will be confirmed accurate, while the program will pick data from those with large model deviations to the new dataset.