dpgen.auto_test package
Subpackages
- dpgen.auto_test.lib package
- Submodules
- dpgen.auto_test.lib.BatchJob module
- dpgen.auto_test.lib.RemoteJob module
- dpgen.auto_test.lib.SlurmJob module
- dpgen.auto_test.lib.abacus module
- dpgen.auto_test.lib.crys module
- dpgen.auto_test.lib.lammps module
- dpgen.auto_test.lib.lmp module
- dpgen.auto_test.lib.mfp_eosfit module
- 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
Submodules
dpgen.auto_test.ABACUS module
- class dpgen.auto_test.ABACUS.ABACUS(inter_parameter, path_to_poscar)[source]
Bases:
Task
Methods
backward_files
([property_type])staticmethod(function) -> method
compute
(output_dir)Compute output of the task.
forward_common_files
([property_type])staticmethod(function) -> method
forward_files
([property_type])staticmethod(function) -> method
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
- backward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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] }
- forward_common_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- forward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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_parame: dict
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.
- Outputs
- ——-
- 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:
Property
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'....
- 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.
- refine: str
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:
Property
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'....
- 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.
- refine: str
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:
Property
Calculation 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.
- refine: str
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:
Property
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'....
- 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.
- refine: str
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:
Task
Methods
backward_files
([property_type])staticmethod(function) -> method
compute
(output_dir)Compute output of the task.
forward_common_files
([property_type])staticmethod(function) -> method
forward_files
([property_type])staticmethod(function) -> method
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
- backward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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] }
- forward_common_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- forward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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_parame: dict
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.
- Outputs
- ——-
- 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_param
Return the parameter of each computational task, for example, {‘ediffg’: 1e-4}
task_type
Return 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.
- refine: str
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:
Property
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'....
- 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.
- refine: str
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_files
staticmethod(function) -> method
forward_common_files
staticmethod(function) -> method
forward_files
staticmethod(function) -> method
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
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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] }
- abstract property forward_common_files
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- abstract property forward_files
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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_parame: dict
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.
- Outputs
- ——-
- 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:
Task
Methods
backward_files
([property_type])staticmethod(function) -> method
compute
(output_dir)Compute output of the task.
forward_common_files
([property_type])staticmethod(function) -> method
forward_files
([property_type])staticmethod(function) -> method
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.
- backward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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] }
- forward_common_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- forward_files(property_type='relaxation')[source]
staticmethod(function) -> method
Convert a function to be a static method.
A static method does not receive an implicit first argument. To declare a static method, use this idiom:
- class C:
@staticmethod def f(arg1, arg2, …):
…
It can be called either on the class (e.g. C.f()) or on an instance (e.g. C().f()). The instance is ignored except for its class.
Static methods in Python are similar to those found in Java or C++. For a more advanced concept, see the classmethod builtin.
- 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_parame: dict
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.
- Outputs
- ——-
- 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:
Property
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'....
- 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.
- refine: str
To refine existing property confs or generate property confs from a equilibrated conf
- Returns
- task_list: list of str
The list of task directories.