Skip to content

Commit 2875938

Browse files
authored
Merge pull request #52 from veritas496/master
update auto-test part of dpgen hands-on
2 parents aa42652 + c365437 commit 2875938

File tree

1 file changed

+305
-2
lines changed

1 file changed

+305
-2
lines changed

source/Tutorials/DP-GEN/learnDoc/DP-GEN_handson.md

Lines changed: 305 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,9 +690,9 @@ $ cat cat dpgen.log | grep system
690690
It can be found that 3010 structures are generated in `iter.000001`, in which no structure is collected for first-principle calculations. Therefore, the final models are not updated in iter.000002/00.train.
691691

692692

693-
### Auto-test
693+
## Auto-test
694694

695-
To verify the accuracy of the DP model, users can calculate a simple set of properties and compare the results with those of a DFT or traditional empirical force field. DPGEN's autotest module supports the calculation of a variety of properties, such as
695+
The function, `auto-test`, is only for alloy materials to verify the accuracy of their DP model, users can calculate a simple set of properties and compare the results with those of a DFT or traditional empirical force field. DPGEN's autotest module supports the calculation of a variety of properties, such as
696696

697697
- 00.equi:(default task) the equilibrium state;
698698

@@ -706,6 +706,309 @@ To verify the accuracy of the DP model, users can calculate a simple set of pro
706706

707707
- 05.surf: the surface formation energy.
708708

709+
In this part, the Al-Mg-Cu DP potential is used to illustrate how to automatically test DP potential of alloy materials. Each `auto-test` task includes three stages:
710+
- `make` prepares all required calculation files and input scripts automatically;
711+
- `run` can help submit calculation tasks to remote calculation plantforms and when calculation tasks are completed, will collect results automatically;
712+
- `post` returns calculation results to local root automatically.
713+
714+
### structure relaxation
715+
716+
#### step1-`make`
717+
Prepare the following files in a separate folder.
718+
```sh
719+
├── machine.json
720+
├── relaxation.json
721+
├── confs
722+
│ ├── mp-3034
723+
```
724+
**IMPORTANT!** The ID number, mp-3034, is in the line with Material Project ID for Al-Mg-Cu.
725+
- machine.json is the same with the one used in `init` and `run`. For more information about it, please check this [link](https://bohrium-doc.dp.tech/#/docs/DP-GEN?id=步骤3:准备计算文件).
726+
- relaxtion.json
727+
728+
```json
729+
{
730+
"structures": ["confs/mp-3034"],//in this folder, confs/mp-3034, required files and scripts will be generated automatically by `dpgen autotest make relaxation.json`
731+
"interaction": {
732+
"type": "deepmd",
733+
"model": "graph.pb",
734+
"in_lammps": "lammps_input/in.lammps",
735+
"type_map": {"Mg":0,"Al": 1,"Cu":2} //if you calculate other materials, remember to modify element types here.
736+
},
737+
"relaxation": {
738+
"cal_setting":{"etol": 1e-12,
739+
"ftol": 1e-6,
740+
"maxiter": 5000,
741+
"maximal": 500000,
742+
"relax_shape": true,
743+
"relax_vol": true}
744+
}
745+
}
746+
```
747+
748+
Run this command,
749+
```bash
750+
dpgen autotest make relaxation.json
751+
```
752+
and then corresponding files and scripts used for calculation will be generated automatically.
753+
754+
#### step2-`run`
755+
```bash
756+
nohup dpgen autotest run relaxation.json machine.json &
757+
```
758+
After running this command, structures will be relaxed.
759+
760+
#### step3-`post`
761+
```bash
762+
dpgen autotest post relaxation.json
763+
```
764+
### property calculation
765+
#### step1-`make`
766+
The parameters used for property calculations are in property.json.
767+
768+
```json
769+
{
770+
"structures": ["confs/mp-3034"],
771+
"interaction": {
772+
"type": "deepmd",
773+
"model": "graph.pb",
774+
"deepmd_version":"2.1.0",
775+
"type_map": {"Mg":0,"Al": 1,"Cu":2}
776+
},
777+
"properties": [
778+
{
779+
"type": "eos",
780+
"vol_start": 0.9,
781+
"vol_end": 1.1,
782+
"vol_step": 0.01
783+
},
784+
{
785+
"type": "elastic",
786+
"norm_deform": 2e-2,
787+
"shear_deform": 5e-2
788+
},
789+
{
790+
"type": "vacancy",
791+
"supercell": [3, 3, 3],
792+
"start_confs_path": "confs"
793+
},
794+
{
795+
"type": "interstitial",
796+
"supercell": [3, 3, 3],
797+
"insert_ele": ["Mg","Al","Cu"],
798+
"conf_filters":{"min_dist": 1.5},
799+
"cal_setting": {"input_prop": "lammps_input/lammps_high"}
800+
},
801+
{
802+
"type": "surface",
803+
"min_slab_size": 10,
804+
"min_vacuum_size":11,
805+
"max_miller": 2,
806+
"cal_type": "static"
807+
}
808+
]
809+
}
810+
```
811+
Run this command
812+
```bash
813+
dpgen autotest make property.json
814+
```
815+
#### step2-`run`
816+
Run this command
817+
```bash
818+
nohup dpgen autotest run property.json machine.json &
819+
```
820+
#### step3-`post`
821+
```bash
822+
dpgen autotest post property.json
823+
```
824+
In the folder, you can use the command `tree . -L 1` and then you can check results.
825+
826+
```
827+
(base) ➜ mp-3034 tree . -L 1
828+
.
829+
├── dpdispatcher.log
830+
├── dpgen.log
831+
├── elastic_00
832+
├── eos_00
833+
├── eos_00.bk000
834+
├── eos_00.bk001
835+
├── eos_00.bk002
836+
├── eos_00.bk003
837+
├── eos_00.bk004
838+
├── eos_00.bk005
839+
├── graph_new.pb
840+
├── interstitial_00
841+
├── POSCAR
842+
├── relaxation
843+
├── surface_00
844+
└── vacancy_00
845+
```
846+
847+
- 01.eos: the equation of state;
848+
```bash
849+
(base) ➜ mp-3034 tree eos_00 -L 1
850+
eos_00
851+
├── 99c07439f6f14399e7785dc783ca5a9047e768a8_flag_if_job_task_fail
852+
├── 99c07439f6f14399e7785dc783ca5a9047e768a8_job_tag_finished
853+
├── 99c07439f6f14399e7785dc783ca5a9047e768a8.sub
854+
├── backup
855+
├── graph.pb -> ../../../graph.pb
856+
├── result.json
857+
├── result.out
858+
├── run_1660558797.sh
859+
├── task.000000
860+
├── task.000001
861+
├── task.000002
862+
├── task.000003
863+
├── task.000004
864+
├── task.000005
865+
├── task.000006
866+
├── task.000007
867+
├── task.000008
868+
├── task.000009
869+
├── task.000010
870+
├── task.000011
871+
├── task.000012
872+
├── task.000013
873+
├── task.000014
874+
├── task.000015
875+
├── task.000016
876+
├── task.000017
877+
├── task.000018
878+
├── task.000019
879+
└── tmp_log
880+
```
881+
882+
The `EOS` calculation results are shown in `eos_00/results.out` file
883+
```bash
884+
(base) ➜ eos_00 cat result.out
885+
conf_dir: /root/1/confs/mp-3034/eos_00
886+
VpA(A^3) EpA(eV)
887+
15.075 -3.2727
888+
15.242 -3.2838
889+
15.410 -3.2935
890+
15.577 -3.3019
891+
15.745 -3.3090
892+
15.912 -3.3148
893+
16.080 -3.3195
894+
16.247 -3.3230
895+
16.415 -3.3254
896+
16.582 -3.3268
897+
16.750 -3.3273
898+
16.917 -3.3268
899+
17.085 -3.3256
900+
17.252 -3.3236
901+
17.420 -3.3208
902+
17.587 -3.3174
903+
17.755 -3.3134
904+
17.922 -3.3087
905+
18.090 -3.3034
906+
18.257 -3.2977
907+
```
908+
- 02.elastic: the elasticity like Young's module;
909+
The `elastic` calculation results are shown in `elastic_00/results.out` file
910+
```bash
911+
(base) ➜ elastic_00 cat result.out
912+
/root/1/confs/mp-3034/elastic_00
913+
124.32 55.52 60.56 0.00 0.00 1.09
914+
55.40 125.82 75.02 0.00 0.00 -0.17
915+
60.41 75.04 132.07 0.00 0.00 7.51
916+
0.00 0.00 0.00 53.17 8.44 0.00
917+
0.00 0.00 0.00 8.34 37.17 0.00
918+
1.06 -1.35 7.51 0.00 0.00 34.43
919+
# Bulk Modulus BV = 84.91 GPa
920+
# Shear Modulus GV = 37.69 GPa
921+
# Youngs Modulus EV = 98.51 GPa
922+
# Poission Ratio uV = 0.31
923+
```
924+
- 03.vacancy: the vacancy formation energy;
925+
The `vacancy` calculation results are shown in `vacancy_00/results.out` file
926+
```bash
927+
(base) ➜ vacancy_00 cat result.out
928+
/root/1/confs/mp-3034/vacancy_00
929+
Structure: Vac_E(eV) E(eV) equi_E(eV)
930+
[3, 3, 3]-task.000000: -10.489 -715.867 -705.378
931+
[3, 3, 3]-task.000001: 4.791 -713.896 -718.687
932+
[3, 3, 3]-task.000002: 4.623 -714.064 -718.687
933+
```
934+
- 04.interstitial: the interstitial formation energy;
935+
The `interstitial` calculation results are shown in `interstitial_00/results.out` file
936+
```bash
937+
(base) ➜ vacancy_00 cat result.out
938+
/root/1/confs/mp-3034/vacancy_00
939+
Structure: Vac_E(eV) E(eV) equi_E(eV)
940+
[3, 3, 3]-task.000000: -10.489 -715.867 -705.378
941+
[3, 3, 3]-task.000001: 4.791 -713.896 -718.687
942+
[3, 3, 3]-task.000002: 4.623 -714.064 -718.687
943+
```
944+
- 05.surf: the surface formation energy.
945+
The `surface` calculation results are shown in `surface_00/results.out` file
946+
```bash
947+
(base) ➜ surface_00 cat result.out
948+
/root/1/confs/mp-3034/surface_00
949+
Miller_Indices: Surf_E(J/m^2) EpA(eV) equi_EpA(eV)
950+
[1, 1, 1]-task.000000: 1.230 -3.102 -3.327
951+
[1, 1, 1]-task.000001: 1.148 -3.117 -3.327
952+
[2, 2, 1]-task.000002: 1.160 -3.120 -3.327
953+
[2, 2, 1]-task.000003: 1.118 -3.127 -3.327
954+
[1, 1, 0]-task.000004: 1.066 -3.138 -3.327
955+
[2, 1, 2]-task.000005: 1.223 -3.118 -3.327
956+
[2, 1, 2]-task.000006: 1.146 -3.131 -3.327
957+
[2, 1, 1]-task.000007: 1.204 -3.081 -3.327
958+
[2, 1, 1]-task.000008: 1.152 -3.092 -3.327
959+
[2, 1, 1]-task.000009: 1.144 -3.093 -3.327
960+
[2, 1, 1]-task.000010: 1.147 -3.093 -3.327
961+
[2, 1, 0]-task.000011: 1.114 -3.103 -3.327
962+
[2, 1, 0]-task.000012: 1.165 -3.093 -3.327
963+
[2, 1, 0]-task.000013: 1.137 -3.098 -3.327
964+
[2, 1, 0]-task.000014: 1.129 -3.100 -3.327
965+
[1, 0, 1]-task.000015: 1.262 -3.124 -3.327
966+
[1, 0, 1]-task.000016: 1.135 -3.144 -3.327
967+
[1, 0, 1]-task.000017: 1.113 -3.148 -3.327
968+
[1, 0, 1]-task.000018: 1.119 -3.147 -3.327
969+
[1, 0, 1]-task.000019: 1.193 -3.135 -3.327
970+
[2, 0, 1]-task.000020: 1.201 -3.089 -3.327
971+
[2, 0, 1]-task.000021: 1.189 -3.092 -3.327
972+
[2, 0, 1]-task.000022: 1.175 -3.094 -3.327
973+
[1, 0, 0]-task.000023: 1.180 -3.100 -3.327
974+
[1, 0, 0]-task.000024: 1.139 -3.108 -3.327
975+
[1, 0, 0]-task.000025: 1.278 -3.081 -3.327
976+
[1, 0, 0]-task.000026: 1.195 -3.097 -3.327
977+
[2, -1, 2]-task.000027: 1.201 -3.121 -3.327
978+
[2, -1, 2]-task.000028: 1.121 -3.135 -3.327
979+
[2, -1, 2]-task.000029: 1.048 -3.147 -3.327
980+
[2, -1, 2]-task.000030: 1.220 -3.118 -3.327
981+
[2, -1, 1]-task.000031: 1.047 -3.169 -3.327
982+
[2, -1, 1]-task.000032: 1.308 -3.130 -3.327
983+
[2, -1, 1]-task.000033: 1.042 -3.170 -3.327
984+
[2, -1, 0]-task.000034: 1.212 -3.154 -3.327
985+
[2, -1, 0]-task.000035: 1.137 -3.165 -3.327
986+
[2, -1, 0]-task.000036: 0.943 -3.192 -3.327
987+
[2, -1, 0]-task.000037: 1.278 -3.144 -3.327
988+
[1, -1, 1]-task.000038: 1.180 -3.118 -3.327
989+
[1, -1, 1]-task.000039: 1.252 -3.105 -3.327
990+
[1, -1, 1]-task.000040: 1.111 -3.130 -3.327
991+
[1, -1, 1]-task.000041: 1.032 -3.144 -3.327
992+
[1, -1, 1]-task.000042: 1.177 -3.118 -3.327
993+
[2, -2, 1]-task.000043: 1.130 -3.150 -3.327
994+
[2, -2, 1]-task.000044: 1.221 -3.135 -3.327
995+
[2, -2, 1]-task.000045: 1.001 -3.170 -3.327
996+
[1, -1, 0]-task.000046: 0.911 -3.191 -3.327
997+
[1, -1, 0]-task.000047: 1.062 -3.168 -3.327
998+
[1, -1, 0]-task.000048: 1.435 -3.112 -3.327
999+
[1, -1, 0]-task.000049: 1.233 -3.143 -3.327
1000+
[1, 1, 2]-task.000050: 1.296 -3.066 -3.327
1001+
[1, 1, 2]-task.000051: 1.146 -3.097 -3.327
1002+
[1, 0, 2]-task.000052: 1.192 -3.085 -3.327
1003+
[1, 0, 2]-task.000053: 1.363 -3.050 -3.327
1004+
[1, 0, 2]-task.000054: 0.962 -3.132 -3.327
1005+
[1, -1, 2]-task.000055: 1.288 -3.093 -3.327
1006+
[1, -1, 2]-task.000056: 1.238 -3.102 -3.327
1007+
[1, -1, 2]-task.000057: 1.129 -3.122 -3.327
1008+
[1, -1, 2]-task.000058: 1.170 -3.115 -3.327
1009+
[0, 0, 1]-task.000059: 1.205 -3.155 -3.327
1010+
[0, 0, 1]-task.000060: 1.188 -3.158 -3.327
1011+
```
7091012

7101013
## Summary
7111014
Now, users have learned the basic usage of the DP-GEN. For further information, please refer to the recommended links.

0 commit comments

Comments
 (0)