Electron Microscopy Simulation in Python: Multislice Method (1)

It will start! Hello. Continuing from the last time (although it was a long time ago), this time is also crystal structure analysis in Python. The code is GitHub [^ 1]

Next article: Electron Microscopy Simulation in Python: Multislice Method (2)

Note: If you are simulating as a hobby (hobby ration), it is difficult to determine whether the result is really correct, and the result shown here may not be physically correct. I would appreciate it if you could point out any mistakes.

electronic microscope

An electron microscope is a device that allows you to see and analyze minute objects by hitting an electron beam against an object. There are other methods for observing minute objects such as optical microscopes and X-ray diffraction, which was discussed in the previous article, but electron beams have shorter wavelengths than visible light and X-rays, and exhibit higher resolution. I will. Taking advantage of its resolution, it is used in various situations such as structural analysis in condensed matter physics and biological tissue observation in biochemistry. There are three main types of electron microscopes: scanning electron microscope (SEM), transmission electron microscope (TEM), and scanning transmission electron microscope (STEM).

Transmission Electron Microscope (TEM)

A transmission electron microscope (TEM) is a microscope that irradiates an object with electrons and creates an image with the transmitted electrons. The internal structure is investigated from the intensity of the transmitted electron beam (transmitted wave), and the crystal structure is identified from the diffraction (diffraction wave) of the electron beam. As a further development, there is a method called High-Resolution electron microscopy (HREM) that creates an image by interfering transmitted waves and diffracted waves. By using HREM, high resolution can be obtained so that individual atomic arrangements can be projected as they are. The image created by HREM is called a crystal structure image. This time, the purpose is to create a crystal structure image by simulation.

Explanation of diffracted and transmitted waves

Since the electron beam has the property of a wave, it causes a diffraction phenomenon that propagates around obstacles. Obstacles in a crystal are electron clouds (potentials) around an atom. Since the atoms are regularly arranged in the crystal, the potential is also periodically distributed, and the diffraction caused by this is $2dsin\theta = n \lambda$ It appears as a diffracted wave only when the Bragg condition indicated by is satisfied. Such reflections are called Bragg reflections. d is the crystal plane spacing, θ is the angle between the crystal plane and the incident electron beam, and λ is the wavelength of the electron beam.

By the way, the sample targeted by TEM is very thin and has a thickness on the order of nm. When such a sample is irradiated with an electron beam, some of them transmit without reflecting, absorbing, or scattering. Such an electron beam is called a transmitted wave. Since the phases of the diffracted wave and the transmitted wave are different, the phase difference can be reflected in the image by interfering with each other (actually, the phase difference is not reflected just by interfering as it is, but the spherical aberration described later is reflected. It is possible by using it).

Multislice method

From here, we will explain the specific method of simulation. When an electron beam enters the sample and is transmitted or diffracted to form an image on the underside of the sample, the electron beam is output by interacting with the potential in the sample. To reproduce it in a simulation, it is necessary to reproduce the potential inside the sample, but to completely reproduce the potential of a sample with a thickness of tens or hundreds of nm, a tremendous number of atoms , The associated interaction from the electron cloud must be calculated. Therefore, a multi-slice method was considered in which the sample was sliced perpendicular to the incident direction of the electron beam and calculated as a stack of thin slices. The electron beam is scattered by passing through the slice, undergoes a phase change, propagates in space to the next slice, undergoes a phase change again at the next slice, and so on, and a crystal structure image is created on the lower surface of the sample. .. Below is a small schematic diagram. スクリーンショット 2020-05-26 14.45.32.png

For simplicity, consider passing through two slices and creating an image on the underside. When the incident wave $ \ psi_0 $ is incident on the first slice, we apply a phase object approximation that only receives a phase change from the potential $ V_p $ in the slice. When undergoing a phase change proportional to the projected potential, the wave at the bottom of the slice $ \psi_{1out}(x, y) = e^{i\sigma V_{p1}(x, y)} $ It will be. $ \ sigma = \ pi / \ lambda E $ ($ \ lambda $: wavelength, E: accelerating voltage). Furthermore, applying the weak phase object approximation that the change received from $ V_p (x, y) $ is small, $ \psi_{1out} (x, y) = \\{1 + i\sigma V_{p1}(x, y) \\} $ $ q_1(x, y) = 1 + i\sigma V_{p1}(x, y) $ $ \psi_{1out}(x, y) = q_1(x, y)\psi_0(x, y) $ It will be. $ q (x, y) $ is called a transparency function. $ \ Ps_1 $ that has passed through the first slice propagates through the space up to the second slice. Propagator $ p , which represents wave propagation, is $ p(x, y) = -\frac{1}{i\lambda \Delta z}e^{-ik\frac{(x^2 + y^2)}{2\Delta z}} $$ is. This is also the Fraunhofer diffraction equation. Here, Fourier transform $ p (x, y) . It will be effective later. $ P(h, k) = -\frac{1}{i\lambda \Delta z}\int e^{-ik\frac{(x^2 + y^2)}{2\Delta z}} e^{-2\pi i(hx + ky)} dxdy = e^{2\pi i \zeta(h, k) \Delta z } $$ Where $ \ zeta (h, k) $ is $ \zeta(h, k) = \frac{\lambda}{2}(h^2 + k^2) $ It is called the excitation error. From the above, the wave that reached the second slice $ \psi_{2in}(x, y) = \psi_{1out}(x, y) \otimes p(x, y) $ It will be. $ \ Otimes $ represents a convolution. The waves that passed through the second slice are the same as the first $ \psi_{2out}(x, y) = q_2(x, y)\psi_{2in}(x, y) $ is. In this way, the calculation is repeated for the number of slices. However, in the previous calculation, we have to perform the convolution operation for the number of slices. Convolutions are generally computationally expensive and should be avoided for direct calculations. Therefore, replace the convolution with the Fourier transform using the following formula. $ F[f(x)\otimes g(x)] = F[f(x)]F[g(x)] $ Then, the formula so far is $ \Psi_{out}(h, k) = F[q_2(x, y)F^{-1}[F[q_1(x, y)\psi_0(x, y)]P(h, k)]] $ It can be calculated by repeating the Fourier transform and the inverse Fourier transform.

program

In the calculation by the multi-slice method, the projection potential must first be prepared. The projected potential is obtained by inverse Fourier transforming the crystal structure factor (the crystal structure factor is the Fourier transform of the internal potential in the first place). Therefore, first, the crystal structure factor is calculated and the inverse Fourier transform is performed. The explanation and calculation method of the crystal structure factor can be found in the previous article. This time, the sample is α-Fe (bcc), and the incident direction is the z-axis direction [001]. The slice interval $ \ Delta z $ is the lattice constant / 2. Atom coordinates are pre-filled in pos_1.csv and pos_2.csv. The reciprocal lattice is generated by np.meshgrid () and applied by np.vectorize (). (I didn't know about np.vectorize () last time, so I listed it. It was useless ...)

fa = 0
hkl = [h, k, 0]
thkl = np.transpose(hkl)
dk = 1/((np.matmul(np.matmul(invG, thkl), hkl))**(1/2))
if(not np.isinf(dk)):
 sinthetalamb = lamb/(2*dk)
 for i in range(4):
  fa = fa + param_fe[i][0]*np.exp((-param_fe[i][1]*(sinthetalamb**2)))
            
 F = 0
 for i in r:
  F = F + fa*np.exp(1.0j*2*np.pi*(h*i[0] + k*i[1]))

Calculate the transmission function $ q $ with the crystal structure factor $ F $ as the projection potential $ V_p $ with np.fft.ifft2 ().

Vp = np.fft.ifft2(F)
q = 1 + 1.0j*sigma*Vp

The propagator function P is calculated from the beginning by Fourier transform.

zeta = lamb/2
zeta = zeta*(h**2 + k**2)
        
p = np.exp(1.0j*2*np.pi*zeta*deltaZ)

Perform multi-slice calculation. The incident electron beam $ \ psi_1 $ is 1.

psi = np.ones((self.N, self.N))
psi = np.fft.fft2(q*psi)*p
psi = np.fft.ifft2(psi)

Repeat this slice by slice. The $ \ psi $ output from the multislice calculation is a complex number. The intensity that actually appears as an image is the wave amplitude $ I $, so

I = np.abs(psi)**2

Then, a crystal structure image can be obtained ....

Continue to (2)

I'm sorry, I've explained it for a long time, but this calculation does not give a crystal structure image (to be exact, a proper crystal structure image). In fact, there are still factors to consider. It's been long, so I'll continue to the next article.

References

I will introduce the articles and books that I referred to when writing the article.

-JEOL Ltd. Glossary JEOL is the manufacturer of electron microscopes, but the glossary on the homepage is very substantial. It would be very useful for those who are studying electron microscopy.

-Numerical calculation of lens point image distribution function and MTF curve (diffraction calculation) An easy-to-understand explanation of diffraction theory is given. I learned about the existence of np.vectorize () in this article, but it's very convenient.

code

Recommended Posts

Electron Microscopy Simulation in Python: Multislice Method (1)
Electron Microscopy Simulation in Python: Multislice Method (2)
Simplex method (simplex method) in Python
Private method in python
Implement method chain in Python
Suppressing method overrides in Python
X-ray diffraction simulation in Python
Try implementing extension method in python
Implemented label propagation method in Python
Simulate Monte Carlo method in Python
Hash method (open address method) in Python
Method to build Python environment in Xcode 6
Alignment algorithm by insertion method in Python
Numerical Simulation in Python (2)-Diffusion-Limited Aggregation (DLA)
Python in optimization
CURL in python
Metaprogramming in Python
Python 3.3 in Anaconda
Geocoding in python
Meta-analysis in Python
Unittest in python
Learn the design pattern "Template Method" in Python
I tried the least squares method in Python
Epoch in Python
Discord in Python
To dynamically replace the next method in python
Learn the design pattern "Factory Method" in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
ambisonics simulation python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Try implementing the Monte Carlo method in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Johnson method (python)
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python