dpgen.auto_test.lib package

Contents

dpgen.auto_test.lib package#

Submodules#

dpgen.auto_test.lib.abacus module#

dpgen.auto_test.lib.abacus.check_finished(fname)[source]#
dpgen.auto_test.lib.abacus.check_stru_fixed(struf, fixed)[source]#
dpgen.auto_test.lib.abacus.final_stru(abacus_path)[source]#
dpgen.auto_test.lib.abacus.make_kspacing_kpt(struf, kspacing)[source]#
dpgen.auto_test.lib.abacus.modify_stru_path(strucf, tpath)[source]#
dpgen.auto_test.lib.abacus.poscar2stru(poscar, inter_param, stru='STRU')[source]#
  • poscar: POSCAR for input

  • inter_param: dictionary of ‘interaction’ from param.json
    some key words for ABACUS are:
    • atom_masses: a dictionary of atoms’ masses

    • orb_files: a dictionary of orbital files

    • deepks_desc: a string of deepks descriptor file

  • stru: output filename, usally is ‘STRU’.

dpgen.auto_test.lib.abacus.stru2Structure(struf)[source]#
dpgen.auto_test.lib.abacus.stru_fix_atom(struf, fix_atom=[True, True, True])[source]#

… ATOMIC_POSITIONS Cartesian #Cartesian(Unit is LATTICE_CONSTANT) Si #Name of element 0.0 #Magnetic for this element. 2 #Number of atoms 0.00 0.00 0.00 0 0 0 #x,y,z, move_x, move_y, move_z 0.25 0.25 0.25 0 0 0.

dpgen.auto_test.lib.abacus.stru_scale(stru_in, stru_out, scale)[source]#
dpgen.auto_test.lib.abacus.write_input(inputf, inputdict)[source]#
dpgen.auto_test.lib.abacus.write_kpt(kptf, kptlist)[source]#

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=np.float64(2.863782463805517), c=np.float64(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=np.float64(2.863782463805517), c=np.float64(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(pars, y, x)[source]#
dpgen.auto_test.lib.mfp_eosfit.res_rBM5(pars, y, x)[source]#
dpgen.auto_test.lib.mfp_eosfit.res_rBM5_pv(pars, 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(pars, 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]#