Talk:Mod:Hunt Research Group/cpmd
Car-Parrinello Molecular Dynamics (notes by Ling)
1. Classical MD vs CPMD
a. Classical MD: interactions described by fixed, paramitrized potentials.
b. CPMD: interactions calculated directly from the electron structure in every time step. The forces are obtained from the gradients of the total energy (from DFT + PW) at the positions of the nuclei and thus forming a multi-particle potential. Peculiarity: wfn is propagated following a ficticious Newtonian dynamic while performing the MD simulation. Therefore the wfn does not need to be recalculated in every simulation step and the computation effort is reduced significantly.
Steps: - generate a (equilibrated) start configuration - Wfn optimisation for the start configuration - Car-Parrinello Molecular Dynamics - analyze the trajectory
2. Useful Tutorial Links:
http://www.pci.uzh.ch/index_e.php?page=http://www.pci.uzh.ch/gruppe.hutter/e/information.html
CPMD Water Exercise: http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-intro.html
CPMD Tutorial: http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-tutor/index.html
CPMD Tips: http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-linux.html
3. How to install and compile cpmd2cube on iMac:
a. download cpmd2cube from http://www.cpmd.org/cpmd_download_it.html
b. unzip cpmd2cube.tar.gz into folder cpmd2cube
c. in the folder cpmd2cube: type: "./Configure Linux-PC-GFORTRAN > Makefile"
d. type: "make"
e. cpmd2cube.x is ready to use.
4. How to install CPMD on iMac:
a. need gfortran compiler, BLAS/LAPACK libraries.
BLAS
The Basic Linear Algebra Subroutines (BLAS) are high quality routines for performing basic vector and matrix operations. Level 1 BLAS consists of vector-vector operations, Level 2 BLAS consists of matrix-vector matrixvector vector operations, and Level 3 BLAS have matrix-matrix operations. The efficiency, portability, and the wide adoption of the BLAS have made them commonplace in the development of high quality linear algebra software such as LAPACK and in other technologies requiring fast vector and matrix calcula-tions. calculations. tions. All the industry standard FORTRAN BLAS entry points and the standard C BLAS entry points are exported from the vecLib framework (the latter are commonly denoted the legacy C BLAS.) For more information refer to <http://www.netlib.org/blas/faq.html
LAPACK
LAPACK provides routines for solving systems of simultaneous linear equations, least-squares solutions of linear systems of equations, eigenvalue problems, and singular value problems. The associated matrix factorizations (LU, Cholesky, QR, SVD, Schur, generalized Schur) are also provided, as are related computations such as reordering of the Schur factorizations and estimating condition numbers. Dense and banded matrices are handled, but not general sparse matrices. In all areas, similar function-ality functionality ality is provided for real and complex matrices, in both single and double precision. LAPACK in vecLib makes full use of the optimized BLAS and fully benefits from their performance. All the industry stan-dard standard dard FORTRAN LAPACK entry points are exported from the vecLib framework. C programs may make calls to the FORTRAN entry points using the prototypes set out in "/System/Library/Frameworks/vecLib.frame-work/Headers/clapack.h". "/System/Library/Frameworks/vecLib.framework/Headers/clapack.h". work/Headers/clapack.h".
For more information refer to <http://www.netlib.org/lapack/index.html.
BLAS and LAPACK follow fortran calling conventions (even from C). Users must be aware that:
ALL arguments must be passed by reference. This includes all scalar arguments such as matrix dimension M and N, further note there is a difference in the memory arrangement of a two-dimensional array in Fortran and C.
For more information refer to <http://www.netlib.org/clapack/readme.
b. how to install BLAS on iMac:
- download blas.tgz from http://www.netlib.org/blas/
- change 'g77' to 'gfortran' in the file make.inc
- type 'make'
- rename 'blas_LINUX.a' to 'libblas.a'
c. how to install LAPACK on iMac:
- download lapack.tgz from http://www.netlib.org/lapack/index.html
- cp make.inc.example to make.inc
- type 'make'
- get 'lapack_LINUX.a', which is the library we need.
d. how to install CPMD on iMac:
- download CPMD-3.13.2 form CPMD.org
- in /Users/ling/CPMD/CPMD-3.13.2/,
mkdir cpmd-MacOSX
cd SOURCE
./mkconfig.sh -m -SRC=$PWD -DEST=../cpmd-MacOSX MACOSX-GFORTRAN-INTEL
cd ../cpmd-MacOSX
make
The executable is called cpmd.x.
To run:
(Please refer to CPMD manual 3.13.2 P21, "compile CPMD outside the source directory.)
(...)/CPMD-3.13.2/cpmd-MacOSX/cpmd.x input.file PSEUDODIR > output.file
PSEUDODIR is the directory containing pseudopotential files (it can be set to ./ or omitted if the pseudopotentials are in the same directory as the input file).
For instance:
....../CPMD-3.13.2/cpmd-MacOSX/cpmd.x h2o.in ./ > h2o.out
Pseudopotential libraries are available from the download section on cpmd.org.