Instructions for charge density multislice (Numis-2.0) Jim Ciston 25 May 2009 The purpose of this program is to simulate exit waves and images of thin crystals in a transmission electron microscope subject to the scattering potential of the fully-bonded valence charge density as calculated by the Wien2k DFT software package. 1) Important limitations a. The present version of the code can only handle structures in orthorhombic unit cells projected along principle axes. If your structure is neither orthorhombic nor a principle projection, you must create a new pseudo-cell for the calculation. For the example of SrTiO3 [110], a new cell should be created with axes [110], [-110], [001]. The provision to project along non-principal axes is currently under development. b. The multislice projection routine computes the full scattering potential for the unit cell along the desired direction. This effectively compresses the entire unit cell into a single slice. If one is calculating images for very large unit cells (e.g. surface structure supercells), the loss of threedimensionality due to this approximation may lose validity. For typical bulk unit cells of 4-8 Å, the approximation has been tested and confirmed to be reasonable. 2) DFT instructions a. Perform your DFT calculation as normal. The calculations should be well converged (-ec 0.0001 –cc 0.0001). It should be noted that the charge density is rather less sensitive to the choice of functional that the energy. For SrTiO3, the difference between PBE and PBE0 is 1000x smaller than the difference between neutral atoms and fully bonded atoms. b. After your calculation is set up and ready to begin (i.e. after dstart), run the following procedure: x lapw3 (calculate x-ray structure factors) grep –n –e ‘X – RAY STRUC’ *.output3 (get line where structurefactors begin) wc –l *.output3 (get total number of lines in file) tail –[total_lines – structurefactor_line + 1] *.output3 > case.dhkl (write only the structurefactor portion of case.output3 to a new file called case.dhkl) c. Once the calculation is converged, run the following procedure (comments in parentheses): save_lapw –a –d directory (save your calculation) x lapw3 (calculate x-ray structure factors) grep –n –e ‘X – RAY STRUC’ *.output3 (get line where structurefactors begin) wc –l *.output3 (get total numer of lines in file) tail –[total_lines – structurefactor_line] *.output3 > case.hkl (write only the structurefactor portion of case.output3 to a new file called case.hkl) d. The multislice code requires three Wien2k files as inputs: 3) case.struct (the Wien2k structure file) case.hkl (the charge density x-ray structurefactors) case.dhkl (the neutral atom x-ray structurefactors) Installation of multislice code a. Numis is available from a CVS (concurrent version system) server hosted at Northwestern University. The software is downloaded and installed through a command line interface and is wrapped within the autoconfigure/automake framework. Installation is recommended either on Cygwin (running on Windows) or Linux platforms. It is also possible to compile on Apple computers, but the appropriate developer tools (compilers, libraries, etc) are not part of the standard Mac OS and must be downloaded and installed separately. Note: your gcc and gfortran compilers MUST be version 4.3 or later. This can be determined by typing ‘gfortran --version’ b. Go to the directory where you want to download the Numis and Semper7 packages (e.g. /home/your_name/cvs_sources). You must set the following environment variables for the CVS download and compilation to function properly (this can either be done at the command line, or added to your .bashrc) export CVSROOT= :ext:your_name@129.105.122.84:/export/home/cvsroot export CVS_RSH=ssh export F77=gfortran (or F77=gfortran-4 if you have multiple compiler version as in Cygwin) export CC=gcc (or possibly CC=gcc-4 for Cygwin depending upon which compilers are linked where) export DISPLAY=127.0.0.1:0.0 (this may or may not be needed for Semper to launch an X-window properly) c. Now it is time to download and install the Numis and Semper7 software. This may be the unfortunate time when you find out that something in your system is broken and you have to case down errors when the compilation crashes. cvs checkout Numis-2.0 cd Numis-2.0/ ./configure (this will determine the appropriate compilation parameters on your local machine) make (compiles the software) make install (puts the executables in /usr/local/numis_2.0/bin) cd ../ cvs checkout simper-7.0beta cd simper-7.0beta ./configure make make install (puts the executables in /usr/local/simper-7.0b/bin) make help d. If everything went successfully, all that is left is to add the appropriate directories to your path. export PATH=$PATH:/usr/local/numis_2.0/bin: /usr/local/simper-7.0b/bin e. Occasionally you may need to update your software as bugs are fixed and features are added. The advantage of the CVS automake framework is that only files which are new will be downloaded and re-compiled, leaving everything else alone. This is accomplished by simply going to the appropriate source file directory (for Numis or Semper) and executing: 4) cvs update make make install Using the Numis code a. Numis ships with an example for Forsterite. Go to an appropriate directory and copy the contents of Numis-2.0/examples/CD-multislice/ there. When executing cases other than the Forsterite example, you will need to copy to your local directory and replace the case.struct, case.hkl, and case.dhkl with your desired structure. b. The first step is to project your structure along the relevant direction and generate the 2-D scattering potential. This is accomplished by running the shell script ‘ProjPotent.sh’. You must provide the header to the file names as an input (‘Forsterite’ in this case…see below) This script will also generate the appropriate input files for the multislice routine (case.dat, case.d200, and case.at). You will be prompted for the projection axes and other parameters. For centering, enter no. All other options (yes, hexagonal, face-centered) are untested. Enter ‘1’ to indicate that the potential has been projected. On the last line, enter the desired temperature factor (in units of B, not u) and an integer to divide the unit cell along the projection direction. This integer should be chosen so that the c-axis in case.at is 1-2Å in length. Jim@tchaikovsky ~/test_numis $ sh ProjPotent.sh Forsterite Enter zone _1 0 0 Enter first axis _0 1 0 Enter second axis _0 0 1 Centering (hex) used (Y/N/H/F) _n Base.hkl (<0) or projected _1 Temperature factor, slice divide _0.25 6 Done Enter zone _1 0 0 Enter first axis _0 1 0 Enter second axis _0 0 1 Centering (hex) used (Y/N/H/F) _n Base.hkl (<0) or projected _1 Temperature factor, slice divide _0.25 6 Done Jim@tchaikovsky ~/test_numis Note that different versions of Wien2k have slightly different output formatting for the case.struct file. This should work for the latest version. You may have to add/remove a space for each atom in the case.struct file here after Z: in order for the atomic number to be read correctly. Sr1 NPT= 781 R0=.000010000 RMT= 2.36000 Z: 38. c. Now, you must edit the case.200 file in order to tell the multislice routine what thicknesses you would like to use. The file is printed below Wien Test 8 8 8 00 1 2 0 8 3 1 0 0 0 1 0 1 0 4CU 0.5000 0.2500 0 MG 1.5792 1.8197 1.6576 0.5323 62.9403 12.4527 2.5042 0.3331 0.0000 12.0 2 000 0 0 200.00000 1.69833 0.00000 0 0 1 200 1 10 1 -50 -50 50 50 1 1 0 2 4 2 0 4 5 1 5 10 50100 1 0 0.0000 0.0000 0.0000 0.000 0.000 0.000 0.000 0.000 0.0000 There are a few things to note about this file. First, most of it should be left alone as it is not used. The first number on line 10 is the microscope asselerating voltage in units of kV. The second number on line 10 is the slice thickness. This should match the c-axis in case.at. The first number on line 13 is the maximum number of slices that will be calculated. Line 17 is where the user may define what thicknesses (in units of slice number) that should be considered. The formatting of this line needs to be (i2,30i3). This first number is the number of thicknesses (i2 format) and the following entries are the thickness values (i3 format). Up to 30 values may be entered. d. Execute the multislice routine by typing ‘sh MultiSlice.sh200 Forsterite’ e. You are now ready to run the image simulation routine. Before this can be done, you need to modify the J2200C5.pr file to tell the program what microscope parameters to use. This is the most user-unfriendly portion of the code and a script may be rewritten in the future to prompt the user for these values at the command line. Here is description of the formatting for this file: C **************************************************************** C DATA. C CARD FORMAT VARIABLES C 1 15A4 HEAD(I),I=1,15 A 60 CHARACTER HEADING C WHICH IS PUT ON THE TOP C OF EACH IMAGET. C 2 A1,A1,2I5 FOUR,ROUT,IFLSK,IMODE C 3 5F10.0 ANGIN,X1,X2,Y1,Y2 C 4 3I5 ISLSK,NTHIKS,NTILTS C C C C C C C C C C C C C C C C C C C C 5 2F10.0 RES,CSS 6 I5,2F10.0 TILH,TILK,IBTSET 7 2F10.0 OI,OJ 8 2F10.0,I5 DFS,DFI,NDF 9 I5,A1,F10.0 NTTTT,NQUAD,DIVGCE 10 2F10.8,I5 CHDIV,DELTA,NDIV 11 3I5 NOPTN,NOPTZ,NOPTY 12 2F10.0 AMEAN,CON PARAMETERS. HEAD A 60 CHARACTER HEADING WHICH IS PRINTED ON THE TOP OF EVERY OUTPUT. (DEFAULT IS HEADING FROM MULTISLICE FILE) FOUR FOURIER TRANSFORM: Must be F ROUT OUTPUT MODE: OVERPRINT(O), NOOVERPRINT(N), TAPE(T), MONITOR(M), VDU(V), FILE(F), PROFILE(P). C IMODE C C C C C C CSS MODE OF OUTPUT IF <1 NORMAL IMAGES =1 MICRODIFFRACTION OR DIFFRACTION =2 CURRENT DENSITY =3 DIFFraction output =4 Reciproal space wave output =5 Real space wave output spherical aberration in millimeters. C ISLSK slice to start calculation at. C NTHIKS number of thicknesses (adjacent arrays) output C NTILTS no. of tilts (ie. thickness loops) output C IBTSET =0 set xtal tilt wrt optic axis (ie. group of beam tilts) C =1 beam tilt wrt optic axis (ie. group of xtal tilts) C TILH,TILK TILTS AS SPECIFIED BY IBTSET ABOVE C OI,OJ APERTURE IS CENTRED AROUND BEAM (OI,OJ). C DFS defocus loop start, angstroms. C DFI increment C NDF number of steps C NTTTT number of tilts in the divergence calculation. C +ve if tilts come from ms.FILE (must have divgce=0.0) C -ve if tilts to be generated (must set divgce) C AQUAD C NTS C NTI C C C Convergence symmetry slice that the divergence calculation commences at. every nti slice after the nts slice is used in the divergence calculation. hence, a specific thickness may be pick off tape 2 at varying tilts to do the divergence sum.. C DIVGCE Convergence (mrad) included in real space by sums c of tilts in objective lens only c requires ntttt to be the negative no. of tilts c chdiv c delta c ndiv chromatic aberration increment steps, angstroms. standard deviation number of steps each side C NOPTN 2-D PROFILES OPTION. - Unsupported C NOPTZ C NOPTY Unsupproted Unsupported c amean mean intensity for output. dark=0, light=1. c 0.5 will centre mean intensity to the middle c con c c 5) contrast range for output. no contrast=0.0, middle contrast=0.5, strong contrast=1.0. Reading the Numis output into Semper a. input 1 ms nam ‘case_J5s.img’ num (THICK*DEF)