dpgen.auto_test.lib package

Submodules

dpgen.auto_test.lib.BatchJob module

class dpgen.auto_test.lib.BatchJob.BatchJob(job_dir='', job_script='', job_finish_tag='tag_finished', job_id_file='tag_jobid')[source]

Bases: object

Abstract class of a batch job It submit a job (leave the id in file tag_jobid) It check the status of the job (return JobStatus) NOTICE: I assume that when a job finishes, a tag file named tag_finished should be touched by the user. TYPICAL USAGE: job = DERIVED_BatchJob (dir, script) job.submit () stat = job.check_status ()

check_status()[source]
get_job_id()[source]
submit()[source]
submit_command()[source]

submission is $ [command] [script]

class dpgen.auto_test.lib.BatchJob.JobStatus(value)[source]

Bases: Enum

An enumeration.

finished = 5
running = 3
terminated = 4
unknow = 100
unsubmitted = 1
waiting = 2

dpgen.auto_test.lib.RemoteJob module

class dpgen.auto_test.lib.RemoteJob.CloudMachineJob(ssh_session, local_root)[source]

Bases: RemoteJob

check_status()[source]
submit(job_dirs, cmd, args=None, resources=None)[source]
class dpgen.auto_test.lib.RemoteJob.JobStatus(value)[source]

Bases: Enum

An enumeration.

finished = 5
running = 3
terminated = 4
unknow = 100
unsubmitted = 1
waiting = 2
class dpgen.auto_test.lib.RemoteJob.PBSJob(ssh_session, local_root)[source]

Bases: RemoteJob

check_status()[source]
submit(job_dirs, cmd, args=None, resources=None)[source]
class dpgen.auto_test.lib.RemoteJob.RemoteJob(ssh_session, local_root)[source]

Bases: object

block_call(cmd)[source]
block_checkcall(cmd)[source]
clean()[source]
download(job_dirs, remote_down_files)[source]
get_job_root()[source]
upload(job_dirs, local_up_files, dereference=True)[source]
class dpgen.auto_test.lib.RemoteJob.SSHSession(jdata)[source]

Bases: object

close()[source]
get_session_root()[source]
get_ssh_client()[source]
class dpgen.auto_test.lib.RemoteJob.SlurmJob(ssh_session, local_root)[source]

Bases: RemoteJob

check_status()[source]
submit(job_dirs, cmd, args=None, resources=None)[source]

dpgen.auto_test.lib.SlurmJob module

class dpgen.auto_test.lib.SlurmJob.SlurmJob(job_dir='', job_script='', job_finish_tag='tag_finished', job_id_file='tag_jobid')[source]

Bases: BatchJob

check_status()[source]
submit_command()[source]

submission is $ [command] [script]

dpgen.auto_test.lib.crys module

dpgen.auto_test.lib.crys.bcc(ele_name='ele', a=3.2144871302356037)[source]
dpgen.auto_test.lib.crys.dhcp(ele_name='ele', a=2.863782463805517, c=9.353074360871936)[source]
dpgen.auto_test.lib.crys.diamond(ele_name='ele', a=2.551340126037118)[source]
dpgen.auto_test.lib.crys.fcc(ele_name='ele', a=4.05)[source]
dpgen.auto_test.lib.crys.fcc1(ele_name='ele', a=4.05)[source]
dpgen.auto_test.lib.crys.hcp(ele_name='ele', a=2.863782463805517, c=4.676537180435968)[source]
dpgen.auto_test.lib.crys.sc(ele_name='ele', a=2.551340126037118)[source]

dpgen.auto_test.lib.lammps module

dpgen.auto_test.lib.lammps.apply_type_map(conf_file, deepmd_type_map, ptypes)[source]

apply type map. conf_file: conf file converted from POSCAR deepmd_type_map: deepmd atom type map ptypes: atom types defined in POSCAR

dpgen.auto_test.lib.lammps.check_finished(fname)[source]
dpgen.auto_test.lib.lammps.check_finished_new(fname, keyword)[source]
dpgen.auto_test.lib.lammps.cvt_lammps_conf(fin, fout, type_map, ofmt='lammps/data')[source]

Format convert from fin to fout, specify the output format by ofmt Imcomplete situation

dpgen.auto_test.lib.lammps.element_list(type_map)[source]
dpgen.auto_test.lib.lammps.get_base_area(log)[source]

get base area

dpgen.auto_test.lib.lammps.get_nev(log)[source]

get natoms, energy_per_atom and volume_per_atom from lammps log

dpgen.auto_test.lib.lammps.get_stress(log)[source]

get stress from lammps log

dpgen.auto_test.lib.lammps.inter_deepmd(param)[source]
dpgen.auto_test.lib.lammps.inter_eam_alloy(param)[source]
dpgen.auto_test.lib.lammps.inter_eam_fs(param)[source]
dpgen.auto_test.lib.lammps.inter_meam(param)[source]
dpgen.auto_test.lib.lammps.make_lammps_elastic(conf, type_map, interaction, param, etol=0, ftol=1e-10, maxiter=5000, maxeval=500000)[source]
dpgen.auto_test.lib.lammps.make_lammps_equi(conf, type_map, interaction, param, etol=0, ftol=1e-10, maxiter=5000, maxeval=500000, change_box=True)[source]
dpgen.auto_test.lib.lammps.make_lammps_eval(conf, type_map, interaction, param)[source]
dpgen.auto_test.lib.lammps.make_lammps_phonon(conf, masses, interaction, param, etol=0, ftol=1e-10, maxiter=5000, maxeval=500000)[source]

make lammps input for elastic calculation

dpgen.auto_test.lib.lammps.make_lammps_press_relax(conf, type_map, scale2equi, interaction, param, B0=70, bp=0, etol=0, ftol=1e-10, maxiter=5000, maxeval=500000)[source]
dpgen.auto_test.lib.lammps.poscar_from_last_dump(dump, poscar_out, deepmd_type_map)[source]

get poscar from the last frame of a lammps MD traj (dump format)

dpgen.auto_test.lib.lmp module

dpgen.auto_test.lib.lmp.box2lmpbox(orig, box)[source]
dpgen.auto_test.lib.lmp.from_system_data(system)[source]
dpgen.auto_test.lib.lmp.get_atoms(lines)[source]
dpgen.auto_test.lib.lmp.get_atype(lines)[source]
dpgen.auto_test.lib.lmp.get_lmpbox(lines)[source]
dpgen.auto_test.lib.lmp.get_natoms(lines)[source]
dpgen.auto_test.lib.lmp.get_natoms_vec(lines)[source]
dpgen.auto_test.lib.lmp.get_natomtypes(lines)[source]
dpgen.auto_test.lib.lmp.get_posi(lines)[source]
dpgen.auto_test.lib.lmp.lmpbox2box(lohi, tilt)[source]
dpgen.auto_test.lib.lmp.system_data(lines)[source]
dpgen.auto_test.lib.lmp.to_system_data(lines)[source]

dpgen.auto_test.lib.mfp_eosfit module

dpgen.auto_test.lib.mfp_eosfit.BM4(vol, pars)[source]

Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order

dpgen.auto_test.lib.mfp_eosfit.BM5(vol, pars)[source]

Birch-Murnaghan 5 pars equation from PRB 70, 224107, 4-Order

dpgen.auto_test.lib.mfp_eosfit.LOG4(vol, pars)[source]

Natrual strain (Poirier-Tarantola)EOS with 4 paramters Seems only work in near-equillibrium range.

dpgen.auto_test.lib.mfp_eosfit.LOG5(vol, parameters)[source]

Natrual strain (Poirier-Tarantola)EOS with 5 paramters

dpgen.auto_test.lib.mfp_eosfit.Li4p(V, parameters)[source]

Li JH, APL, 87, 194111 (2005)

dpgen.auto_test.lib.mfp_eosfit.SJX_5p(vol, par)[source]

SJX_5p’s five parameters EOS, Physica B: Condens Mater, 2011, 406: 1276-1282

dpgen.auto_test.lib.mfp_eosfit.SJX_v2(vol, par)[source]

Sun Jiuxun, et al. J phys Chem Solids, 2005, 66: 773-782. They said it is satified for the limiting condition at high pressure.

dpgen.auto_test.lib.mfp_eosfit.TEOS(v, par)[source]

Holland, et al, Journal of Metamorphic Geology, 2011, 29(3): 333-383 Modified Tait equation of Huang & Chow

dpgen.auto_test.lib.mfp_eosfit.birch(v, parameters)[source]

From Intermetallic compounds: Principles and Practice, Vol. I: Princples Chapter 9 pages 195-210 by M. Mehl. B. Klein, D. Papaconstantopoulos paper downloaded from Web

case where n=0

dpgen.auto_test.lib.mfp_eosfit.calc_props_BM4(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_LOG4(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_SJX_5p(par)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_mBM4(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_mBM4poly(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_mBM5poly(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_morse(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_morse_6p(par)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_props_vinet(pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_v0_mBM4poly(x, pars)[source]
dpgen.auto_test.lib.mfp_eosfit.calc_v0_mBM5poly(x, pars)[source]
dpgen.auto_test.lib.mfp_eosfit.ext_splint(xp, yp, order=3, method='unispl')[source]
dpgen.auto_test.lib.mfp_eosfit.ext_vec(func, fin, p0, fs, fe, vols=None, vole=None, ndata=101, refit=0, show_fig=False)[source]

extrapolate the data points for E-V based on the fitted parameters in small or very large volume range.

dpgen.auto_test.lib.mfp_eosfit.ext_velp(fin, fstart, fend, vols, vole, ndata, order=3, method='unispl', fout='ext_velp.dat', show_fig=False)[source]

extrapolate the lattice parameters based on input data

dpgen.auto_test.lib.mfp_eosfit.get_eos_list()[source]
dpgen.auto_test.lib.mfp_eosfit.get_eos_list_3p()[source]
dpgen.auto_test.lib.mfp_eosfit.get_eos_list_4p()[source]
dpgen.auto_test.lib.mfp_eosfit.get_eos_list_5p()[source]
dpgen.auto_test.lib.mfp_eosfit.get_eos_list_6p()[source]
dpgen.auto_test.lib.mfp_eosfit.init_guess(fin)[source]
dpgen.auto_test.lib.mfp_eosfit.lsqfit_eos(func, fin, par, fstart, fend, show_fig=False, fout='EoSfit.out', refit=- 1)[source]
dpgen.auto_test.lib.mfp_eosfit.mBM4(vol, pars)[source]

Birch-Murnaghan 4 pars equation from PRB 70, 224107, 3-order BM

dpgen.auto_test.lib.mfp_eosfit.mBM4poly(vol, parameters)[source]

modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions.

dpgen.auto_test.lib.mfp_eosfit.mBM5(vol, pars)[source]

modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048

dpgen.auto_test.lib.mfp_eosfit.mBM5poly(vol, pars)[source]

modified BM5 EOS, Shang SL comput mater sci, 2010: 1040-1048, original expressions.

dpgen.auto_test.lib.mfp_eosfit.mie(v, p)[source]

Mie model for song’s FVT

dpgen.auto_test.lib.mfp_eosfit.mie_simple(v, p)[source]

Mie_simple model for song’s FVT

dpgen.auto_test.lib.mfp_eosfit.morse(v, pars)[source]

Reproduce from ShunliShang’s matlab script.

dpgen.auto_test.lib.mfp_eosfit.morse_3p(volume, p)[source]

morse_AB EOS formula from Song’s FVT souces A= 0.5*B

dpgen.auto_test.lib.mfp_eosfit.morse_6p(vol, par)[source]

Generalized Morse EOS proposed by Qin, see: Qin et al. Phys Rev B, 2008, 78, 214108. Qin et al. Phys Rev B, 2008, 77, 220103(R).

dpgen.auto_test.lib.mfp_eosfit.morse_AB(volume, p)[source]

morse_AB EOS formula from Song’s FVT souces

dpgen.auto_test.lib.mfp_eosfit.murnaghan(vol, pars)[source]

Four-parameters murnaghan EOS. From PRB 28,5480 (1983)

dpgen.auto_test.lib.mfp_eosfit.parse_argument()[source]
dpgen.auto_test.lib.mfp_eosfit.rBM4(vol, pars)[source]

Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here Comput Physics Comm, 2011, 182: 1708-1720

dpgen.auto_test.lib.mfp_eosfit.rBM4_pv(vol, pars)[source]

Implementions as Alberto Otero-de-la-Roza, i.e. rBM4 is used here Comput Physics Comm, 2011, 182: 1708-1720 Fit for V-P relations

dpgen.auto_test.lib.mfp_eosfit.rBM5(vol, pars)[source]

Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here Comput Physics Comm, 2011, 182: 1708-1720

dpgen.auto_test.lib.mfp_eosfit.rBM5_pv(vol, pars)[source]

Implementions as Alberto Otero-de-la-Roza, i.e. rBM5 is used here Comput Physics Comm, 2011, 182: 1708-1720 Fit for V-P relations

dpgen.auto_test.lib.mfp_eosfit.rPT4(vol, pars)[source]

Natrual strain EOS with 4 paramters Seems only work in near-equillibrium range. Implementions as Alberto Otero-de-la-Roza, i.e. rPT4 is used here Comput Physics Comm, 2011, 182: 1708-1720, in their article, labeled as PT3 (3-order), however, we mention it as rPT4 for 4-parameters EOS.

dpgen.auto_test.lib.mfp_eosfit.rPT4_pv(vol, pars)[source]

Natrual strain (Poirier-Tarantola)EOS with 4 paramters Seems only work in near-equillibrium range. Implementions as Alberto Otero-de-la-Roza, i.e. rPT4 is used here Comput Physics Comm, 2011, 182: 1708-1720, in their article, labeled as PT3 (3-order), however, we mention it as rPT4 for 4-parameters EOS.

dpgen.auto_test.lib.mfp_eosfit.rPT5(vol, pars)[source]

Natrual strain EOS with 4 paramters Seems only work in near-equillibrium range. Implementions as Alberto Otero-de-la-Roza, i.e. rPT5 is used here Comput Physics Comm, 2011, 182: 1708-1720, in their article, labeled as PT3 (3-order), however, we mention it as rPT5 for 4-parameters EOS.

dpgen.auto_test.lib.mfp_eosfit.rPT5_pv(vol, pars)[source]

Natrual strain (Poirier-Tarantola)EOS with 5 paramters Implementions as Alberto Otero-de-la-Roza, i.e. rPT5 is used here Comput Physics Comm, 2011, 182: 1708-1720, in their article, labeled as PT3 (3-order), however, we mention it as rPT5 for 4-parameters EOS.

dpgen.auto_test.lib.mfp_eosfit.read_ve(fin)[source]
dpgen.auto_test.lib.mfp_eosfit.read_velp(fin, fstart, fend)[source]
dpgen.auto_test.lib.mfp_eosfit.read_vlp(fin, fstart, fend)[source]
dpgen.auto_test.lib.mfp_eosfit.repro_ve(func, vol_i, p)[source]
dpgen.auto_test.lib.mfp_eosfit.repro_vp(func, vol_i, pars)[source]
dpgen.auto_test.lib.mfp_eosfit.res_BM4(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_BM5(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_LOG4(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_LOG5(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_Li4p(p, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_SJX_5p(p, e, v)[source]
dpgen.auto_test.lib.mfp_eosfit.res_SJX_v2(p, e, v)[source]
dpgen.auto_test.lib.mfp_eosfit.res_TEOS(p, e, v)[source]
dpgen.auto_test.lib.mfp_eosfit.res_birch(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mBM4(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mBM4poly(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mBM5(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mBM5poly(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mie(p, e, v)[source]
dpgen.auto_test.lib.mfp_eosfit.res_mie_simple(p, e, v)[source]
dpgen.auto_test.lib.mfp_eosfit.res_morse(p, en, volume)[source]
dpgen.auto_test.lib.mfp_eosfit.res_morse_3p(p, en, volume)[source]
dpgen.auto_test.lib.mfp_eosfit.res_morse_6p(p, en, volume)[source]
dpgen.auto_test.lib.mfp_eosfit.res_morse_AB(p, en, volume)[source]
dpgen.auto_test.lib.mfp_eosfit.res_murnaghan(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rBM4(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rBM4_pv(par, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rBM5(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rBM5_pv(par, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rPT4(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rPT4_pv(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rPT5(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_rPT5_pv(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_universal(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_vinet(pars, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.res_vinet_pv(par, y, x)[source]
dpgen.auto_test.lib.mfp_eosfit.universal(vol, parameters)[source]

Universal equation of state(Vinet P et al., J. Phys.: Condens. Matter 1, p1941 (1989))

dpgen.auto_test.lib.mfp_eosfit.vinet(vol, pars)[source]

Vinet equation from PRB 70, 224107 Following, Shang Shunli et al., comput mater sci, 2010: 1040-1048, original expressions.

dpgen.auto_test.lib.mfp_eosfit.vinet_pv(vol, pars)[source]

dpgen.auto_test.lib.pwscf module

dpgen.auto_test.lib.pwscf.make_pwscf_input(sys_data, fp_pp_files, fp_params)[source]

dpgen.auto_test.lib.siesta module

dpgen.auto_test.lib.siesta.make_siesta_input(sys_data, fp_pp_files, fp_params)[source]

dpgen.auto_test.lib.util module

dpgen.auto_test.lib.util.collect_task(all_task, task_type)[source]
dpgen.auto_test.lib.util.get_machine_info(mdata, task_type)[source]
dpgen.auto_test.lib.util.insert_data(task, task_type, username, file_name)[source]
dpgen.auto_test.lib.util.make_work_path(jdata, task, reprod_opt, static, user)[source]
dpgen.auto_test.lib.util.voigt_to_stress(inpt)[source]

dpgen.auto_test.lib.utils module

dpgen.auto_test.lib.utils.cmd_append_log(cmd, log_file)[source]
dpgen.auto_test.lib.utils.copy_file_list(file_list, from_path, to_path)[source]
dpgen.auto_test.lib.utils.create_path(path)[source]
dpgen.auto_test.lib.utils.log_iter(task, ii, jj)[source]
dpgen.auto_test.lib.utils.log_task(message)[source]
dpgen.auto_test.lib.utils.make_iter_name(iter_index)[source]
dpgen.auto_test.lib.utils.record_iter(record, confs, ii, jj)[source]
dpgen.auto_test.lib.utils.repeat_to_length(string_to_expand, length)[source]
dpgen.auto_test.lib.utils.replace(file_name, pattern, subst)[source]

dpgen.auto_test.lib.vasp module

exception dpgen.auto_test.lib.vasp.OutcarItemError[source]

Bases: Exception

dpgen.auto_test.lib.vasp.check_finished(fname)[source]
dpgen.auto_test.lib.vasp.get_boxes(fname)[source]
dpgen.auto_test.lib.vasp.get_energies(fname)[source]
dpgen.auto_test.lib.vasp.get_nev(fname)[source]
dpgen.auto_test.lib.vasp.get_poscar_natoms(fname)[source]
dpgen.auto_test.lib.vasp.get_poscar_types(fname)[source]
dpgen.auto_test.lib.vasp.get_stress(fname)[source]
dpgen.auto_test.lib.vasp.make_kspacing_kpoints(poscar, kspacing, kgamma)[source]
dpgen.auto_test.lib.vasp.make_vasp_kpoints(kpoints, kgamma=False)[source]
dpgen.auto_test.lib.vasp.make_vasp_kpoints_from_incar(work_dir, jdata)[source]
dpgen.auto_test.lib.vasp.make_vasp_phonon_incar(ecut, ediff, npar, kpar, kspacing=0.5, kgamma=True, ismear=1, sigma=0.2)[source]
dpgen.auto_test.lib.vasp.make_vasp_relax_incar(ecut, ediff, relax_ion, relax_shape, relax_volume, npar, kpar, kspacing=0.5, kgamma=True, ismear=1, sigma=0.22)[source]
dpgen.auto_test.lib.vasp.make_vasp_static_incar(ecut, ediff, npar, kpar, kspacing=0.5, kgamma=True, ismear=1, sigma=0.2)[source]
dpgen.auto_test.lib.vasp.perturb_xz(poscar_in, poscar_out, pert=0.01)[source]
dpgen.auto_test.lib.vasp.poscar_natoms(poscar_in)[source]
dpgen.auto_test.lib.vasp.poscar_scale(poscar_in, poscar_out, scale)[source]
dpgen.auto_test.lib.vasp.poscar_vol(poscar_in)[source]
dpgen.auto_test.lib.vasp.reciprocal_box(box)[source]
dpgen.auto_test.lib.vasp.regulate_poscar(poscar_in, poscar_out)[source]
dpgen.auto_test.lib.vasp.sort_poscar(poscar_in, poscar_out, new_names)[source]