Bohrium
robot
新建

空间站广场

论文
Notebooks
比赛
课程
Apps
我的主页
我的Notebooks
我的论文库
我的足迹

我的工作空间

任务
节点
文件
数据集
镜像
项目
数据库
公开
从 DFT 先去 DeePKS 再到 DeePMD | DeePKS案例篇 + 增强采样
Deep Learning
中文
notebook
Molecular Dynamics
DeePMD
DeePKS
Enhanced Sampling
Deep Learning中文notebookMolecular DynamicsDeePMDDeePKSEnhanced Sampling
zhangpengchao@dp.tech
pc-zhang20@foxmail.com
发布于 2023-10-19
推荐镜像 :Basic Image:bohrium-notebook:2023-04-07
推荐机型 :c2_m4_cpu
赞 9
7
29
deepks_fundamental_tutorial_gly(v1)

从 DFT 先去 DeePKS 再到 DeePMD | DeePKS案例篇 + 增强采样

代码
文本

©️ Copyright 2023 @ Authors
作者:章鹏超 📨
日期:2023-11
共享协议:本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。

代码
文本

🎉 欢迎来到这个关于DeePKS的Notebook!

这是从第一性原理计算到分子动力学模拟的超详细「DeePKS+DeePMD」计算上手指南,主要面向零基础用户。

阅读前,请先了解 DeePKS的基本思想,戳 👉 DeePKS基础篇

代码
文本

Bohrium Notebook 界面,你可以点击界面上方蓝色按钮 开始连接,选择 xxx 镜像及 c32_m128_CPU 节点配置,稍等片刻即可运行。

注:镜像可能要制作一个,本工作采用了plumed_v2.8.1_patch (其中额外加入了Voronoi CVs代码,并需要安装OPES模块),deepmd-kit_v2.1.5 (with lammps and plumed),deepks-kit_v0.1,abacus_v3.0.5,cp2k_v9.1 (with plumed)。所以目前的notebook还只是输入输出文件介绍,等镜像制作好了再详细更新该notebook...

代码
文本

背景

202310-DeePKS-PengchaoZhang_Page6.png

在本教程中,我们将以甘氨酸分子在纯水溶液中的质子转移现象为例,详细介绍DeePKS模型和DP模型的训练和应用。DeePKS模型是一种基于深度学习校正的泛函,用于精确高效获得训练DP模型的数据集。DP模型是一种基于深度学习形式的力场,用于精确描述原子间相互作用的势能面。一般用DP模型跑MD包含上图右侧的4个步骤,本案例加入了DeePKS,因此增加了2个步骤,对应上图右侧所示,即具体对应以下6节:

代码
文本

章节 1: CP2K进行分子动力学模拟,同时用PLUMED增强采样收集构象

代码
文本

对于甘氨酸分子在纯水溶液中的质子转移现象,可能涉及到多种质子转移过程,并且这些过程往往是稀有事件,无法在常规MD模拟时间尺度下完成。故我们需要增强采样技术,常用PLUMED程序,在CP2K有中PLUMED的接口。为加速采样过程,以半经验方法GFN1-xTB作为初始势能面来跑增强采样的MD。这一步骤只是为后续训练收集构象坐标(如果我们不用DeePKS,其实也可以直接用DP-GEN),GFN1-xTB的能量和受力不会用于后续训练。

代码
文本

1.1 下载教程资源

我们已经在 deepks_fundamental_tutorial_gly 中准备了简化的文件,你可以点击左侧数据集查看(最终用于发表的数据集和模型已上传至AIS SquareGoogle DriveGithub):

代码
文本
[48]
# 出于安全考虑,我们没有数据集所在文件夹的写入权限,因此我们将其复制到 `/data/` 目录下:
! cp -r /bohr/1019-sjiy/v1/deepks_fundamental_tutorial_gly /data/

# 我们在这里定义一些路径,并切换到工作路径,方便后续调用:
import os
bohr_dataset_url = "/deepks_fundamental_tutorial_gly" # 数据集的 url 可从左侧数据集复制
work_path = os.path.join("/data", bohr_dataset_url[1:]) # 进行一个切片以删除上述路径中最开始的“/”
os.chdir(work_path)
print(f"当前路径为:{os.getcwd()}")
当前路径为:/data/deepks_fundamental_tutorial_gly
代码
文本
[49]
! ls
01-Sampling_configurations  03-DeePKS_Interation  05-DP_Training
02-DFT_Labeling		    04-DeePKS_Labeling	  06-DPMD+Enhanced_sampling
代码
文本
[50]
! tree 01-Sampling_configurations
01-Sampling_configurations
├── COLVAR
├── cp2k.inp
├── init.xyz
├── plumed.dat
├── sub.sh
└── xyz.dat

0 directories, 6 files
代码
文本

01-Sampling_configurations 文件夹包含

输入文件:

  • cp2k.inp: CP2K 输入文件,用于控制 MD 细节;
  • xyz.dat: 用于存放 MD 模拟的初始构型;
  • plumed.dat: PLUMED 增强采样的输入文件;
  • sub.sh: 提交作业的脚本。
代码
文本

1.2 CP2K跑MD输入文件

输入文件的作用是告诉 CP2K 软件其应该如何计算。关键词以&XXX开始,&END XXX结束,#后面是注释。

下面是一个示例(CP2K手写输入文件入门难度不低,也可选用Multiwfn生成输入文件然后再改):

代码
文本
[51]
! cat 01-Sampling_configurations/cp2k.inp
&GLOBAL
  PROJECT Gly54H2O # Project name
  PRINT_LEVEL LOW # Print level
  RUN_TYPE MD # Run type
&END GLOBAL

&FORCE_EVAL
  METHOD Quickstep # Method
  &SUBSYS
    &CELL
      A    12.02800000     0.00000000     0.00000000 # Lattice
      B     0.00000000    12.02800000     0.00000000
      C     0.00000000     0.00000000    12.02800000
      PERIODIC XYZ # Periodic boundary conditions
    &END CELL
	&TOPOLOGY
	  COORD_FILE_FORMAT XYZ # Coordinate file format
	  COORD_FILE_NAME init.xyz # Initial coordinate file name
	&END TOPOLOGY
  &END SUBSYS

  &DFT
    CHARGE    0 # Charge of the system 
    MULTIPLICITY    1 
    &QS
      EPS_DEFAULT 1E-10 # Leading to an energy correct up to EPS_DEFAULT
      EXTRAPOLATION ASPC # Always stable predictor corrector
      EXTRAPOLATION_ORDER 3 # Order for the PS or ASPC extrapolation (typically 2-4)
      METHOD xTB
      &xTB
        DO_EWALD T # Use Ewald summation for long-range interactions
        CHECK_ATOMIC_CHARGES F # Don't stop calculation if atomic charges are outside chemical range
        &PARAMETER # parameter file
          DISPERSION_PARAMETER_FILE dftd3.dat
          PARAM_FILE_NAME xTB_parameters
        &END PARAMETER
      &END xTB
    &END QS
    &POISSON # Periodic boundary conditions for Poisson solver
      PERIODIC XYZ 
      PSOLVER PERIODIC 
    &END POISSON
    &SCF
      MAX_SCF 200 # Maximum number of SCF iterations
      EPS_SCF 1.0E-05 # SCF convergence criterion
      &OT # Sets the various options for the orbital transformation (OT) method.
        PRECONDITIONER FULL_SINGLE_INVERSE # Preconditioning method. Based on H-eS cholesky inversion.
        MINIMIZER DIIS # Minimization method. Direct inversion in the iterative subspace
        LINESEARCH 2PNT # Line search method. extrapolate based on 2 points 
      &END OT
      &PRINT 
        &RESTART # Controls the dumping of the MO restart file during SCF
          BACKUP_COPIES 0 # Specifies the maximum number of backup copies
        &END RESTART
      &END PRINT
    &END SCF
  &END DFT
&END FORCE_EVAL

&MOTION
  &MD # molecular dynamics
    ENSEMBLE NVT # Ensemble type
    STEPS 200000 # Number of MD steps
    TIMESTEP 1.0 # MD time step 1 fs
    TEMPERATURE 300 # Temperature 300 K
    &THERMOSTAT
      TYPE CSVR # Thermostat type
      &CSVR
        TIMECON 200 # Thermostat time constant 200 fs
      &END CSVR
    &END THERMOSTAT
  &END MD

  &FREE_ENERGY
    &METADYN
      USE_PLUMED .TRUE. # Use PLUMED for enhanced sampling
      PLUMED_INPUT_FILE ./plumed.dat # PLUMED input file location
    &END METADYN
  &END FREE_ENERGY 
  
  &PRINT
    &TRAJECTORY
      &EACH
        MD   10 # Trajectory output frequency 
      &END EACH
      FORMAT xyz # Trajectory output format
    &END TRAJECTORY
    &VELOCITIES
      &EACH
        MD   10 # Velocities output frequency
      &END EACH
    &END VELOCITIES
    &RESTART
      BACKUP_COPIES 0 
      &EACH
        MD 50000 # Restart output frequency
      &END EACH
    &END RESTART
  &END PRINT
&END MOTION

#&EXT_RESTART
#  RESTART_FILE_NAME xxx.restart
#&END EXT_RESTART
代码
文本

为了缩短运行所需的时间,我们适当降低了运行步数。

在采样构象阶段,可以同时跑多个独立的MD模拟加速构象收集过程。本工作跑了40个左右的独立MD,即从不同初始结构和不同随机数出发,根据需要还可以改变温度和压力等参数。

代码
文本

1.3 PLUMED 增强采样收集构象的输入文件

下面是一个示例:

代码
文本
[52]
! cat 01-Sampling_configurations/plumed.dat
# this is using Angstrom
UNITS LENGTH=A

# set atom groups
GlyN:      GROUP ATOMS=163      
GlyOhasH:  GROUP ATOMS=171      
GlyOnotH:  GROUP ATOMS=169
GlyH:      GROUP ATOMS=164,170,172,2
WaterO:    GROUP ATOMS=1-160:3
WaterH:    GROUP ATOMS=5-161:3,3-162:3

# define voronoi CVs
s05:   VORONOIS1  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-5    D_0=108     D_1=3           NLIST NL_CUTOFF=2.4 NL_STRIDE=1
d05:   VORONOID2  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-5    D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1

# define opes-explore
OPES_METAD_EXPLORE ...
   RESTART=NO
   LABEL=opes
   ARG=s05,d05
   FILE=HILLS # a file in which the list of all deposited kernels is stored
   TEMP=300 # temperature(K). If not set, it is taken from MD engine
   PACE=500 # the frequency for kernel deposition
   BARRIER=80 # the free energy barrier to be overcome
   STATE_WFILE=STATE # write to this file the compressed kernels and all the info needed to RESTART the simulation   
   STATE_WSTRIDE=5000 # number of MD steps between writing the STATE_WFILE
   STORE_STATES # append to STATE_WFILE instead of ovewriting it each time
   WALKERS_MPI # switch on MPI version of multiple walkers
... OPES_METAD_EXPLORE 

# print CVs and bias
FLUSH STRIDE=100
PRINT ...
 ARG=s05,d05,*.bias # the outputs you want to print
 STRIDE=1 # number of MD steps between writing ARGs
 FILE=COLVAR # a file in which the ARGs is stored
 RESTART=NO
... PRINT

ENDPLUMED
代码
文本

这里所用的集合变量(collective variables, CVs),简单来说是为了将我们所研究的质子转移坐标从高维空间降维,以便可视化质子转移反应的自由能面。基于CV的增强采样,即增强了对所设反应坐标的采样,这样可以大幅缩短模拟时间。此处涉及的篇幅可能过长,我们会另写notebook具体介绍on-the-fly probability enhanced sampling (OPES)Voronoi CVs

代码
文本

1.4 初始结构的输入文件

初始结构文件init.xyz需要在cp2k.inp中指定,CV所涉及的原子索引号则需要plumed.dat中指定。当然也可以用.pdb格式,对应修改cp2k.inp中的&TOPOLOGY

下面是一个172原子体系的示例(包含,只展示了前10个原子):

代码
文本
[53]
! head -n 12 01-Sampling_configurations/init.xyz
172
 init xyz
 O         4.299293        4.776775        9.737641
 H         6.775417        5.071937        0.136651
 H         4.246821        3.309147        1.263330
 O        11.063144       10.339872        1.599614
 H         9.168386        1.532002        2.761902
 H         0.739205        4.121296        7.187894
 O         8.877948        5.856919        7.472394
 H         8.492142       11.270641        3.570705
 H         5.342224        1.546288        3.804414
 O        10.399652        8.269867        5.802673
代码
文本

1.5 运行 GFN1-xTB 级别下的分子动力学模拟

笔者所用的是PBS作业调度系统,执行qsub sub.sh运行作业。

主要的输出文件(文件较大只截取了部分作为示例)有:

  • xyz.dat: 结构轨迹文件;
  • COLVAR: 记录模拟时间、CV值s05和d05、以及其他增强采样输出参数(此处为偏置势opes.bias)的文件。
代码
文本
[54]
! head -n 12 01-Sampling_configurations/xyz.dat
172
 frame 1
 O         4.610098        4.684042        9.775987
 H         6.329322        4.861331       11.283769
 H         4.148137        3.248957        0.906027
 O        11.552249       10.303507        1.766647
 H         9.560211        1.320587        2.804950
 H         1.338245        3.731550        7.389257
 O         8.983176        5.859800        7.711576
 H         8.339740       11.099571        3.989882
 H         5.054429        2.055170        3.794269
 O        10.508759        8.508986        5.898236
代码
文本
[55]
! cat 01-Sampling_configurations/COLVAR
#! FIELDS time s05 d05 opes.bias
 0.001000   -0.001057  3.023400 -80.000000
 0.002000   -0.000282  3.020795 -80.000000
 0.003000    0.000240  3.015184 -80.000000
 0.004000    0.000431  3.010100 -80.000000
 0.005000    0.000129  3.007531 -80.000000
 0.006000   -0.000583  3.006861 -80.000000
 0.007000   -0.001239  3.008498 -80.000000
 0.008000   -0.001364  3.014579 -80.000000
 0.009000   -0.000905  3.024676 -80.000000
 0.010000   -0.000156  3.034457 -80.000000
 0.011000    0.000601  3.039903 -80.000000
 199.989000 -0.001910  1.734044  92.918086
 199.990000 -0.001846  1.834772  95.331408
 199.991000 -0.001584  1.881821  96.663240
 199.992000 -0.001157  1.867308  96.241737
 199.993000 -0.000667  1.792590  94.243802
 199.994000 -0.000261  1.673940  91.796998
 199.995000 -0.000062  1.558311  90.434774
 199.996000 -0.000083  1.510852  90.201213
 199.997000 -0.000179  1.555498  90.417191
 199.998000 -0.000209  1.646575  91.377599
 199.999000 -0.000180  1.710271  92.440309
 200.000000 -0.000139  1.696906  92.191787
代码
文本

在得到以上输出文件之后,我们可以根据CV值来选取组成数据集的构象,这些构象需要尽可能涵盖我们研究问题对应的构象空间。如下图所示,数据集中的每个构象对应图中的一个点,基本覆盖了最后的自由能面。然而自由能面我们在初始时并不知道,所以这个过程可能需要迭代多轮才能收集充分的构象数量。

configuration_sampling.png

代码
文本

章节 2: CP2K第一性原理计算,用以构造DeePKS模型的数据集

我们使用CP2K进行第一性原理计算。选择杂化泛函M06-2X和基组QZV3P,计算上一步骤中的300个构象的能量和受力来组成DeePKS模型的数据集。

代码
文本

2.1 下载教程资源

在本章节中,我们已经在 02-DFT_Labeling 中准备了需要的文件。

输入文件有

  • m062x.inp:设定单点计算;
  • geo.xyz:所选结构;
  • sub.sh:提交脚本;
代码
文本
[56]
! tree 02-DFT_Labeling
02-DFT_Labeling
├── geo.xyz
├── m062x.inp
├── m062x.out
└── sub.sh

0 directories, 4 files
代码
文本

与章节1不同的是我们更换了计算任务类型为单点计算,即通过自洽场迭代(SCF)获取能量和受力。

以及所选计算级别换成了高精度方法,当然更耗时,这也是我们后面采用DeePKS的原因。

代码
文本
[57]
! cat 02-DFT_Labeling/m062x.inp
&GLOBAL
  PROJECT M062X
  PRINT_LEVEL LOW
  RUN_TYPE ENERGY_FORCE # print energy and force
&END GLOBAL

&FORCE_EVAL
  METHOD Quickstep
  &PRINT
    &FORCES ON
    &END FORCES
  &END PRINT  
  &SUBSYS
    &CELL
      A    12.02800000     0.00000000     0.00000000
      B     0.00000000    12.02800000     0.00000000
      C     0.00000000     0.00000000    12.02800000
      PERIODIC XYZ
    &END CELL
	&TOPOLOGY
	  COORD_FILE_FORMAT XYZ
	  COORD_FILE_NAME geo.xyz
	&END TOPOLOGY
    &KIND O # basis sets   
      ELEMENT O 
      BASIS_SET QZV3P-GTH-q6
      BASIS_SET AUX_FIT admm-dzp-q6
      POTENTIAL GTH-PBE
    &END KIND
    &KIND H    
      ELEMENT H 
      BASIS_SET QZV3P-GTH-q1
      BASIS_SET AUX_FIT admm-dzp-q1
      POTENTIAL GTH-PBE
    &END KIND
    &KIND N    
      ELEMENT N 
      BASIS_SET QZV3P-GTH-q5
      BASIS_SET AUX_FIT admm-dzp-q5
      POTENTIAL GTH-PBE
    &END KIND
    &KIND C    
      ELEMENT C 
      BASIS_SET QZV3P-GTH-q4
      BASIS_SET AUX_FIT admm-dzp-q4
      POTENTIAL GTH-PBE
    &END KIND
  &END SUBSYS

  &DFT
    BASIS_SET_FILE_NAME  GTH_BASIS_SETS # Specifies the basis set
    BASIS_SET_FILE_NAME  BASIS_ADMM_UZH # ADMM calculations
    POTENTIAL_FILE_NAME  POTENTIAL # Specifies the file containing the potential
    #WFN_RESTART_FILE_NAME ../pbe/PBE-RESTART.wfn # Specifies the path to the wavefunction restart file
    CHARGE    0       
    MULTIPLICITY    1
    &QS
      EPS_DEFAULT 1.0E-11 # leading to an energy correct up
      EPS_PGF_ORB 1E-12 # Sets precision of the overlap matrix elements  
    &END QS
    &POISSON
      PERIODIC XYZ 
      PSOLVER PERIODIC 
    &END POISSON
    &AUXILIARY_DENSITY_MATRIX_METHOD
      METHOD BASIS_PROJECTION # Construct auxiliary density matrix from auxiliary basis
      ADMM_PURIFICATION_METHOD MO_DIAG # Calculate MO derivatives via Cauchy representation by diagonalization
    &END AUXILIARY_DENSITY_MATRIX_METHOD
    &XC
	  &XC_FUNCTIONAL
	  	&LIBXC
	  		FUNCTIONAL MGGA_C_M06_2X # Specifies the correlation (C) part
	  	&END LIBXC
	  	&LIBXC
	  		FUNCTIONAL HYB_MGGA_X_M06_2X # Specifies the exchange (X) part
	  	&END LIBXC
	  &END XC_FUNCTIONAL
      &HF
        FRACTION 0.54 # Specifies the fraction of exact exchange included in the HF exchange
        &SCREENING
          EPS_SCHWARZ 1E-10 # Screens the near field part of the electronic repulsion integrals using the Schwarz inequality for the given threshold
          SCREEN_ON_INITIAL_P T # Screen on an initial density matrix
        &END SCREENING
        &INTERACTION_POTENTIAL
          POTENTIAL_TYPE TRUNCATED # runcated coulomb potential: if (r < R_c) 1/r else 0
          CUTOFF_RADIUS 6.0 # Determines cutoff radius (in Angstroms) for the truncated 1/r potential
        &END INTERACTION_POTENTIAL
        &MEMORY
          MAX_MEMORY 3000 # Defines the maximum amount of memory [MB]
          EPS_STORAGE_SCALING 0.1 # Scaling factor to scale eps_schwarz.
        &END MEMORY
      &END HF
    &END XC
    &MGRID
      CUTOFF  1000 # planewave cutoff (default unit is in Ry) for the finest level of the multi-grid
      REL_CUTOFF  70 # planewave cutoff of a reference grid covered by a Gaussian with unit standard deviation
    &END MGRID
    &SCF
      MAX_SCF 50 # Maximum number of SCF iteration to be performed for one optimization
      EPS_SCF 1.0E-07 # Target accuracy for the SCF convergence
      SCF_GUESS RESTART # Use the RESTART file as an initial guess (and ATOMIC if not present)
      &OT
        PRECONDITIONER FULL_ALL # This preconditioner is recommended for almost all systems
        MINIMIZER DIIS # Direct inversion in the iterative subspace: less reliable than CG, but sometimes about 50% faster
        LINESEARCH 2PNT # extrapolate based on 2 points
      &END OT
      &OUTER_SCF
        MAX_SCF 10 # The maximum number of outer loops
        EPS_SCF 1.0E-07 # The target gradient of the outer SCF variables.
      &END OUTER_SCF
      &PRINT
        &RESTART 
          BACKUP_COPIES 0 
        &END RESTART
      &END PRINT
    &END SCF
  &END DFT
&END FORCE_EVAL
代码
文本

值得注意的是我们需要对CUTOFF进行收敛测试,如下表所示,我们最终选择CUTOFF=1000,REL_CUTOFF=70的组合

cutoff_test.png

代码
文本

2.2 运行 M06-2X 级别下的单点计算

笔者所用的是PBS作业调度系统,执行qsub sub.sh运行作业。

主要的输出文件(文件较大只截取了部分作为示例)有:

  • m062x.out: 记录SCF收敛后的能量和受力文件;
代码
文本
[58]
#能量
! grep 'ENERGY| Total FORCE_EVAL' 02-DFT_Labeling/m062x.out
 ENERGY| Total FORCE_EVAL ( QS ) energy [a.u.]:             -987.850379144107478
代码
文本
[59]
#打印前3个原子受力
!grep -A 5 'ATOMIC FORCES in' 02-DFT_Labeling/m062x.out
 ATOMIC FORCES in [a.u.]

 # Atom   Kind   Element          X              Y              Z
      1      1      O           0.01317008    -0.02281718    -0.01692091
      2      2      H           0.01592927    -0.01750254    -0.02033401
      3      2      H          -0.02224085    -0.00953753     0.01490330
代码
文本

章节 3: ABACUS自洽场迭代,同时DeePKS-kit训练DeePKS模型

做完章节2的计算后,即我们准备好了拟合DeePKS模型的部分数据集,本节进行迭代训练DeePKS模型。

代码
文本

3.1 下载教程资源

在本章节中,我们已经在 03-DeePKS_Interation 中准备了需要的文件。

输入文件有

  • machines.yaml:机器配置;
  • params.yaml:训练DeePKS模型的参数;
  • scf_abacus.yaml:SCF迭代参数,其输出的密度矩阵、轨道等信息会额外作为DeePKS模型的输入;
  • systems.yaml:数据集设定;
  • sub.sh:提交脚本;
代码
文本
[60]
! tree 03-DeePKS_Interation
03-DeePKS_Interation
├── glycine
│   ├── iter
│   │   ├── RECORD
│   │   ├── iter.14
│   │   │   ├── 00.scf
│   │   │   │   ├── data_train
│   │   │   │   │   └── 001
│   │   │   │   │       ├── conv.npy
│   │   │   │   │       ├── dm_eig.npy
│   │   │   │   │       ├── e_base.npy
│   │   │   │   │       ├── e_tot.npy
│   │   │   │   │       ├── energy.npy
│   │   │   │   │       ├── f_base.npy
│   │   │   │   │       ├── f_tot.npy
│   │   │   │   │       ├── force.npy
│   │   │   │   │       ├── grad_vx.npy
│   │   │   │   │       ├── l_e_delta.npy
│   │   │   │   │       └── l_f_delta.npy
│   │   │   │   ├── log.data
│   │   │   │   └── model.ptg
│   │   │   └── 01.train
│   │   │       ├── log.train
│   │   │       └── model.pth
│   │   ├── machines.yaml
│   │   ├── params.yaml
│   │   ├── scf_abacus.yaml
│   │   ├── sub.sh
│   │   └── systems.yaml
│   ├── projector
│   │   ├── INPUT
│   │   ├── KPT
│   │   ├── STRU
│   │   ├── jle.orb
│   │   └── sub.sh
│   └── systems
│       ├── 001
│       │   ├── atom.npy
│       │   ├── energy.npy
│       │   └── force.npy
│       └── 002
│           ├── atom.npy
│           ├── energy.npy
│           └── force.npy
├── orbital_dir
│   ├── C_gga_7au_100Ry_2s2p1d.orb
│   ├── H_gga_6au_100Ry_2s1p.orb
│   ├── N_gga_7au_100Ry_2s2p1d.orb
│   └── O_gga_7au_100Ry_2s2p1d.orb
└── pseudo_dir
    ├── C_ONCV_PBE-1.0.upf
    ├── H_ONCV_PBE-1.0.upf
    ├── N_ONCV_PBE-1.0.upf
    └── O_ONCV_PBE-1.0.upf

13 directories, 40 files
代码
文本

3.2 机器配置文件

参考DeePKS-kit文档,以下是笔者的本地机器配置文件machines.yaml示例,使用bohrium平台的机器配置文件待写中...

代码
文本
[61]
! cat 03-DeePKS_Interation/glycine/iter/machines.yaml
# this is only part of input settings.
# should be used together with systems.yaml and params.yaml
scf_machine:
  resources:
    numb_node: 1            # int; number of nodes; default value is 1
    task_per_node: 20       # int; ppn required; default value is 1;
    numb_gpu: 0             # int; number of GPUs; default value is 1
    time_limit: "100:00:00" # time limit; default value is 1:0:0
    mem_limit: 20           # int; memeory limit in GB
    partition: "normal2"    # string; queue name
    module_list: [anaconda/anaconda.2020.02]    # e.g., [abacus]
    source_list: [activate abacus_3.0.5]        # e.g., [/opt/intel/oneapi/setvars.sh; conda activate deepks]
    envs: {'OMP_NUM_THREADS': '1'}

  group_size: 20
  sub_size: 1            # keyword for PySCF; set to 1 for ABACUS SCF jobs
  dispatcher:
    context: local       # "local" to run on local machine, or "ssh" to run on a remote machine
    batch: "pbs"         # set to shell to run on local machine, you can also use `slurm` or `pbs`

train_machine:
  resources:
    numb_node: 1             # int; number of nodes; default value is 1
    task_per_node: 28        # int; ppn required; default value is 1;
    #numb_gpu:               # int; number of GPUs; default value is 1
    time_limit: "100:00:00"  # time limit; default value is 1:0:0
    mem_limit: 30            # int; memeory limit in GB
    partition: "normal4"     # string; queue name
    module_list: [anaconda/anaconda.2020.02]     # e.g., [abacus]
    source_list: [activate deepkskit_0.1]        # e.g., [/opt/intel/oneapi/setvars.sh; conda activate deepks]
    envs: {'OMP_NUM_THREADS': '1'}

  dispatcher:
    context: local       # "local" to run on local machine, or "ssh" to run on a remote machine
    batch: "pbs"         # set to shell to run on local machine, you can also use `slurm` or `pbs`
    remote_profile: null # use lazy local
  # resources are no longer needed, and the task will use gpu automatically if there is one.
  python: "python"       # use python in path


# other settings (these are default; can be omitted)
cleanup: false           # whether to delete slurm and err files
strict: true             # do not allow undefined machine parameters

#paras for abacus
use_abacus: true         # use abacus in scf calculation
代码
文本

3.3 训练参数文件

以下是训练DeePKS模型的参数文件params.yaml示例,本案例只作为练习,只把迭代论述设为2,实际情况要迭代更多次,以及训练超参数可以根据情况拉高。

代码
文本
[62]
! cat 03-DeePKS_Interation/glycine/iter/params.yaml
# this is only part of input settings.
# should be used together with systems.yaml and machines.yaml

# number of iterations to do, can be set to zero for DeePHF training
n_iter: 2

# directory setting (these are default choices, can be omitted)
workdir: "."
share_folder: "share" # folder that stores all other settings

# scf settings, set to false when n_iter = 0 to skip checking
scf_input: false

# train settings for training after init iteration,
# set to false when n_iter = 0 to skip checking
train_input:
  # model_args is omitted, which will inherit from init_train
  data_args:
    batch_size:  1          # training batch size; 16 is recommended
    group_batch: 1          # number of batches to be grouped; set to 1 for ABACUS-related training
    extra_label: true       # set to true to train the model with force, stress, or bandgap labels.
                            # note that these extra labels will only be included after the init iteration
                            # only energy label will be included for the init training
    conv_filter: true       # if set to true (recommended), will read the convergence data from conv_name
                            # and only use converged datapoints to train; including any unconverged
                            # datapoints may screw up the training!
    conv_name: conv         # npy file that records the converged datapoints
  preprocess_args:
    preshift: false         # restarting model already shifted. Will not recompute shift value
    prescale: false         # same as above
    prefit_ridge: 1e1       # the ridge factor used in linear regression
    prefit_trainable: false # make the linear regression fixed during the training
  train_args:
    # start learning rate (lr) will decay a factor of `decay_rate` every `decay_steps` epoches
    decay_rate: 0.5
    decay_steps: 1000
    display_epoch: 100      # show training results every n epoch
    force_factor: 1         # the prefactor multiplied infront of the force part of the loss
    n_epoch: 5000           # total number of epoch needed in training
    start_lr: 0.0001        # the start learning rate, will decay later

# init training settings, these are for DeePHF task
init_model: false           # do not use existing model to restart from

init_scf: True              # whether to perform init SCF;

init_train:                 # parameters for init nn training; basically the same as those listed in train_input
  model_args:
    hidden_sizes: [32, 32, 32] # neurons in hidden layers [100, 100, 100]
    output_scale: 100             # the output will be divided by 100 before compare with label
    use_resnet: true              # skip connection
    actv_fn: mygelu               # same as gelu, support force calculation
  data_args:
    batch_size: 1
    group_batch: 1
  preprocess_args:
    preshift: true                # shift the descriptor by its mean
    prescale: false               # scale the descriptor by its variance (can cause convergence problem)
    prefit_ridge: 1e1             # do a ridge regression as prefitting
    prefit_trainable: false
  train_args:
    decay_rate: 0.96
    decay_steps: 500
    display_epoch: 100
    n_epoch: 5000
    start_lr: 0.0003
代码
文本

3.4 SCF迭代参数文件

scf_abacus.yaml文件是为生成ABACUS输入文件做准备,ABACUS需要如下 5 种文件:

  • INPUT:包含了计算过程中所需的各种参数,定义和控制计算任务,其中我们以PBE泛函为baseline;
  • STRU:结构文件,包含了原子种类、原子位置、晶格常数以及晶格向量等信息;
  • KPT:包含了布里渊区积分所需的k点信息;
  • *.upf:包含了原子的赝势信息;
  • *.orb:包含了原子轨道的数值表示;
代码
文本
[63]
! cat 03-DeePKS_Interation/glycine/iter/scf_abacus.yaml
scf_abacus:
  ntype: 4                    # int; number of different atom species in this calculations, e.g., 2 for H2O
  nbands: 277                 # int; number of bands to be calculated; optional
  ecutwfc: 100                # real; energy cutoff, unit: Ry
  scf_thr: 1e-7               # real; SCF convergence threshold for density error; 5e-7 and below is acceptable
  scf_nmax: 48                # int; maximum SCF iteration steps
  dft_functional: "pbe"       # string; name of the baseline density functional
  gamma_only: 1               # bool; 1 for gamma-only calculation
  cal_force: 1                # bool; 1 for force calculation
  cal_stress: 0               # bool; 1 for stress calculation
  orb_files: ["H_gga_6au_100Ry_2s1p.orb","O_gga_7au_100Ry_2s2p1d.orb","N_gga_7au_100Ry_2s2p1d.orb","C_gga_7au_100Ry_2s2p1d.orb"]
  pp_files:  ["H_ONCV_PBE-1.0.upf",      "O_ONCV_PBE-1.0.upf",        "N_ONCV_PBE-1.0.upf",        "C_ONCV_PBE-1.0.upf"       ]
  proj_file: ["jle.orb"]
  lattice_constant: 1.8897259886
  lattice_vector: [[12.028,0,0], [0,12.028,0], [0,0,12.028]]
  coord_type: "Cartesian"
  run_cmd : "mpirun"
  abacus_path: "abacus"
init_scf_abacus:
  orb_files: ["H_gga_6au_100Ry_2s1p.orb","O_gga_7au_100Ry_2s2p1d.orb","N_gga_7au_100Ry_2s2p1d.orb","C_gga_7au_100Ry_2s2p1d.orb"]
  pp_files:  ["H_ONCV_PBE-1.0.upf",      "O_ONCV_PBE-1.0.upf",        "N_ONCV_PBE-1.0.upf",        "C_ONCV_PBE-1.0.upf"       ]
  proj_file: ["jle.orb"]
  ntype: 4
  nbands: 277
  ecutwfc: 100
  scf_thr: 1e-5
  scf_nmax: 64
  dft_functional: "pbe"
  gamma_only: 1
  cal_force: 0
  lattice_constant: 1.8897259886
  lattice_vector: [[12.028,0,0], [0,12.028,0], [0,0,12.028]]
  coord_type: "Cartesian"
  run_cmd : "mpirun"
  abacus_path: "abacus"
代码
文本

3.5 投影子轨道的生成

202310-DeePKS-PengchaoZhang_Page9.png

为获得如上图所示的DeePKS描述子,需构造投影密度矩阵,需要先构造DeePKS中使用的投影子,其有如下形式:

为截断半径(推荐5 Bohr), 的选取需保证,其上限由动能的cutoff决定(推荐与SCF保持一致),同时的取值也决定了径向球贝塞尔函数的个数。球谐函数决定了角向部分,对于每个球贝塞尔函数,若角量子数,则包含三种角向轨道, 生成个描述子。每个元素总共的描述子个数则为

代码
文本
[64]
! cat 03-DeePKS_Interation/glycine/projector/INPUT
INPUT_PARAMETERS
#Parameters (1.General)
suffix                  abacus
pseudo_dir              ../../pseudo_dir
orbital_dir             ../../orbital_dir
calculation             gen_bessel # calculation type should be gen_bessel
ntype                   4
nbands                  277
symmetry                0

#Parameters (2.Iteration)
ecutwfc                 100        # kinetic energy cutoff in unit Ry; should be consistent with that set for ABACUS SCF calculation
scf_thr                 1e-8
scf_nmax                128

#Parameters (3.Basis)
basis_type              pw
gamma_only              1

#Parameters (4.Smearing)
smearing_method         gaussian
smearing_sigma          0.1

#Parameters (5.Mixing)
mixing_type             pulay
mixing_beta             0.4

#Parameters (6. Bessel function)
bessel_lmax			    2         # maximum angular momentum for projectors; 2 is recommended
bessel_rcut             5         # radial cutoff in unit Bohr; 5 or 6 is recommended
bessel_tol              1.0e-12

代码
文本

在projector文件夹下,qsub sub.sh提交任务,完成后即可得到投影子轨道文件jle.orb

代码
文本
[65]
! head -n 20 03-DeePKS_Interation/glycine/projector/jle.orb
---------------------------------------------------------------------------
Energy Cutoff(Ry)           100
Radius Cutoff(a.u.)         5
Lmax                        2
Number of Sorbitals-->      15
Number of Porbitals-->      15
Number of Dorbitals-->      15
---------------------------------------------------------------------------
SUMMARY END

Mesh                        505
dr                          0.01
                Type                   L                   N
                   0                   0                   0
1.000000000000e+00 9.999934202767e-01 9.999736812627e-01 9.999407834256e-01 
9.998947275446e-01 9.998355147105e-01 9.997631463261e-01 9.996776241054e-01 
9.995789500740e-01 9.994671265693e-01 9.993421562398e-01 9.992040420456e-01 
9.990527872577e-01 9.988883954587e-01 9.987108705420e-01 9.985202167122e-01 
9.983164384844e-01 9.980995406847e-01 9.978695284498e-01 9.976264072266e-01 
9.973701827725e-01 9.971008611549e-01 9.968184487513e-01 9.965229522488e-01 
代码
文本

3.6 数据集指定文件

systems.yaml文件中指定了训练集和测试集的路径,拟合的目标就是数据集中的M06-2X级别下的能量和受力标签。

代码
文本
[66]
! cat 03-DeePKS_Interation/glycine/iter/systems.yaml
# this is only part of input settings. 
# should be used together with params.yaml and machines.yaml

# training and testing systems
systems_train: # can also be files that containing system paths
  - ../systems/001 # support glob

systems_test: # if empty, use the last system of training set
  - ../systems/002
代码
文本

3.7 运行 DeePKS interation 及其文件输出

在iter文件夹下,执行qsub sub.sh运行作业,工作流思路如下图

deepks_workflow.png

代码
文本

输出文件(文件较多只截取了部分作为示例)有:

流程监测文件:iter/RECORD

生成时间点:从程序运行开始直至结束,每一步骤完成均在RECORD内有记录,文件说明:

  • (X 0 0): 每个iteration预处理,生成ABACUS SCF所需的输入文件。X=0对应iter.init, X=1对应iter.00,以此类推
  • (X 0 1): 运行SCF计算
  • (X 0 2): 检查SCF结果并进行当前误差统计log.data
  • (X 0): 当前SCF结束
  • (X 1 0): 基于SCF计算结果,本轮模型训练开始,学习曲线记录于log.train
  • (X 1 1): 本轮模型训练完成
  • (X 1): 模型精度测试
  • (X): 本轮流程结束
代码
文本

以迭代至iter.14为例,主要的输出文件有:

  • data_train/*.npy: 当前的训练集,其中grad_vx.npy用于计算受力校正项,因此文件较大(此处的grad_vx.npy并不是真实的,仅作示例);
  • log.data: 当前结果误差统计;
  • log.train: 模型训练学习曲线文件;
  • model.pth: 模型文件,DeePKS-kit神经网络输出,本轮模型训练完成时生成;
  • model.ptg: 模型文件,传给ABACUS;c++可读,下轮SCF任务开始时生成;
代码
文本
[67]
! cat 03-DeePKS_Interation/glycine/iter/iter.14/00.scf/log.data
Training:
  Convergence:
    122 / 150 = 	 0.81333
  Energy:
    ME: 	 0.00034515150545378975
    MAE: 	 0.0006003819333447306
    MARE: 	 0.00034084577732682096
  Force:
    MAE: 	 0.0006016773367485338
Testing:
  Convergence:
    22 / 30 = 	 0.73333
  Energy:
    ME: 	 0.001293148748713217
    MAE: 	 0.002438159172519742
    MARE: 	 0.002341818484132394
  Force:
    MAE: 	 0.0006044441443446342
代码
文本

值得注意的是并不是所有单点计算都收敛到设定值,说明在哈密顿量中加入神经网络修正后,一定程度上会影响收敛稳定性

代码
文本
[68]
! head -n 15 03-DeePKS_Interation/glycine/iter/iter.14/01.train/log.train
# using seed: 4032076500
# load 5 systems with fields {'lb_e', 'gvx', 'lb_f', 'eig'}
# load 1 systems with fields {'lb_e', 'gvx', 'lb_f', 'eig'}
# working on device: cpu
# epoch      trn_err   tst_err        lr  trn_time  tst_time 
  0         1.08e-02  1.25e-02  1.00e-04      0.00      2.07
  100       8.46e-04  3.08e-03  1.00e-04      6.52      0.02
  200       9.10e-04  2.91e-03  1.00e-04      6.37      0.02
  300       8.33e-04  3.09e-03  1.00e-04      6.59      0.02
  400       8.53e-04  2.99e-03  1.00e-04      6.42      0.02
  500       8.45e-04  3.13e-03  1.00e-04      6.36      0.02
  600       8.44e-04  3.06e-03  1.00e-04      6.53      0.02
  700       8.52e-04  3.25e-03  1.00e-04      6.50      0.02
  800       9.66e-04  2.97e-03  1.00e-04      6.19      0.02
  900       8.74e-04  3.11e-03  1.00e-04      6.23      0.02
代码
文本

3.8 模型测试

测试集来自独立的构象,并在M06-2X级别下完成计算。本工作中DeePKS模型的测试误差如下图

deepks_test.png

代码
文本

章节 4: ABACUS调用DeePKS模型,用于构造DP模型的数据集

本工作中利用训练好的PBE-based DeePKS模型,就可以用来代替M06-2X,完成55489个单点计算(构象由章节1中收集),这可以节省约8倍的机时(如果我们选用比M06-2X级别更高的方法,则可以省更多)。

runtime_test.png

代码
文本

4.1 SCF迭代参数文件

在本章节中,我们已经在 04-DeePKS_Labeling 中准备了需要的文件。

输入文件与ABACUS进行SCF计算类似,有

  • INPUT:包含了计算过程中所需的各种参数,定义和控制计算任务;
  • STRU:结构文件,包含了原子种类、原子位置、晶格常数以及晶格向量等信息;
  • KPT:包含了布里渊区积分所需的k点信息;
  • *.upf:包含了原子的赝势信息;
  • *.orb:包含了原子轨道的数值表示;
代码
文本
[69]
! tree 04-DeePKS_Labeling
04-DeePKS_Labeling
├── INPUT
├── KPT
├── STRU
├── running_scf.log
└── sub.sh

0 directories, 5 files
代码
文本
  1. INPUT 文件。INPUT中的参数设置于章节3中的SCF计算一致,其中我们以PBE泛函为baseline,并指定DeePKS模型路径(其参与到SCF计算)
代码
文本
[70]
! cat 04-DeePKS_Labeling/INPUT
INPUT_PARAMETERS
calculation scf
ntype 4
ecutwfc 100.000000
scf_thr 1.000000e-07
scf_nmax 18
basis_type lcao
dft_functional pbe
gamma_only 1
mixing_type pulay
mixing_beta 0.400000
symmetry 0
nbands 277
nspin 1
smearing_method fixed
smearing_sigma 0.001000
cal_force 1
cal_stress 0
deepks_out_labels 0
deepks_scf 1
deepks_bandgap 0
deepks_model ../03-DeePKS_Interation/glycine/iter/iter.14/00.scf/model.ptg
代码
文本
  1. STRU 文件。STRU 文件包含了原子种类、原子位置、晶格常数以及晶格向量等信息。并指定了赝势、轨道、投影子的路径:
代码
文本
[71]
! cat 04-DeePKS_Labeling/STRU
ATOMIC_SPECIES
H 1.00 ../03-DeePKS_Interation/pseudo_dir/H_ONCV_PBE-1.0.upf
O 1.00 ../03-DeePKS_Interation/pseudo_dir/O_ONCV_PBE-1.0.upf
N 1.00 ../03-DeePKS_Interation/pseudo_dir/N_ONCV_PBE-1.0.upf
C 1.00 ../03-DeePKS_Interation/pseudo_dir/C_ONCV_PBE-1.0.upf


LATTICE_CONSTANT
1.8897259886

LATTICE_VECTORS
12.028 0.0 0.0
0.0 12.028 0.0
0.0 0.0 12.028

ATOMIC_POSITIONS
Cartesian

H
0.0
113
8.477512 11.052771 4.986609 0 0 0
0.713460 6.625312 7.234243 0 0 0
8.379590 10.521278 7.850620 0 0 0
5.126922 0.000242 3.475644 0 0 0
5.780297 10.219974 2.802691 0 0 0
0.476735 10.084497 1.767674 0 0 0
0.458904 9.171061 4.329539 0 0 0
7.225451 2.122528 5.401010 0 0 0
8.518972 6.703912 4.615551 0 0 0
9.529254 11.500578 10.321160 0 0 0
0.237500 10.445055 8.469310 0 0 0
6.736948 11.328984 10.410131 0 0 0
0.479657 9.392328 9.566849 0 0 0
0.743417 6.521008 1.126826 0 0 0
2.709654 7.316965 3.996281 0 0 0
6.454134 9.097445 4.747141 0 0 0
6.707681 7.055103 1.290373 0 0 0
4.720297 0.656670 7.583141 0 0 0
5.875757 0.301229 9.642776 0 0 0
9.305656 3.528874 1.531390 0 0 0
6.066634 7.529630 10.937747 0 0 0
0.347528 5.176702 9.186558 0 0 0
2.696763 10.177609 0.260227 0 0 0
8.680944 8.228310 9.318817 0 0 0
0.579454 0.935519 0.788905 0 0 0
1.143323 5.288025 5.538924 0 0 0
3.929066 5.677605 11.449092 0 0 0
5.886518 2.603033 5.440133 0 0 0
6.054872 4.291443 1.049866 0 0 0
4.555193 3.744698 1.583451 0 0 0
4.802487 11.142155 5.690429 0 0 0
0.507386 7.838729 11.326568 0 0 0
9.800293 8.220575 2.769882 0 0 0
10.356333 10.709876 9.082552 0 0 0
7.517673 1.630213 2.454091 0 0 0
10.937224 5.110278 8.748446 0 0 0
4.358699 3.022382 7.190637 0 0 0
11.152841 9.544364 6.671887 0 0 0
11.204836 10.273087 2.502405 0 0 0
1.540861 11.170513 0.394901 0 0 0
3.320854 9.094880 6.172404 0 0 0
8.280992 9.110674 11.389585 0 0 0
0.466385 7.766830 8.202456 0 0 0
6.651360 2.775823 2.918653 0 0 0
4.795009 4.517778 3.560350 0 0 0
4.635582 7.018159 1.785197 0 0 0
5.946291 1.624960 7.277583 0 0 0
9.156671 4.873720 1.066682 0 0 0
3.819360 5.297258 9.931563 0 0 0
9.659438 0.706990 0.860768 0 0 0
6.913244 11.921111 0.456257 0 0 0
7.156819 7.070028 4.976803 0 0 0
5.016958 1.802284 1.805349 0 0 0
7.764881 5.068147 6.217623 0 0 0
5.111135 7.226218 8.168274 0 0 0
7.180951 6.634584 8.029705 0 0 0
2.935961 7.202505 0.139212 0 0 0
2.983514 4.305543 4.988204 0 0 0
9.496047 6.084994 6.708427 0 0 0
6.869145 9.053115 11.949920 0 0 0
8.755458 10.096845 2.971789 0 0 0
5.283078 8.392680 5.422639 0 0 0
11.491615 5.123042 1.078104 0 0 0
6.983433 11.792354 2.016835 0 0 0
6.863919 8.072224 7.606946 0 0 0
3.944497 2.006696 4.147048 0 0 0
0.339058 6.263888 4.693703 0 0 0
4.748745 5.910080 7.958939 0 0 0
4.941720 10.549195 0.205023 0 0 0
3.581996 4.910788 6.184750 0 0 0
1.250838 7.218697 2.573446 0 0 0
10.184779 7.260062 11.392811 0 0 0
7.382149 11.245316 6.815370 0 0 0
11.864153 7.494446 1.962388 0 0 0
2.774976 4.651631 8.086785 0 0 0
2.521530 9.833419 2.339826 0 0 0
4.377120 8.277041 2.593911 0 0 0
8.887805 9.317310 5.989867 0 0 0
0.705336 8.138920 5.460177 0 0 0
11.688733 7.109435 10.252553 0 0 0
4.678569 2.712175 11.164536 0 0 0
11.146048 9.117496 0.425415 0 0 0
9.706977 9.148640 10.010559 0 0 0
5.219004 10.406819 6.995871 0 0 0
8.807673 0.047341 3.750322 0 0 0
11.927291 10.112556 11.548690 0 0 0
3.789981 0.940396 5.262649 0 0 0
2.726245 6.123123 8.446609 0 0 0
2.837328 5.908180 3.502186 0 0 0
1.127986 0.197139 2.015033 0 0 0
7.214744 4.217977 7.299943 0 0 0
10.784087 6.421259 6.149549 0 0 0
10.973170 12.027130 0.662913 0 0 0
9.772116 8.161264 5.498056 0 0 0
5.211637 1.411018 11.076792 0 0 0
0.056527 5.356343 11.745871 0 0 0
6.370808 8.842716 2.391141 0 0 0
2.997955 7.443466 10.603126 0 0 0
7.471695 6.611041 2.515934 0 0 0
3.515982 1.625137 1.842416 0 0 0
3.978843 9.871054 2.296667 0 0 0
4.775685 7.811378 11.619961 0 0 0
9.480505 7.035846 0.647082 0 0 0
8.868067 10.134663 1.584573 0 0 0
10.735825 7.482301 3.744403 0 0 0
4.797298 3.021638 8.570107 0 0 0
6.479938 0.062927 4.394109 0 0 0
3.069998 7.687982 6.570897 0 0 0
10.811597 8.371383 7.651952 0 0 0
0.835099 3.241213 1.134827 0 0 0
1.501103 3.880456 11.626279 0 0 0
4.961216 6.080938 3.678907 0 0 0
4.561210 11.812593 0.917473 0 0 0
O
0.0
56
2.206114 6.592205 3.589702 0 0 0
10.732100 9.329175 7.464139 0 0 0
2.223431 5.278677 8.587705 0 0 0
7.645067 5.072650 7.182924 0 0 0
9.441138 11.068409 9.449919 0 0 0
4.369172 6.776752 7.936759 0 0 0
3.282936 9.482682 2.791039 0 0 0
6.983782 7.512527 8.446922 0 0 0
10.275126 7.456214 0.335466 0 0 0
6.079891 0.013400 10.521057 0 0 0
5.726767 7.932617 11.787012 0 0 0
6.576653 9.663115 2.952065 0 0 0
0.244163 5.639699 5.458062 0 0 0
6.663630 2.700629 5.933249 0 0 0
5.581856 3.546764 1.450071 0 0 0
0.473027 7.488905 10.421940 0 0 0
4.321913 1.286847 2.236269 0 0 0
10.184948 7.349734 2.937191 0 0 0
4.583616 3.625996 7.904262 0 0 0
5.543302 1.043739 7.917020 0 0 0
0.379637 10.328048 9.422410 0 0 0
9.440982 8.212171 9.931885 0 0 0
4.478494 5.312835 4.033938 0 0 0
7.478191 0.049752 1.204663 0 0 0
3.277196 8.196071 5.791242 0 0 0
7.654345 6.367523 4.523920 0 0 0
10.552967 0.883696 0.564552 0 0 0
7.327133 2.187912 3.213115 0 0 0
2.798415 4.478644 5.937614 0 0 0
5.576144 11.774659 4.268349 0 0 0
4.367718 5.644089 10.609721 0 0 0
11.442246 5.092536 9.586917 0 0 0
1.722208 10.224981 0.290858 0 0 0
7.680344 9.608853 11.908463 0 0 0
0.832246 7.557763 7.383029 0 0 0
4.082949 1.854934 5.180315 0 0 0
0.783357 7.521982 1.750993 0 0 0
8.435534 11.973924 4.652752 0 0 0
9.198317 8.867465 5.160566 0 0 0
3.149756 7.854211 11.453526 0 0 0
6.212763 8.605740 5.521239 0 0 0
0.148318 8.321816 4.692639 0 0 0
11.181329 10.061852 0.143693 0 0 0
9.634097 4.086678 0.898526 0 0 0
1.379823 0.808317 1.324665 0 0 0
7.797373 10.416174 7.147862 0 0 0
4.764720 10.926903 1.060141 0 0 0
10.141476 6.763653 6.761077 0 0 0
5.025996 7.555070 2.435468 0 0 0
4.488856 10.828791 6.602896 0 0 0
9.355994 10.461932 2.326700 0 0 0
4.339259 1.831479 11.135584 0 0 0
0.114986 10.461302 2.601943 0 0 0
7.521582 6.555799 1.539522 0 0 0
3.051578 3.746804 2.105064 0 0 0
2.994047 5.701360 1.057220 0 0 0
N
0.0
1
0.372586 5.305090 0.697343 0 0 0
C
0.0
2
1.266851 4.111790 0.638086 0 0 0
2.533331 4.581331 1.361807 0 0 0

NUMERICAL_ORBITAL
../03-DeePKS_Interation/orbital_dir/H_gga_6au_100Ry_2s1p.orb
../03-DeePKS_Interation/orbital_dir/O_gga_7au_100Ry_2s2p1d.orb
../03-DeePKS_Interation/orbital_dir/N_gga_7au_100Ry_2s2p1d.orb
../03-DeePKS_Interation/orbital_dir/C_gga_7au_100Ry_2s2p1d.orb

NUMERICAL_DESCRIPTOR
../03-DeePKS_Interation/glycine/projector/jle.orb
代码
文本

STRU 文件介绍如下:

ATOMIC_SPECIES
H 1.00 ../03-DeePKS_Interation/pseudo_dir/H_ONCV_PBE-1.0.upf # 元素,原子质量,使用的赝势文件
O 1.00 ../03-DeePKS_Interation/pseudo_dir/O_ONCV_PBE-1.0.upf
N 1.00 ../03-DeePKS_Interation/pseudo_dir/N_ONCV_PBE-1.0.upf
C 1.00 ../03-DeePKS_Interation/pseudo_dir/C_ONCV_PBE-1.0.upf

LATTICE_CONSTANT
1.8897259886         # 1.8897259886 Bohr =  1.0 Angstrom

LATTICE_VECTORS      # 晶格向量
12.028 0.0 0.0
0.0 12.028 0.0
0.0 0.0 12.028
                
ATOMIC_POSITIONS
Cartesian # 以笛卡尔坐标表示(Cartesian),单位为晶格常数

H # 元素名称
0.0 # 元素磁性
113 # 原子个数
8.477512 11.052771 4.986609 0 0 0 # 每个原子x,y,z方向的坐标和约束条件(1表示允许在该方向上移动,0表示固定) 
...(省略)

NUMERICAL_ORBITAL # 数值轨道
../03-DeePKS_Interation/orbital_dir/H_gga_6au_100Ry_2s1p.orb
../03-DeePKS_Interation/orbital_dir/O_gga_7au_100Ry_2s2p1d.orb
../03-DeePKS_Interation/orbital_dir/N_gga_7au_100Ry_2s2p1d.orb
../03-DeePKS_Interation/orbital_dir/C_gga_7au_100Ry_2s2p1d.orb

NUMERICAL_DESCRIPTOR # 投影子
../03-DeePKS_Interation/glycine/projector/jle.orb
代码
文本
  1. KPT 文件。KPT 文件包含了SCF 计算的 k 点设置:
代码
文本
[72]
! cat 04-DeePKS_Labeling/KPT
K_POINTS
0
Gamma
1 1 1 0 0 0
代码
文本
  1. *.upf*.orb 文件。各原子的 upf 和 orb 文件可以从 ABACUS 官网下载。
代码
文本

4.2 运行 ABACUS 自洽计算

代码
文本

准备好以上所有输入文件后,我们可以执行甘氨酸溶液体系的 SCF 计算。例如,使用命令行:

  • 镜像待安装。笔者在本地机器执行qsub sub.sh即可运行。
  • 设置 OMP_NUM_THREADS=1 使用单线程进行计算。
  • abacus 为 ABACUS 可执行程序的命令。

运行结束后查看running_scf.log输出文件:

代码
文本
[86]
! cat 04-DeePKS_Labeling/running_scf.log
                                                                                     
                             WELCOME TO ABACUS v3.0                                  
                                                                                     
               'Atomic-orbital Based Ab-initio Computation at UStc'                  
                                                                                     
                     Website: http://abacus.ustc.edu.cn/                             
                                                                                     
    Version: Parallel, in development
    Processor Number is 24
    Start Time is Sun Jan  8 00:19:35 2023
                                                                                     
 ------------------------------------------------------------------------------------

 READING GENERAL INFORMATION
                           global_out_dir = OUT.ABACUS/
                           global_in_card = INPUT
                               pseudo_dir = 
                              orbital_dir = 
                                    DRANK = 1
                                    DSIZE = 24
                                   DCOLOR = 1
                                    GRANK = 1
                                    GSIZE = 1
 The esolver type has been set to : ksdft_lcao




 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Reading atom information in unitcell:                              |
 | From the input file and the structure file we know the number of   |
 | different elments in this unitcell, then we list the detail        |
 | information for each element, especially the zeta and polar atomic |
 | orbital number for each element. The total atom number is counted. |
 | We calculate the nearest atom distance for each atom and show the  |
 | Cartesian and Direct coordinates for each atom. We list the file   |
 | address for atomic orbitals. The volume and the lattice vectors    |
 | in real and reciprocal space is also shown.                        |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




 READING UNITCELL INFORMATION
                                    ntype = 4
                 atom label for species 1 = H
                 atom label for species 2 = O
                 atom label for species 3 = N
                 atom label for species 4 = C
                  lattice constant (Bohr) = 1.88973
              lattice constant (Angstrom) = 1

 READING ATOM TYPE 1
                               atom label = H
                      L=0, number of zeta = 2
                      L=1, number of zeta = 1
             number of atom for this type = 113
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE

 READING ATOM TYPE 2
                               atom label = O
                      L=0, number of zeta = 2
                      L=1, number of zeta = 2
                      L=2, number of zeta = 1
             number of atom for this type = 56
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE
                      start magnetization = FALSE

 READING ATOM TYPE 3
                               atom label = N
                      L=0, number of zeta = 2
                      L=1, number of zeta = 2
                      L=2, number of zeta = 1
             number of atom for this type = 1
                      start magnetization = FALSE

 READING ATOM TYPE 4
                               atom label = C
                      L=0, number of zeta = 2
                      L=1, number of zeta = 2
                      L=2, number of zeta = 1
             number of atom for this type = 2
                      start magnetization = FALSE
                      start magnetization = FALSE

                        TOTAL ATOM NUMBER = 172

 CARTESIAN COORDINATES ( UNIT = 1.88973 Bohr ).
         atom                   x                   y                   z                 mag                  vx                  vy                  vz
      tauc_H1       8.47751200001           11.052771            4.986609                   0                   0                   0                   0
      tauc_H2      0.713459999993       6.62531200001            7.234243                   0                   0                   0                   0
      tauc_H3       8.37958999999           10.521278       7.85061999999                   0                   0                   0                   0
      tauc_H4       5.12692199999   0.000241999991202            3.475644                   0                   0                   0                   0
      tauc_H5       5.78029700001           10.219974            2.802691                   0                   0                   0                   0
      tauc_H6       0.47673500001           10.084497            1.767674                   0                   0                   0                   0
      tauc_H7      0.458904000007       9.17106099999       4.32953900001                   0                   0                   0                   0
      tauc_H8       7.22545100001            2.122528             5.40101                   0                   0                   0                   0
      tauc_H9       8.51897200001       6.70391199999       4.61555099999                   0                   0                   0                   0
     tauc_H10       9.52925400001           11.500578            10.32116                   0                   0                   0                   0
     tauc_H11       0.23749999999           10.445055       8.46931000001                   0                   0                   0                   0
     tauc_H12            6.736948           11.328984           10.410131                   0                   0                   0                   0
     tauc_H13      0.479656999991       9.39232800001       9.56684900001                   0                   0                   0                   0
     tauc_H14            0.743417       6.52100800001       1.12682599999                   0                   0                   0                   0
     tauc_H15            2.709654       7.31696500001            3.996281                   0                   0                   0                   0
     tauc_H16            6.454134            9.097445       4.74714100001                   0                   0                   0                   0
     tauc_H17            6.707681       7.05510299999            1.290373                   0                   0                   0                   0
     tauc_H18            4.720297      0.656670000006            7.583141                   0                   0                   0                   0
     tauc_H19            5.875757      0.301228999997       9.64277599999                   0                   0                   0                   0
     tauc_H20       9.30565599999            3.528874       1.53138999999                   0                   0                   0                   0
     tauc_H21       6.06663400001             7.52963           10.937747                   0                   0                   0                   0
     tauc_H22      0.347528000003            5.176702            9.186558                   0                   0                   0                   0
     tauc_H23            2.696763           10.177609      0.260226999996                   0                   0                   0                   0
     tauc_H24       8.68094400001             8.22831       9.31881699999                   0                   0                   0                   0
     tauc_H25      0.579453999992      0.935519000004      0.788905000002                   0                   0                   0                   0
     tauc_H26       1.14332299999            5.288025       5.53892400001                   0                   0                   0                   0
     tauc_H27       3.92906600001            5.677605           11.449092                   0                   0                   0                   0
     tauc_H28       5.88651800001       2.60303300001            5.440133                   0                   0                   0                   0
     tauc_H29            6.054872       4.29144299999            1.049866                   0                   0                   0                   0
     tauc_H30       4.55519299999       3.74469799999       1.58345099999                   0                   0                   0                   0
     tauc_H31       4.80248699999           11.142155       5.69042900001                   0                   0                   0                   0
     tauc_H32      0.507386000007       7.83872900001           11.326568                   0                   0                   0                   0
     tauc_H33       9.80029300001            8.220575            2.769882                   0                   0                   0                   0
     tauc_H34           10.356333           10.709876       9.08255199999                   0                   0                   0                   0
     tauc_H35            7.517673       1.63021300001       2.45409100001                   0                   0                   0                   0
     tauc_H36           10.937224            5.110278       8.74844599999                   0                   0                   0                   0
     tauc_H37       4.35869899999            3.022382       7.19063699999                   0                   0                   0                   0
     tauc_H38           11.152841       9.54436399999            6.671887                   0                   0                   0                   0
     tauc_H39           11.204836           10.273087            2.502405                   0                   0                   0                   0
     tauc_H40            1.540861           11.170513      0.394901000004                   0                   0                   0                   0
     tauc_H41            3.320854             9.09488       6.17240400001                   0                   0                   0                   0
     tauc_H42       8.28099200001            9.110674           11.389585                   0                   0                   0                   0
     tauc_H43      0.466384999998       7.76683000001       8.20245599999                   0                   0                   0                   0
     tauc_H44       6.65135999999       2.77582299999       2.91865300001                   0                   0                   0                   0
     tauc_H45            4.795009            4.517778       3.56035000001                   0                   0                   0                   0
     tauc_H46            4.635582       7.01815899999            1.785197                   0                   0                   0                   0
     tauc_H47       5.94629100001             1.62496       7.27758300001                   0                   0                   0                   0
     tauc_H48            9.156671             4.87372       1.06668199999                   0                   0                   0                   0
     tauc_H49       3.81936000001       5.29725800001       9.93156299999                   0                   0                   0                   0
     tauc_H50            9.659438      0.706990000001      0.860768000008                   0                   0                   0                   0
     tauc_H51            6.913244           11.921111      0.456256999994                   0                   0                   0                   0
     tauc_H52            7.156819       7.07002800001       4.97680299999                   0                   0                   0                   0
     tauc_H53       5.01695800001       1.80228400001       1.80534900001                   0                   0                   0                   0
     tauc_H54            7.764881            5.068147            6.217623                   0                   0                   0                   0
     tauc_H55            5.111135       7.22621800001       8.16827399999                   0                   0                   0                   0
     tauc_H56            7.180951       6.63458399999       8.02970500001                   0                   0                   0                   0
     tauc_H57       2.93596099999       7.20250499999      0.139211999998                   0                   0                   0                   0
     tauc_H58            2.983514            4.305543       4.98820399999                   0                   0                   0                   0
     tauc_H59       9.49604700001       6.08499399999            6.708427                   0                   0                   0                   0
     tauc_H60       6.86914499999       9.05311500001            11.94992                   0                   0                   0                   0
     tauc_H61            8.755458           10.096845            2.971789                   0                   0                   0                   0
     tauc_H62            5.283078       8.39267999999       5.42263899999                   0                   0                   0                   0
     tauc_H63           11.491615       5.12304199999       1.07810399999                   0                   0                   0                   0
     tauc_H64       6.98343300001           11.792354       2.01683500001                   0                   0                   0                   0
     tauc_H65       6.86391899999            8.072224            7.606946                   0                   0                   0                   0
     tauc_H66            3.944497       2.00669599999       4.14704800001                   0                   0                   0                   0
     tauc_H67      0.339058000005       6.26388799999       4.69370299999                   0                   0                   0                   0
     tauc_H68            4.748745             5.91008            7.958939                   0                   0                   0                   0
     tauc_H69       4.94172000001           10.549195      0.205022999998                   0                   0                   0                   0
     tauc_H70            3.581996            4.910788       6.18475000001                   0                   0                   0                   0
     tauc_H71       1.25083799999            7.218697       2.57344599999                   0                   0                   0                   0
     tauc_H72           10.184779            7.260062           11.392811                   0                   0                   0                   0
     tauc_H73       7.38214900001           11.245316             6.81537                   0                   0                   0                   0
     tauc_H74           11.864153       7.49444599999       1.96238799999                   0                   0                   0                   0
     tauc_H75       2.77497600001       4.65163100001            8.086785                   0                   0                   0                   0
     tauc_H76       2.52152999999       9.83341899999            2.339826                   0                   0                   0                   0
     tauc_H77       4.37712000001       8.27704100001       2.59391099999                   0                   0                   0                   0
     tauc_H78            8.887805       9.31731000001       5.98986699999                   0                   0                   0                   0
     tauc_H79      0.705336000009       8.13892000001            5.460177                   0                   0                   0                   0
     tauc_H80           11.688733            7.109435           10.252553                   0                   0                   0                   0
     tauc_H81            4.678569            2.712175           11.164536                   0                   0                   0                   0
     tauc_H82           11.146048       9.11749600001      0.425415000002                   0                   0                   0                   0
     tauc_H83            9.706977       9.14864000001           10.010559                   0                   0                   0                   0
     tauc_H84       5.21900399999           10.406819       6.99587099999                   0                   0                   0                   0
     tauc_H85       8.80767300001     0.0473409999954            3.750322                   0                   0                   0                   0
     tauc_H86           11.927291           10.112556            11.54869                   0                   0                   0                   0
     tauc_H87       3.78998099999      0.940395999993            5.262649                   0                   0                   0                   0
     tauc_H88       2.72624500001            6.123123       8.44660900001                   0                   0                   0                   0
     tauc_H89            2.837328             5.90818            3.502186                   0                   0                   0                   0
     tauc_H90       1.12798599999      0.197138999997       2.01503300001                   0                   0                   0                   0
     tauc_H91            7.214744       4.21797699999            7.299943                   0                   0                   0                   0
     tauc_H92           10.784087       6.42125900001            6.149549                   0                   0                   0                   0
     tauc_H93            10.97317            12.02713      0.662913000007                   0                   0                   0                   0
     tauc_H94       9.77211600001       8.16126399999       5.49805600001                   0                   0                   0                   0
     tauc_H95            5.211637       1.41101800001           11.076792                   0                   0                   0                   0
     tauc_H96     0.0565269999972       5.35634299999           11.745871                   0                   0                   0                   0
     tauc_H97       6.37080799999            8.842716            2.391141                   0                   0                   0                   0
     tauc_H98       2.99795500001            7.443466           10.603126                   0                   0                   0                   0
     tauc_H99       7.47169499999            6.611041            2.515934                   0                   0                   0                   0
    tauc_H100       3.51598200001       1.62513699999            1.842416                   0                   0                   0                   0
    tauc_H101            3.978843       9.87105400001       2.29666700001                   0                   0                   0                   0
    tauc_H102            4.775685       7.81137799999           11.619961                   0                   0                   0                   0
    tauc_H103            9.480505            7.035846      0.647082000009                   0                   0                   0                   0
    tauc_H104       8.86806700001           10.134663       1.58457300001                   0                   0                   0                   0
    tauc_H105           10.735825            7.482301            3.744403                   0                   0                   0                   0
    tauc_H106            4.797298            3.021638            8.570107                   0                   0                   0                   0
    tauc_H107       6.47993800001      0.062927000002       4.39410899999                   0                   0                   0                   0
    tauc_H108            3.069998       7.68798199999            6.570897                   0                   0                   0                   0
    tauc_H109           10.811597       8.37138300001            7.651952                   0                   0                   0                   0
    tauc_H110      0.835098999993            3.241213       1.13482700001                   0                   0                   0                   0
    tauc_H111       1.50110300001       3.88045600001           11.626279                   0                   0                   0                   0
    tauc_H112       4.96121599999            6.080938            3.678907                   0                   0                   0                   0
    tauc_H113       4.56120999999           11.812593      0.917473000008                   0                   0                   0                   0
      tauc_O1            2.206114       6.59220499999            3.589702                   0                   0                   0                   0
      tauc_O2             10.7321       9.32917500001            7.464139                   0                   0                   0                   0
      tauc_O3            2.223431       5.27867700001       8.58770499999                   0                   0                   0                   0
      tauc_O4            7.645067             5.07265            7.182924                   0                   0                   0                   0
      tauc_O5            9.441138           11.068409       9.44991900001                   0                   0                   0                   0
      tauc_O6            4.369172       6.77675200001            7.936759                   0                   0                   0                   0
      tauc_O7       3.28293599999            9.482682       2.79103900001                   0                   0                   0                   0
      tauc_O8            6.983782            7.512527            8.446922                   0                   0                   0                   0
      tauc_O9           10.275126            7.456214       0.33546600001                   0                   0                   0                   0
     tauc_O10            6.079891     0.0133999999914           10.521057                   0                   0                   0                   0
     tauc_O11       5.72676700001            7.932617           11.787012                   0                   0                   0                   0
     tauc_O12            6.576653            9.663115       2.95206499999                   0                   0                   0                   0
     tauc_O13      0.244163000006       5.63969899999       5.45806200001                   0                   0                   0                   0
     tauc_O14       6.66363000001       2.70062899999       5.93324900001                   0                   0                   0                   0
     tauc_O15       5.58185600001       3.54676400001            1.450071                   0                   0                   0                   0
     tauc_O16      0.473026999994       7.48890499999            10.42194                   0                   0                   0                   0
     tauc_O17       4.32191300001            1.286847       2.23626899999                   0                   0                   0                   0
     tauc_O18           10.184948            7.349734            2.937191                   0                   0                   0                   0
     tauc_O19            4.583616            3.625996            7.904262                   0                   0                   0                   0
     tauc_O20            5.543302            1.043739       7.91702000001                   0                   0                   0                   0
     tauc_O21      0.379636999991           10.328048       9.42240999999                   0                   0                   0                   0
     tauc_O22       9.44098199999            8.212171       9.93188500001                   0                   0                   0                   0
     tauc_O23            4.478494       5.31283499999       4.03393800001                   0                   0                   0                   0
     tauc_O24       7.47819100001     0.0497519999956       1.20466299999                   0                   0                   0                   0
     tauc_O25       3.27719599999       8.19607100001       5.79124199999                   0                   0                   0                   0
     tauc_O26            7.654345       6.36752299999             4.52392                   0                   0                   0                   0
     tauc_O27           10.552967            0.883696      0.564552000006                   0                   0                   0                   0
     tauc_O28            7.327133       2.18791199999       3.21311499999                   0                   0                   0                   0
     tauc_O29       2.79841500001       4.47864400001            5.937614                   0                   0                   0                   0
     tauc_O30       5.57614399999           11.774659            4.268349                   0                   0                   0                   0
     tauc_O31            4.367718            5.644089           10.609721                   0                   0                   0                   0
     tauc_O32           11.442246            5.092536            9.586917                   0                   0                   0                   0
     tauc_O33       1.72220799999           10.224981      0.290858000008                   0                   0                   0                   0
     tauc_O34       7.68034399999       9.60885300001           11.908463                   0                   0                   0                   0
     tauc_O35      0.832246000008       7.55776299999       7.38302900001                   0                   0                   0                   0
     tauc_O36       4.08294900001       1.85493400001       5.18031499999                   0                   0                   0                   0
     tauc_O37      0.783357000006       7.52198200001            1.750993                   0                   0                   0                   0
     tauc_O38       8.43553399999           11.973924       4.65275200001                   0                   0                   0                   0
     tauc_O39       9.19831700001            8.867465       5.16056599999                   0                   0                   0                   0
     tauc_O40            3.149756       7.85421099999           11.453526                   0                   0                   0                   0
     tauc_O41       6.21276299999             8.60574       5.52123900001                   0                   0                   0                   0
     tauc_O42      0.148317999998       8.32181600001       4.69263900001                   0                   0                   0                   0
     tauc_O43           11.181329           10.061852      0.143692999992                   0                   0                   0                   0
     tauc_O44            9.634097            4.086678      0.898525999991                   0                   0                   0                   0
     tauc_O45       1.37982299999      0.808317000009            1.324665                   0                   0                   0                   0
     tauc_O46       7.79737300001           10.416174            7.147862                   0                   0                   0                   0
     tauc_O47       4.76472000001           10.926903       1.06014099999                   0                   0                   0                   0
     tauc_O48           10.141476       6.76365300001            6.761077                   0                   0                   0                   0
     tauc_O49       5.02599600001       7.55507000001       2.43546799999                   0                   0                   0                   0
     tauc_O50       4.48885600001           10.828791       6.60289599999                   0                   0                   0                   0
     tauc_O51       9.35599400001           10.461932              2.3267                   0                   0                   0                   0
     tauc_O52       4.33925899999            1.831479           11.135584                   0                   0                   0                   0
     tauc_O53      0.114985999997           10.461302            2.601943                   0                   0                   0                   0
     tauc_O54            7.521582       6.55579899999            1.539522                   0                   0                   0                   0
     tauc_O55            3.051578       3.74680400001       2.10506400001                   0                   0                   0                   0
     tauc_O56            2.994047       5.70136000001       1.05722000001                   0                   0                   0                   0
      tauc_N1      0.372586000007             5.30509            0.697343                   0                   0                   0                   0
      tauc_C1            1.266851             4.11179       0.63808600001                   0                   0                   0                   0
      tauc_C2            2.533331       4.58133100001       1.36180699999                   0                   0                   0                   0


 READING ORBITAL FILE NAMES FOR LCAO
 orbital file: /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/H_gga_6au_100Ry_2s1p.orb
 orbital file: /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/O_gga_7au_100Ry_2s2p1d.orb
 orbital file: /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/N_gga_7au_100Ry_2s2p1d.orb
 orbital file: /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/C_gga_7au_100Ry_2s2p1d.orb

                          Volume (Bohr^3) = 11742.937938
                             Volume (A^3) = 1740.12178961

 Lattice vectors: (Cartesian coordinate: in unit of a_0)
              +12.028                  +0                  +0
                   +0             +12.028                  +0
                   +0                  +0             +12.028
 Reciprocal vectors: (Cartesian coordinate: in unit of 2 pi/a_0)
     +0.0831393415364                  -0                  +0
                   -0    +0.0831393415364                  -0
                   +0                  -0    +0.0831393415364




 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Reading pseudopotentials files:                                    |
 | The pseudopotential file is in UPF format. The 'NC' indicates that |
 | the type of pseudopotential is 'norm conserving'. Functional of    |
 | exchange and correlation is decided by 4 given parameters in UPF   |
 | file.  We also read in the 'core correction' if there exists.      |
 | Also we can read the valence electrons number and the maximal      |
 | angular momentum used in this pseudopotential. We also read in the |
 | trail wave function, trail atomic density and local-pseudopotential|
 | on logrithmic grid. The non-local pseudopotential projector is also|
 | read in if there is any.                                           |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<




                PAO radial cut off (Bohr) = 15

 Read in pseudopotential file is /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/H_ONCV_PBE-1.0.upf
                     pseudopotential type = NC
          exchange-correlation functional = PBE
                 nonlocal core correction = 0
                        valence electrons = 1
                                     lmax = 0
                           number of zeta = 0
                     number of projectors = 2
                           L of projector = 0
                           L of projector = 0
                PAO radial cut off (Bohr) = 15

 Read in pseudopotential file is /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/O_ONCV_PBE-1.0.upf
                     pseudopotential type = NC
          exchange-correlation functional = PBE
                 nonlocal core correction = 0
                        valence electrons = 6
                                     lmax = 1
                           number of zeta = 0
                     number of projectors = 4
                           L of projector = 0
                           L of projector = 0
                           L of projector = 1
                           L of projector = 1
                PAO radial cut off (Bohr) = 15

 Read in pseudopotential file is /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/N_ONCV_PBE-1.0.upf
                     pseudopotential type = NC
          exchange-correlation functional = PBE
                 nonlocal core correction = 0
                        valence electrons = 5
                                     lmax = 1
                           number of zeta = 0
                     number of projectors = 4
                           L of projector = 0
                           L of projector = 0
                           L of projector = 1
                           L of projector = 1
                PAO radial cut off (Bohr) = 15

 Read in pseudopotential file is /data/HOME_BACKUP/pengchao/glycine/deepks/glycine/pbe_2/iter/C_ONCV_PBE-1.0.upf
                     pseudopotential type = NC
          exchange-correlation functional = PBE
                 nonlocal core correction = 0
                        valence electrons = 4
                                     lmax = 1
                           number of zeta = 0
                     number of projectors = 4
                           L of projector = 0
                           L of projector = 0
                           L of projector = 1
                           L of projector = 1
     initial pseudo atomic orbital number = 0
                                   NLOCAL = 1332




 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Setup plane waves of charge/potential:                             |
 | Use the energy cutoff and the lattice vectors to generate the      |
 | dimensions of FFT grid. The number of FFT grid on each processor   |
 | is 'nrxx'. The number of plane wave basis in reciprocal space is   |
 | different for charege/potential and wave functions. We also set    |
 | the 'sticks' for the parallel of FFT. The number of plane waves    |
 | is 'npw' in each processor.                                        |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<





 SETUP THE PLANE WAVE BASIS
 energy cutoff for charge/potential (unit:Ry) = 400
          [fft grid for charge/potential] = 150, 150, 150
                      [fft grid division] = 2, 2, 2
      [big fft grid for charge/potential] = 75, 75, 75
                                     nbxx = 22500
                                     nrxx = 180000

 SETUP PLANE WAVES FOR CHARGE/POTENTIAL
                    number of plane waves = 1586405
                         number of sticks = 16453

 PARALLEL PW FOR CHARGE/POTENTIAL
     PROC   COLUMNS(POT)             PW
        1            685          66101
        2            685          66101
        3            685          66101
        4            685          66101
        5            685          66101
        6            685          66101
        7            686          66100
        8            686          66100
        9            686          66100
       10            686          66102
       11            686          66102
       12            686          66100
       13            686          66100
       14            686          66100
       15            686          66100
       16            686          66100
       17            686          66100
       18            686          66100
       19            686          66100
       20            685          66099
       21            685          66099
       22            685          66099
       23            685          66099
       24            685          66099
 --------------- sum -------------------
       24          16453        1586405
                            number of |g| = 4218
                                  max |g| = 36.1781936815
                                  min |g| = 0.062209351

 SETUP THE ELECTRONS NUMBER
             electron number of element H = 1
       total electron number of element H = 113
             electron number of element O = 6
       total electron number of element O = 336
             electron number of element N = 5
       total electron number of element N = 5
             electron number of element C = 4
       total electron number of element C = 8
            AUTOSET number of electrons:  = 462
 DONE : SETUP UNITCELL Time : 0.414418935776 (SEC)





 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Setup K-points                                                     |
 | We setup the k-points according to input parameters.               |
 | The reduced k-points are set according to symmetry operations.     |
 | We treat the spin as another set of k-points.                      |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<





 SETUP K-POINTS
                                    nspin = 1
                   Input type of k points = Monkhorst-Pack(Gamma)
                                   nkstot = 1
                               nkstot_ibz = 1
      IBZ             DirectX             DirectY             DirectZ              Weight    ibz2bz
        1                   0                   0                   0                   1         0
                               nkstot now = 1

  KPOINTS            DIRECT_X            DIRECT_Y            DIRECT_Z              WEIGHT
        1                   0                   0                   0                   1

           k-point number in this process = 1
       minimum distributed K point number = 1

  KPOINTS         CARTESIAN_X         CARTESIAN_Y         CARTESIAN_Z              WEIGHT
        1                   0                   0                   0                   2

  KPOINTS            DIRECT_X            DIRECT_Y            DIRECT_Z              WEIGHT
        1                   0                   0                   0                   2
 DONE : INIT K-POINTS Time : 0.448012828827 (SEC)

                           occupied bands = 231
                                   NLOCAL = 1332
                                   NBANDS = 277
                                   NBANDS = 277




 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Setup numerical orbitals:                                          |
 | This part setup: numerical atomic orbitals, non-local projectors   |
 | and neutral potential (1D). The atomic orbitals information        |
 | including the radius, angular momentum and zeta number.            |
 | The neutral potential is the sum of local part of pseudopotential  |
 | and potential given by atomic charge, they will cancel out beyond  |
 | a certain radius cutoff, because the Z/r character.                |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<





 SETUP ONE DIMENSIONAL ORBITALS/POTENTIAL
                        delta k  (1/Bohr) = 0.01
                        delta r    (Bohr) = 0.01
                        dr_uniform (Bohr) = 0.001
                        rmax       (Bohr) = 30
                                    kmesh = 1005
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     601    0.01       6           1           1
            2  0  1     601    0.01       6           1           1
            3  1  0     601    0.01       6           1           1
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     701    0.01       7           1           1
            2  0  1     701    0.01       7           1           1
            3  1  0     701    0.01       7           1           1
            4  1  1     701    0.01       7           1           1
            5  2  0     701    0.01       7           1           1
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     701    0.01       7           1           1
            2  0  1     701    0.01       7           1           1
            3  1  0     701    0.01       7           1           1
            4  1  1     701    0.01       7           1           1
            5  2  0     701    0.01       7           1           1
      ORBITAL  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     701    0.01       7           1           1
            2  0  1     701    0.01       7           1           1
            3  1  0     701    0.01       7           1           1
            4  1  1     701    0.01       7           1           1
            5  2  0     701    0.01       7           1           1
   DESCRIPTOR  L  N      nr      dr    RCUT  CHECK_UNIT    NEW_UNIT
            1  0  0     505    0.01    5.04        6.33           1
            2  0  1     505    0.01    5.04        1.58           1
            3  0  2     505    0.01    5.04       0.704           1
            4  0  3     505    0.01    5.04       0.396           1
            5  0  4     505    0.01    5.04       0.253           1
            6  0  5     505    0.01    5.04       0.176           1
            7  0  6     505    0.01    5.04       0.129           1
            8  0  7     505    0.01    5.04       0.099           1
            9  0  8     505    0.01    5.04      0.0782           1
           10  0  9     505    0.01    5.04      0.0633           1
           11  0 10     505    0.01    5.04      0.0524           1
           12  0 11     505    0.01    5.04       0.044           1
           13  0 12     505    0.01    5.04      0.0375           1
           14  0 13     505    0.01    5.04      0.0323           1
           15  0 14     505    0.01    5.04      0.0282           1
           16  1  0     505    0.01    5.04        2.95           1
           17  1  1     505    0.01    5.04        1.03           1
           18  1  2     505    0.01    5.04       0.521           1
           19  1  3     505    0.01    5.04       0.314           1
           20  1  4     505    0.01    5.04        0.21           1
           21  1  5     505    0.01    5.04        0.15           1
           22  1  6     505    0.01    5.04       0.113           1
           23  1  7     505    0.01    5.04      0.0878           1
           24  1  8     505    0.01    5.04      0.0703           1
           25  1  9     505    0.01    5.04      0.0575           1
           26  1 10     505    0.01    5.04      0.0479           1
           27  1 11     505    0.01    5.04      0.0406           1
           28  1 12     505    0.01    5.04      0.0348           1
           29  1 13     505    0.01    5.04      0.0302           1
           30  1 14     505    0.01    5.04      0.0264           1
           31  2  0     505    0.01    5.04        1.71           1
           32  2  1     505    0.01    5.04       0.728           1
           33  2  2     505    0.01    5.04       0.403           1
           34  2  3     505    0.01    5.04       0.256           1
           35  2  4     505    0.01    5.04       0.177           1
           36  2  5     505    0.01    5.04        0.13           1
           37  2  6     505    0.01    5.04      0.0994           1
           38  2  7     505    0.01    5.04      0.0785           1
           39  2  8     505    0.01    5.04      0.0635           1
           40  2  9     505    0.01    5.04      0.0525           1
           41  2 10     505    0.01    5.04      0.0441           1
           42  2 11     505    0.01    5.04      0.0376           1
           43  2 12     505    0.01    5.04      0.0324           1
           44  2 13     505    0.01    5.04      0.0282           1
           45  2 14     505    0.01    5.04      0.0248           1
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 SET NONLOCAL PSEUDOPOTENTIAL PROJECTORS
 max number of nonlocal projetors among all species is 4

 SETUP THE TWO-CENTER INTEGRATION TABLES

 SETUP THE DIVISION OF H/S MATRIX
 divide the H&S matrix using 2D block algorithms.
                                     nb2d = 64
 parameter nb2d is too large: nb2d = 64
 reset nb2d to value 1, this set would make the program keep working but maybe get slower during diagonalization.
                  trace_loc_row dimension = 1332
                  trace_loc_col dimension = 1332
                                     nloc = 73926
 Initialize the descriptor index for DeePKS (lcao line)
 lmax of descriptor = 2
 nmax of descriptor= 15
 total basis (all atoms) for descriptor= 
 Type 1 number_of_atoms 113
 Type 2 number_of_atoms 56
 Type 3 number_of_atoms 1
 Type 4 number_of_atoms 2
 descriptors_per_atom 135
 total_descriptors 23220

 -------------------------------------------
 SELF-CONSISTENT
 -------------------------------------------




 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 |                                                                    |
 | Search adjacent atoms:                                             |
 | Set the adjacent atoms for each atom and set the periodic boundary |
 | condition for the atoms on real space FFT grid. For k-dependent    |
 | algorithm, we also need to set the sparse H and S matrix element   |
 | for each atom.                                                     |
 |                                                                    |
 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<





 SETUP SEARCHING RADIUS FOR PROGRAM TO SEARCH ADJACENT ATOMS
                  longest orb rcut (Bohr) = 7
   longest nonlocal projector rcut (Bohr) = 1.64
              searching radius is (Bohr)) = 14
         searching radius unit is (Bohr)) = 1.89

 SETUP EXTENDED REAL SPACE GRID FOR GRID INTEGRATION
                        [real space grid] = 150, 150, 150
               [big cell numbers in grid] = 75, 75, 75
           [meshcell numbers in big cell] = 2, 2, 2
                      [extended fft grid] = 24, 24, 24
              [dimension of extened grid] = 124, 124, 124
                            UnitCellTotal = 27
              Atom number in sub-FFT-grid = 117
    Local orbitals number in sub-FFT-grid = 905
Successful completion of Potential's registration : local
Successful completion of Potential's registration : hartree
Successful completion of Potential's registration : xc
Successful completion of Potential's registration : tddft
                                 lgd_last = 0
                                  lgd_now = 905
 allocate DM , the dimension is 905
        enter setAlltoallvParameter, nblk = 1
checkpoint 2
                                     pnum = 0
                                     prow = 0
                                     pcol = 0
                             nRow_in_proc = 229
                             nCol_in_proc = 149
                                     pnum = 1
                                     prow = 0
                                     pcol = 1
                             nRow_in_proc = 229
                             nCol_in_proc = 149
                                     pnum = 2
                                     prow = 0
                                     pcol = 2
                             nRow_in_proc = 229
                             nCol_in_proc = 148
                                     pnum = 3
                                     prow = 0
                                     pcol = 3
                             nRow_in_proc = 229
                             nCol_in_proc = 151
                                     pnum = 4
                                     prow = 0
                                     pcol = 4
                             nRow_in_proc = 229
                             nCol_in_proc = 154
                                     pnum = 5
                                     prow = 0
                                     pcol = 5
                             nRow_in_proc = 229
                             nCol_in_proc = 154
                                     pnum = 6
                                     prow = 1
                                     pcol = 0
                             nRow_in_proc = 226
                             nCol_in_proc = 149
                                     pnum = 7
                                     prow = 1
                                     pcol = 1
                             nRow_in_proc = 226
                             nCol_in_proc = 149
                                     pnum = 8
                                     prow = 1
                                     pcol = 2
                             nRow_in_proc = 226
                             nCol_in_proc = 148
                                     pnum = 9
                                     prow = 1
                                     pcol = 3
                             nRow_in_proc = 226
                             nCol_in_proc = 151
                                     pnum = 10
                                     prow = 1
                                     pcol = 4
                             nRow_in_proc = 226
                             nCol_in_proc = 154
                                     pnum = 11
                                     prow = 1
                                     pcol = 5
                             nRow_in_proc = 226
                             nCol_in_proc = 154
                                     pnum = 12
                                     prow = 2
                                     pcol = 0
                             nRow_in_proc = 222
                             nCol_in_proc = 149
                                     pnum = 13
                                     prow = 2
                                     pcol = 1
                             nRow_in_proc = 222
                             nCol_in_proc = 149
                                     pnum = 14
                                     prow = 2
                                     pcol = 2
                             nRow_in_proc = 222
                             nCol_in_proc = 148
                                     pnum = 15
                                     prow = 2
                                     pcol = 3
                             nRow_in_proc = 222
                             nCol_in_proc = 151
                                     pnum = 16
                                     prow = 2
                                     pcol = 4
                             nRow_in_proc = 222
                             nCol_in_proc = 154
                                     pnum = 17
                                     prow = 2
                                     pcol = 5
                             nRow_in_proc = 222
                             nCol_in_proc = 154
                                     pnum = 18
                                     prow = 3
                                     pcol = 0
                             nRow_in_proc = 228
                             nCol_in_proc = 149
                                     pnum = 19
                                     prow = 3
                                     pcol = 1
                             nRow_in_proc = 228
                             nCol_in_proc = 149
                                     pnum = 20
                                     prow = 3
                                     pcol = 2
                             nRow_in_proc = 228
                             nCol_in_proc = 148
                                     pnum = 21
                                     prow = 3
                                     pcol = 3
                             nRow_in_proc = 228
                             nCol_in_proc = 151
                                     pnum = 22
                                     prow = 3
                                     pcol = 4
                             nRow_in_proc = 228
                             nCol_in_proc = 154
                                     pnum = 23
                                     prow = 3
                                     pcol = 5
                             nRow_in_proc = 228
                             nCol_in_proc = 154
receiver_size is 819025 ; receiver_size of each process is:
34121 34121 33892 34579 35266 35266 33674 33674 33448 34126 34804 34804 33078 33078 32856 33522 34188 34188 33972 33972 33744 34428 35112 35112 
sender_size is 826434 ; sender_size of each process is:
34121 36036 40590 41168 40016 42926 43010 45232 43172 37120 33592 30595 28560 25021 24768 24130 26136 27470 30738 31524 32256 36261 36190 35802 
                                 init_chg = atomic
 DONE : INIT SCF Time : 16.878 (SEC)


 LCAO ALGORITHM --------------- ION=   1  ELEC=   1--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00404168
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00622052

 Density error is 0.227314000648

       Energy                       Rydberg                            eV
   E_KohnSham                -1976.27439151                 -26888.592536
     E_Harris                -1988.47857191                -27054.6389289
      E_Fermi               -0.419967773079                -5.71395469025

 LCAO ALGORITHM --------------- ION=   1  ELEC=   2--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00364001815946
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00635725846671

 Density error is 0.0814572657435

       Energy                       Rydberg                            eV
   E_KohnSham                -1977.63064707                -26907.0453396
     E_Harris                -1977.76500213                 -26908.873334
      E_Fermi               -0.191615043833                -2.60705641865

 LCAO ALGORITHM --------------- ION=   1  ELEC=   3--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00341992685964
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00586206564199

 Density error is 0.0498116059971

       Energy                       Rydberg                            eV
   E_KohnSham                -1976.13026302                -26886.6315674
     E_Harris                -1976.20532493                 -26887.652837
      E_Fermi               -0.154651923865                -2.10414737123

 LCAO ALGORITHM --------------- ION=   1  ELEC=   4--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00337862138725
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00570424464891

 Density error is 0.00621204948294

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.94394593                -26884.0965933
     E_Harris                -1975.95007152                -26884.1799362
      E_Fermi               -0.128938410702                 -1.7542970766

 LCAO ALGORITHM --------------- ION=   1  ELEC=   5--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00343248496684
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00574741905578

 Density error is 0.00213983594865

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.98943873                -26884.7155546
     E_Harris                -1975.98972332                -26884.7194265
      E_Fermi               -0.128890193412                -1.75364104673

 LCAO ALGORITHM --------------- ION=   1  ELEC=   6--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00345884007165
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00580476537254

 Density error is 0.00105747326241

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96141636                -26884.3342906
     E_Harris                -1975.96146289                -26884.3349238
      E_Fermi               -0.130394966584                -1.77411453607

 LCAO ALGORITHM --------------- ION=   1  ELEC=   7--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347396918484
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00580968228732

 Density error is 0.00023116392174

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96138028                -26884.3337998
     E_Harris                -1975.96139028                -26884.3339357
      E_Fermi                -0.12987438085                -1.76703160378

 LCAO ALGORITHM --------------- ION=   1  ELEC=   8--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347061200901
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.0058137461561

 Density error is 8.84520165868e-05

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96095129                -26884.3279631
     E_Harris                -1975.96095208                -26884.3279737
      E_Fermi               -0.130417549668                -1.77442179468

 LCAO ALGORITHM --------------- ION=   1  ELEC=   9--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347291587297
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.0058131406283

 Density error is 2.73897806268e-05

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96116376                -26884.3308538
     E_Harris                -1975.96116385                 -26884.330855
      E_Fermi               -0.130231381083                -1.77188884114

 LCAO ALGORITHM --------------- ION=   1  ELEC=  10--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347338182217
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581435951942

 Density error is 7.63084372372e-06

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96128205                -26884.3324633
     E_Harris                -1975.96128206                -26884.3324634
      E_Fermi               -0.130263216266                -1.77232198103

 LCAO ALGORITHM --------------- ION=   1  ELEC=  11--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347368912615
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581451675197

 Density error is 3.11716499145e-06

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96116371                -26884.3308531
     E_Harris                -1975.96116371                -26884.3308531
      E_Fermi               -0.130261732168                -1.77230178883

 LCAO ALGORITHM --------------- ION=   1  ELEC=  12--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347381684749
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581473774185

 Density error is 9.93014256052e-07

       Energy                       Rydberg                            eV
   E_KohnSham                -1975.96118534                -26884.3311475
     E_Harris                -1975.96118534                -26884.3311475
      E_Fermi               -0.130260787559                -1.77228893677

 LCAO ALGORITHM --------------- ION=   1  ELEC=  13--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347385093602
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581476393895

 Density error is 2.68495121111e-07

       Energy                       Rydberg                            eV
   E_KohnSham                 -1975.9611737                -26884.3309891
     E_Harris                 -1975.9611737                -26884.3309891
      E_Fermi               -0.130261539369                -1.77229916567

 LCAO ALGORITHM --------------- ION=   1  ELEC=  14--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347386253503
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581477661417

 Density error is 8.74652341678e-08

       Energy                       Rydberg                            eV
   E_KohnSham                 -1975.9611767                -26884.3310299
     E_Harris                 -1975.9611767                -26884.3310299
       E_band                -315.293237188                -4289.78456662
   E_one_elec                -2526.32621042                -34372.4314685
    E_Hartree                +1424.85196768                 +19386.105567
         E_xc                -492.328005796                 -6698.4661638
      E_Ewald                -367.312466806                -4997.54249499
      E_demet                            +0                            +0
      E_descf                            +0                            +0
        E_exx                            +0                            +0
     E_DeePKS                -10.2075189363                -138.880419977
      E_Fermi               -0.130261482713                -1.77229839482

 charge density convergence is achieved
 final etot is -26884.3310299 eV

 STATE ENERGY(eV) AND OCCUPATIONS    NSPIN == 1
 1/1 kpoint (Cartesian) = 0 0 0 (0 pws)
       1       -21.5207        2.00000
       2       -21.5049        2.00000
       3       -21.2301        2.00000
       4       -21.1716        2.00000
       5       -21.0795        2.00000
       6       -21.0265        2.00000
       7       -20.9430        2.00000
       8       -20.8734        2.00000
       9       -20.7968        2.00000
      10       -20.7920        2.00000
      11       -20.7387        2.00000
      12       -20.6533        2.00000
      13       -20.5900        2.00000
      14       -20.5729        2.00000
      15       -20.5107        2.00000
      16       -20.4876        2.00000
      17       -20.4210        2.00000
      18       -20.3643        2.00000
      19       -20.3520        2.00000
      20       -20.3076        2.00000
      21       -20.3048        2.00000
      22       -20.2978        2.00000
      23       -20.2927        2.00000
      24       -20.2753        2.00000
      25       -20.2635        2.00000
      26       -20.2557        2.00000
      27       -20.2172        2.00000
      28       -20.2052        2.00000
      29       -20.1655        2.00000
      30       -20.1623        2.00000
      31       -20.1384        2.00000
      32       -20.1350        2.00000
      33       -20.1296        2.00000
      34       -20.1171        2.00000
      35       -20.0741        2.00000
      36       -20.0706        2.00000
      37       -20.0625        2.00000
      38       -20.0609        2.00000
      39       -20.0250        2.00000
      40       -19.9960        2.00000
      41       -19.9531        2.00000
      42       -19.9445        2.00000
      43       -19.9185        2.00000
      44       -19.9105        2.00000
      45       -19.8880        2.00000
      46       -19.8415        2.00000
      47       -19.8144        2.00000
      48       -19.7917        2.00000
      49       -19.6701        2.00000
      50       -19.6281        2.00000
      51       -19.6047        2.00000
      52       -19.5113        2.00000
      53       -19.4784        2.00000
      54       -19.4072        2.00000
      55       -19.3661        2.00000
      56       -19.2763        2.00000
      57       -17.0095        2.00000
      58       -12.3776        2.00000
      59       -10.2042        2.00000
      60       -10.1740        2.00000
      61       -10.1230        2.00000
      62       -10.0389        2.00000
      63       -9.88033        2.00000
      64       -9.69702        2.00000
      65       -9.63540        2.00000
      66       -9.46562        2.00000
      67       -9.42815        2.00000
      68       -9.41445        2.00000
      69       -9.33401        2.00000
      70       -9.31343        2.00000
      71       -9.30406        2.00000
      72       -9.27733        2.00000
      73       -9.24322        2.00000
      74       -9.21329        2.00000
      75       -9.20078        2.00000
      76       -9.16802        2.00000
      77       -9.15671        2.00000
      78       -9.13828        2.00000
      79       -9.09078        2.00000
      80       -9.05675        2.00000
      81       -9.03949        2.00000
      82       -9.00280        2.00000
      83       -8.97253        2.00000
      84       -8.93545        2.00000
      85       -8.86454        2.00000
      86       -8.84675        2.00000
      87       -8.84025        2.00000
      88       -8.82007        2.00000
      89       -8.78470        2.00000
      90       -8.75765        2.00000
      91       -8.73006        2.00000
      92       -8.68736        2.00000
      93       -8.64042        2.00000
      94       -8.62125        2.00000
      95       -8.59262        2.00000
      96       -8.56856        2.00000
      97       -8.50508        2.00000
      98       -8.47330        2.00000
      99       -8.43895        2.00000
     100       -8.40773        2.00000
     101       -8.39712        2.00000
     102       -8.35720        2.00000
     103       -8.32913        2.00000
     104       -8.28455        2.00000
     105       -8.23797        2.00000
     106       -8.23426        2.00000
     107       -8.17393        2.00000
     108       -8.16099        2.00000
     109       -8.11939        2.00000
     110       -8.10206        2.00000
     111       -7.99835        2.00000
     112       -7.97738        2.00000
     113       -7.87437        2.00000
     114       -7.80247        2.00000
     115       -7.77870        2.00000
     116       -7.59997        2.00000
     117       -6.99779        2.00000
     118       -6.76582        2.00000
     119       -6.59047        2.00000
     120       -6.44710        2.00000
     121       -6.21954        2.00000
     122       -6.10992        2.00000
     123       -6.09983        2.00000
     124       -6.04022        2.00000
     125       -6.00559        2.00000
     126       -5.92126        2.00000
     127       -5.90712        2.00000
     128       -5.87413        2.00000
     129       -5.82055        2.00000
     130       -5.78688        2.00000
     131       -5.77889        2.00000
     132       -5.76072        2.00000
     133       -5.66270        2.00000
     134       -5.59001        2.00000
     135       -5.57352        2.00000
     136       -5.50792        2.00000
     137       -5.47762        2.00000
     138       -5.45039        2.00000
     139       -5.40025        2.00000
     140       -5.28850        2.00000
     141       -5.27204        2.00000
     142       -5.24963        2.00000
     143       -5.20924        2.00000
     144       -5.18637        2.00000
     145       -5.13202        2.00000
     146       -5.11968        2.00000
     147       -5.05162        2.00000
     148       -5.02708        2.00000
     149       -5.01026        2.00000
     150       -4.99454        2.00000
     151       -4.96277        2.00000
     152       -4.92088        2.00000
     153       -4.91477        2.00000
     154       -4.86606        2.00000
     155       -4.83963        2.00000
     156       -4.81681        2.00000
     157       -4.79178        2.00000
     158       -4.75537        2.00000
     159       -4.73558        2.00000
     160       -4.70838        2.00000
     161       -4.65602        2.00000
     162       -4.64186        2.00000
     163       -4.59755        2.00000
     164       -4.57465        2.00000
     165       -4.54004        2.00000
     166       -4.49979        2.00000
     167       -4.47810        2.00000
     168       -4.44861        2.00000
     169       -4.38479        2.00000
     170       -4.30018        2.00000
     171       -4.24634        2.00000
     172       -4.22749        2.00000
     173       -4.13705        2.00000
     174       -4.04407        2.00000
     175       -3.86148        2.00000
     176       -3.66326        2.00000
     177       -3.54996        2.00000
     178       -3.52747        2.00000
     179       -3.51617        2.00000
     180       -3.48918        2.00000
     181       -3.48535        2.00000
     182       -3.45750        2.00000
     183       -3.41080        2.00000
     184       -3.32766        2.00000
     185       -3.31196        2.00000
     186       -3.27210        2.00000
     187       -3.23508        2.00000
     188       -3.21352        2.00000
     189       -3.19785        2.00000
     190       -3.17308        2.00000
     191       -3.15281        2.00000
     192       -3.13738        2.00000
     193       -3.12953        2.00000
     194       -3.10737        2.00000
     195       -3.07806        2.00000
     196       -3.06556        2.00000
     197       -3.06221        2.00000
     198       -3.04004        2.00000
     199       -3.03753        2.00000
     200       -3.01146        2.00000
     201       -3.00087        2.00000
     202       -2.97725        2.00000
     203       -2.96947        2.00000
     204       -2.95033        2.00000
     205       -2.90961        2.00000
     206       -2.89446        2.00000
     207       -2.86585        2.00000
     208       -2.81464        2.00000
     209       -2.80289        2.00000
     210       -2.75306        2.00000
     211       -2.74202        2.00000
     212       -2.70760        2.00000
     213       -2.69705        2.00000
     214       -2.68068        2.00000
     215       -2.66161        2.00000
     216       -2.60501        2.00000
     217       -2.57592        2.00000
     218       -2.55472        2.00000
     219       -2.53332        2.00000
     220       -2.50601        2.00000
     221       -2.49766        2.00000
     222       -2.47761        2.00000
     223       -2.45365        2.00000
     224       -2.34536        2.00000
     225       -2.29944        2.00000
     226       -2.28225        2.00000
     227       -2.22395        2.00000
     228       -2.14925        2.00000
     229       -2.11448        2.00000
     230       -2.04941        2.00000
     231       -1.77230        2.00000
     232        3.47015        0.00000
     233        4.05965        0.00000
     234        4.76907        0.00000
     235        4.92119        0.00000
     236        5.06944        0.00000
     237        5.23686        0.00000
     238        5.35402        0.00000
     239        5.38800        0.00000
     240        5.67504        0.00000
     241        5.77959        0.00000
     242        5.82633        0.00000
     243        5.92846        0.00000
     244        6.02261        0.00000
     245        6.08244        0.00000
     246        6.12751        0.00000
     247        6.23592        0.00000
     248        6.30846        0.00000
     249        6.36624        0.00000
     250        6.52017        0.00000
     251        6.58951        0.00000
     252        6.66717        0.00000
     253        6.69861        0.00000
     254        6.77893        0.00000
     255        6.89973        0.00000
     256        7.05175        0.00000
     257        7.08273        0.00000
     258        7.11536        0.00000
     259        7.15347        0.00000
     260        7.20289        0.00000
     261        7.29817        0.00000
     262        7.36034        0.00000
     263        7.39300        0.00000
     264        7.49937        0.00000
     265        7.59276        0.00000
     266        7.63609        0.00000
     267        7.68085        0.00000
     268        7.72190        0.00000
     269        7.79853        0.00000
     270        7.83316        0.00000
     271        7.92673        0.00000
     272        7.98688        0.00000
     273        8.03352        0.00000
     274        8.12809        0.00000
     275        8.14448        0.00000
     276        8.25088        0.00000
     277        8.25988        0.00000

 EFERMI = -1.772298394824647 eV
 OUT.ABACUS/ final etot is -26884.33102989164 eV
 correction force for each atom along direction 1 is 1.658097903011684e-05
 correction force for each atom along direction 2 is 1.227943257710597e-06
 correction force for each atom along direction 3 is 1.017309399449144e-05

 ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

    TOTAL-FORCE (eV/Angstrom)

 ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

     atom              x              y              z
       H1         +0.48096941         +0.70969173         -0.80047080
       H2        -0.050144161         -0.63341955         -0.11815875
       H3          +1.6718354          +1.2422693          +2.2965521
       H4         -0.10531528          +1.0704930         -0.75041216
       H5          +1.1722744         -0.46078862         +0.35698735
       H6         -0.17961370         +0.30874855         +0.64808057
       H7         -0.32177274         -0.33048919         -0.31259074
       H8         +0.74204574         +0.18787296        +0.060485623
       H9          +1.8193521         +0.59574426         -0.34309619
      H10         +0.51329726         -0.32866201         -0.72031480
      H11         +0.20257213         -0.23053974         +0.59267615
      H12         -0.18161689         +0.35043753         +0.19838510
      H13         +0.15615839         -0.67696930        +0.078838059
      H14        +0.044719171          -1.3615400         -0.24073049
      H15         -0.32600390       -0.0040231262         +0.26119144
      H16         +0.35990326         +0.61877230          -1.0533055
      H17         +0.93586322         -0.56652308         -0.41105650
      H18         +0.50047561        -0.064276966         -0.19761125
      H19         -0.26117389         +0.49420229          -1.3602747
      H20         -0.99637960          -2.5472231          +2.3478563
      H21         -0.12620387         +0.48392667          +1.3258744
      H22          -1.4116302         -0.33529229          +1.2415928
      H23         -0.78045742         -0.21018792         -0.31072496
      H24         +0.21081430         -0.40679010        +0.094374212
      H25         +0.21273934         +0.43304328         +0.44822157
      H26         +0.13966085         -0.33271136         +0.32566487
      H27         -0.67144688         -0.44632074         +0.54446162
      H28          -2.4795441        +0.042028522         -0.96977937
      H29         -0.37181512         -0.17200000         +0.15431077
      H30          +2.1039065        +0.032493009         -0.12318493
      H31         -0.22350382         -0.72292775          +1.4511636
      H32       +0.0084130824         -0.16507758         -0.49155835
      H33        -0.042645148       +0.0066157095        +0.085590759
      H34          -2.4452487          +1.4426908          +1.5450391
      H35        +0.030286173        -0.044138952         -0.36921607
      H36         -0.19133150         -0.17266336          +1.0210716
      H37         -0.29468743         +0.28404747         -0.55361197
      H38         +0.92116311        -0.011844577          -2.1407033
      H39         -0.66189699         +0.37420710         +0.19559932
      H40         +0.23263600         +0.24369132         -0.12104779
      H41         +0.18547225        -0.093857539         -0.57971970
      H42          +1.0309600         -0.80162192         -0.76516760
      H43         -0.58668349         +0.34734919          +2.2044837
      H44         -0.70323973         +0.89472119         -0.59651644
      H45         -0.11515728         +0.86080926         +0.13871329
      H46          -1.0402475          -1.4064839          -1.4634598
      H47         +0.33946064         +0.36828985         -0.78818830
      H48         -0.89728210          +1.4581762        +0.040119533
      H49          -1.1385098         -0.60685986         -0.49415299
      H50         -0.46481241        +0.045666816        +0.087652999
      H51         -0.37291954         -0.14392557         -0.39361549
      H52         -0.48699041        +0.081754540       -0.0078706809
      H53         +0.13001021         +0.17204237       -0.0093401225
      H54         -0.33480308         +0.37959297       +0.0069879031
      H55          +3.4088559          +3.0039729          +1.3409105
      H56         +0.11172661         +0.36552038         +0.61509664
      H57         -0.30188568         +0.30788882         -0.87222712
      H58         -0.28603654        -0.069939159          +1.0196279
      H59          -1.4667942         -0.86109198         +0.59856950
      H60         +0.47219138         +0.39798042        +0.067008671
      H61         -0.14806512        -0.018952402          +1.1824826
      H62         -0.54633078         -0.12133952        +0.069234003
      H63         -0.58817222         -0.69780657          +1.0305047
      H64         +0.79079274        -0.096391710          -1.5250127
      H65         +0.39952918         -0.58916586          +1.6453130
      H66         +0.50286347         -0.44258700          +2.9506375
      H67        +0.067668462         -0.82306456         +0.94933880
      H68        -0.036723745          -1.4204486         -0.15364696
      H69         +0.38467434         -0.31250961         -0.60991807
      H70          +1.6803802          +1.1714888         +0.50085412
      H71         +0.81592543         -0.13055147         +0.23325986
      H72        -0.012991837         +0.78478957          +1.1221611
      H73         +0.89513694         -0.79516402          +1.0886582
      H74         -0.70206870         +0.46043332         +0.31023773
      H75         -0.57744550         -0.24299025         +0.25864459
      H76         -0.90566013         -0.11050710         -0.22374568
      H77        -0.026894771         -0.97427662        +0.099259953
      H78         +0.14188597         -0.63657267         -0.83647998
      H79        +0.050244896        -0.046109183         +0.24053702
      H80          -2.8271437          -1.5689191         -0.42398789
      H81         -0.50376483          +1.4514235         +0.24058608
      H82         -0.49613437         +0.94304377         -0.35471552
      H83        -0.072637706         -0.33295239        -0.033056303
      H84          +1.5154769         -0.87623818         +0.68086866
      H85        -0.088554318         -0.61365317         +0.94330032
      H86         -0.44372153        +0.048423757         +0.16606378
      H87         +0.18530683         +0.18998161         +0.16687474
      H88         -0.87464318         -0.77272128         +0.20973740
      H89          +1.3213285          -1.3849067         -0.35821524
      H90         -0.50767165         -0.19359016         +0.59529347
      H91        -0.063774990        -0.071014214         +0.25453841
      H92          +1.4088989         -0.33172651         -0.30769636
      H93         -0.70056017         +0.49455152         -0.13561924
      H94         -0.22537704         +0.48701095        +0.079435412
      H95         -0.51655129         -0.79909047        +0.083592739
      H96         +0.11880465         +0.77352392         +0.21239347
      H97         +0.55613189          +1.5265920          +1.1326383
      H98         -0.18808910         -0.24362210        -0.027714438
      H99         +0.49314200         -0.40552617         -0.17208726
     H100         -0.74798206         +0.13216779         -0.20696615
     H101         +0.96368255          +1.2314292         -0.88055314
     H102         -0.87370024         +0.40038029         +0.21392108
     H103         -0.81114626        -0.015788460         +0.99725590
     H104         -0.36061179         +0.17980255          -2.0979670
     H105         -0.50303333         +0.20722373         -0.77152027
     H106         +0.62051876          -1.3121257          +2.0017023
     H107         +0.20246228         +0.29654036         -0.58049802
     H108        -0.015288230         -0.72698435         +0.28027882
     H109         -0.28436894         +0.88824120         -0.70877742
     H110        +0.073473722         +0.29743915         -0.12727667
     H111        +0.074624273        -0.018605861         +0.12087532
     H112        -0.036643578         -0.26315033        +0.011559984
     H113         -0.78044870          +2.8032608         -0.16478120
       O1          -1.2030135          +1.8529469         +0.62913957
       O2          -1.2294966         -0.27371504          +2.7722233
       O3         +0.89742016         +0.76119989         -0.17066901
       O4         +0.19500594         -0.14567018         -0.52851637
       O5          +2.0742425          -1.1129994         -0.85874927
       O6          -3.3492941          -1.8162295          -1.1881180
       O7         -0.60227955         -0.59311412          +1.1578565
       O8         -0.10003688         +0.54995962          -2.4440918
       O9         +0.61783870         -0.92605359          -1.8625995
      O10         +0.95977547          -1.4667366         +0.99881869
      O11         +0.96775365          -1.1283806          -1.7955552
      O12         -0.98724816          -1.1533591          -1.3403954
      O13        -0.040098638         +0.76120053          -1.2798908
      O14          +1.9593693         -0.35180574         +0.89376792
      O15          -1.5439376         +0.48688615         +0.28962972
      O16          +3.1376818          +1.9667084         +0.62257771
      O17         +0.35839609         -0.37821726         +0.25570825
      O18         +0.88821889         -0.11349089         +0.94994077
      O19         -0.59163402          +1.4678182          -1.3862988
      O20         -0.47989375         -0.72177139          +1.1408573
      O21         -0.14994357         +0.95720664         -0.35640587
      O22         -0.19357644         +0.48278816         -0.39833142
      O23         +0.69343308         -0.62650398         -0.27457126
      O24         -0.23314929         +0.75739736          +1.9468758
      O25        -0.067054515          +1.0907924         -0.10950753
      O26          -1.4415151         -0.56061807         +0.13375480
      O27         +0.81845933          -1.0535754        +0.017110284
      O28         +0.80541175         -0.77930787         +0.68293165
      O29          -1.6987951          -1.0345474          -1.6677007
      O30         -0.10505782          -1.1369805          +1.2825300
      O31          +2.0576844         +0.18651866        -0.027230476
      O32          +1.7274135         +0.52748537          -2.2309477
      O33          +1.0831526       -0.0058532472         +0.36328692
      O34          -1.0882906         +0.80577323         +0.77050671
      O35          +1.3300959         +0.20325474          -1.9016910
      O36         -0.86765572         +0.60838443          -3.1603118
      O37         -0.56823424         +0.23220642         -0.64405670
      O38         -0.45562609         -0.10438344        +0.028381676
      O39         -0.41184215         +0.54302659         +0.64143245
      O40         -0.12228119         +0.48309189          +1.1512981
      O41        -0.051972356         -0.89480105          +1.1655228
      O42         +0.24917478         +0.54401172        +0.010129432
      O43         +0.17146260         -0.80955112         -0.57769640
      O44          +1.7842386          +1.2940435          -2.1883350
      O45         +0.13621901        +0.020541096         -0.79706504
      O46          -2.4798129         -0.17776721          -3.1365447
      O47         +0.38380110          -2.6662810         +0.37702562
      O48         +0.14913148         +0.61274148       +0.0079436920
      O49         +0.66260731          +1.3061527          +1.5532722
      O50          -1.4717108          +1.3660259          -2.1956946
      O51         +0.48707268         -0.57747006         +0.94384937
      O52         +0.74950365         -0.22493944        -0.049001827
      O53          +1.1643262         -0.46584961         -0.25855320
      O54         -0.94057355         +0.57023197         +0.42474692
      O55          +1.2901126         -0.87000379          +1.2287939
      O56         +0.56245948         +0.50269089        +0.068679204
       N1         -0.39319043        -0.081417097          -2.6905335
       C1         -0.29531506          +1.2203175          +1.1982769
       C2         -0.81565481         -0.68525539          -1.5946904


 --------------------------------------------
 !FINAL_ETOT_IS -26884.33102989164 eV
 --------------------------------------------






  |CLASS_NAME---------|NAME---------------|TIME(Sec)-----|CALLS----|AVG------|PER%-------
                                      total         274.00         7       39.   1.0e+02%
                 Driver         driver_line         273.99         1   2.7e+02    1.e+02%
               PW_Basis      setuptransform        0.36106         1      0.36      0.13%
               PW_Basis  setup_struc_factor        0.99831         1       1.0      0.36%
            ORB_control      read_orb_first        0.43508         1      0.44      0.16%
          LCAO_Orbitals       Read_Orbitals        0.43508         1      0.44      0.16%
            NOrbital_Lm       extra_uniform        0.26745        63    0.0042     0.098%
          Mathzone_Add1       Uni_Deriv_Phi        0.23874        63    0.0038     0.087%
            ORB_control      set_orb_tables         11.402         1       11.       4.2%
         ORB_gen_tables          gen_tables         11.402         1       11.       4.2%
          ORB_table_phi          init_Table         3.0108         1       3.0       1.1%
          ORB_table_phi      cal_ST_Phi12_R         2.9945       548    0.0055       1.1%
         ORB_table_beta     init_Table_Beta         1.2610         1       1.3      0.46%
         ORB_table_beta       VNL_PhiBeta_R         1.2545       312    0.0040      0.46%
        ORB_table_alpha    init_Table_Alpha         6.8116         1       6.8       2.5%
        ORB_table_alpha        S_PhiAlpha_R         6.7816      1155    0.0059       2.5%
              ppcell_vl           init_vloc        0.32731         1      0.33      0.12%
        ESolver_KS_LCAO                 Run         237.49         1   2.4e+02       87.%
        ESolver_KS_LCAO           beforescf         3.0821         1       3.1       1.1%
        ESolver_KS_LCAO        beforesolver         2.0786         1       2.1      0.76%
        ESolver_KS_LCAO     set_matrix_grid        0.22531         1      0.23     0.082%
         Grid_Technique                init        0.18953         1      0.19     0.069%
            LCAO_Deepks      build_psialpha         1.8341         1       1.8      0.67%
         ORB_gen_tables  snap_psialpha_half         1.7062     44699   3.8e-05      0.62%
                 Charge          atomic_rho        0.79093         1      0.79      0.29%
               PW_Basis          recip2real         1.0473        77     0.014      0.38%
               PW_Basis    gathers_scatterp        0.69031        77    0.0090      0.25%
              Potential            init_pot        0.19203         1      0.19     0.070%
              Potential  update_from_charge         2.7668        15      0.18       1.0%
              Potential           cal_v_eff         2.7569        15      0.18       1.0%
           H_Hartree_pw           v_hartree        0.27649        15     0.018      0.10%
               PW_Basis          real2recip        0.80642       120    0.0067      0.29%
               PW_Basis    gatherp_scatters        0.32097       120    0.0027      0.12%
                  PotXC           cal_v_eff         2.4671        15      0.16      0.90%
          XC_Functional                v_xc         2.4592        15      0.16      0.90%
            HSolverLCAO               solve         225.38        14       16.       82.%
             HamiltLCAO            updateHk         195.17        14       14.       71.%
           OperatorLCAO                init         169.62        42       4.0       62.%
   Nonlocal<OperatorLCAO>        contributeHR        0.12831         1      0.13     0.047%
        LCAO_gen_fixedHbuild_Nonlocal_beta_new        0.12825         1      0.13     0.047%
                   Veff        contributeHk         25.557        14       1.8       9.3%
         Gint_interface            cal_gint         49.163        29       1.7       18.%
         Gint_interface     cal_gint_vlocal         22.905        14       1.6       8.4%
             Gint_Gamma           distri_vl         2.6080        14      0.19      0.95%
             Gint_Gamma     distri_vl_index         2.2035        14      0.16      0.80%
             Gint_Gamma     distri_vl_value        0.40449        14     0.029      0.15%
                 DeePKS        contributeHR         169.42        14       12.       62.%
            LCAO_Deepks    cal_projected_DM         164.29        16       10.       60.%
        LCAO_gen_fixedH         add_v_delta         116.86         7       17.       43.%
        LCAO_DESCRIPTOR         add_v_delta         116.60         7       17.       43.%
            HSolverLCAO     hamiltSolvePsiK         6.3403        14      0.45       2.3%
              DiagoElpa          elpa_solve         1.8431        14      0.13      0.67%
          ElecStateLCAO            psiToRho         23.870        14       1.7       8.7%
              elecstate              cal_dm        0.17092        15     0.011     0.062%
           psiMulPsiMpi              pdgemm        0.16168        15     0.011     0.059%
            LCAO_Charge         dm_2dTOgrid        0.29234        14     0.021      0.11%
         Gint_interface        cal_gint_rho         21.613        14       1.5       7.9%
                 Charge             mix_rho        0.26330        13     0.020     0.096%
      Force_Stress_LCAO      getForceStress         22.647         1       23.       8.3%
                 Forces       cal_force_loc        0.95109         1      0.95      0.35%
                 Forces        cal_force_ew        0.83219         1      0.83      0.30%
                 Forces       cal_force_scc         1.2014         1       1.2      0.44%
       Force_LCAO_gamma        ftable_gamma         19.662         1       20.       7.2%
       Force_LCAO_gamma      allocate_gamma        0.54057         1      0.54      0.20%
        LCAO_gen_fixedHbuild_Nonlocal_mu_new        0.35481         1      0.35      0.13%
       Force_LCAO_gamma        cal_foverlap        0.13804         1      0.14     0.050%
       Force_LCAO_gamma          cal_edm_2d        0.13528         1      0.14     0.049%
       Force_LCAO_gamma  cal_fvnl_dbeta_new        0.22399         1      0.22     0.082%
       Force_LCAO_gamma        cal_fvl_dphi         4.6455         1       4.6       1.7%
         Gint_interface      cal_gint_force         4.6455         1       4.6       1.7%
 ----------------------------------------------------------------------------------------

 CLASS_NAME---------|NAME---------------|MEMORY(MB)--------
                                         7.620e+04
        ORB_table_phi               Jl(x)          138.2
      ORB_table_alpha           Table_DSR          16.60
        Charge_Mixing                Rrho          10.99
        ORB_table_phi         Table_SR&TR          10.72
        Charge_Mixing               dRrho          9.613
        Charge_Mixing                drho          9.613
        Grid_Meshcell        index2normal          7.273
        Grid_Meshcell         index2ucell          7.273
  LocalOrbital_Charge      Density_Kernal          6.249
       ORB_table_beta            Table_NR          4.136
             PW_Basis           struc_fac          4.034
        atoms_on_grid          which_atom          2.377
        atoms_on_grid       which_bigcell          2.377
        atoms_on_grid      which_unitcell          2.377
             force_lo                  dS          1.692
             force_lo               dTVNL          1.692
        init_meshball        meshball_pos          1.426
               Charge                 rho          1.373
               Charge            rho_save          1.373
               Charge            rho_core          1.373
            Potential   v_effective_fixed          1.373
            Potential              vr_eff          1.373
        Charge_Mixing           rho_save2          1.373
 ----------------------------------------------------------

 Start  Time  : Sun Jan  8 00:19:35 2023
 Finish Time  : Sun Jan  8 00:24:09 2023
 Total  Time  : 0 h 4 mins 34 secs 
代码
文本

在这里,我们关注:

...(省略)

 LCAO ALGORITHM --------------- ION=   1  ELEC=   1--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00404168
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00622052

 Density error is 0.227314000648

       Energy                       Rydberg                            eV
   E_KohnSham                -1976.27439151                 -26888.592536
     E_Harris                -1988.47857191                -27054.6389289
      E_Fermi               -0.419967773079                -5.71395469025

...(省略)

 LCAO ALGORITHM --------------- ION=   1  ELEC=  14--------------------------------

vlocal exchange index is built
                          buffer size(M): = 12
                    buffer index size(M): = 12
 vlocal data are put in sender_buffer, size(M): = 6
 vlocal data are exchanged, received size(M): = 6

K-S equation was solved by genelpa2

eigenvalues were copied to ekb
              cal_dk_gamma_from_2D, NSPIN = 1
 number of non-zero elements in sender_buffer = 826434
                              sender_size = 826434
                       last sender_buffer = -0.00347386253503
 number of non-zero elements in receiver_buffer = 819025
                            receiver_size = 819025
                     last receiver_buffer = 0.00581477661417

 Density error is 8.74652341678e-08

       Energy                       Rydberg                            eV
   E_KohnSham                 -1975.9611767                -26884.3310299
     E_Harris                 -1975.9611767                -26884.3310299
       E_band                -315.293237188                -4289.78456662
   E_one_elec                -2526.32621042                -34372.4314685
    E_Hartree                +1424.85196768                 +19386.105567
         E_xc                -492.328005796                 -6698.4661638
      E_Ewald                -367.312466806                -4997.54249499
      E_demet                            +0                            +0
      E_descf                            +0                            +0
        E_exx                            +0                            +0
     E_DeePKS                -10.2075189363                -138.880419977
      E_Fermi               -0.130261482713                -1.77229839482

 charge density convergence is achieved
 final etot is -26884.3310299 eV

...(省略)

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

    TOTAL-FORCE (eV/Angstrom)

 ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

     atom              x              y              z
       H1         +0.48096941         +0.70969173         -0.80047080
       H2        -0.050144161         -0.63341955         -0.11815875
       H3          +1.6718354          +1.2422693          +2.2965521
       
...(省略)

可以看到,经过 14 次迭代后,电荷密度收敛,密度误差达到 8.74652341678e-08,最终总能量为 -26884.3310299 eV。

输出文件中也打印了受力,最后收集坐标、能量和受力以制作DP的数据集。

代码
文本

章节 5: DeePMD-kit训练DP模型

代码
文本

已有溶液体系的反应力场并不全面,这里我们使用 DeePMD-kit 训练一个DP模型。在这个示例中,训练集来自章节4。

代码
文本

5.1 下载教程资源

我们已经在 05-DP_Training 中准备了需要的文件。

代码
文本
[74]
! tree 05-DP_Training
05-DP_Training
├── lcurve.out
├── partial_dataset
│   └── glycine
│       └── 001
│           ├── set.000
│           │   ├── box.npy
│           │   ├── coord.npy
│           │   ├── energy.npy
│           │   └── force.npy
│           ├── type.raw
│           └── type_map.raw
├── run.json
└── sub.sh

4 directories, 9 files
代码
文本

05-DP_Training 文件夹下输入文件有

  • partial_dataset 文件夹用于存放训练和测试数据,
  • run.json 包含使用 DeePMD-kit 训练模型的参数设置,
代码
文本

5.2 准备训练数据

调用 dpdata 的工具,将 ABACUS生成的数据转换为 DeePMD-kit 训练所需的数据格式(NumPy数组)。

代码
文本

在开始训练之前,我们可以先检查数据集组成

代码
文本
[75]
! tree 05-DP_Training/partial_dataset/glycine/001
05-DP_Training/partial_dataset/glycine/001
├── set.000
│   ├── box.npy
│   ├── coord.npy
│   ├── energy.npy
│   └── force.npy
├── type.raw
└── type_map.raw

1 directory, 6 files
代码
文本

这些文件的作用如下:

  1. set.000:是一个目录,包含压缩格式的数据(NumPy压缩数组)。所有训练数据应首先转换为此格式,然后在 DeePMD-kit 中使用。该数据格式在 DeePMD-kit 手册中有详细解释,可以在 DeePMD-kit Data Introduction 中找到。
  2. type.raw:是一个文件,包含原子的类型(以整数表示)。
  3. type_map.raw:是一个文件,包含原子的类型名称。

让我们来看一下这些文件:

代码
文本
[76]
! cat 05-DP_Training/partial_dataset/glycine/001/type.raw
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
3
3
代码
文本

这告诉我们这个例子中有 172 个原子,其中4个原子类型由"0、1、2、3"表示。映射可以通过文件type_map.raw给出。

由于系统中的所有帧都具有相同的原子类型和原子序号,因此我们只需为整个系统指定一次类型信息。

代码
文本
[77]
! cat 05-DP_Training/partial_dataset/glycine/001/type_map.raw
H
O
N
C
代码
文本

其中原子H、O、N、C分别被赋予类型"0、1、2、3"

代码
文本

5.3 准备输入脚本

训练数据准备完成后,接下来就可以进行训练。让我们进入训练目录看一下运行所需的脚本:

代码
文本
[78]
! cat 05-DP_Training/run.json
{
    "model": {
      "type_map":           ["H","O","N","C"],      
	  "descriptor": {
		"_comment":         "if type = se_a_tpe: can’t apply compression method while using atom type embedding",
        "type":             "se_e2_a",
		"_comment":         "sel: [16 32 32] means maximal number of neighbors = 16H 32O 32N",
		"_comment":         "sel: auto:1.1 means automatically counts maximal number of neighbors*1.1",
        "sel":              "auto:1.1",
        "rcut_smth":        0.5,
        "rcut":             6.0,
        "neuron":           [25,50,100],
		"activation_function": "tanh",
        "resnet_dt":        false,
		"_comment":         "axis_neuron: Size of the submatrix of G (embedding matrix)",
        "axis_neuron":      16,
		"seed":             20230129,
	    "_comment":		    "descriptor that's all--------------------------------------------------------------"		
      },
      "fitting_net": {
		"_comment":         "other types: dipole or polar",
		"type":             "ener",
        "neuron":           [240,240,240],
		"activation_function": "tanh",
        "resnet_dt":        true,
		"seed":             20230129,
	    "_comment":		    "fitting_net that's all-------------------------------------------------------------"		
      },  
    "_comment": " model that's all------------------------------------------------------------------------------"
    },

    "loss": {
		"_comment": "loss = pref_e * loss_e + pref_f * loss_f + pref_v * loss_v",
		"_comment": "pref_f(t) = start_pref_f * ( lr(t) / start_lr ) + limit_pref_f * ( 1 - lr(t) / start_lr )",
        "start_pref_e":      0.02,
        "limit_pref_e":      1.0,
        "start_pref_f":      1000,
        "limit_pref_f":      1.0,
        "start_pref_v":      0.0,
        "limit_pref_v":      0.0,
	    "_comment": " loss that's all-----------------------------------------------------------------------------"
    },

    "learning_rate": {
		"_comment": "lr(t) = start_lr * decay_rate ^ ( training step / decay_steps )",
		"_comment": "decay_rate and decay_steps are automatically determined by start_lr, stop_lr and training step)",
        "type":              "exp",
		"_comment": "When parallel training or batch size scaled, how to alter learning rate. Valid values are linear`(default), `sqrt or none.",
		"_scale_by_worker":   "sqrt",
        "start_lr":          1e-03,
	"stop_lr":               1e-08,
	    "_comment": " learning_rate that's all--------------------------------------------------------------------"
    },

    "training": {
        "numb_steps":        100000,
	"seed":                  20230129,
        "disp_file":         "lcurve.out",
        "disp_freq":         1000,
        "numb_test":         10,
        "save_freq":         10000,
        "save_ckpt":         "model.ckpt",
        "disp_training":     true,
        "time_training":     true,
        "profiling":         false,
        "profiling_file":    "timeline.json",
	"training_data": {
	    "systems":		 [
			"partial_dataset/glycine/001"		
		],
	    "batch_size":	"auto",
        "_auto_prob": 	"prob_sys_size; 0:14:0.25; 14:56:0.75",	
	    "_comment": " training_data that's all--------------------------------------------------------------------"
		},
		"_comment": " training that's all-------------------------------------------------------------------------"		
    }
}
代码
文本

input.json 包含了 DP 模型训练过程中所需的各种参数,定义和控制训练任务。这些参数在 DeePMD-kit 手册中有详细的解释,所以这里只做简单介绍。

在 model 模块, 指定嵌入和拟合网络的参数。

    "model":{
    "type_map":    ["H","O","N","C"],                         # 元素名称
    "descriptor":{
        "type":            "se_e2_a",                    # 描述符类型
        "sel":             "auto:1.1",                   # 原子的选定邻居数
        "rcut_smth":       0.50,                         # 光滑截止半径
        "rcut":            6.00,                         # 截止半径
        "neuron":          [25,50,100],                 # 嵌入网络尺寸
        "resnet_dt":       false,
        "axis_neuron":     16,                           # 嵌入子网络横向尺寸
    },
    "fitting_net":{
        "neuron":          [240,240,240],              # 拟合网络尺寸
        "resnet_dt":       true,
    },
},

描述符 se_e2_a 用于 DP 模型的训练。将嵌入和拟合神经网络的大小分别设置为 [25,50,100] 和 [240,240,240]。 里的成分会从 0.5 到 6 Å 平滑地趋于 0。

下面的参数指定学习效率和损失函数:

    "learning_rate" :{
        "type":                "exp",
        "start_lr":             1e-03,                   # 起始学习率   
        "stop_lr":              1e-08,                   # 结束学习率 
    },
    "loss" :{
        "type":                "ener",
        "start_pref_e":        0.02,                      # 能量起始权重
        "limit_pref_e":        1,                         # 能量最终权重
        "start_pref_f":        1000,                      # 力起始权重
        "limit_pref_f":        1,                         # 力最终权重
        "start_pref_v":        0,                         # 维里
        "limit_pref_v":        0,
    },

在损失函数中, 从 0.02 逐渐增加到 1 ,而 f 从 1000 逐渐减小到 1 ,这意味着力项在开始时占主导地位,而能量项和维里项在结束时变得重要。这种策略非常有效,并且减少了总训练时间。 设为 0 ,这表明训练过程中不包含任何维里数据。将起始学习率、停止学习率分别设置为 1e-3,1e-8。模型训练步数为

训练参数如下:

    "training" : {
        "training_data": {
            "systems":            ["partial_dataset/glycine/001"],         # 训练数据路径
            "batch_size":         "auto",                               # 自动确定,natoms*batch_size≥32
        },
        "numb_steps":             100000,                               # 训练步数
        "disp_file":              "lcurve.out",                         # 写入学习曲线到文件
        "disp_freq":              1000,                                 # 写入学习曲线的频率
        "save_freq":              10000,                                # 保存模型相关文件频率
    },
代码
文本

5.4 模型训练

准备好训练脚本后,我们可以用 DeePMD-kit 开始训练,本地机器只需运行qsub sub.sh:

代码
文本
[79]
! head -n 5 05-DP_Training/lcurve.out
! tail -n 4 05-DP_Training/lcurve.out
#  step      rmse_trn    rmse_e_trn    rmse_f_trn         lr
      0      2.93e+01      4.04e-01      9.25e-01    1.0e-03
   1000      8.96e+00      3.79e-02      2.83e-01    1.0e-03
   2000      7.41e+00      4.41e-02      2.34e-01    1.0e-03
   3000      6.39e+00      1.03e-01      2.02e-01    1.0e-03
9997000      6.88e-02      4.36e-04      6.82e-02    1.0e-08
9998000      4.95e-02      6.52e-04      4.86e-02    1.0e-08
9999000      5.79e-02      4.61e-04      5.73e-02    1.0e-08
10000000      5.72e-02      4.55e-05      5.69e-02    1.0e-08
代码
文本

第2、3、4列分别介绍了总loss、能量和力的训练误差。 本工作经过 10000000 步训练,训练误差可以通过简单的 Python 脚本对该文件进行可视化:

代码
文本
[80]
import numpy as np
import matplotlib.pyplot as plt

data = np.genfromtxt("./05-DP_Training/lcurve.out", names=True)
for name in data.dtype.names[1:-1]:
plt.plot(data['step'], data[name], label=name)
plt.legend()
plt.xlabel('Step')
plt.ylabel('Loss')
plt.yscale('log')
plt.show()

代码
文本

当训练过程异常停止时,我们可以从提供的检查点重新开始训练,只需运行

代码
文本
[ ]
! cd ./05-DP_Training && dp train --restart model.ckpt input.json
代码
文本

需要注意的是 input.json 需要和上一个保持一致。

代码
文本

5.5 冻结和压缩模型

在训练结束时,保存在 TensorFlow 的 checkpoint 文件中的模型参数通常需要冻结为一个以扩展名 .pb 结尾的模型文件。 当训练结束时,在sub.sh脚本中会自动执行dp freeze,将输出一个名为frozen_model.pb模型文件。紧接着,压缩frozen_model.pb模型通常会将基于 DP 的计算速度提高一个数量级,并且消耗更少的内存。 通过dp compress压缩,将输出一个名为frozen_model_cpmpressed.pb模型文件。

代码
文本
代码
文本
[82]
! cat 05-DP_Training/sub.sh
#!/bin/bash
#PBS -l select=1:ncpus=4:mpiprocs=1:ngpus=1:ompthreads=4
#PBS -l walltime=24:00:00
#PBS -q gpu_a100
#PBS -o dptrain.out
#PBS -j oe
#PBS -N train

# change dir submission dir
cd $PBS_O_WORKDIR

# source env
export PATH=/work/pzhang/app/miniconda/3/bin:$PATH
source activate deepmdkit_2.1.5

# run job
if [ ! -f tag_0_finished ] ;then
    { if [ ! -f model.ckpt.index ]; then
        CUDA_VISIBLE_DEVICES=0 horovodrun -np 1
        dp train --mpi-log=master run.json ;
    else
        CUDA_VISIBLE_DEVICES=0 horovodrun -np 1
        dp train --mpi-log=master run.json --restart model.ckpt; fi }
    1>> train.log 2>> train.log
    { if test $? -ne 0; then touch tag_0_failure; 
	else
	  dp freeze && dp compress && touch tag_0_finished; fi }
fi

# Run the application - the line below is just a random examp
#dp train run.json
#dp train run.json --restart model.ckpt
#dp freeze
#dp compress
代码
文本

5.6 模型测试

我们可以通过运行dp test命令检查训练模型的质量,测试集来自独立的构象,并在M06-2X级别下完成计算。本工作的测试误差如下图(因为描述子更简单,在构象数数量比DeePKS数据集高两个数量级下,DP模型测试误差相对比DeePKS模型大一些,但精度足够用以跑DPMD)

代码
文本

章节 6: LAMMPS进行深度势能分子动力学(DPMD)

在训练好DP模型后,我们可以将其应用于 LAMMPS 软件中,以便增强采样跑质子在溶液中的转移反应。

代码
文本

6.1 下载教程资源

我们已经在 06-DPMD+Enhanced_sampling 中准备了需要的文件。

代码
文本
[83]
! tree 06-DPMD+Enhanced_sampling
06-DPMD+Enhanced_sampling
├── COLVAR
├── Glycine128H2O_opt_atomic.data
├── geo.lammpstrj
├── in.lammps
└── input.plumed

0 directories, 5 files
代码
文本
  • in.lammpsGlycine128H2O_opt_atomic.data 是 LAMMPS 的输入文件
  • input.plumed 是 PLUMED 的输入文件

本教程采用 DeePMD-kit(2.1.5)软件包中预置的 LAMMSP 程序完成,PLUMED需要手动修改CV代码后,借助plumed-feedstock安装在DeePMD-kit环境下。

代码
文本

6.2 LAMMPS输入文件

溶液体系 LAMMPS NVT-MD 的控制文件如下:

代码
文本
[84]
! cat 06-DPMD+Enhanced_sampling/in.lammps
# Variables: Specifies variables and their values to be used in the script.
variable        NSTEPS          equal 500000
variable        THERMO_FREQ     equal 10
variable        DUMP_FREQ       equal 10
variable        TEMP            equal 300.0
variable        TAU_T           equal 0.040
variable	    SEED1           equal 20230216
variable	    SEED2           equal 20230216 

# Prints the following lines to the screen
echo			screen

units           metal # Specifies the units used in the simulation (metal units).
boundary        p p p # Sets the boundary conditions for the simulation (periodic in all three directions).
atom_style      atomic # Sets the atom style used to define atom properties (atomic style).

read_data		Glycine128H2O_opt_atomic.data # Reads the data file that contains the initial atomic positions and properties of the system.
#read_restart	../5000000.comp

neighbor        1.0 bin # Defines the neighbor list settings for pairwise interactions (bin method with a cutoff of 1.0).

pair_style      deepmd  frozen_model.pb # Specifies the potential model used for pairwise interactions (Deep Potential Molecular Dynamics).
pair_coeff      * * # indicates that the potential coefficients are assigned to all pairs of atom types.

thermo_style    custom step temp density pe ke etotal vol press # Specifies the output style for thermodynamic properties.
thermo          ${THERMO_FREQ} # is the frequency at which thermodynamic output should be printed.

velocity        all create ${TEMP} ${SEED2} dist gaussian # Assigns velocities to all atoms.

# a fix using the PLUMED package with an input and output file specified.
fix             dpgen_plm all plumed plumedfile input.plumed outfile output.plumed 

# a thermostat fix that controls the temperature using a stochastic velocity rescaling algorithm.
fix             1 all nve
fix             2 all temp/csvr ${TEMP} ${TEMP} ${TAU_T} ${SEED1}

# Specifies the dump output for atomic positions.
dump            glycine1  all custom ${DUMP_FREQ}   geo.lammpstrj    id type x y z
dump_modify	    glycine1  sort id

restart			100000 restart.*.cont # is the frequency at which restart files will be written.

timestep        0.001 # ps, Specifies the length of each time step in the simulation.
run             ${NSTEPS} # Runs the simulation for the specified number of steps (${NSTEPS}).

write_restart	*.comp # Writes a restart file for the simulation.
write_data      *.data # Writes the final atomic configuration to a data file.
代码
文本

6.3 PLUMED输入文件

与章节1中的采样设置类似,我们只额外加了一些用于后处理分析的输出参数,溶液体系 OPES Voronoi CVs 的控制文件如下:

代码
文本
[85]
! cat 06-DPMD+Enhanced_sampling/input.plumed
# this is using Angstrom
UNITS LENGTH=A

# set atom groups
GlyN:      GROUP ATOMS=385      
GlyOhasH:  GROUP ATOMS=391      
GlyOnotH:  GROUP ATOMS=393
GlyH:      GROUP ATOMS=386,392,394
WaterO:    GROUP ATOMS=1-382:3
WaterH:    GROUP ATOMS=2-383:3,3-384:3

# define CVs
cp:    VORONOIC1P GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-30   D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
cm:    VORONOIC1M GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-30   D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
d05:   VORONOID2  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-5    D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
s05:   VORONOIS1  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-5    D_0=256     D_1=3           NLIST NL_CUTOFF=2.4 NL_STRIDE=1
c05:   VORONOIC0  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-5    D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
d08:   VORONOID2  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-8    D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
s08:   VORONOIS1  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-8    D_0=256     D_1=3           NLIST NL_CUTOFF=2.4 NL_STRIDE=1
c08:   VORONOIC0  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-8    D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
d100:  VORONOID2  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-100  D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
s100:  VORONOIS1  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-100  D_0=256     D_1=3           NLIST NL_CUTOFF=2.4 NL_STRIDE=1
c100:  VORONOIC0  GROUPA=WaterO,GlyN,GlyOhasH,GlyOnotH GROUPB=WaterH,GlyH NRX=3 LAMBDA=-100  D_0=2 D_1=2 D_2=0.5 D_3=0.5 NLIST NL_CUTOFF=2.4 NL_STRIDE=1
d_N_O1:  DISTANCE ATOMS=GlyN,GlyOhasH
d_N_O2:  DISTANCE ATOMS=GlyN,GlyOnotH
ene: ENERGY 

# define opes
OPES_METAD ...
   RESTART=NO
   LABEL=opes
   ARG=s05,d05
   FILE=HILLS
   TEMP=300
   PACE=500
   BARRIER=35
   STATE_WFILE=STATE   
   STATE_WSTRIDE=5000 
   STORE_STATES
   WALKERS_MPI
... OPES_METAD 

# print CVs and bias
FLUSH STRIDE=1000
PRINT ...
 ARG=s05,d05,c05,s08,d08,c08,s100,d100,c100,cp,cm,d_N_O1,d_N_O2,opes.*,ene
 STRIDE=1
 FILE=COLVAR
 RESTART=NO
... PRINT

ENDPLUMED
代码
文本

6.4 结果简析

本工作进行了30ns的充分增强采样,CVs与bias随时间的变化如下图

alt CVs.png

最终我们可以计算得到的反应自由能面,基本包含了所有的构象转变

alt fes.png

正好对应3条质子转移路径

alt pt.png

代码
文本

结语

在这项工作中,我们通过如下工作流(主要借助DeePKS、DeePMD、OPES、Voronoi CVs)完成了甘氨酸在水溶液中的多种质子转移通道的探索,相信该方法也能适用于多种场景。

代码
文本

参考文献

如果您对本notebook中介绍的具体案例感兴趣,请看

Intramolecular and water mediated tautomerism of solvated glycine JCIM arXiv

Cooresponding notebooks:

OPES(on-the-fly probability enhanced sampling)

Voronoi CVs for enhanced sampling autoionization and tautomerism

代码
文本
Deep Learning
中文
notebook
Molecular Dynamics
DeePMD
DeePKS
Enhanced Sampling
Deep Learning中文notebookMolecular DynamicsDeePMDDeePKSEnhanced Sampling
已赞9
本文被以下合集收录
机器学习与DFT精华帖
gtang
更新于 2024-09-10
38 篇21 人关注
打通DPA2-ABACUS-DeepKS-DeepMD的基础与案例
weiqingzhou@whu.edu.cn
更新于 2024-05-21
1 篇5 人关注
推荐阅读
公开
从 DFT 先去 DeePKS 再到 DeePMD | DeePKS案例篇 + 增强采样副本
Deep Learning中文notebookMolecular DynamicsDeePMDDeePKSEnhanced Sampling
Deep Learning中文notebookMolecular DynamicsDeePMDDeePKSEnhanced Sampling
山妖
发布于 2024-05-21
公开
从 DFT 先去 DeePKS 再到 DeePMD | DeePKS基础篇
Deep LearningMolecular DynamicsDeePKSDeePMDDFTnotebook中文
Deep LearningMolecular DynamicsDeePKSDeePMDDFTnotebook中文
zhangpengchao@dp.tech
发布于 2023-09-28
10 赞14 转存文件
评论
 ! cat 01-Sampling_co...

zhangwei2011@hotmail.com

11-22 06:46
请问这是哪个版本的plumed?可以使用 voronoi 

zhangpengchao@dp.tech

作者
04-07 03:07
To use additional Voronoi CVs code, put the three .cpp files (https://github.com/Zhang-pchao/GlycineTautomerism) into /your_plumed_path/plumed/src/colvar, and then compile plumed.
评论
 这里所用的集合变量(collective...

1063910598@qq.com

11-27 07:07
希望可以详细解释一下这个CV,看了半天没懂555555

zhangpengchao@dp.tech

作者
04-07 03:09
回复 1063910598@qq.com Please see the code on https://github.com/Zhang-pchao/GlycineTautomerism/tree/main/Voronoi_collective_variables

zhangpengchao@dp.tech

作者
04-15 09:42
https://bohrium.dp.tech/notebooks/83327491785
评论