Skip to content

update run/dp2.x-lammps-cp2k example #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions dpgen/generator/arginfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def fp_style_vasp_args() -> List[Argument]:
doc_fp_incar = 'Input file for VASP. INCAR must specify KSPACING and KGAMMA.'
doc_fp_aniso_kspacing = 'Set anisotropic kspacing. Usually useful for 1-D or 2-D materials. Only support VASP. If it is setting the KSPACING key in INCAR will be ignored.'
doc_cvasp = 'If cvasp is true, DP-GEN will use Custodian to help control VASP calculation.'
doc_ratio_failed = 'Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised.'

return [
Argument("fp_pp_path", str, optional=False, doc=doc_fp_pp_path),
Expand All @@ -226,6 +227,8 @@ def fp_style_vasp_args() -> List[Argument]:
Argument("fp_aniso_kspacing", list, optional=True,
doc=doc_fp_aniso_kspacing),
Argument("cvasp", bool, optional=True, doc=doc_cvasp),
Argument("ratio_failed", float, optional=True,
doc=doc_ratio_failed),
]

# abacus
Expand Down Expand Up @@ -342,12 +345,15 @@ def fp_style_siesta_args() -> List[Argument]:
def fp_style_cp2k_args() -> List[Argument]:
doc_user_fp_params = 'Parameters for cp2k calculation. find detail in manual.cp2k.org. only the kind section must be set before use. we assume that you have basic knowledge for cp2k input.'
doc_external_input_path = 'Conflict with key:user_fp_params, use the template input provided by user, some rules should be followed, read the following text in detail.'
doc_ratio_failed = 'Check the ratio of unsuccessfully terminated jobs. If too many FP tasks are not converged, RuntimeError will be raised.'

return [
Argument("user_fp_params", dict, optional=False,
Argument("user_fp_params", dict, optional=True,
doc=doc_user_fp_params),
Argument("external_input_path", str, optional=False,
Argument("external_input_path", str, optional=True,
doc=doc_external_input_path),
Argument("ratio_failed", float, optional=True,
doc=doc_ratio_failed),
]


Expand Down
144 changes: 144 additions & 0 deletions examples/run/dp2.x-lammps-cp2k/param_CH4_deepmd-kit-2.0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"type_map": [
"H",
"C"
],
"mass_map": [
1,
12
],
"init_data_prefix": "./data",
"init_data_sys": [
"deepmd"
],
"sys_configs": [
[
"./data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00000*/POSCAR"
],
[
"./data/CH4.POSCAR.01x01x01/01.scale_pert/sys-0004-0001/scale-1.000/00001*/POSCAR"
]
],
"_comment": " 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": [
25,
50,
100
],
"resnet_dt": true,
"axis_neuron": 12,
"seed": 1
},
"fitting_net": {
"neuron": [
120,
120,
120
],
"resnet_dt": false,
"seed": 1
}
},
"learning_rate": {
"type": "exp",
"start_lr": 0.001,
"decay_steps": 200
},
"loss": {
"start_pref_e": 0.02,
"limit_pref_e": 1,
"start_pref_f": 1000,
"limit_pref_f": 1,
"start_pref_v": 0.0,
"limit_pref_v": 0.0
},
"training": {
"_set_prefix": "set",
"stop_batch": 40000,
"_batch_size": 1,
"disp_file": "lcurve.out",
"disp_freq": 1000,
"numb_test": 4,
"save_freq": 1000,
"save_ckpt": "model.ckpt",
"disp_training": true,
"time_training": true,
"profiling": false,
"profiling_file": "timeline.json",
"_comment": "that's all"
}
},
"model_devi_dt": 0.002,
"model_devi_skip": 0,
"model_devi_f_trust_lo": 0.02,
"model_devi_f_trust_hi": 0.15,
"model_devi_clean_traj": true,
"model_devi_jobs": [
{
"sys_idx": [
0
],
"temps": [
100
],
"press": [
1
],
"trj_freq": 10,
"nsteps": 2000,
"ensemble": "nvt",
"_idx": "00"
},
{
"sys_idx": [
1
],
"temps": [
100
],
"press": [
1
],
"trj_freq": 10,
"nsteps": 5000,
"ensemble": "nvt",
"_idx": "01"
}

],
"ratio_failed": 0.20,
"fp_style": "cp2k",
"shuffle_poscar": false,
"fp_task_max": 30,
"fp_task_min": 1,
"user_fp_params": {
"FORCE_EVAL":{
"DFT":{
"BASIS_SET_FILE_NAME": "BASIS_MOLOPT",
"POTENTIAL_FILE_NAME": "GTH_POTENTIALS"
},
"SUBSYS":{
"KIND":{
"_": ["C","H"],
"POTENTIAL": ["GTH-PBE-q4", "GTH-PBE-q1"],
"BASIS_SET": ["DZVP-MOLOPT-GTH","DZVP-MOLOPT-GTH"]
}
}
}
}
}
1 change: 1 addition & 0 deletions tests/test_check_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
(init_reaction_jdata, p_examples / "init" / "reaction.json"),
(simplify_jdata, p_examples / "simplify" / "qm7.json"),
(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-cp2k" / "param_CH4_deepmd-kit-2.0.1.json"),
#(run_jdata, p_examples / "run" / "dp2.x-gromacs-gaussian" / "param.json"),
(run_jdata, p_examples / "run" / "dp1.x-lammps-vasp" / "CH4" / "param_CH4_deepmd-kit-1.1.0.json"),
(run_jdata, p_examples / "run" / "dp1.x-lammps-vasp" / "Al" / "param_al_all_gpu-deepmd-kit-1.1.0.json"),
Expand Down