|Developer(s)||Castep developers group|
17.2 / 28 February 2017
|Written in||Fortran 2003 with OpenMP and MPI|
|Operating system||Linux, MacOS and Microsoft Windows|
|Type||Density Functional Theory (simulation)|
|License||Academic (UK) / Commercial|
CASTEP (originally from CAmbridge Serial Total Energy Package) is a shared-source academic and commercial software package which uses density functional theory with a plane wave basis set to calculate the electronic properties of crystalline solids, surfaces, molecules, liquids and amorphous materials from first principles. CASTEP permits geometry optimisation and finite temperature molecular dynamics with implicit symmetry and geometry constraints, as well as calculation of a wide variety of derived properties of the electronic configuration. Although CASTEP was originally a serial, Fortran 77-based program, it was completely redesigned and rewritten from 1999-2001 using Fortran 95 and MPI for use on parallel computers by researchers at the Universities of York, Durham, St. Andrews, Cambridge and Rutherford Labs.
CASTEP was created in the late 1980s and early 1990s in the TCM Group of the Cavendish Laboratory in Cambridge. It was then an academic code written in Fortran77. In the mid 1990s it was commercialised by licensing it to Molecular Simulations International (the company was later purchased by Accelrys, in turn purchased by Biovia) in an arrangement through which the University of Cambridge received a share of the royalties, and much of the development remained with the original academic authors. The code was then redesigned and completely rewritten from 1999-2001 to make use of the features of modern Fortran, enable parallelism throughout the code and improve its software sustainability. By this point annual sales exceeded £1m.
Despite its commercialisation, CASTEP and its source code remain free to UK academics. Commercial users can purchase it as part of Biovia's Materials Studio package; within the EU, there is also the option of an academic source-code licence.
Theory and approximations
Starting from the many-body wavefunction, an adiabatic approximation is made with respect to the nuclear and electronic coordinates (the Born–Oppenheimer approximation). The code also makes use of Bloch's Theorem which means a wavefunction of a periodic system has a cell-periodic factor and a phase factor. The phase factor is represented by a plane wave. From the usage of Bloch's Theorem, it is ideal to write the wavefunction in plane waves for the cell-periodic factor and the phase factor. From this the basis functions are orthogonal and it is easy to perform a Fourier transform from real to reciprocal space and vice versa. Fast Fourier Transforms are used throughout the CASTEP code, as is the Ewald summation method for Coulombic energies. Along with plane waves and iterative diagonalisation methods (via conjugate gradient or blocked Davidson algorithms), pseudopotentials are essential to the CASTEP code for reducing the computational expense of the calculation. Pseudopotentials replace the atomic nucleus and the core electrons by an effective numeric potential.
CASTEP is capable of optimising the atomic geometry of a system in several different ways. The default is BFGS, whereby an approximation to the Hessian matrix is built up over successive electronic minimisation steps and used to find a search direction at each. Damped molecular dynamics is also possible and often quick to converge, sometimes even faster than BFGS, due to wavefunction extrapolation. Damped MD is most often chosen over BFGS, however, due to the possibility for non-linear ion constraints. A further alternative is the FIRE scheme, which takes approximately the same approach as damped MD, but based on slightly different methodology.