From 6e4049abe426049a1f03fc09c92144c92705386b Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 18 Nov 2023 22:39:45 -0500 Subject: [PATCH 1/7] add doc for fp style pwscf (Quantum Espresso) --- dpgen/generator/arginfo.py | 42 ++++++++++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index e0b13e4c1..afa9f6805 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -789,14 +789,14 @@ def fp_style_cp2k_args() -> list[Argument]: ), ] - +# amber/diff def fp_style_amber_diff_args() -> list[Argument]: """Arguments for FP style amber/diff. Returns ------- list[dargs.Argument] - list of Gaussian fp style arguments + list of amber/diff fp style arguments """ doc_fp_params_gaussian = "Parameters for FP calculation." doc_high_level = ( @@ -826,6 +826,40 @@ def fp_style_amber_diff_args() -> list[Argument]: ), ] +# pwscf +def fp_style_pwscf_args() -> list[Argument]: + """Arguments for FP style pwscf (Quantum Espresso). + Returns + ------- + list[dargs.Argument] + list of pwscf fp style arguments + """ + doc_fp_pp_path = "Directory of psuedo-potential file to be used for 02.fp exists." + doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map." + doc_user_fp_params = "Parameters for pwscf calculation. Find details at https://www.quantum-espresso.org/Doc/INPUT_PW.html. When user_fp_params is set, the settings in fp_params will be ignored. kspacing must be set in user_fp_params. kspacing is the spacing between kpoints, and helps to determin KPOINTS in pwscf." + doc_fp_params = "Parameters for pwscf calculation. It has lower priority than user_fp_params." + doc_ecut = "ecutwfc in pwscf." + doc_ediff = "conv_thr and ts_vdw_econv_thr in pwscf." + doc_kspacing = "The spacing between kpoints. Helps to determin KPOINTS in pwscf." + doc_smearing = "smearing in pwscf." + doc_sigma = "degauss in pwscf." + + args = [ + Argument("ecut", float, optional=False, doc=doc_ecut), + Argument("ediff", float, optional=False, doc=doc_ediff), + + Argument("smearing", str, optional=False, doc=doc_smearing), + Argument("sigma", float, optional=False, doc=doc_sigma), + ] + return [ + Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path), + Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files), + Argument( + "fp_params", dict, args, [], optional=False, doc=doc_fp_params + ), + Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params), + Argument("kspacing", float, optional=False, doc=doc_kspacing), + ] def fp_style_custom_args() -> list[Argument]: """Arguments for FP style custom. @@ -833,7 +867,7 @@ def fp_style_custom_args() -> list[Argument]: Returns ------- list[dargs.Argument] - list of Gaussian fp style arguments + list of custom fp style arguments """ doc_fp_params_custom = "Parameters for FP calculation." doc_input_fmt = "Input dpdata format of the custom FP code. Such format should only need the first argument as the file name." @@ -883,7 +917,7 @@ def fp_style_variant_type_args() -> Variant: "amber/diff", dict, fp_style_amber_diff_args(), doc=doc_amber_diff ), Argument("pwmat", dict, [], doc="TODO: add doc"), - Argument("pwscf", dict, [], doc="TODO: add doc"), + Argument("pwscf", dict, [], doc=fp_style_pwscf_args()), Argument("custom", dict, fp_style_custom_args(), doc=doc_custom), ], optional=False, From 7c84a1cc0c135f72e4e0d4c41c9737ad2b305c2b Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sat, 18 Nov 2023 22:51:31 -0500 Subject: [PATCH 2/7] add example input for fp style pwscf --- .../dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf | 1 + .../Al/param_al_all_gpu-deepmd-kit-2.x.json | 452 ++++++++++++++++++ .../dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf | 1 + .../dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf | 1 + .../CH4/param_CH4_deepmd-kit-2.x.json | 159 ++++++ .../param_CH4_deepmd-kit-2.0.1.json | 156 ++++++ 6 files changed, 770 insertions(+) create mode 100644 examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf create mode 100644 examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json create mode 100644 examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf create mode 100644 examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf create mode 100644 examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json create mode 100644 examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json diff --git a/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf new file mode 100644 index 000000000..4ee609d65 --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf @@ -0,0 +1 @@ +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file diff --git a/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json b/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json new file mode 100644 index 000000000..3f5520789 --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json @@ -0,0 +1,452 @@ +{ + "type_map": [ + "Al" + ], + "mass_map": [ + 27 + ], + "init_data_prefix": "/data1/yfb222333/2_dpgen_gpu_multi/init/", + "init_data_sys": [ + "al.fcc.02x02x02/02.md/sys-0032/deepmd", + "al.hcp.02x02x02/02.md/sys-0016/deepmd", + "al.bcc.02x02x02/02.md/sys-0016/deepmd" + ], + "sys_configs": [ + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[0-4]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00000[5-9]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00001*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00002*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00003*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00004*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00005*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00006*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00007*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.fcc.02x02x02/01.scale_pert/sys-0032/scale-1.000/00008*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.hcp.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[0-4]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00000[5-9]/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00001*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00002*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00003*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00004*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00005*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00006*/POSCAR" + ], + [ + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00007*/POSCAR", + "/data1/yfb222333/2_dpgen_gpu_multi/init/al.bcc.02x02x02/01.scale_pert/sys-0016/scale-1.000/00008*/POSCAR" + ] + ], + "_comment1": " 00.train ", + "numb_models": 4, + "default_training_param": { + "model": { + "_comment2": " model parameters", + "type_map": [ + "Al" + ], + "descriptor": { + "type": "se_a", + "sel": [ + 300 + ], + "rcut_smth": 2.0, + "rcut": 8.0, + "neuron": [ + 240, + 240, + 240 + ], + "resnet_dt": true, + "axis_neuron": 12, + "seed": 1 + }, + "fitting_net": { + "neuron": [ + 25, + 50, + 100 + ], + "resnet_dt": false, + "sedd": 1 + } + }, + "learning_rate": { + "type": "exp", + "start_lr": 0.001, + "decay_steps": 2000, + "stop_lr": 0.0005987369392383787 + }, + "loss": { + "start_pref_e": 0.02, + "limit_pref_e": 2, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0.0, + "limit_pref_v": 0.0 + }, + "training": { + "coord_norm": true, + "type_fitting_net": false, + "_comment3": " traing controls", + "stop_batch": 20000, + "seed": 0, + "_comment4": " display and restart", + "_comment5": " frequencies counted in batch", + "disp_file": "lcurve.out", + "disp_freq": 2000, + "save_freq": 2000, + "save_ckpt": "model.ckpt", + "disp_training": true, + "time_training": true, + "profiling": false, + "profiling_file": "timeline.json", + "_comment6": "that's all", + "training_data": { + "systems": [], + "set_prefix": "set", + "batch_size": 1 + } + } + }, + "_comment7": " 01.model_devi ", + "_comment8": "model_devi_skip: the first x of the recorded frames", + "model_devi_dt": 0.002, + "model_devi_skip": 0, + "model_devi_f_trust_lo": 0.05, + "model_devi_f_trust_hi": 0.2, + "model_devi_clean_traj": false, + "model_devi_jobs": [ + { + "_idx": 0, + "ensemble": "npt", + "nsteps": 1000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 0, + 8, + 16 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 1, + "ensemble": "npt", + "nsteps": 1000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 1, + 9, + 17 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 2, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 2, + 10, + 18 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 3, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 3, + 11, + 19 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 4, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 4, + 12, + 20 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 5, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 5, + 13, + 21 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 6, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 6, + 14, + 22 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 7, + "ensemble": "npt", + "nsteps": 3000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 7, + 15, + 23 + ], + "temps": [ + 50, + 132.0, + 198.0, + 264.0 + ], + "trj_freq": 10 + }, + { + "_idx": 8, + "ensemble": "npt", + "nsteps": 1000, + "press": [ + 1.0, + 10.0, + 100.0, + 1000.0, + 5000.0, + 10000.0, + 20000.0, + 50000.0 + ], + "sys_idx": [ + 0, + 8, + 16 + ], + "temps": [ + 330.0, + 396.0, + 462.0, + 528.0, + 594.0 + ], + "trj_freq": 10 + } + ], + "fp_style": "pwscf", + "user_fp_params": { + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 1, + "nat": 192, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 + }, + "shuffle_poscar": false, + "fp_task_max": 2000, + "fp_task_min": 5, + "fp_pp_path": "./", + "fp_pp_files": [ + "Al_ONCV_PBE_sr.upf" + ], + "_comment": " that's all " +} diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf new file mode 100644 index 000000000..4ee609d65 --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf @@ -0,0 +1 @@ +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf new file mode 100644 index 000000000..4ee609d65 --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf @@ -0,0 +1 @@ +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json b/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json new file mode 100644 index 000000000..338582c2e --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json @@ -0,0 +1,159 @@ +{ + "type_map": [ + "H", + "C" + ], + "mass_map": [ + 1, + 12 + ], + "init_data_prefix": "/data1/yfb222333/2_dpgen_gpu_multi", + "init_data_sys": [ + "CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd" + ], + "sys_configs_prefix": "/data1/yfb222333/2_dpgen_gpu_multi", + "sys_configs": [ + [ + "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000*/POSCAR" + ], + [ + "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR" + ] + ], + "_comment1": " that's all ", + "numb_models": 4, + "default_training_param": { + "model": { + "type_map": [ + "H", + "C" + ], + "descriptor": { + "type": "se_a", + "sel": [ + 16, + 4 + ], + "rcut_smth": 0.5, + "rcut": 5, + "neuron": [ + 120, + 120, + 120 + ], + "resnet_dt": true, + "axis_neuron": 12, + "seed": 1 + }, + "fitting_net": { + "neuron": [ + 25, + 50, + 100 + ], + "resnet_dt": false, + "seed": 1 + } + }, + "learning_rate": { + "type": "exp", + "start_lr": 0.001, + "decay_steps": 100, + "stop_lr": 0.0003584859224085419 + }, + "loss": { + "start_pref_e": 0.02, + "limit_pref_e": 2, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0.0, + "limit_pref_v": 0.0 + }, + "training": { + "stop_batch": 2000, + "disp_file": "lcurve.out", + "disp_freq": 1000, + "save_freq": 1000, + "save_ckpt": "model.ckpt", + "disp_training": true, + "time_training": true, + "profiling": false, + "profiling_file": "timeline.json", + "_comment2": "that's all", + "training_data": { + "set_prefix": "set", + "batch_size": 1 + } + } + }, + "model_devi_dt": 0.002, + "model_devi_skip": 0, + "model_devi_f_trust_lo": 0.05, + "model_devi_f_trust_hi": 0.15, + "model_devi_clean_traj": true, + "model_devi_jobs": [ + { + "sys_idx": [ + 0 + ], + "temps": [ + 100 + ], + "press": [ + 1.0 + ], + "trj_freq": 10, + "nsteps": 300, + "ensemble": "nvt", + "_idx": "00" + }, + { + "sys_idx": [ + 1 + ], + "temps": [ + 100 + ], + "press": [ + 1.0 + ], + "trj_freq": 10, + "nsteps": 3000, + "ensemble": "nvt", + "_idx": "01" + } + ], + "fp_style": "pwscf", + "user_fp_params": { + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 2, + "nat": 5, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 + }, + "shuffle_poscar": false, + "fp_task_max": 2000, + "fp_task_min": 5, + "fp_pp_path": "./", + "fp_pp_files": [ + "C_ONCV_PBE_sr.upf", "H_ONCV_PBE_sr.upf" + ], + "_comment": " that's all " +} diff --git a/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json b/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json new file mode 100644 index 000000000..2d98fd713 --- /dev/null +++ b/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json @@ -0,0 +1,156 @@ +{ + "type_map": [ + "H", + "C" + ], + "mass_map": [ + 1, + 12 + ], + "init_data_prefix": "./", + "init_data_sys": [ + "CH4.POSCAR.01x01x01/02.md/sys-0004-0001/deepmd" + ], + "sys_configs_prefix": "./", + "sys_configs": [ + [ + "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00000*/POSCAR" + ], + [ + "CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale*/00001*/POSCAR" + ] + ], + "_comment1": " that's all ", + "numb_models": 4, + "default_training_param": { + "model": { + "type_map": [ + "H", + "C" + ], + "descriptor": { + "type": "se_a", + "sel": [ + 16, + 4 + ], + "rcut_smth": 0.5, + "rcut": 5.0, + "neuron": [ + 120, + 120, + 120 + ], + "resnet_dt": true, + "axis_neuron": 12, + "seed": 1 + }, + "fitting_net": { + "neuron": [ + 25, + 50, + 100 + ], + "resnet_dt": false, + "seed": 1 + } + }, + "learning_rate": { + "type": "exp", + "start_lr": 0.001, + "decay_steps": 100 + }, + "loss": { + "start_pref_e": 0.02, + "limit_pref_e": 2, + "start_pref_f": 1000, + "limit_pref_f": 1, + "start_pref_v": 0.0, + "limit_pref_v": 0.0 + }, + "training": { + "set_prefix": "set", + "numb_steps": 2000, + "batch_size": 1, + "disp_file": "lcurve.out", + "disp_freq": 1000, + "save_freq": 1000, + "save_ckpt": "model.ckpt", + "disp_training": true, + "time_training": true, + "profiling": false, + "profiling_file": "timeline.json", + "_comment2": "that's all" + } + }, + "model_devi_dt": 0.002, + "model_devi_skip": 0, + "model_devi_f_trust_lo": 0.05, + "model_devi_f_trust_hi": 0.15, + "model_devi_clean_traj": true, + "model_devi_jobs": [ + { + "sys_idx": [ + 0 + ], + "temps": [ + 100 + ], + "press": [ + 1.0 + ], + "trj_freq": 10, + "nsteps": 300, + "ensemble": "nvt", + "_idx": "00" + }, + { + "sys_idx": [ + 1 + ], + "temps": [ + 100 + ], + "press": [ + 1.0 + ], + "trj_freq": 10, + "nsteps": 3000, + "ensemble": "nvt", + "_idx": "01" + } + ], + "fp_style": "pwscf", + "user_fp_params": { + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 2, + "nat": 5, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 + }, + "shuffle_poscar": false, + "fp_task_max": 2000, + "fp_task_min": 5, + "fp_pp_path": "./CH4", + "fp_pp_files": [ + "C_ONCV_PBE_sr.upf", "H_ONCV_PBE_sr.upf" + ], + "_comment": " that's all " +} From 6e54cd04eb292868eff9c6088b1050633f950ce7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 19 Nov 2023 03:53:11 +0000 Subject: [PATCH 3/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dpgen/generator/arginfo.py | 13 +++-- .../dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf | 2 +- .../Al/param_al_all_gpu-deepmd-kit-2.x.json | 48 +++++++++--------- .../dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf | 2 +- .../dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf | 2 +- .../CH4/param_CH4_deepmd-kit-2.x.json | 49 ++++++++++--------- .../param_CH4_deepmd-kit-2.0.1.json | 49 ++++++++++--------- 7 files changed, 85 insertions(+), 80 deletions(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index afa9f6805..f35021145 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -789,6 +789,7 @@ def fp_style_cp2k_args() -> list[Argument]: ), ] + # amber/diff def fp_style_amber_diff_args() -> list[Argument]: """Arguments for FP style amber/diff. @@ -826,9 +827,11 @@ def fp_style_amber_diff_args() -> list[Argument]: ), ] + # pwscf def fp_style_pwscf_args() -> list[Argument]: """Arguments for FP style pwscf (Quantum Espresso). + Returns ------- list[dargs.Argument] @@ -837,7 +840,9 @@ def fp_style_pwscf_args() -> list[Argument]: doc_fp_pp_path = "Directory of psuedo-potential file to be used for 02.fp exists." doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map." doc_user_fp_params = "Parameters for pwscf calculation. Find details at https://www.quantum-espresso.org/Doc/INPUT_PW.html. When user_fp_params is set, the settings in fp_params will be ignored. kspacing must be set in user_fp_params. kspacing is the spacing between kpoints, and helps to determin KPOINTS in pwscf." - doc_fp_params = "Parameters for pwscf calculation. It has lower priority than user_fp_params." + doc_fp_params = ( + "Parameters for pwscf calculation. It has lower priority than user_fp_params." + ) doc_ecut = "ecutwfc in pwscf." doc_ediff = "conv_thr and ts_vdw_econv_thr in pwscf." doc_kspacing = "The spacing between kpoints. Helps to determin KPOINTS in pwscf." @@ -847,20 +852,18 @@ def fp_style_pwscf_args() -> list[Argument]: args = [ Argument("ecut", float, optional=False, doc=doc_ecut), Argument("ediff", float, optional=False, doc=doc_ediff), - Argument("smearing", str, optional=False, doc=doc_smearing), Argument("sigma", float, optional=False, doc=doc_sigma), ] return [ Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path), Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files), - Argument( - "fp_params", dict, args, [], optional=False, doc=doc_fp_params - ), + Argument("fp_params", dict, args, [], optional=False, doc=doc_fp_params), Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params), Argument("kspacing", float, optional=False, doc=doc_kspacing), ] + def fp_style_custom_args() -> list[Argument]: """Arguments for FP style custom. diff --git a/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf index 4ee609d65..e819ad123 100644 --- a/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf +++ b/examples/run/dp2.x-lammps-pwscf/Al/Al_ONCV_PBE_sr.upf @@ -1 +1 @@ -You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. diff --git a/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json b/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json index 3f5520789..535a81d4c 100644 --- a/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json +++ b/examples/run/dp2.x-lammps-pwscf/Al/param_al_all_gpu-deepmd-kit-2.x.json @@ -418,35 +418,35 @@ ], "fp_style": "pwscf", "user_fp_params": { - "control": { - "calculation": "scf", - "tprnfor": true, - "outdir": "./", - "disk_io": "none", - "pseudo_dir": "./" - }, - "system": { - "ecutwfc": 110, - "input_dft": "revpbe", - "edir": 1, - "emaxpos": 0.6, - "vdw_corr": "dft-d3", - "ntyp": 1, - "nat": 192, - "ibrav": 0 - }, - "electrons": { - "electron_maxstep": 1000, - "mixing_beta": 0.5 - }, - "kspacing": 999 + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 1, + "nat": 192, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 }, "shuffle_poscar": false, "fp_task_max": 2000, "fp_task_min": 5, "fp_pp_path": "./", "fp_pp_files": [ - "Al_ONCV_PBE_sr.upf" + "Al_ONCV_PBE_sr.upf" ], - "_comment": " that's all " + "_comment": " that's all " } diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf index 4ee609d65..e819ad123 100644 --- a/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf +++ b/examples/run/dp2.x-lammps-pwscf/CH4/H_ONCV_PBE_sr.upf @@ -1 +1 @@ -You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf b/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf index 4ee609d65..e819ad123 100644 --- a/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf +++ b/examples/run/dp2.x-lammps-pwscf/CH4/O_ONCV_PBE_sr.upf @@ -1 +1 @@ -You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. \ No newline at end of file +You may download the needed pseudopotential files online. An example is https://github.com/pipidog/ONCVPSP. diff --git a/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json b/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json index 338582c2e..103179a7b 100644 --- a/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json +++ b/examples/run/dp2.x-lammps-pwscf/CH4/param_CH4_deepmd-kit-2.x.json @@ -125,35 +125,36 @@ ], "fp_style": "pwscf", "user_fp_params": { - "control": { - "calculation": "scf", - "tprnfor": true, - "outdir": "./", - "disk_io": "none", - "pseudo_dir": "./" - }, - "system": { - "ecutwfc": 110, - "input_dft": "revpbe", - "edir": 1, - "emaxpos": 0.6, - "vdw_corr": "dft-d3", - "ntyp": 2, - "nat": 5, - "ibrav": 0 - }, - "electrons": { - "electron_maxstep": 1000, - "mixing_beta": 0.5 - }, - "kspacing": 999 + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 2, + "nat": 5, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 }, "shuffle_poscar": false, "fp_task_max": 2000, "fp_task_min": 5, "fp_pp_path": "./", "fp_pp_files": [ - "C_ONCV_PBE_sr.upf", "H_ONCV_PBE_sr.upf" + "C_ONCV_PBE_sr.upf", + "H_ONCV_PBE_sr.upf" ], - "_comment": " that's all " + "_comment": " that's all " } diff --git a/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json b/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json index 2d98fd713..4de2c3751 100644 --- a/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json +++ b/examples/run/dp2.x-lammps-pwscf/param_CH4_deepmd-kit-2.0.1.json @@ -122,35 +122,36 @@ ], "fp_style": "pwscf", "user_fp_params": { - "control": { - "calculation": "scf", - "tprnfor": true, - "outdir": "./", - "disk_io": "none", - "pseudo_dir": "./" - }, - "system": { - "ecutwfc": 110, - "input_dft": "revpbe", - "edir": 1, - "emaxpos": 0.6, - "vdw_corr": "dft-d3", - "ntyp": 2, - "nat": 5, - "ibrav": 0 - }, - "electrons": { - "electron_maxstep": 1000, - "mixing_beta": 0.5 - }, - "kspacing": 999 + "control": { + "calculation": "scf", + "tprnfor": true, + "outdir": "./", + "disk_io": "none", + "pseudo_dir": "./" + }, + "system": { + "ecutwfc": 110, + "input_dft": "revpbe", + "edir": 1, + "emaxpos": 0.6, + "vdw_corr": "dft-d3", + "ntyp": 2, + "nat": 5, + "ibrav": 0 + }, + "electrons": { + "electron_maxstep": 1000, + "mixing_beta": 0.5 + }, + "kspacing": 999 }, "shuffle_poscar": false, "fp_task_max": 2000, "fp_task_min": 5, "fp_pp_path": "./CH4", "fp_pp_files": [ - "C_ONCV_PBE_sr.upf", "H_ONCV_PBE_sr.upf" + "C_ONCV_PBE_sr.upf", + "H_ONCV_PBE_sr.upf" ], - "_comment": " that's all " + "_comment": " that's all " } From b70100c3f010f2e00d20aea7e8cf386418399335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yifan=20Li=E6=9D=8E=E4=B8=80=E5=B8=86?= Date: Sat, 18 Nov 2023 23:24:27 -0500 Subject: [PATCH 4/7] Update dpgen/generator/arginfo.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jinzhe Zeng Signed-off-by: Yifan Li李一帆 --- dpgen/generator/arginfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index f35021145..54767d9e2 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -920,7 +920,7 @@ def fp_style_variant_type_args() -> Variant: "amber/diff", dict, fp_style_amber_diff_args(), doc=doc_amber_diff ), Argument("pwmat", dict, [], doc="TODO: add doc"), - Argument("pwscf", dict, [], doc=fp_style_pwscf_args()), + Argument("pwscf", dict, fp_style_pwscf_args()), Argument("custom", dict, fp_style_custom_args(), doc=doc_custom), ], optional=False, From 0189b60faa46216ab92acb1d35c555239930d493 Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sun, 19 Nov 2023 00:06:15 -0500 Subject: [PATCH 5/7] add pwscf to test_check_examples --- tests/test_check_examples.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_check_examples.py b/tests/test_check_examples.py index 8522e8568..cbbae79b6 100644 --- a/tests/test_check_examples.py +++ b/tests/test_check_examples.py @@ -45,6 +45,10 @@ run_jdata, p_examples / "run" / "dp2.x-lammps-vasp" / "param_CH4_deepmd-kit-2.0.1.json", ), + ( + run_jdata, + p_examples / "run" / "dp2.x-lammps-pwscf" / "param_CH4_deepmd-kit-2.0.1.json", + ), ( run_jdata, p_examples / "run" / "dp2.x-lammps-cp2k" / "param_CH4_deepmd-kit-2.0.1.json", @@ -66,6 +70,22 @@ / "Al" / "param_al_all_gpu-deepmd-kit-2.x.json", ), + ( + run_jdata, + p_examples + / "run" + / "dp2.x-lammps-pwscf" + / "CH4" + / "param_CH4_deepmd-kit-2.x.json", + ), + ( + run_jdata, + p_examples + / "run" + / "dp2.x-lammps-pwscf" + / "Al" + / "param_al_all_gpu-deepmd-kit-2.x.json", + ), (run_jdata, p_examples / "run" / "dp2.x-lammps-vasp-et" / "param_elet.json"), ( run_jdata, From 8dfad9fee178e931bd38bc2ec75ce4468b354e7a Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sun, 19 Nov 2023 00:14:33 -0500 Subject: [PATCH 6/7] set fp_params optional for pwscf --- dpgen/generator/arginfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 54767d9e2..4cda1577d 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -858,7 +858,7 @@ def fp_style_pwscf_args() -> list[Argument]: return [ Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path), Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files), - Argument("fp_params", dict, args, [], optional=False, doc=doc_fp_params), + Argument("fp_params", dict, args, [], optional=True, doc=doc_fp_params), Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params), Argument("kspacing", float, optional=False, doc=doc_kspacing), ] From 0867e558d8bb0fb058e1658964caf12ea6162e5c Mon Sep 17 00:00:00 2001 From: Yifan Li Date: Sun, 19 Nov 2023 00:20:07 -0500 Subject: [PATCH 7/7] correct kspacing setting for pwscf --- dpgen/generator/arginfo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dpgen/generator/arginfo.py b/dpgen/generator/arginfo.py index 4cda1577d..70167e4b4 100644 --- a/dpgen/generator/arginfo.py +++ b/dpgen/generator/arginfo.py @@ -839,7 +839,7 @@ def fp_style_pwscf_args() -> list[Argument]: """ doc_fp_pp_path = "Directory of psuedo-potential file to be used for 02.fp exists." doc_fp_pp_files = "Psuedo-potential file to be used for 02.fp. Note that the order of elements should correspond to the order in type_map." - doc_user_fp_params = "Parameters for pwscf calculation. Find details at https://www.quantum-espresso.org/Doc/INPUT_PW.html. When user_fp_params is set, the settings in fp_params will be ignored. kspacing must be set in user_fp_params. kspacing is the spacing between kpoints, and helps to determin KPOINTS in pwscf." + doc_user_fp_params = "Parameters for pwscf calculation. Find details at https://www.quantum-espresso.org/Doc/INPUT_PW.html. When user_fp_params is set, the settings in fp_params will be ignored. If one wants to use user_fp_params, kspacing must be set in user_fp_params. kspacing is the spacing between kpoints, and helps to determin KPOINTS in pwscf." doc_fp_params = ( "Parameters for pwscf calculation. It has lower priority than user_fp_params." ) @@ -854,13 +854,13 @@ def fp_style_pwscf_args() -> list[Argument]: Argument("ediff", float, optional=False, doc=doc_ediff), Argument("smearing", str, optional=False, doc=doc_smearing), Argument("sigma", float, optional=False, doc=doc_sigma), + Argument("kspacing", float, optional=False, doc=doc_kspacing), ] return [ Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path), Argument("fp_pp_files", list[str], optional=False, doc=doc_fp_pp_files), Argument("fp_params", dict, args, [], optional=True, doc=doc_fp_params), Argument("user_fp_params", dict, optional=True, doc=doc_user_fp_params), - Argument("kspacing", float, optional=False, doc=doc_kspacing), ]