start adding QE support to exampes/QUANTUM

This commit is contained in:
Steve Plimpton
2023-02-03 18:14:50 -07:00
parent c45b9a5301
commit b7ed8828e7
6 changed files with 300 additions and 4 deletions

View File

@ -0,0 +1,63 @@
# Test runs of QMMM with LAMMPS and Quantum Espress (QE)
Step 1: build LAMMPS
Step 2: download/build QE with MDI support
Step 3: run test problem
---------------------------------
---------------------------------
Step 1: build LAMMPS
The molecule and kspace packages are needed for the 2-water test
problem. Copy the final LAMMPS executable into the
examples/QUANTUM/PySCF directory.
Traditional make:
% cd ~/lammps/lib/mdi
% python Install.py -m mpi
% cd ~/lammps/src
% make yes-mdi yes-molecule yes-kspace
% make -j mpi
% cp lmp_mpi ~/lammps/examples/QUANTUM/QE
CMake:
% cd ~/lammps
% mkdir build; cd build
% cmake -D PKG_MDI=yes -D PKG_MOLECULE=yes -D PKG_KSPACE=yes ../cmake
% make -j
% cp lmp ~/lammps/examples/QUANTUM/QE/lmp_mpi
---------------------------------
---------------------------------
Step 2: download/build QE with MDI support
% git clone --branch mdi_plugin https://github.com/MolSSI-MDI/q-e.git
% cd qe/git
% ./configure --enable-parallel --enable-openmp --enable-shared FFLAGS="-fPIC" FCFLAGS="-fPIC" CFLAGS="-fPIC" try_foxflags="-fPIC -cpp"
% make mdi
copy MDI/src/qemdi.x to QUANTUM/QE
---------------------------------
---------------------------------
Step 3: run test problem
% cd ~/lammps/examples/QUANTUM/QE
# Run with TCP: 1 proc each
% mpirun -np 1 lmp_mpi -mdi "-name LMP -role DRIVER -method TCP -port 8021" -log log.test.qe.aimd.tcp.1 -in in.water.qe.aimd &
% qemdi.x -in in.qe.test -mdi "-name QE -role ENGINE -method TCP -port 8021 -hostname localhost"
# Run with MPI: 1 proc each
% mpirun -np 1 lmp_mpi -mdi "-name LMP -role DRIVER -method MPI" -log log.test.qe.aimd.mpi.1 -in in.water.qe.aimd : -np 1 qemdi.x -in in.qe.test -mdi "-name QE -role ENGINE -method MPI"
# Run in plugin mode: 1 proc
% mpirun -np 1 lmp_mpi -mdi "-role DRIVER -name driver -method LINK -plugin_path /home/sjplimp/qe/git/MDI/src" -log log.test.qe.aimd.plugin.1 -in in.test.qe.aimd.plugin

View File

@ -0,0 +1,92 @@
LAMMPS data file for water
24 atoms
16 bonds
8 angles
0 dihedrals
0 impropers
2 atom types
1 bond types
1 angle types
0 dihedral types
0 improper types
0.0 4.9325 xlo xhi
0.0 4.9325 ylo yhi
0.0 4.9325 zlo zhi
Masses
1 15.9994
2 1.008
Pair Coeffs
1 0.102 3.188
2 0.000 0.000
Bond Coeffs
1 450 0.9572
Angle Coeffs
1 55.0 104.52
Atoms
1 0 1 -0.83400 2.17919 0.196156 4.15513
2 0 2 0.41700 2.29785 4.8353 0.126003
3 0 2 0.41700 1.82037 1.07996 4.23498
4 0 1 -0.83400 4.65839 0.120414 0.305758
5 0 2 0.41700 4.67446 -0.0220991 4.29186
6 0 2 0.41700 4.28188 0.994196 0.410515
7 0 1 -0.83400 3.65045 2.40907 0.344349
8 0 2 0.41700 3.52052 2.1838 4.35565
9 0 2 0.41700 4.26579 3.14208 0.327669
10 0 1 -0.83400 1.21327 2.62177 4.15519
11 0 2 0.41700 1.47452 3.53837 4.0667
12 0 2 0.41700 1.20743 2.46396 0.16677
13 0 1 -0.83400 4.45777 4.47325 2.74192
14 0 2 0.41700 4.53396 4.49652 1.78804
15 0 2 0.41700 4.21354 3.56943 2.94119
16 0 1 -0.83400 2.04119 4.41585 1.64725
17 0 2 0.41700 2.26934 4.77582 2.50434
18 0 2 0.41700 1.69079 3.54574 1.83793
19 0 1 -0.83400 3.73384 1.97964 2.81949
20 0 2 0.41700 3.41083 2.22014 1.95113
21 0 2 0.41700 3.91914 1.04272 2.75561
22 0 1 -0.83400 1.20859 2.09853 1.68186
23 0 2 0.41700 1.01865 2.25693 2.60655
24 0 2 0.41700 1.16884 1.14674 1.58832
Bonds
1 1 1 2
2 1 1 3
3 1 4 5
4 1 4 6
5 1 7 8
6 1 7 9
7 1 10 11
8 1 10 12
9 1 13 14
10 1 13 15
11 1 16 17
12 1 16 18
13 1 19 20
14 1 19 21
15 1 22 23
16 1 22 24
Angles
1 1 2 1 3
2 1 5 4 6
3 1 8 7 9
4 1 11 10 12
5 1 14 13 15
6 1 17 16 18
7 1 20 19 21
8 1 23 22 24

View File

@ -0,0 +1,63 @@
&CONTROL
title="Test"
calculation='md',
restart_mode = 'from_scratch',
tprnfor=.t.,
prefix='qe',
pseudo_dir='pseudo'
nstep = 1,
tqmmm = .true.
/
&SYSTEM
ibrav = 1,
celldm(1) = 9.321077825,
celldm(2) = 1.,
celldm(3) = 1.,
celldm(4) = 0.,
celldm(5) = 0.,
celldm(6) = 0.,
nat = 24,
ntyp = 2,
ecutwfc = 80.0 ,
/
&ELECTRONS
conv_thr = 1.D-6,
/
&IONS
ion_positions = 'default'
/
ATOMIC_SPECIES
O 16.0000 O.pbe-van_bm.UPF
H 1.0000 H.pbe-van_ak.UPF
ATOMIC_POSITIONS angstrom
O 2.17919 0.196156 4.15513
H 2.29785 4.8353 0.126003
H 1.82037 1.07996 4.23498
O 4.65839 0.120414 0.305758
H 4.67446 -0.0220991 4.29186
H 4.28188 0.994196 0.410515
O 3.65045 2.40907 0.344349
H 3.52052 2.1838 4.35565
H 4.26579 3.14208 0.327669
O 1.21327 2.62177 4.15519
H 1.47452 3.53837 4.0667
H 1.20743 2.46396 0.16677
O 4.45777 4.47325 2.74192
H 4.53396 4.49652 1.78804
H 4.21354 3.56943 2.94119
O 2.04119 4.41585 1.64725
H 2.26934 4.77582 2.50434
H 1.69079 3.54574 1.83793
O 3.73384 1.97964 2.81949
H 3.41083 2.22014 1.95113
H 3.91914 1.04272 2.75561
O 1.20859 2.09853 1.68186
H 1.01865 2.25693 2.60655
H 1.16884 1.14674 1.58832
K_POINTS gamma

View File

@ -0,0 +1,38 @@
# AIMD for water with LAMMPS + QE
units real
neigh_modify delay 0 every 1 check yes
atom_style full
bond_style harmonic
angle_style harmonic
pair_style lj/cut/coul/long 10.0
pair_modify mix arithmetic
kspace_style pppm 1e-4
special_bonds amber
atom_modify sort 0 0
read_data data.water.qe.aimd
timestep 1.0
#dump 1 all custom 1 dump.lammpstrj id element xu yu zu
#dump 2 all custom 1 dump.force id element fx fy fz
#dump 3 all xyz 1 dump.xyz
#dump_modify 1 element O H
#dump_modify 2 element O H
thermo_style multi
thermo 1
# NVE
fix 1 all nve
# NPT
#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0
fix 2 all mdi/qm virial yes
thermo_style custom step temp pe etotal press vol
thermo 1
run 5

View File

@ -0,0 +1,40 @@
# AIMD for water with LAMMPS + QE
units real
neigh_modify delay 0 every 1 check yes
atom_style full
bond_style harmonic
angle_style harmonic
pair_style lj/cut/coul/long 10.0
pair_modify mix arithmetic
kspace_style pppm 1e-4
special_bonds amber
atom_modify sort 0 0
read_data lammps.data
timestep 1.0
#dump 1 all custom 1 dump.lammpstrj id element xu yu zu
#dump 2 all custom 1 dump.force id element fx fy fz
#dump 3 all xyz 1 dump.xyz
#dump_modify 1 element O H
#dump_modify 2 element O H
thermo_style multi
thermo 1
# NVE
fix 1 all nve
# NPT
#fix 1 all npt temp 1.0 1.0 0.1 iso 1.0 1.0 1.0
fix 2 all mdi/qm virial yes
thermo_style custom step temp pe etotal press vol
thermo 1
mdi plugin qemdi mdi "-role ENGINE -name QE -method LINK" &
extra "--in qe.in" &
command "run 5"

View File

@ -12,13 +12,13 @@ NWChem = computational chemistry code from PNNL
focus here is on DFT portion of NWChem = PWDFT library
https://www.nwchem-sw.org
-----------------------------------------------------
To be added later (as of Jan 2023):
Quantum Espresso (QE) = DFT code for materials modeling
https://www.quantum-espresso.org/
-----------------------------------------------------
To be added later (as of Feb 2023):
DFT-FE = real-space DFT code from U Michigan
https://github.com/dftfeDevelopers/dftfe