15 June 2018

650. N/EDA in GAMESS. 2. Defining an external basis set

This is post number two in a series. Post 1 is here: http://verahill.blogspot.com/2018/06/649-neda-in-gamess-1-recompiling-gamess.html

Defining external basis sets isn't hard, but I find that the gamess documentation isn't great, and there isn't as much online as one would hope.


1. Either way, I'll create an external basis set file with def2svp and def2tzvp at /opt/gamess/gamess_nbo/EXTFILE.txt

2. Get the basis set definition from https://bse.pnl.gov/bse/portal -- select the atoms you want, and the basis set, set format to GAMESS US, and click Get Basis Set.


3. When you paste the data into the EXTFILE.txt,
a) skip the $DATA tag, and
b) change the atom definition to their corresponding symbols (e.g. H instead of Hydrogen) and append the name of the basis set,

so the beginning looks like this:
MG DEF2SVP S 5 1 4953.8339196 -0.57778967498E-02 2 745.18044154 -0.43124761082E-01 3 169.21604972 -0.19268216987 4 47.300672019 -0.48641439116 5 14.461336973 -0.42550894077 S 3 1 24.768174789 0.87956969984E-01 2 2.4940945349 -0.55165058128 3 0.87807584533 -0.53443294833 S 1 1 0.87212782497E-01 1.0000000 S 1 1 0.33599293780E-01 1.0000000 P 5 1 98.053010494 -0.14480564601E-01 2 22.586932277 -0.95495750787E-01 3 6.8391509842 -0.30787672651 4 2.2332843818 -0.49936292886 5 0.71606599387 -0.31503476213 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 0.1010000 1.0000000 H DEF2SVP S 3 1 13.0107010 0.19682158E-01 2 1.9622572 0.13796524 3 0.44453796 0.47831935 S 1 1 0.12194962 1.0000000 P 1 1 0.8000000 1.0000000 C DEF2SVP
and the end like this:
D 1 1 0.64500000 1.0000000 F 1 1 1.42800000 1.0000000 MG DEF2TZVP S 7 1 31438.3495550 0.60912311326E-03 2 4715.5153354 0.47066196465E-02 3 1073.1629247 0.24135820657E-01 4 303.57238768 0.93628959834E-01 5 98.626251042 0.26646742093 6 34.943808417 0.47890929917 7 12.859785199 0.33698490286 S 3 1 64.876913004 0.19180889307E-01 2 19.725520777 0.90913704392E-01 3 2.8951804339 -0.39563756125 S 2 1 1.1960454710 1.6827603373 2 0.54329451156 0.52141091954 S 1 1 0.10099104092 1.0000000 S 1 1 0.36865728085E-01 1.0000000 P 5 1 179.87189612 0.53799549018E-02 2 42.120069376 0.39318014098E-01 3 13.120503032 0.15740129476 4 4.6257503609 0.35919094128 5 1.6695211016 0.45533379310 P 1 1 0.58551012105 1.0000000 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 3.4440000 1.0000000 D 1 1 0.2900000 1.0000000 D 1 1 0.0700000 1.0000000


4. Edit the gms-files.csh in your gamess root (e.g. /opt/gamess/gamess_nbo)
setenv EXTBAS /opt/gamess/gamess_nbo/EXTFILE.txt


5. To use, put
$BASIS EXTFIL=.TRUE. GBASIS=DEF2TZVP $END
or
$BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END
in your gamess input file.

649. N/EDA in GAMESS. 1. Recompiling GAMESS US with NBO6

I need to do energy decomposition analysis (EDA), but only have licenses for Gaussian and NBO6 (i.e. not ADF, turbomole, QChem etc.). NEDA isn't supported by NBO6 with gaussian (afaik).

NWChem, my usual gaussian alternative, doesn't support NBO6 beyond writing a .47 file.

Enter GAMESS US. I've been trying out gamess every few years, but I've found that it's slow and unreliable (very difficult to get SCF convergence) for the systems I work with (polyanions). Some of this may obviously be down to my lack of familiarity with the code -- there are probably plenty of satisified users of GAMESS US.

Either way, NBO6 suppports NEDA with GAMESS US. Also, GAMESS US does two different types  of   EDA: the common Morokuma-Kitaura (MOROKM) one (although only with HF) and an alternative approach by Su and Li that's referred to by GAMESS as LMOEDA (or CMOEDA).

MOROKM and LMOEDA as supported out of the box by GAMESS, but to get it to do NEDA you need to re-link it against NBO. Luckily it's even easier than the instructions in the NBO gamess file (i.e. no need to edit code).

NOTE: I could only link with gfortran 4.9 (jessie). gfortran 6.3 (stretch) failed to link (messages re -fPIC; recompiling gamess with -fPIC didn't solve it).

To compile gamess, see e.g. http://verahill.blogspot.com/2013/06/4xx-gamess-us-2013-r1-on-debian-wheezy.html

Once you've done the ddi/comp and compall steps, edit lked and search for NBO. Change to

set NBO=true set NBOLIB="/opt/nbo6/bin/gmsnbo.i8.a"
assuming that this location is correct.

Then do lked as in the post above.

17 April 2018

648. Compiling Quantum Espresso 6.2.1 on debian 8

Time has come for me to expand my horizons and skills. As I drift farther and farther away from my origins as an organic chemist and more and more towards inorganic materials science and non-discrete, extended systems, localised orbital DFT (i.e. 'standard' DFT) is not always looking as an appropriate method.

NWChem
Time thus to start using periodic systems and planewave basis sets. I've started working with nwpw and pspw in nwchem, and since I've used nwchem since ca 2002, in terms of setting up jobs and getting results it's been fairly straightforward. Understanding what all the options do and what's appropriate is another issue, but that's something I can work out empirically by comparing with benchmark systems (beginning to discover the importance of simulation cell now...)

Either way, nwchem does not yet afford a way of computing raman spectra for pspw jobs, which is one of the properties I'm interested in. Quantum Espresso, on the other hand, does, and is geared towards materials science in a way that nwchem isn't. Although quantum-espresso is included in the debian repos, I prefer to compile my own version. So, here I am.

I did this on one of my AMD nodes, but will follow up later with a post using intel MKL on my intel nodes. I only used the debian math libs, and not the AMD ACML (now replaced with ACL?), which I probably should've. Maybe I'll do an updated post on that later.

Note: I specify libblas.a instead of -lblas in the configure step since I have a custom openblas package installed as well, but which didn't work during compilation of QE.

Quantum Espresso (on an 8 core AMD processor)

'make' for gwl failed, and I didn't want to figure out why, so I skipped it. You can try doing make all instead of doing make for individual parts as I do below (type make to see what your options are).


sudo mkdir /opt/QE
sudo chown $USER /opt/QE
mkdir ~/tmp/QE -p
mkdir $HOME/scratch/QE -p
cd ~/tmp/QE
wget https://gitlab.com/QEF/q-e/-/archive/qe-6.2.1/q-e-qe-6.2.1.tar.gz
tar xvf q-e-qe-6.2.1.tar.gz
cd q-e-qe-6.2.1/

edit environment_variables
20 PREFIX=`/opt/QE` 21 BIN_DIR=$PREFIX/bin 22 PSEUDO_DIR=$PREFIX/pseudo 23 # Beware: everything in $TMP_DIR will be destroyed ! 24 TMP_DIR=$HOME/scratch/QE

sudo apt-get install libblas-dev libfftw3-dev libopenmpi-dev
./configure --prefix=/opt/QE/bin --exec-prefix=/opt/QE/bin/ FC=mpif90 BLAS_LIBS="/usr/lib/libblas/libblas.a" LIBS="-lmpi -lopen-rte -lopen-pal -ldl -lmpi_f77 -lpthread" CPPFLAGS="-I/usr/lib/openmpi/include"
sudo apt-get install libblas-dev libfftw3-dev libopenmpi-dev
-------------------------------------------------------------------- ESPRESSO can take advantage of several optimized numerical libraries (essl, fftw, mkl...). This configure script attempts to find them, but may fail if they have been installed in non-standard locations. If a required library is not found, the local copy will be compiled. The following libraries have been found: BLAS_LIBS="/usr/lib/libblas/libblas.a" LAPACK_LIBS=-L/opt/ATLAS/lib -llapack -lblas FFT_LIBS= -lfftw3 Please check if this is what you expect. If any libraries are missing, you may specify a list of directories to search and retry, as follows: ./configure LIBDIRS="list of directories, separated by spaces" Parallel environment detected successfully.\ Configured for compilation of parallel executables. For more info, read the ESPRESSO User's Guide (Doc/users-guide.tex). --------------------------------------------------------------------

make -j8 pwall cp ld1 upf xspectra tddft
make couple epw gui gwl

echo 'export PATH=$PATH:/opt/QE/bin' >>~/.bashrc
echo 'export PSEUDO_DIR=/opt/QE/pseudo' >>~/.bashrc
cp * -R /opt/QE/

source ~/.bashrc

To benchmark:
 make test-suite