dpgen.auto_test package#
Subpackages#
- dpgen.auto_test.lib package
- Submodules
- dpgen.auto_test.lib.abacus module
- dpgen.auto_test.lib.crys module
- dpgen.auto_test.lib.lammps module
apply_type_map()check_finished()check_finished_new()cvt_lammps_conf()element_list()get_base_area()get_nev()get_stress()inter_deepmd()inter_eam_alloy()inter_eam_fs()inter_meam()make_lammps_elastic()make_lammps_equi()make_lammps_eval()make_lammps_phonon()make_lammps_press_relax()poscar_from_last_dump()
- dpgen.auto_test.lib.lmp module
- dpgen.auto_test.lib.mfp_eosfit module
BM4()BM5()LOG4()LOG5()Li4p()SJX_5p()SJX_v2()TEOS()birch()calc_props_BM4()calc_props_LOG4()calc_props_SJX_5p()calc_props_mBM4()calc_props_mBM4poly()calc_props_mBM5poly()calc_props_morse()calc_props_morse_6p()calc_props_vinet()calc_v0_mBM4poly()calc_v0_mBM5poly()ext_splint()ext_vec()ext_velp()get_eos_list()get_eos_list_3p()get_eos_list_4p()get_eos_list_5p()get_eos_list_6p()init_guess()lsqfit_eos()mBM4()mBM4poly()mBM5()mBM5poly()mie()mie_simple()morse()morse_3p()morse_6p()morse_AB()murnaghan()parse_argument()rBM4()rBM4_pv()rBM5()rBM5_pv()rPT4()rPT4_pv()rPT5()rPT5_pv()read_ve()read_velp()read_vlp()repro_ve()repro_vp()res_BM4()res_BM5()res_LOG4()res_LOG5()res_Li4p()res_SJX_5p()res_SJX_v2()res_TEOS()res_birch()res_mBM4()res_mBM4poly()res_mBM5()res_mBM5poly()res_mie()res_mie_simple()res_morse()res_morse_3p()res_morse_6p()res_morse_AB()res_murnaghan()res_rBM4()res_rBM4_pv()res_rBM5()res_rBM5_pv()res_rPT4()res_rPT4_pv()res_rPT5()res_rPT5_pv()res_universal()res_vinet()res_vinet_pv()universal()vinet()vinet_pv()
- dpgen.auto_test.lib.pwscf module
- dpgen.auto_test.lib.siesta module
- dpgen.auto_test.lib.util module
- dpgen.auto_test.lib.utils module
- dpgen.auto_test.lib.vasp module
OutcarItemErrorcheck_finished()get_boxes()get_energies()get_nev()get_poscar_natoms()get_poscar_types()get_stress()make_kspacing_kpoints()make_vasp_kpoints()make_vasp_kpoints_from_incar()make_vasp_phonon_incar()make_vasp_relax_incar()make_vasp_static_incar()perturb_xz()poscar_natoms()poscar_scale()poscar_vol()reciprocal_box()regulate_poscar()sort_poscar()
Submodules#
dpgen.auto_test.ABACUS module#
- class dpgen.auto_test.ABACUS.ABACUS(inter_parameter, path_to_poscar)[source]#
Bases:
TaskMethods
backward_files([property_type])Return backward files.
compute(output_dir)Compute output of the task.
forward_common_files([property_type])Return forward common files.
forward_files([property_type])Return forward files.
make_input_file(output_dir, task_type, ...)Prepare input files for a computational task For example, the VASP prepares INCAR.
make_potential_files(output_dir)Prepare potential files for a computational task.
modify_input
- compute(output_dir)[source]#
Compute output of the task. IMPORTANT: The output configuration should be converted and stored in a CONTCAR file.
- Parameters:
- output_dirstr
The directory storing the input and output files.
- Returns:
- result_dict: dict
A dict that storing the result. For example: { “energy”: xxx, “force”: [xxx] }
Notes
The following files are generated: CONTCAR: output file
The output configuration is converted to CONTCAR and stored in the output_dir
- make_input_file(output_dir, task_type, task_param)[source]#
Prepare input files for a computational task For example, the VASP prepares INCAR. LAMMPS (including DeePMD, MEAM…) prepares in.lammps.
- Parameters:
- output_dirstr
The directory storing the input files.
- task_typestr
Can be - “relaxation:”: structure relaxation - “static”: static computation calculates the energy, force… of a strcture
- task_paramdict
The parameters of the task. For example the VASP interaction can be provided with { “ediff”: 1e-6, “ediffg”: 1e-5 }
- make_potential_files(output_dir)[source]#
Prepare potential files for a computational task. For example, the VASP prepares POTCAR. DeePMD prepares frozen model(s). IMPORTANT: Interaction should be stored in output_dir/inter.json.
- Parameters:
- output_dirstr
The directory storing the potential files.
Notes
The following files are generated:
- inter.json: output file
The task information is stored in output_dir/inter.json
dpgen.auto_test.EOS module#
- class dpgen.auto_test.EOS.EOS(parameter, inter_param=None)[source]#
Bases:
PropertyMethods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
dpgen.auto_test.Elastic module#
- class dpgen.auto_test.Elastic.Elastic(parameter, inter_param=None)[source]#
Bases:
PropertyMethods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
dpgen.auto_test.Gamma module#
- class dpgen.auto_test.Gamma.Gamma(parameter, inter_param=None)[source]#
Bases:
PropertyCalculation of common gamma lines for bcc and fcc.
Methods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
centralize_slab
return_direction
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
dpgen.auto_test.Interstitial module#
- class dpgen.auto_test.Interstitial.Interstitial(parameter, inter_param=None)[source]#
Bases:
PropertyMethods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
dpgen.auto_test.Lammps module#
- class dpgen.auto_test.Lammps.Lammps(inter_parameter, path_to_poscar)[source]#
Bases:
TaskMethods
backward_files([property_type])Return backward files.
compute(output_dir)Compute output of the task.
forward_common_files([property_type])Return forward common files.
forward_files([property_type])Return forward files.
make_input_file(output_dir, task_type, ...)Prepare input files for a computational task For example, the VASP prepares INCAR.
make_potential_files(output_dir)Prepare potential files for a computational task.
set_inter_type_func
set_model_param
- compute(output_dir)[source]#
Compute output of the task. IMPORTANT: The output configuration should be converted and stored in a CONTCAR file.
- Parameters:
- output_dirstr
The directory storing the input and output files.
- Returns:
- result_dict: dict
A dict that storing the result. For example: { “energy”: xxx, “force”: [xxx] }
Notes
The following files are generated: CONTCAR: output file
The output configuration is converted to CONTCAR and stored in the output_dir
- make_input_file(output_dir, task_type, task_param)[source]#
Prepare input files for a computational task For example, the VASP prepares INCAR. LAMMPS (including DeePMD, MEAM…) prepares in.lammps.
- Parameters:
- output_dirstr
The directory storing the input files.
- task_typestr
Can be - “relaxation:”: structure relaxation - “static”: static computation calculates the energy, force… of a strcture
- task_paramdict
The parameters of the task. For example the VASP interaction can be provided with { “ediff”: 1e-6, “ediffg”: 1e-5 }
- make_potential_files(output_dir)[source]#
Prepare potential files for a computational task. For example, the VASP prepares POTCAR. DeePMD prepares frozen model(s). IMPORTANT: Interaction should be stored in output_dir/inter.json.
- Parameters:
- output_dirstr
The directory storing the potential files.
Notes
The following files are generated:
- inter.json: output file
The task information is stored in output_dir/inter.json
dpgen.auto_test.Property module#
- class dpgen.auto_test.Property.Property(parameter)[source]#
Bases:
ABC- Attributes:
task_paramReturn the parameter of each computational task, for example, {‘ediffg’: 1e-4}.
task_typeReturn the type of each computational task, for example, ‘relaxation’, ‘static’….
Methods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
- compute(output_file, print_file, path_to_work)[source]#
Postprocess the finished tasks to compute the property. Output the result to a json database.
- Parameters:
- output_file:
The file to output the property in json format
- print_file:
The file to output the property in txt format
- path_to_work:
The working directory where the computational tasks locate.
- abstract make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
- abstract property task_param#
Return the parameter of each computational task, for example, {‘ediffg’: 1e-4}.
- abstract property task_type#
Return the type of each computational task, for example, ‘relaxation’, ‘static’….
dpgen.auto_test.Surface module#
- class dpgen.auto_test.Surface.Surface(parameter, inter_param=None)[source]#
Bases:
PropertyMethods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.
dpgen.auto_test.Task module#
- class dpgen.auto_test.Task.Task(inter_parameter, path_to_poscar)[source]#
Bases:
ABC- Attributes:
backward_filesReturn backward files.
forward_common_filesReturn forward common files.
forward_filesReturn forward files.
Methods
compute(output_dir)Compute output of the task.
make_input_file(output_dir, task_type, ...)Prepare input files for a computational task For example, the VASP prepares INCAR.
make_potential_files(output_dir)Prepare potential files for a computational task.
- abstract property backward_files#
Return backward files.
- abstract compute(output_dir)[source]#
Compute output of the task. IMPORTANT: The output configuration should be converted and stored in a CONTCAR file.
- Parameters:
- output_dirstr
The directory storing the input and output files.
- Returns:
- result_dict: dict
A dict that storing the result. For example: { “energy”: xxx, “force”: [xxx] }
Notes
The following files are generated: CONTCAR: output file
The output configuration is converted to CONTCAR and stored in the output_dir
- abstract property forward_common_files#
Return forward common files.
- abstract property forward_files#
Return forward files.
- abstract make_input_file(output_dir, task_type, task_param)[source]#
Prepare input files for a computational task For example, the VASP prepares INCAR. LAMMPS (including DeePMD, MEAM…) prepares in.lammps.
- Parameters:
- output_dirstr
The directory storing the input files.
- task_typestr
Can be - “relaxation:”: structure relaxation - “static”: static computation calculates the energy, force… of a strcture
- task_paramdict
The parameters of the task. For example the VASP interaction can be provided with { “ediff”: 1e-6, “ediffg”: 1e-5 }
- abstract make_potential_files(output_dir)[source]#
Prepare potential files for a computational task. For example, the VASP prepares POTCAR. DeePMD prepares frozen model(s). IMPORTANT: Interaction should be stored in output_dir/inter.json.
- Parameters:
- output_dirstr
The directory storing the potential files.
Notes
The following files are generated:
- inter.json: output file
The task information is stored in output_dir/inter.json
dpgen.auto_test.VASP module#
- class dpgen.auto_test.VASP.VASP(inter_parameter, path_to_poscar)[source]#
Bases:
TaskMethods
backward_files([property_type])Return backward files.
compute(output_dir)Compute output of the task.
forward_common_files([property_type])Return forward common files.
forward_files([property_type])Return forward files.
make_input_file(output_dir, task_type, ...)Prepare input files for a computational task For example, the VASP prepares INCAR.
make_potential_files(output_dir)Prepare potential files for a computational task.
- compute(output_dir)[source]#
Compute output of the task. IMPORTANT: The output configuration should be converted and stored in a CONTCAR file.
- Parameters:
- output_dirstr
The directory storing the input and output files.
- Returns:
- result_dict: dict
A dict that storing the result. For example: { “energy”: xxx, “force”: [xxx] }
Notes
The following files are generated: CONTCAR: output file
The output configuration is converted to CONTCAR and stored in the output_dir
- make_input_file(output_dir, task_type, task_param)[source]#
Prepare input files for a computational task For example, the VASP prepares INCAR. LAMMPS (including DeePMD, MEAM…) prepares in.lammps.
- Parameters:
- output_dirstr
The directory storing the input files.
- task_typestr
Can be - “relaxation:”: structure relaxation - “static”: static computation calculates the energy, force… of a strcture
- task_paramdict
The parameters of the task. For example the VASP interaction can be provided with { “ediff”: 1e-6, “ediffg”: 1e-5 }
- make_potential_files(output_dir)[source]#
Prepare potential files for a computational task. For example, the VASP prepares POTCAR. DeePMD prepares frozen model(s). IMPORTANT: Interaction should be stored in output_dir/inter.json.
- Parameters:
- output_dirstr
The directory storing the potential files.
Notes
The following files are generated:
- inter.json: output file
The task information is stored in output_dir/inter.json
dpgen.auto_test.Vacancy module#
- class dpgen.auto_test.Vacancy.Vacancy(parameter, inter_param=None)[source]#
Bases:
PropertyMethods
compute(output_file, print_file, path_to_work)Postprocess the finished tasks to compute the property.
make_confs(path_to_work, path_to_equi[, refine])Make configurations needed to compute the property.
post_process(task_list)post_process the KPOINTS file in elastic.
Return the parameter of each computational task, for example, {'ediffg': 1e-4}.
Return the type of each computational task, for example, 'relaxation', 'static'....
- make_confs(path_to_work, path_to_equi, refine=False)[source]#
Make configurations needed to compute the property. The tasks directory will be named as path_to_work/task.xxxxxx IMPORTANT: handel the case when the directory exists.
- Parameters:
- path_to_workstr
The path where the tasks for the property are located
- path_to_equistr
-refine == False: The path to the directory that equilibrated the configuration. -refine == True: The path to the directory that has property confs.
- refinestr
To refine existing property confs or generate property confs from a equilibrated conf
- Returns:
- task_list: list of str
The list of task directories.