Look at me, I'm on TV!

I used to edit videos as a hobby. It was back in the day of MiniDV tapes and a trusty firewire connection. It drove my old computers to their limits the video processing would take hours (often overnight).

In 2020, I have been pushed back into making more and more videos. From the perspective of recording lectures or conference talks, here are some tips that have helped me to survive on my MacBook, working from home.

My philosophy is very much getting to something reasonable with minimal effort.

Read More

One-pot recipe for small polaron localisation

When an excess charge (electron or hole) is added to a perfect crystal, there are several possible scenarios. In dielectric materials, the two extremes are a large polaron (wave function extending over many unit cells) and small polarons (wave function localised in a single unit cell; often on one atom). Austin and Mott provided an essential overview of the topic in 1969.

Read More

Anharmonic phonons are heating up

The importance of anharmonicity in the atomic vibrations of crystalline materials has long been known, but the quantities involved have been prohibitively expensive to calculate from first-principles. It is now becoming possible to accurately predict properties including thermal expansion, thermal conductivity, phonon lifetimes, frequency shifts, and displacive phase transitions, for increasingly complex materials.

Last week, I attended a stimulating workshop on anharmonicity in Paris (funded by CECAM) that collected many leaders in the field.  Below is a summary of the selection of currently available techniques and codes. For a primer on the history of the field, I recommend The rise of self-consistent phonon theory by Klein and Horton (1972).

  • AFLOW-AAPL - Automation of phonon calculations and thermal conductivity: [code]; [paper]
  • Alamode - High-order force constants and self-consistent phonons: [code]; [paper]
  • AlmaBTE - Boltzmann transport for device level simulations: [code]; [paper]
  • DynaPhoPy - Anharmonic phonons from molecular dynamics simulations: [code]; [paper]
  • D3q - 3-phonon processes and stochastic self-consistent phonons using random displacements: [code]; [paper]
  • Phono3py - 3-phonon processes and thermal conductivity from finite-displacements: [code]; [paper]
  • SCALID - self-consistent phonon approach, but no longer developed and fails for optic modes: [code]; [paper]
  • ShengBTE - 3-phonon processes and thermal conductivity from finite-displacements: [code]; [paper]
  • TDEP - effective Hamiltonian approach for anharmonic systems from molecular dynamics simulations: [code]; [paper]

 

Read More

MacOS Sierra for Computational Materials Science in 2017

An update of previous entries for setting up an Apple computer for scientific computing. It is not an absolute guide, but simply one way to get going.  I started with a clean install of Mac OS 10.12 (Sierra).

  • Awaken UNIX

The first step is to install the command line tools. Open a Terminal and type make which triggers the system to install Xcode (if missing) and the command line tools module (basic UNIX commands including a gcc compiler). Be sure to set up your bash_profile, ssh config, and vimrc files to make working faster and more comfortable.

  • Basics

My base applications include: (standard office) Dropbox, Slack, MS Office (Imperial link), Mactex, Texmaker, Mendeley; (scientific computing) latest gcc/gfortraniTerm, Textmate, XQuartz, Atom, Cyberduck, GitHub client(materials modelling) VESTA, Avogadro. For video and image editing ffmpeg and imagemagick are essential.

  • Python

Python package and environment maintenance can cause headaches, so this time I went with Conda for Mac. I am happy with the results so far, and the standard install gives a good base set of packages.

  • Fortran and C

It is possible to survive using gnu compilers and freely available maths libraries, but Intel Fortran and MKL tend to be faster and better tested (easier to compile). For non-commericial purposes Intel Composer is now free for OS X. The package installs in a few clicks, but be sure source the variables in your .bash_profile:
source /opt/intel/mkl/bin/mklvars.sh intel64
source /opt/intel/bin/compilervars.sh intel64


The outcome:
% which ifort
/usr/local/bin/ifort
% ifort --version
ifort (IFORT) 17.0.4 20170411

  • Openmpi

To enable parallelism, I downloaded the latest source code of openmpi (2.1.1).
./configure -prefix=/usr/local/openmpi-2.1.1 CC=icc FC=ifort F77=ifort
make
sudo make install

be patient… it can easily take 20 minutes. Finally add to your .bash_profile:
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/openmpi-2.1.1/lib/
export PATH=./:/usr/local/openmpi-2.1.1/bin:$PATH
export OMP_NUM_THREADS=1

The outcome:
% which mpif90
/usr/local/openmpi-2.1.1/bin/mpif90
% mpif90 --version
ifort (IFORT) 17.0.4 20170411

  • Phonopy

I use this open-source lattice-dynamics package a lot. The installation used to be multi-step, but Conda makes life easier (adapted from Togo's official guide):
% conda install numpy scipy h5py pyyaml matplotlib openblas
% git clone https://github.com/atztogo/phonopy.git
% export CC=gcc
% cd phonopy
% python setup.py install --user

To run: phonopy

If harmonic phonons are not enough for you, then Phono3py lets you calculate phonon-phonon interactions, but it gets very expensive to compute.
% git clone https://github.com/atztogo/phono3py.git
% cd phono3py
% python setup.py install --user

To run: phono3py

  • VASP

I use a range of electronic structure packages, but VASP is the old reliable. I downloaded the latest version (5.4.4), which has streamlined the install process. Enter the main folder and
cp ./arch/makefile.include.linux_intel ./makefile.include

The file needs to be modified to point to the correct compilers (I used icc, icpc, and mpifort). We will also remove DscaLAPACK from the pre-compiler options and set SCALAPACK =  . There is one bug to fix before you type make: in ./src/lib/getshmem.c add #define SHM_NORESERVE 010000 to the end of the include statements.

The outcome:
% mpirun -np 4 ../vasp_std
running on 4 total cores
distrk: each k-point on 4 cores, 1 groups
distr: one band on 1 cores, 4 groups
using from now: INCAR
vasp.5.4.4

  • ASE

The atomistic simulation environment is a useful set of Python tools and modules. It now installs, including the gui, in one command:
pip install --user ase gpaw

The outcome:
ase-gui

ASE

I will update with more codes and tools as I find time, and always happy to receive suggestions.

Read More

Lost in Seoul

I’ve had the pleasure to visit South Korea on several occasions. The people, food and culture have left me with many unforgettable experiences. On our last trip, we made even more friends, enjoyed the most delicious grilled eel, and wandered into Changdeokgung palace just in time for a full-scale reenactment of an 18th century royal birthday party (set after a mad prince died of starvation while being confined in a rice barrel).

Read More