Posted on

Papers on Locally Coupled Open Subsystems

Back in July (2018), our paper on molecular dissociation, size consistency, and fractional charges, was published in the Journal of Chemical Physics. https://aip.scitation.org/doi/pdf/10.1063/1.5038557
This work introduces our new family of theories, locally coupled open subsystems (LCOS), which is initially intended as a set of electronic structure methods that can lead to controllability of the computational scaling of quantum chemical calculations. A common problem with standard DFT calculations is that electrons/holes usually are delocalized when a single molecule (or more) interacts with a surface that is subject to a bias. A way to resolve this problem is to couple the molecule to the surface in such a way that one can perform separate DFT calculations on the molecule and surface, and then one can introduce another DFT method for the coupling, so the fragments exchange energy and electron charge. This is advantageous from fundamental and computational perspectives. The theory is flexible, and has a good number of potential applications in chemistry and physics.

In our most recent paper, https://journals.aps.org/pra/abstract/10.1103/PhysRevA.98.062505, the full formalism is described. This work includes the possibility of using correlated wave function methods instead of DFT to describe the electronic structure of the molecule and the surface, for instance. The paper also presents the formalism to ensure the spin symmetry of the whole system is preserved, and a way to perform time-dependent propagation of the state of the entire system: The electronic occupations of the fragments can now be obtained as a function of time, meaning that we can let the nuclei evolve as well and/or apply an external field and track the flow of energy and electrons. An important point of the LCOS work is that the computational implementation is simple. The DFT version of LCOS, for example, uses local potentials and density functionals in such a way that computing the charge and energy transferred between the molecule and the surface is not difficult to obtain; LCOS in this context uses ensemble DFT, which features the needed derivative discontinuities!. The next step I am working on is centered on implementing LCOS and applying it to problems where common DFT methods have trouble. The implementation (within NWChem) mostly consists of managing pieces of established code, and using these pieces to make (models of) molecules interact accordingly to the theory. (Update 01/30/19: It’s cold in Chicago!, -20F. Although this is optional, I found several ways to compute the lambda value, or matrix. The implementation will also help in this direction. Update 10/04/19: manuscript under preparation)

Posted on

The Canonical Laws of C and Fortran

Just want to put some links here on the standard sources of the C language and Fortran. Sometimes it’s reaffirming to read the official documents suggesting how the compilers should interpret the language. In general this page

http://gcc.gnu.org/readings.html ,

has most of those references, including info on chips. Although the standards aren’t officially released very often, there seems to be constant communication discussing future updates.

The current standard of C is C11, public version:

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf .

Links to Fortran standards:

https://gcc.gnu.org/wiki/GFortranStandards#Fortran_77 .

This compact list of gnu packages is great:

https://www.gnu.org/software/software.html,

search the package, its documentation, and download it into a .txt file (few exceptions). I just use vim to browse them. The g77 docs have some useful notes on interoperability between C and Fortran.

Posted on

Compilers

Back in college (Colombia), having access to powerful software was really difficult. If you plugged a usb drive into any pc running windows in campus you’d get a virus, and buying software was an expensive dream. The best alternative is switching to software libre. You get plenty of versatile programs, but at the cost of learning how to program in many languages. Sometimes it’s frustrating, especially when dealing with wifi and other accessories.

Anyway, at this point I’m feeling temptation by the dark side to try intel libraries, math kernel library (mkl), for example. It seems faster than other free libraries.  It’s interesting this mkl is available to you at no cost… if you are a student, researcher, or open source developer. These libraries are compatible with libre gnu compilers. But some folks might think, “I should keep everything under intel’s control”. If you’re a student you can download their ifort and icc, $0. But researchers must purchase it for only $700. Apparently, you could get a 50% discount…
Posted on

El Capitan drinks Quantum Espresso

To compile a slow version of quantum espresso for an iMac: i) Download last version, and extract somewhere. ii), use this script, “qe_conf.sh”:


FL=-L/opt/local/lib -lfftw3
CC=gcc
F77=gfortran
LAPACK_LIBS=-L/lapack-folder -llapack -lrefblas
BLAS_LIBS=-L/lapack-folder -lrefblas

./configure CC=$CC F77=$F77 LAPACK_LIBS=$LAPACK_LIBS
  BLAS_LIBS=$BLAS_LIBS FFT_LIBS=$FL –enable-openmp

If you don’t have fftw libs type in a terminal “sudo port install fftw-3“. Follow the steps from previous post to get consistent mpi commands. iii), Build your module typing “make X”, where X = pw, ph, pwcond, etc. Note: There is an ATLAS package that can be installed with port, but I don’t know yet how much it will speed up the computations. 
Posted on

NWChem in El Capitan

I installed it in a mid 2011 iMac, and used gcc compilers. First, get the right compilers (or make sure gcc5, or alike, is installed). 

sudo port install gcc5 +gfortran+universal 

(I needed to make symbolic links in /opt/local/bin for gfortran, gcc, g++, and cpp. Port installs them as gsomething-mp-5). Also make sure you have mpich. If not, type 

sudo port install mpich-gcc5

then 

sudo port select –set mpi mpich-gcc5-fortran

This last step is to use the mpi commands linked to gcc, instead of clang.

Download nwchem-6.6 from here, and extract the .tar.gz file into some folder. The environmental variables are:

export NWCHEM_TOP=`pwd`
export NWCHEM_MODULES=all
export NWCHEM_TARGET=MACX64
export CFLAGS_FORGA=-DMPICH_NO_ATTR_TYPE_TAGS
export USE_MPI=y
export USE_MPIF=y
export USE_MPIF4=y
export CFLAGS_FORGA=-DMPICH_NO_ATTR_TYPE_TAGS
export LIBMPI= -lmpifort -lmpi -lpmpi -lpthread
export BLASOPT= 
export FC=gfortran
export CC=gcc

To compile:

cd $NWCHEM_TOP/src
make nwchem_config


make

All these variables and make commands can be written into a my_comp.sh file and just be run as “sh my_comp.sh”. I ran some QA tests and they looked fine. Finally, note that blasopt is empty. NWChem uses its internal BLAS. I tried to compile ATLAS to get optimize libraries but failed in the attempt :_(   Apparently, ATLAS has some issues working with Apple machines from Hell.
Posted on

Finding Cutoffs for Quantum Espresso Calculations

Critical numbers to check before running plane-wave calculations are the kinetic energy and density cut-offs. I found a useful guide to check these cutoffs, http://larrucea.eu/checking-optimum-cutoff-qe/. I uploaded a copy here. The script needs the location of the pseudopotential file and the executable, pw.x, location. One can modify the script, for example changing the numbers in the list of trial cutoffs to search for the best numbers. For ultrasoft potentials I guess one has to make sure the density cutoffs are high enough so the calculations for the last values in the list of kinetic energy cutoffs are reliable enough. [Update: the new QE library based on rrkjus pseudopotentials includes the cut-offs]

Posted on

Installing NWChem

For a long time, I’ve had trouble installing nwchem using the directions suggested in the official website. GA tools is usually the culprit. For some reason, the tools included in the nwchem source code don’t work, and one has to import them from somewhere else, or simply try a different development version. This post is very useful: http://www.nwchem-sw.org/index.php/Special:AWCforum/st/id1401/HOWTO%3A_compiling_nwchem-6.5_beta….html