首页 >> 仿真软件说明 >>ABACUS >>朱雪刚版 >> 2.2.1.2 KPT测试(做DPGEN要用上kspacing,不用KPT)ABACUS3.4.0测试结果(软件已更新。推荐使用最新版本)
详细内容

2.2.1.2 KPT测试(做DPGEN要用上kspacing,不用KPT)ABACUS3.4.0测试结果(软件已更新。推荐使用最新版本)

KPT的测试直接附上我目前使用的脚本,和测试结果,不再详细解释,是在前期的脚本中不断加入变量来实现的。这里需要注意,由于DPGEN拟合DP势函数过程中会使用不同的晶胞尺寸,因此建议刚开始就使用kspcaing关键词。

  1. 测试脚本

#!/bin/bash
source activate abacus_env
OMP_NUM_THREADS=1
cpu_cores=(12 8 12 16 20 24)
upf_potential_file="Be_ONCV_PBE-1.0.upf"
path_to_potential_file="../../../../SG15_v1.0_ONCVPP_and_Orbitals"
orbital_file="../../../../SG15_v1.0_ONCVPP_and_Orbitals"

ecut_energys=(100 30 50 70 80 90 110 120 130 150 200) # the unit is Rydberg and 1 Rydberg = 13.6 eV
KPTs=(1 2 3 4 5 6 7 8 9 10 12 14 16 18 20)
Rcut_aus=(10 7 8 9)
num_orbs=(6s2p 5s2p 4s1p 4s1p_2016 2s)
strus=(16 2 16 54 128 250)

test_var=KPTs

cat > ${test_var}_energy_time << EOF
${test_var}    ETOT    Time
EOF
echo "start to test ${test_var} with energy and time"
for KPT in ${KPTs[@]} 
    do
        echo "strus ${strus} Radius ${Rcut_aus} energy cutoff ${ecut_energy} orbital ${num_orbs} KPT ${KPT} ${KPT} ${KPT}"
        mkdir "${test_var}_${KPT}"
        cd "${test_var}_${KPT}"
            echo "now we are in the dir of $PWD "
            echo "write the INPUT"

            cat > INPUT << EOF
INPUT_PARAMETERS
#Parameters (General)

pseudo_dir      $path_to_potential_file
orbital_dir     $orbital_file
#Parameters (Accuracy)
basis_type      pw
ecutwfc         $ecut_energys
smearing_method gauss
smearing_sigma  0.01
calculation     scf
scf_nmax        100

EOF

            echo "write the KPT"
            cat > KPT << EOF
K_POINTS
0
Gamma
$KPT $KPT $KPT 0 0 0
EOF
            echo "get the stru file"
            cp ../../../../STRU/Be/STRU_file/Be${strus}.STRU ./STRU
            sed -i "5s/Be_gga_[0-9]*au_100Ry_[0-9a-zA-Z]*.orb/Be_gga_${Rcut_aus}au_100Ry_${num_orbs}.orb/" STRU
            echo "run abacus in $PWD"
            OMP_NUM_THREADS=1 mpirun -n $cpu_cores abacus | tee out.log
            Time=`grep "TOTAL" out.log  | awk '{printf int($4)}'`
            energy_atom=`grep "FINAL_ETOT_IS" OUT.ABACUS/running_scf.log  | awk -v stru="${strus}" '{printf "%.8f\n",$2/stru}'`
            echo "$KPT    $energy_atom    $Time" >> ../${test_var}_energy_time
        cd ..
        echo "done the $KPT number of orbital with energy scf calculation"
done

cat > ${test_var}_energy_time.py << EOF
import matplotlib.pyplot as plt

with open('${test_var}_energy_time', 'r') as f:
    data = f.readlines()

${test_var} = []
energy_atom = []
Time = []

for line in data[1:]:
    line = line.strip().split()
    ${test_var}.append(str(line[0]))
    energy_atom.append(float(line[1]))
    Time.append(int(line[2]))

fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
ax1.plot(${test_var}, energy_atom, marker='o')
ax1.set_ylabel('energy_atom')
ax1.set_title('Plot of ${test_var} vs energy/atom')
ax1.set_ylim(min(energy_atom), max(energy_atom))

ax2.plot(${test_var}, Time, marker='o')
ax2.set_xlabel('${test_var}')
ax2.set_ylabel('Time')
ax2.set_title('Plot of ${test_var} vs Time')
ax2.set_ylim(min(Time), max(Time))
plt.savefig('${test_var}_energy_time.png')

EOF
python ${test_var}_energy_time.py
echo "all finish"


  1. 测试结果展示


作者:朱雪刚 邮箱:xuegangzhu@qq.com; 工作单位:石家庄学院 理学院/北京科学智能研究院(AISI)访问学者2023.07-2024.09,访问导师北京大学陈默涵; 徐张满仓 邮箱: xuzhangmancang@dp.tech

截止2024.07.21录制视频教程已上传至Bohrium的课程《DeePMD应用案例讲解:铜原子掺杂铍晶体的机器学习势函数拟合过程演示》网址: https://bohrium.dp.tech/courses/1075495070?tab=courses 后续会在Bohrium平台更新

注意:后续的更新,大部分会在Bohrium课程平台进行,请看教程入门的同学加入课程进行学习;且录制的视频课程会把一些个人观点给加入,从个人观点来看比文字教程的内容更多

写教程内容讨论QQ群:143276924 DPGEN+ABACUS教程准备;

ABACUS软件的QQ群:759914681,群内有专职开发人员,目前ABACUS提问问题以github的issue为主,群内可作为辅助提问。

欢迎大家推广本教程,让更多的dp入门学习者有个参考,目前2024.09.16我联系的微信公众号推广是 lammps加油站的小马老师(我也报名了小马老师的一对一辅导)。当然也看到lammps爱好者在转发推广。感谢大家公众号的推广。


技术支持: CLOUD | 管理登录
seo seo