Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MuSTEM Manual

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

µSTEM

v5.3

A transmission electron microscopy simulation suite, in particular


for scanning transmission electron microscopy.

Authors of this manual (in alphabetical order):


L. J. Allen, H. G. Brown, A. J. D’Alfonso, S.D. Findlay, B. D. Forbes

Les Allen, Adrian D’Alfonso and Scott Findlay originally took the initiative to make
this code publicly available, with Adrian D’Alfonso taking on the considerable task of
setting up the GPU code. Hamish Brown and Ben Forbes have subsequently made sub-
stantial refinements and extensions, with Ben Forbes responsible for several efficiency
improvements. The code was developed mainly at the University of Melbourne. 1
We would like to acknowledge the contributions of Mark Oxley and Chris Rossouw to
the theoretical and numerical aspects of collaborative research that underpins µSTEM.
In particular, the code IONIZER, whose primary author was Mark Oxley, has been used
to set up the parametrized atomic scattering factors for ionization used in µSTEM. In
addition, in alphabetical order, Eireann Cosgriff, Torgny Josefsson, Nathan Lugg, Andrew
Martin, Gary Ruben and Chris Witte have all contributed as members of the group led
by Prof. Les Allen at the University of Melbourne.

September 24, 2018


c A. J. D’Alfonso, H. G. Brown, S. D. Findlay, B. D. Forbes and L. J. Allen

1
The µ is derived from the generic symbol used to denote inelastic scattering coefficients (related
to Fourier coefficients of inelastic scattering potentials) in the papers on which the code is based. In
addition, the “mu” is short for Melbourne University.

1
Contents
1 Introduction 5
1.1 Release notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.1 Version 4.4 improvements . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.2 Version 4.5 bug fix . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.3 Version 4.6 improvements . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.4 Version 5.0 improvements . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.5 Version 5.1 improvements . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.6 Version 5.2 improvements . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.7 Version 5.3 improvements . . . . . . . . . . . . . . . . . . . . . . . 6
1.2 System requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 GPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.2 CPU versions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 Program input and output 7


2.1 Input crystal file *.xtl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1.1 Important note . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Program control file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3 General details about operation of the program 8


3.1 Choice of GPU device (GPU versions) . . . . . . . . . . . . . . . . . . . . 8
3.1.1 GPU memory usage . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 Output filename prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.3 Specimen input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.4 Specimen slicing and thickness . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 Potential calculation method . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.6 Ionic potentials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.7 Choice of illumination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.7.1 Lens aberrations and defocus series . . . . . . . . . . . . . . . . . . 12
3.7.2 Tilting the beam (illumination) and/or specimen . . . . . . . . . . 13
3.8 Thermal scattering model . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8.1 Absorptive model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.8.2 QEP model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.9 Tiling and grid size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.9.1 Unit cell tiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.9.2 Size of the grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.10 Saving and loading transmission functions . . . . . . . . . . . . . . . . . . 18
3.11 Remaining choices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

4 Case studies 18
4.1 Plane wave illumination with the absorptive model . . . . . . . . . . . . . 19
4.2 Plane wave illumination with the QEP model . . . . . . . . . . . . . . . . 22
4.3 Convergent beam illumination with the absorptive model . . . . . . . . . . 24
4.3.1 CBED patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.2 PACBED patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3.3 STEM images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.3.4 STEM EELS images . . . . . . . . . . . . . . . . . . . . . . . . . . 27

2
4.3.5 STEM EDX images . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4 Convergent beam illumination with the QEP model . . . . . . . . . . . . . 29

References 29

3
Preamble:
Copyright (C) 2017 L. J. Allen, H. G. Brown, A. J. D’Alfonso, S.D. Findlay, B. D.
Forbes
This program is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this
program. If not, see http://www.gnu.org/licenses/.
Please forward your comments and suggestions to:

hamish.brown@monash.edu

Note that this is not a support email address and a response will not necessarily be forth-
coming.

4
1 Introduction
This manual describes a transmission electron microscopy (TEM) simulation suite, in par-
ticular for scanning transmission electron microscopy (STEM) images, that was developed
mainly at the University of Melbourne. The computing suite is based on the multislice
method.
Thermal scattering is accounted for with one of two models:
1. The absorptive scattering potential approach [1, 2, 7].
2. The quantum excitation of phonons (QEP) model [6] which provides overall results
numerically equivalent to the frozen phonon (FPh) method [8] but provides differ-
ent physical insights and allows both elastic and inelastic phonon scattering to be
separately elucidated.
Image simulation of inner shell ionization, i.e. electron energy loss spectroscopy (EELS)
and energy dispersive x-ray spectroscopy (EDX), are based on a parameterization of the
effective ionization potential in the local approximation. For EELS, a correction is made
for the finite detector aperture size. It is assumed that the aperture size is large enough
that the elastic scattering of the outgoing electron can be neglected.
The user is advised to read this manual in full even if they will not be running a
particular calculation. Concepts will be cross referenced between sections.

1.1 Release notes


This version of µSTEM has the ability to simulate structures with on-the-fly calculated
scattering potentials. In the case of the GPU accelerated program, the code will determine
whether there is sufficient memory on the GPU for the inputs that the user has selected
to pre-compute and store scattering potentials. Pre-computing and storing the potentials
is the fastest way to perform a calculation but requires sufficient GPU memory. For larger
calculations involving large number of atoms or non-periodic systems it may be necessary
to compute potentials on-the-fly. The on-the-fly time penalty seems to be approximately
3-6 times slower than pre-computing and storing. This method is only utilised when the
GPU memory is insufficient.
In addition to on-the-fly scattering potentials, scattering potentials can now be calcu-
lated using a faster and less accurate approach (hybrid method) [3]. The GPU version
of µSTEM will default to the hybrid method for on-the-fly potentials. For a further
discussion please see Sec. 3.5.

1.1.1 Version 4.4 improvements


It is now possible to save precalculated transmission functions and load them for sub-
sequent calculations. This is useful for calculations involving repeated use of the same
structure but with variation of parameters such as specimen thickness.
STEM probe intensities can now be outputted to file as a function of thickness. This
allows the channelling of the STEM probe to be examined in detail.
There have been some miscellaneous bug fixes made to calculations using hybrid and
on-the-fly potentials, as well as calculations of structures with fractional occupancies less
than 1.0.
Calculation of transmission functions using the accurate, reciprocal space method is
now significantly faster.

5
1.1.2 Version 4.5 bug fix
Version 4.5 has fixed a bug in which the third order spherical aberration coefficient CS
was not correctly set.

1.1.3 Version 4.6 improvements


Version 4.6 includes tilts of the beam and the specimen. The code has been compiled so
that it should run on the Pascal GPU architecture but this has not been tested.

1.1.4 Version 5.0 improvements


Version 5.0 allows the output of images for multiple thicknesses and a more streamlined
system to input defocus series. The option to include higher order aberrations is also
added.

1.1.5 Version 5.1 improvements


Version 5.1 allows the ionization of multiple orbitals for STEM-EELS and EDX calcula-
tions to be outputted in a single run of µSTEM and additional higher-order aberrations
have been added. The user input directive play all has been introduced to run multiple
µSTEM calculations sequentially.

1.1.6 Version 5.2 improvements


Version 5.2:

• Introduces M and N shell ionization for EDX and EELS and allows EDX subshells
to be output seperately

• Introduces segmented DPC detectors for QEP STEM calculations

• Includes scattering factor parametrizations for ions (Peng’s 1998 parametrization)

1.1.7 Version 5.3 improvements


Version 5.3 allows multiple STEM simulations (e.g. PACBED, EDX and HAADF) to be
done concurrently and allows multiple diffraction plane detectors to be used in absorptive
STEM calculations.

1.2 System requirements


1.2.1 GPU versions
The program runs on Windows 64-bit operating systems, and a CUDA-capable graphics
co-processor is required. The graphics card must be at least compute class 3.0 capable.
For more details refer to this website. µSTEM v5.3 has been compiled using the CUDA
9.0 Toolkit. The first thing to check if a calculation will not start is that you have the
latest driver for your graphics card and have the correct version of the NVIDIA CUDA
toolkit.

6
1.2.2 CPU versions
The program runs on Windows 64-bit operating systems. The source code has been
succesfully compiled Linux.

2 Program input and output


The program inputs can be summarised by two files, the input crystal file and the program
control file.

2.1 Input crystal file *.xtl


The input crystal file describes a generic unit cell of the crystal that will be used for the
simulation. There is no requirements that the unit cell be the primitive unit cell. In the
case where a simulation is performed for a system with no natural periodic repeat (e.g.
a nano-particle or interface) then the unit cell would simply represent the system. An
example .xtl file follows:
1 Strontium Titanate 001
2 3.905000 3.905000 3.905000 90.0000 90.0000 90.0000
3 3
4 Sr
5 1 38.000 1.000 0.78700 E -02
6 0.00000 0.00000 0.000000
7 O
8 3 8.000 1.000 0.92750 E -02
9 0.500000 0.500000 0.000000
10 0.500000 0.000000 0.500000
11 0.000000 0.500000 0.500000
12 Ti
13 1 22.000 1.000 0.55700 E -02
14 0.500000 0.500000 0.500000

2.1.1 Important note


The program assumes that an orthorhombic unit cell is input into the program and that
the incident beam direction is along h001i. This cannot be changed. You are required
to redefine your unit cell external to the program so that the structure is that which you
wish to simulate.

1. Generic crystal label (or short description).

2. a, b, c (unit cell lengths in Ångströms), α, β, γ (angles between axes in degrees; these


must always be 90◦ ).

3. Number of atom types in specimen.

4. Atom type label (human readable, i.e. Strontium is also a valid input).

7
5. Number of atoms of this type, atomic number Z, fractional occupancy, mean squared
displacement hu2 i in Å2 (hu2 i = B/(8π 2 ) where B is assumed to be an isotropic tem-
perature factor, so that hu2 i = (hu2x i+hu2y i+hu2z i)/3 with each Cartesian component
assumed to contribute equally). Atoms with the same atomic number but different
temperature factors can be entered as different atom types.

6. Fractional co-ordinate of the atom(s) in the unit cell.

2.2 Program control file


The program prompts the user with a series of questions and menu options. One can
record the inputs for a given calculation and this uses the supplied user_input.txt file.
This file must be in the directory containing the executable file and has two entries on
two separate lines:

Line 1: Will contain a single directive: Play, record overwrite, record, interactive
Interactive: no recording or playing, all inputs taken from the console
Record : as above, but does not overwrite the listed simulation file if it exists.
Record overwrite: records the simulation based on console inputs. Overwrites the listed
simulation file (if it exists).
Play: plays the listed simulation file with no input via console needed.
Play all : plays the listed simulation file(s) with no input via console needed. Introduced
in version 5.1
Line 2: Filename
The name of the file to store the recorded input file. If a playback file is used which does
not follow the same sequence as the program expects the program will exit. The user is
then required to amend the user input file, or alternatively, record a new file using the
interactive prompts.
Note: playback files may need to be amended if you are upgrading from an earlier
version of µSTEM (due to possible changed or added prompts).

2.3 Output
Two dimensional images are output as single (32-bit) or double (64-bit) precision floating-
point binary files in big-endian format. The precision of the output is determined by the
version of the software that has been executed. These can be viewed easily in the free
software ImageJ as detailed in Sec. 4.1. Line scans along a single dimension are output
as text files.

3 General details about operation of the program


3.1 Choice of GPU device (GPU versions)
The first section of the program displays a summary of the CUDA-enabled graphics cards
on your system and allows you to choose which one will be used for calculations — see
the example depicted in Fig. 1. It is important to check the details carefully to make
sure you are using the best device. You may also wish to run multiple instances of this
program simultaneously on different devices.

8
Figure 1: An example of how the GPU selection summary might appear, depending on
your system.

Note: if you are connecting to a remote machine via a Remote Desktop protocol, the
program may become confused about which machine it is running on (it may for example
present you with a list of graphics cards on the local machine, rather than the remote
machine). In this instance it is recommended that the user connect via SSH instead. On
Windows, an SSH server can be set up using Bitvise SSH.

3.1.1 GPU memory usage


The memory requirements of the calculation will be presented to the user prior to the
calculation beginning. If the required memory is greater than that available on the selected
device, then the calculation of transmission functions will be done “on-the-fly” to minimise
memory usage. The user also has the choice to force on-the-fly calculations. This option
not recommended as it is significantly slower. However, if the memory requirements have
been underestimated the program will crash, and the user is advised to try on-the-fly
calculations to see if that helps. Figure 2 depicts a situation where there appears to be
enough memory, but on-the-fly calculation has been selected anyway.

Figure 2: GPU memory requirements

9
3.2 Output filename prefix
The user may specify a prefix which is used for all data files outputted by the program.
This is helpful to keep datasets organised.
Recommendation: µSTEM can be directed to output to a different directory by
adding the relative path to the output filename prefix, use this to better organise µSTEM
outputs.

3.3 Specimen input


The program will next ask the user to enter the name of an .xtl file to define the specimen.
More details about this can be found in Sec. 2.1.

3.4 Specimen slicing and thickness


The user can specify whether or not the unit cell will be divided into slices (along the
c-axis of the input structure). The fractional depths of the front faces of each slice can be
entered manually or be calculated automatically. In the latter case the unit cell is divided
into slices of uniform thickness.
The distance over which the projection is applied should be kept to less than 2 Å (based
on the experience of the authors). Convergence of the slicing procedure can be checked
by simply slicing more finely. Specimens with no repeat in the z-direction (e.g. nano-
particles) will require that slicing be used, since in those cases the “unit cell” will generally
extend far beyond 2 Å. The experience of the authors suggests that for calculations using
the QEP model, slicing can be very important.
If no slicing is used, then the entire unit cell is projected into a single slice.
If an accurate calculation of Higher Order Laue Zone details is important, then slicing
finer than the unit cell should be performed.
As an example, for SrTiO3 oriented down the [001] zone axis the unit cell is 3.905 Å
to a side, and so slicing the unit cell is recommended. Fortunately in this case there are
two “natural” depths at which atoms occur, namely 0.0 and 0.5. Slicing the unit cell at
these depths will yield an accuate multislice solution, assuming other parameters such as
unit cell tiling and grid size are sufficient.

Figure 3: User input to µSTEM to perform a thickness series.

The specimen thickness is entered in Ångström units. This will be rounded to the near-
est thickness that is an integer number of unit cell repeats in the z-direction. Thicknesses
can be entered as a single value, a list (z1 , z2 , z3 ...zn ) or a sequence (zinitial : zfinal : zstep ).

10
As an example a thickness series in steps of 100 Å entered as a sequence (zinitial = 100Å :
zfinal = 1000Å : zstep = 100Å), is demonstrated in Fig. 3.

3.5 Potential calculation method

Figure 4: Choice between potential calculation methods.

Two methods are provided for calculating the potentials: the reciprocal space method
and the hybrid method [3]. The reciprocal space method is accurate, while the hybrid
method is considerably faster but is not as accurate. For rapid computations we recom-
mend the hybrid approach, which can be subsequently checked with the reciprocal space
method.
Note that if the memory on your graphics card is insufficient for storing pre-calculated
potentials for QEP model calculations, then potentials will be calculated “on-the-fly”
using the hybrid approach.

3.6 Ionic potentials


By default atomic potentials are calculated within an isolated atom approximation (IAM)
using the parametrization of Waasmaier and Kirfel [11]. Ionic bonding can be approxi-
mated in µSTEM using by running the program with the command line option ionic. In
this case the atomic potentials will be calculated using the parametrisation of Peng [10],
the *.xtl crystal input file will need to be modified to include the ionic state of the atoms
within the crystal as shown in Fig. 5

3.7 Choice of illumination


The user will next be presented with a choice between plane wave and convergent-beam
illumination, which should look like Fig. 6.
Plane wave illumination can be used to calculate images and diffraction patterns
within both the QEP and absorptive models. Convergent-beam illumination can be used
to calculate CBED patterns, PACBED patterns and STEM images (including BF/AD-
F/EDX/EELS) within the QEP and absorptive models.

11
Figure 5: A *.xtl crystal input file modified to include the ionic state of the atoms within
the crystal

Figure 6: Choice of illumination.

3.7.1 Lens aberrations and defocus series


The probe forming aperture is set and Defocus, 3rd and 5th order spherical, twofold
and threefold astigmatism and coma aberrations can be included using the lens menu.
The form of the lens menu is the same for the probe forming lens in STEM and CBED
and the image forming lens in CTEM. A defocus series can be set up in a manner sim-
ilar to thickness series (see Sec. 3.4). Defocus can be entered as a single value, a list
(∆f1 , ∆f2 , ∆f3 ...∆fn ) or a sequence (∆finitial : ∆ffinal : ∆fstep ). As an example a defocus
series in steps of 20 Å entered as a sequence (∆finitial = −120Å : ∆ffinal = 100Å : ∆fstep =
20Å), is demonstrated in Fig. 7. Note that defocus series have not yet been implemented
for the CBED and PACBED routines. These routines will simply take the first defocus in
the series. The menu also offers the option to output the lens constrast transfer function,
this is demonstrated for the example of a 24 mrad probe forming aperture with 5000 Å of
coma in Fig. 8. The phase of the contrast transfer function and the intensity of the real
space point-spread function associated with the lens is outputted. In the case of STEM
imaging the intensity of the real space point spread function represents the intensity of
the STEM probe on the surface of the sample.
There are two things to keep in mind regarding input of aberrations:

• The magnitude of all aberrations is in Ångström units for consistency and this can
be inconvenient for aberrations above first order such as spherical aberration C30
(for which mm is a more convenient unit). Here it is best to use the exponent symbol
“E” for input, so 1.2 mm of C30 is inputted as “1.2E7” Å.

• For an uncorrected instrument with significant 3rd order spherical aberration C30 ,

12
Figure 7: Choice of lens parameters.

Figure 8: Example output for the phase of the lens contrast transfer function and the
intensity of the point spread function. The scale bars were added in ImageJ.

C30 should be balanced with defocus ∆f in the Sherzer condition:


p
∆f = −sgn(C30 ) 4|C30 |/3 (1)

Where sgn(C30 ) is the sign of the 3rd order spherical aberration coefficient. As
shown in Fig. 9, if C30 is adjusted, ∆f should be changed again and µSTEM will
automatically suggest the appropriate Sherzer condition.

3.7.2 Tilting the beam (illumination) and/or specimen


The beam (illumination) can be tilted away from the optical axis and/or the specimen
can be tilted (new feature in v4.6). In Fig. 10 we show an example where the beam is
tilted and in Fig. 11 the specimen is tilted. Tilts of up to a few degrees can be handled
in this way.

13
Figure 9: For a given 3rd order spherical aberration C30 µSTEM will suggest the appro-
priate Sherzer defocus condition

Figure 10: Tilting the beam (illumination)

14
Figure 11: Tilting the specimen.

3.8 Thermal scattering model


The user will next have a choice between two scattering models. Briefly, the absorptive
model permits a rapid calculation but only considers how thermal scattering attenuates
the elastic wave function. Thermal scattering cross sections are calculated in a single
inelastic scattering approximation, less accurate for thicker specimens. Channelling of
the thermally scattered electrons is also ignored.
The Quantum Excitation of Phonons (QEP) model includes all thermal scattering
effects but will take longer to calculate. More details are given below.

3.8.1 Absorptive model


The absorptive model is a method of including the effects of thermal scattering on the
elastic wave function, by attenuating the wave function with the “absorption” due to
thermal scattering. The contributions made by those electrons which have been thermally
scattered are not included in many of the results. Exceptions to this are STEM images
for diffraction plane detectors, which include thermal scattering in the single inelastic
scattering approximation. For thicker specimens, multiple thermal scattering becomes
significant and the QEP model should be used instead.
The user may also choose to not include absorption at all, in which case no ther-
mal scattering is considered. The atomic potentials will still however be “smeared out”
according to the temperature factors specified in the xtl file. This option is useful for
checking if the grid size is sufficient. The intensity displayed in the status line during
calculation will drop below 1.0 if electrons are being “lost” due to inadequate numerical
parameters, namely the grid size.

3.8.2 QEP model


The Quantum Excitation of Phonons (QEP) model [6] is a rigorous approach to handling
what is also known as thermal diffuse scattering (TDS). The advantages of this model are
its quantum mechanical underpinnings and the fact that we can keep track of electrons
which have been elastically scattered and thermally scattered separately. This means
that the contribution to EELS and EDX due to both elastically and thermally scattered
electrons can be tracked separately.

15
If one is not interested in the contribution from thermally scattered electrons to EELS
and EDX cross sections, then an absorptive model calculation would suffice. In fact,
the elastic contribution will be very similar to that calculated in the QEP, and will be
significantly faster to calculate within the absorptive model. Nevertheless, the thermally
scattered component is often crucial in understanding the physics [5].
Calculations of the total scattered intensity in the QEP model are numerically equiv-
alent to what would be obtained in a frozen phonon (FPh) model calculation [9]; for the
FPh mode, the separation into elastic and thermal components is not obvious.

Practical considerations Using the QEP model typically requires the unit cell to be tiled
out by at least 4×4. Additionally, the atomic potentials are not thermally smeared out
as in the absorptive model but rather are quite sharp, which corresponds to requiring
a large grid size that permits high-angle scattering. The user should ensure that their
choice of grid size allows scattering out to at least 150 mrad, or at the very least confirm
convergence of their results by using progressively larger grid sizes. The user can also
monitor the intensity at each probe position to ensure that it does not drop significantly
below 1.0.
The algorithm employed by the QEP model relies on displacing the atoms in the
specimen into a number of random configurations based on the thermal motion of the
atoms. The accuracy of the QEP calculation increases as more configurations are cho-
sen; as a loose rule of thumb the authors would recommend at least 40 configurations.
More than 100 passes may be required for the elastic contribution to reach convergence.
Precalculating many transmission functions may require a large amount of memory.
To ameliorate this, the program can randomly translate the transmission functions
by an integer number of unit cells in each direction. Whilst technically this is not a
different configuration, it may effectively be different as seen by the incident electron
wave function. Using this approach increases the number of configurations by a factor
equal to the number of unit cells that have been tiled out. The translation of transmission
functions is computationally fastest when there are an integer number of pixels along each
direction of the unit cell. For example, with a 4×4 tiling and a 512×512 grid size, there
are 128×128 pixels per unit cell. If this is not the case then the code must revert to using
the Fourier Shift theorem and this will cost, in computational terms, an extra FFT per
slice.
It is also possible to generate transmission functions “on-the-fly”, which means that
transmission functions are not precalculated but rather are calculated just before they are
needed, and then are discarded. While slower than the precalculation approach it does
significantly reduce memory requirements and allows the simulation of aperiodic systems
containing of the order of 106 atoms. This option is only used if the GPU does not have
sufficient memory to precalculate and store an adequate number of transmission functions.
The user may also specify the “starting position of the random number sequence”.
Normally this input is not important, and any integer can be entered. If the same number
is entered for the same inputted parameters, then the results of the calculation should
be numerically identical. This is useful for exactly reproducing results, e.g. for checking
purposes.

16
3.9 Tiling and grid size
3.9.1 Unit cell tiling
The user may specify how the unit cell is tiled to form a supercell. This is necessary in
two cases: where the QEP model is being used, or when the illumination is a convergent
beam (e.g. a STEM probe). In the former case, we recommend that the tiling is at least
a factor of 4 in each direction, although if the unit cell (as specified in the xtl file) is
a complicated structure such as a nano-particle or an interface, it may already be large
enough so that tiling is not needed. In the case of convergent-beam illumination, it is
important that the supercell is large enough so that the scattered probe wave function
does not “wrap around” the supercell and interfere with itself. A supercell with side
lengths of 30 Å should be sufficient to contain a atom-sized probe (e.g. probe-forming
convergence semi-angle of 15 mrad for 300 keV electrons, which gives a probe about 1 Å
across).
If the absorptive model is being used and the illumination is a plane wave, then no
tiling is necessary.
For further details on supercell tiling please review Ref. [4].

3.9.2 Size of the grid


The user must also specify the number of pixels on the grid on which calculations will
proceed. The size of this grid (in conjunction with the unit cell tiling) determines the
resolution of the calculation, or equivalently, it determines the plane wave basis with which
the calculation will proceed. An important consideration is that this plane wave basis
should extend out far enough to cover the possible range of outgoing wave vectors. If it
is insufficient, then electrons scattered to high angles will not contribute appropriately to
the calculation. This will affect primarily calculations of annular dark field STEM images
in the QEP model.
Once the tiling and grid size have been specified, the program will output a number
of derived quantities, which include the maximum scattering vectors/angles included in
the calculation. It is important to review these numbers to ensure that they are sufficient
for the desired calculation.
There are further considerations when choosing the size of the grid:

• Pixel numbers (in each direction) that are products of powers of small primes can
result in significantly faster calculations, since the majority of the time is spent
performing Fast Fourier Transforms. The optimal choice would be a power of 2, e.g.
64, 128, 256, 512, 1024 etc.

• Calculations within the QEP model may be sped up significantly if there is an integer
number of pixels per unit cell, since in that case we can effectively compute new
“frozen lattice” configurations by simply translating an entire transmission function
by a random physical lattice vector, which would correspond to an integer number
of pixels. Otherwise, one would need to compute significantly more transmission
functions (taking up more memory and time) or translate the transmission functions
using a phase ramp in Fourier space (i.e. applying the Fourier Shift Theorem) which
is less efficient.

17
Comments: One can check whether the size of the grid is sufficient by monitoring the
intensity which is output as the calculation runs. If the intensity drops significantly
below 1.0, then the grid size could be increased. To check this for calculations using the
absorptive model, one should initially choose the option “Do not include absorption” and
check that the intensity is sufficiently conserved. Subsequently the calculation should be
run with absorption included.

3.10 Saving and loading transmission functions


New in version 4.4 is the ability to save and load precalculated transmission functions. The
associated files may require a large amount of disk space, depending on the calculation.
These can be loaded for subsequent calculations provided the following parameters are
identical:

• The xtl file

• The slicing of the unit cell

• The choice of thermal scattering model (QEP vs. absorptive)

• The tiling of the unit cell

• The number of pixels

• (For absorptive model: whether absorption is included)

• (For QEP model: the number of distinct transmission functions)

• (For QEP model: phase ramp shift choice)

Saving the transmission functions is depicted in Fig. 12. The transmission functions
are stored in a file prefixed according to the user’s specification at the beginning of the
program. In a subsequent calculation, the user can choose to load these transmission
functions by specifying the filename.

3.11 Remaining choices


The choices remaining to the user are specific to each type of calculation, and will be
covered in the case studies in the following section.

4 Case studies
In this section we present a few case studies with specific details about what typical
choices of parameters might be. For more worked examples of µSTEM calculations and
a simple worksheet see the Tutorials folder on the GitHub.

18
Figure 12: Saving transmission functions to file

4.1 Plane wave illumination with the absorptive model


For this example we will use the case study of SrTiO3 (STO) with 300 keV plane wave
illumination oriented down the h001i zone axis. The .xtl file is provided with the program
under the name SrTiO3_001_300keV.xtl. After entering this filename at the prompt,
details of the specimen will be written to the screen. The user is advised to check the
values here to ensure that they are sensible.
This specimen has a repeat distance of 3.905 Å in the z-direction, which could poten-
tially introduce a significant error in the multislice calculation. We will thus slice the unit
cell. Since there are atoms sitting at only two depths, 0.0 and 0.5, we will choose these
manually, as depicted in Fig. 13.
For this example the thickness is assumed to be 200 Å. After this is entered, the
program outputs how many unit cells will be used and the corresponding thickness. In
this case, rounding to the nearest thickness corresponding to a whole number of unit cells
gives 199.2 Å.
The next prompt is a choice between two methods of calculating potentials: the re-
ciprocal space method and the hybrid method. For this example we choose the reciprocal
space method since it is the most accurate and will not take too long for this example.
For more details on this topic see Sec. 3.5.
We then choose the options for “Plane wave illumination” and “Absorptive model”.
At this point you will be prompted to enter details of unit cell tiling and grid size. This
calculation assumes a perfectly periodic crystal and illumination and hence does not
require a supercell. A typical choice of numerical sampling parameters is depicted in
Fig. 14. A grid size of 128 × 128 has been chosen which, for the 1 × 1 unit cell tiling means
that the elastic wave function will be computed out to a scattering angle of 211 mrad.
Experience suggests that for plane wave illumination this is more than sufficient, the
reasons for this being twofold:
1. If we are calculating an HRTEM image we would typically include an aperture on
the image-forming lens, which will most likely correspond to scattering angles far

19
Figure 13: Slicing choices

Figure 14: A summary of a smeared HRTEM calculation supercell setup.

less than 211 mrad.

2. For specimen thicknesses typically used for atomic resolution HRTEM, the smeared
elastic scattering potential will generally not scatter a significant fraction of the
incident flux to angles greater than 100 mrad.

The user is encouraged to check that the grid size is sufficient by running a calculation in
the absorptive model but with absorption switched off, for more details see Sec. 3.8.1.
The user will now be presented with a series of questions pertaining to the imaging lens
of the microscope (see Fig. 15). In this example we have used a Cs of 1.2 mm, and have
accepted the recommended aperture cutoff and defocus to optimise for phase constrast in
the image. The sign convention for defocus is such that a positive value indicates more

20
Figure 15: A summary of the image forming lens parameters.

‘focusing’ power (overfocus). In other words the wave is brought to a focus before the
detector plane.
The program will now compute the image and diffraction pattern (see Fig. 16) and
output these 2D images as files named in the following format:
<Prefix>_Image_<NX>x<NY>.bin
<Prefix>_DiffractionPattern_<NX>x<NY>.bin
where NX and NY are the dimensions of the 2D image.

Figure 16: Calculation output.

To load these files in ImageJ, go to File → Import → Raw, locate the file, and enter
the details shown in Fig. 17 (note that the single precision version has been used for this
example and hence the “Image type” is “32-bit Real”).
A more convenient way to load the files is using the Droplet: Drag and Drop file
processor plugin written by Jerome Mutterer and Wayne Rasband for ImageJ. Follow the
link and download instructions therein for the Droplet Plugin then add the contents of
the Droplet Actions folder from the muSTEM github to the folder of the same name in

21
Figure 17: Loading a binary file in ImageJ. The HRTEM image is displayed.

the plugins directory of your ImageJ directory. A screenshot of the droplet app is shown
in Fig. 18.

Figure 18: The ImageJ droplet with scripts to open µSTEM output: a much more con-
venient way of viewing data

If you use either MatlabTM or Python programming languages for data analysis then
functions to open µSTEM output in these languages are also available in the Auxiliary tools
folder
The diffraction pattern does not usually look very interesting when first displayed. It
is often necessary to adjust contrast or apply a log transformation. We refer the user to
the ImageJ documentation and to the literature for this.

4.2 Plane wave illumination with the QEP model


A plane wave QEP calculation proceeds largely as per Sec. 4.1. The differences between
the two calculation approaches will be discussed presently.
As discussed in Sec. 3.9.1, the unit cell must be tiled out for calculations in the
QEP model, and consequently the grid size must be increased to ensure that high angle
scattering is correctly accounted for. In this example we will use a 4×4 tiling and 512×512
pixels. This is depicted in Fig. 19, and we can see that scattering is included out to 212
mrad, which should be sufficient. These numerical parameters have the further advantage
that there are an integer number of pixels per unit cell (128 in each direction). As
discussed in Sec. 3.8.2 this speeds up the calculation and saves memory by allowing the
precalculated transmission functions to be quick shifted by random physical lattice vectors
to effectively gain new transmission functions.

22
Figure 19: Numerical parameters for plane wave illumination and QEP model

Figure 20: QEP parameters

The user will now be asked some specific questions relating to the QEP model. In Fig.
20 we show the numbers used in this example; 10 distinct transmission functions have
been calculated, but since quick shifting is possible in this case, there will effectively be
160 configurations. This should be more than sufficient. We have chosen to use 20 passes,
which should usually be sufficient for calculating the total scattered intensity. However, it
may be insufficient for calculation of elastic intensities (and thermal intensities, which are
calculated by subtracting the elastic from the total). The absorptive model can be used
for rapid calculation of elastic intensities. The number chosen as the starting position of
the random number sequence is only important for reproducing a previous result, and can
be any integer.
At this point the user will be asked to specify the parameters of the image forming
lens, for more details Fig. 15 and the surrounding discussion.
The program will now calculate the transmission functions and then proceed with the
multislice solution. At completion the code will output the exit surface elastic intensity
and phase, the inelastic intensity and the total intensity. It will also output the equivalent
far-field diffraction and image plane quantities.

23
The following files are outputted:
<Prefix>_DiffPlaneTotal_<NX>x<NY>.bin
<Prefix>_DiffPlaneElastic_<NX>x<NY>.bin
<Prefix>_DiffPlaneTDS_<NX>x<NY>.bin
<Prefix>_ExitSurface_IntensityElastic_<NX>x<NY>.bin
<Prefix>_ExitSurface_PhaseElastic_<NX>x<NY>.bin
<Prefix>_ExitSurface_IntensityTotal_<NX>x<NY>.bin
<Prefix>_ExitSurface_IntensityTDS_<NX>x<NY>.bin
<Prefix>_Image_Elastic_<NX>x<NY>.bin
<Prefix>_Image_TDS_<NX>x<NY>.bin
<Prefix>_Image_Total_<NX>x<NY>.bin

4.3 Convergent beam illumination with the absorptive model


A calculation using a convergent beam and the absorptive model proceeds similarly to
the plane wave illumination procedure outlined in Sec. 4.1 with a few exceptions detailed
here.

Figure 21: Typical numerical parameters for a convergent beam calculation using the
absorptive model.

As the convergent probe does not share the same periodicity as the crystal we require
the use of a supercell. The size of the supercell must be such that there is no “aliasing” of
the probe, which occurs when the probe wave function scatters and subsequently extends
to the edges of the supercell. Numerical tests for aliasing are not easily defined and we
are forced to rely on intuition. As a general rule of thumb the more scattering that
occurs the larger the supercell needs to be. Another rule of thumb is that the finer the
probe is the larger the supercell needs to be. Without being prescriptive, keeping the
supercell side lengths larger than 30Å is usually sufficient, the caveat being that larger
is usually better. If in doubt, the user is encouraged to double the tiling of the unit cell
and simultaneously double the grid size, which will increase the size of the supercell while
keeping the resolution of the simulation constant.
In the present case study, we have tiled the STO unit cell 8×8 so that the supercell
measures 31 Å × 31 Å. We use a grid size of 512×512, which should be sufficient for

24
the absorptive model. This should be checked in practice by doubling the grid size to
1024×1024 and checking the results. These parameters are depicted in Fig. 21.

Figure 22: Parameters for the probe-forming lens.

The probe-forming lens is set up in much the same way as for an imaging lens, as
described in Sec. 4.1 and depicted in Fig. 22. In this case we have assumed an aberration-
corrected probe with a convergence semi-angle of 15 mrad.

Figure 23: Choosing the type of convergent-beam calculation to perform.

The user is now presented with a list of possible calculations as depicted in Fig. 23.
These calculation types are explained in the following sections.

4.3.1 CBED patterns


The user will be asked to enter the fractional co-ordinate, with respect to the unit cell, to
place the probe. In this case, we position the probe over the strontium-containing column
and thus specify “0.0 0.0”. The CBED pattern will be outputted with the filename in
the form
<Prefix>_DiffractionPattern_<NX>x<NY>.bin .

25
4.3.2 PACBED patterns
The calculation will proceed using the probe positions determined from the information
transfer limit of the microscope and the unit cell under consideration. A choice is given as
to whether to output the different diffraction patterns contributing toward the PACBED.
If pertinent these will be outputted with the filename in the form
<Prefix>_pp_<n_x>_<n_y>_Diffraction_pattern_<NX>x<NY>.bin .
where the integers <n_x> and <n_y> label the scan positions of the probe across the unit
cell. This option allows one to construct a “4D STEM” data-set, ie one that could be
achieved in experiment with a fast-readout pixelated detector. The PACBED pattern will
be outputted with the filename in the form
<Prefix>_PACBED_Pattern_<NX>x<NY>.bin .

4.3.3 STEM images


The STEM probe intensity can optionally be outputted as a function of thickness at each
probe position. This is depicted in Fig. 24. The resulting dataset may be very large.

Figure 24: Outputting the STEM probe intensity.

When calculating any type of STEM image, the user can choose the inner and outer
angles for a number of detectors in the diffraction plane, so that for example a STEM
HAADF image can be simultaneously calculated. These angles can be chosen to simulate
a broad range of imaging modes, including bright-field (BF), annular bright field (ABF)
and annular dark field (ADF) simultaneously. Segmented detectors are also a possibility
and can be accessed by inputting the number of detector annular and angular segments
seperated by a comma. Input for a 4 annulus ×4 segment detector system is shown by
way of example in Fig. 25. For all examples in the following sections, we specify a HAADF
detector with inner and outer angles of 60 and 180 mrad respectively.

26
Figure 25: Choosing STEM detectors in µSTEM.

4.3.4 STEM EELS images


In this example we have chosen an EELS detector collecting electrons out to 50 mrad.
A correction is applied to account for the finite detector size [12]. We choose to calcu-
late the STEM EELS image that would result from only detecting electrons which have
inelastically scattered after ionizing oxygen atoms within the 1s orbital. We choose an
energy window which extends 30 eV above threshold as an example. See Fig. 26.
Next the user will be prompted for details about scan vectors and probe position
sampling. Typically the defaults should be accepted. In the present example, that means
that there will be 12×12 probe positions.
The calculated STEM images will also be tiled and interpolated according to the
user’s specifications. In the present example we have specified that the image should
be interpolated up to a maximum of 100×100 pixels (the actual output dimensions will
depend in general on the aspect ratio of the region over which the probe is scanned), and
we have used a 2×2 tiling.

27
Figure 26: Parameters for an EELS calculation

The template for the outputted filenames is:


<Prefix>_DiffPlaneTotal_Defocus<DF>_<NX>x<NY>.bin
<Prefix>_DiffPlaneElastic_Defocus<DF>_<NX>x<NY>.bin
<Prefix>_DiffPlaneTDS_Defocus<DF>_<NX>x<NY>.bin
<Prefix>_EELS_Defocus<DF>_<NX>x<NY>.bin
<Prefix>_EELS_CorrectionMap_Defocus<DF>_<NX>x<NY>.bin
<Prefix>_EELS_Corrected_Defocus<DF>_<NX>x<NY>.bin

4.3.5 STEM EDX images


The STEM EDX inputs are slightly different than EELS inputs. The concept of an energy
window is meaningless here, since the EDX signal is proportional to the probability of
an electron being ejected with any kinetic energy, hence the energy window effectively
extends all the way to the incident energy minus the binding energy. The EDX image is
calculated assuming that the signal comes from electrons that are inelastically scattered
through all angles after ionization. Figure 27 depicts the parameters we have chosen for
this example.

28
Figure 27: Parameters for an EDX calculation

4.4 Convergent beam illumination with the QEP model


A QEP STEM calculation proceeds largely as per Sec. 4.3. There are QEP specific
questions which are discussed in Sec. 4.2. The choice of numerical parameters here is
affected by both the requirements of the QEP model and the requirements of a convergent-
beam probe. That is, the unit cell should be tiled out sufficiently so that the probe is
“contained” within the supercell (see Sec. 4.3) and the grid size should be sufficiently
large so that scattering to high angles is included (see Sec. 4.2).
Further differences here are that many diffraction plane detectors may be specified and
all quantities are outputted as Total, Elastic and TDS, the latter being the contributions
from elastic and thermal scattering respectively.

References
[1] L. J. Allen, S. D. Findlay, M. P. Oxley, and C. J. Rossouw. Lattice-resolution contrast
from a focused coherent electron probe. Part I. Ultramicroscopy, 96:47, 2003.

[2] D. M. Bird and Q. A. King. Absorptive form factors for high-energy electron diffrac-
tion. Acta Cryst., A46:202, 1990.

[3] W. Van den Broek, X. Jiang, and C.T. Koch. FDES, a GPU-based multislice algo-
rithm with increased efficiency of the computation of the projected potential. Ultra-
microscopy, 158:89 – 97, 2015.

[4] S. D. Findlay, L. J. Allen, M. P. Oxley, and C. J. Rossouw. Lattice-resolution contrast


from a focused coherent electron probe. Part II. Ultramicroscopy, 96:65, 2003.

29
[5] B. D. Forbes, A. J. D’Alfonso, R. E. A. Williams, R. Srinivasan, H. L. Fraser, D. W.
McComb, B. Freitag, D. O. Klenov, and L. J. Allen. Contribution of thermally scat-
tered electrons to atomic resolution elemental maps. Physical Review B, 86:024108,
2012.

[6] B. D. Forbes, A. V. Martin, S. D. Findlay, A. J. D’Alfonso, and L. J. Allen. Quantum


mechanical model for phonon excitation in electron diffraction and imaging using a
born-oppenheimer approximation. Phys. Rev. B, 82(10):104103–, September 2010.

[7] C. R. Hall and P. B. Hirsch. Effect of thermal diffuse scattering on propagation of


high energy electrons through crystals. Proc. Roy. Soc. Lond. A, 286:158, 1965.

[8] R. F. Loane, P. Xu, and J. Silcox. Thermal vibrations in convergent-beam electron


diffraction. Acta Cryst., A47:267, 1991.

[9] R. F. Loane, P. Xu, and J. Silcox. Thermal vibrations in convergent-beam electron


diffraction. Acta Crystallographica Section A, 47:267, 1991.

[10] L-M Peng. Electron scattering factors of ions and their parameterization. Acta
Crystallographica Section A, 54(4):481–485, 1998.

[11] D. Waasmaier and A. Kirfel. New analytical scattering-factor functions for free atoms
and ions. Acta Crystallographica Section A, 51:416–431, 1995.

[12] Y. Zhu, A. Soukiassian, D. G. Schlom, D. A. Muller, and C. Dwyer. Towards artifact-


free atomic-resolution elemental mapping with electron energy-loss spectroscopy. Ap-
plied Physics Letters, 103(14), 2013.

30

You might also like