Skip to main content
Journal of Applied Crystallography logoLink to Journal of Applied Crystallography
. 2021 Sep 13;54(Pt 5):1530–1534. doi: 10.1107/S160057672100830X

New developments including X-ray standing waves in the dynamical Bragg diffraction program of X-ray Server

Sergey Stepanov a,*
PMCID: PMC8493622  PMID: 34671232

The X-ray Server program for calculating dynamical X-ray diffraction from crystals with strained surface layers has been updated to run ten times faster, be more stable, output X-ray standing waves and more.

Keywords: dynamical X-ray diffraction, X-ray standing waves, grazing incidence, multilayers

Abstract

X-ray Server (https://x-server.gmca.aps.anl.gov) is a collection of programs for online modelling of X-ray diffraction and scattering. The dynamical diffraction program is the second most popular Server program, contributing 34% of total Server usage. It models dynamical X-ray diffraction from strained crystals and multilayers for any Bragg-case geometry including grazing incidence and exit. This paper reports on a revision of equations used by the program, which yields ten times faster calculations in most use cases, on implementing calculations of X-ray standing waves and on adding new options for modelling diffraction from monolayers.

1. Introduction  

X-ray Server (https://x-server.gmca.aps.anl.gov] is a web service providing free unrestricted access to a collection of programs implementing the author’s models in the fields of dynamical X-ray diffraction from strained crystals, multiple Bragg diffraction, X-ray specular reflection and diffuse scattering from multilayers with rough interfaces, resonant X-ray reflection from magnetic multilayers, calculation of scattering factors, and searches for Bragg reflections meeting specified conditions. All software operates directly on the Server and is available for use without need for local installations. The project has been online since 1997, being one of the first in the X-ray field, and its recognition has been growing exponentially: the usage of the software has doubled approximately each two years as shown in Fig. 1. Since 1997 the Server has processed more than 5 400 000 X-ray requests; about 1200 users (unique IP addresses) deployed it at least 100 times; and about 6400 users ran the programs ten or more times. The fast usage growth was facilitated by several developments. Initially the Server programs were accessible via web browsers only (Stepanov, 2004). Then, around 2006, we added some example scripts illustrating how to call the Server programs from user software (Stepanov, 2007). This helped users to arrange remote data fitting where the X-ray Server programs are called at each iteration and then the calculations are compared with experimental data. In 2008 the first successful remote data fitting of Bragg diffraction from an AlSb/AlAs superlattice using the Server program was reported (Stepanov & Forrest, 2008). In 2016 the graphical interface to the X-ray Server program was developed within the OASYS package by the ESRF and the APS (Rebuffi & Sanchez del Rio, 2017; Sanchez del Rio et al., 2014). It provided a tool for looped calling of the Server programs without any programming on the user side. Finally, in 2017 an online interface for adding crystal structures to the Server materials database and their verification against expected space groups was developed. Once added, the structures can be used with any Server programs.

Figure 1.

Figure 1

X-ray Server usage statistics. Black: total usage; blue: the dynamical diffraction program usage.

The dynamical diffraction program presented in the X-ray Server is named GID_sl [grazing incidence diffraction (GID) from superlattices]. It is based on the paper by Stepanov et al. (1998), which suggested a recursive matrix method for calculating GID from crystals with strained multilayers at their surfaces. In this method, each layer is treated as a perfect crystal where the fourth-order dispersion equation of the extended dynamical diffraction theory accounting for X-ray specular reflection and refraction is solved. The four solutions of this equation in each layer correspond to four pairs of transmitted and diffracted X-ray waves with the amplitudes given by the boundary conditions for electric fields and their derivatives. The overall problem is reduced to 4 × 4 matrix equations. Following the method suggested by Kohn (1991) for multiple Bragg diffraction, Stepanov et al. (1998) split the 4 × 4 matrices into 2 × 2 blocks and thus further reduced the problem to recursive equations for these 2 × 2 blocks. The splitting provides a better numerical stability of calculations for crystals with a large number of layers compared with using 4 × 4 matrices because it helps to separate exponents growing with the crystal depth coordinate from those decreasing with the depth: the former and the later end up in different matrix blocks.

The GID_sl program fully accounts for potential specular reflection effects of X-rays at grazing incidence and/or exit, which allows its application to a wide range of X-ray diffraction cases from grazing-incidence X-ray diffraction to regular diffraction at normal incidence angles, i.e. far beyond the GID cases. Furthermore, the analysis of the GID_sl usage at X-ray Server shows that about 95% of jobs use it for regular X-ray diffraction without any grazing incidence or exit. Under these conditions all specular reflection effects can be neglected and the 4 × 4 matrices can be reduced to 2 × 2 while their subblocks can be reduced to scalars. In the cases where only one X-ray wave is grazing, whether the incident or the exit, the matrices can be reduced to 3 × 3 and their subblocks become 2 × 2, 2 × 1, 1 × 2 and 1 × 1 in size. Implementation of these changes dynamically, depending on the incidence and exit angles, is the subject of this report. We show that it can speed up calculations by up to ten times and also improve their numerical stability because it avoids accounting for negligibly small effects that are a potential source of precision loss errors. We also report on adding calculations of X-ray standing waves and implementing additional data input for modelling diffraction from very thin layers.

2. Dynamical reduction of dispersion equation  

According to Stepanov et al. (1998), in the case of Bragg diffraction from multilayers, the X-ray electric field in each layer can be represented as

2.

where the sum is over the pairs (branches) of transmitted waves and diffracted waves with the amplitudes D 0j and D hj, respectively. For each branch the amplitudes D 0j and D hj are linearly related by the dynamical diffraction equations. The vectors k 0j are the wavevectors of the transmitted waves in the layer. They can be split into the lateral component along the crystal surface, which is the same in vacuum and all layers because of the boundary conditions, and the normal components represented as kzj = k uj , where k is the modulus of the X-ray wavevector in vacuum and the scalars uj are the roots of the following dispersion equation:

2.

Here Inline graphic and Inline graphic are the k-normalized z components of the wavevectors of the refracted waves along the incident and diffracted waves in the layer corresponding to the amorphous state, Inline graphic, Inline graphic and Inline graphic are the crystal susceptibilities, and γ0 = k 0z /k and γh = k hz/k are the sines of the angles made by the incident and diffracted waves to the surface in vacuum; they can also be treated as z components of the in-vacuum incident and diffracted waves normalized by k. Parameter ψ is the normal component of the Bragg vector normalized by k: ψ = h z/k. Since the refraction of X-rays is very small, the dispersion equation solutions u j can only provide strong X-ray amplitudes when either u j ≃ ±u 0 or (u j + ψ) ≃ ±u h. Also note that |χ0|1/2 is the critical angle Φc for total external reflection of X-rays from a layer. Then, the dispersion equation can be expressed as a product of four terms (branches) corresponding to the transmitted, specularly reflected, diffracted and diffracted–reflected waves:

2.

The product on the right side of equations (2) and (3) is very small, Inline graphic. Therefore, the four roots u j of the dispersion equation (2) correspond to approximate zeroing of each of the four multipliers on the left side of equation (3). When both the incidence angle and the exit angle of the diffracted wave are of the order of Φc, i.e. γ0 ≅ |χ0|1/2 and γh ≅ |χ0|1/2, then all four solutions u j are also of the same order ≅ |χ0|1/2. In this case we have to take into consideration all four solutions u j because they provide strong amplitudes. However, when either γ0 or γh is large, the situation changes.

2.1. X-ray diffraction without grazing angles  

Let us consider the case of normal X-ray diffraction where γ0 ≫ Φc and |γh| ≫ Φc. Two roots of equation (2) are going to be of the order u 1u 0 and (u 2 + ψ) ≃ −u h. They come from the conditions S 0 ≃ 0 and S h ≃ 0, respectively. Since from the Bragg law (γ0 + ψ) ≃ γh and at large incidence and exit angles γ0u 0 and γh ≃ −u hh is negative), both of these roots are close to u 0. Then for u 1 and u 2, the other two multipliers in equation (2) are large and equation (2) can be simplified as

2.1.

The other two roots of equation (2), u 3 ≃ −u 0 and u 4u h − ψ, correspond to specularly reflected and diffracted–reflected waves and can be discarded because the amplitudes of these two waves are small. Thus, we have arrived at a quadratic dispersion equation which can be easily transformed into a classical form of the dynamical diffraction theory [see Stepanov et al. (1998)]. With this equation, the roots can be found analytically and the 2 × 2 matrices of Stepanov et al. (1998) are reduced to scalars. Correspondingly, the calculations for multilayers are greatly simplified. As we found in our benchmarking tests, these calculations take about 10× less time compared with using the full fourth-order dispersion equation.

2.2. Asymmetric X-ray diffraction with grazing incidence and normal exit angles  

Applying the same approach as for normal diffraction, it is easy to find that in the case of asymmetric diffraction with grazing incidence the root corresponding to S hs ≃ 0 is separated from the other three and this branch can be neglected. Then equation (2) reduces to the cubic polynomial form

2.2.

Among the three roots u j of equation (5), one has Im(u 1) > 0, corresponding to the transmitted wave propagating inside the layer, and the other two have Im(u 2,3) < 0, corresponding to the diffracted and specularly reflected waves propagating back to the entrance surface.

2.3. Asymmetric X-ray diffraction with normal incidence and grazing exit  

Finally in the case of asymmetric diffraction with grazing exit one can neglect the branch corresponding to S 0s ≃ 0 and reduce equation (2) to another cubic polynomial form:

2.3.

Among the three roots u j of equation (6), two have Im(u 1,2) > 0, corresponding to the transmitted and diffracted waves propagating inside the layer, and the remaining one has Im(u 3) < 0, corresponding to the specularly reflected diffracted wave propagating back to the entrance surface.

2.4. Wave amplitudes and recursive matrix equations for multilayers  

As per Stepanov et al. (1998), for each root u j of equations (2), (4), (5) or (6) the amplitudes D 0j and D hj are related by the dynamical diffraction equation:

2.4.

The amplitudes and the reflection coefficients are determined with the help of boundary conditions at each interface of one or more layers in the crystal. For grazing waves the boundary conditions need to be applied not only for X-ray amplitudes but also for their derivatives, which corresponds to accounting for X-ray refraction and specular reflection effects. For non-grazing waves these effects can be neglected and the conditions for the derivatives can be dropped. The boundary conditions can be represented in the 4 × 4 matrix form for X-ray diffraction with both grazing incidence and exit, in the 3 × 3 matrix form for X-ray diffraction with only one grazing wave, and in the 2 × 2 matrix form for normal X-ray diffraction. The rest of the solution can follow Section IV of Stepanov et al. (1998), but with reduced size of matrix blocks. For example, for asymmetric diffraction with only one grazing wave the non-diagonal matrices M tr and M rt of equation (17) of Stepanov et al. (1998) become 2 × 1 or 1 × 2 non-square instead of 2 × 2 square; for normal diffraction all matrices M ij become scalars.

2.5. Implementation in the GID_sl program  

With the above considerations, the X-ray Server program GID_sl has been supplied with the new parameter ‘Matrix reduction’ which can have three values: ‘No’, ‘Prescan’ and ‘Fly’. When the default ‘Fly’ option is selected, the program automatically selects equation (2), (4), (5) or (6) and the respective size of the scattering matrix according to the ratio of γ0 and γh to the maximum critical angle Φc for total external reflection among all layers in the multilayer crystal stack. For example, if both γ0 > 5Φc and |γh| > 5Φc then the case is considered as normal diffraction, etc. If the ‘Prescan’ option is selected, the curve is pre-scanned for the condition of the ratio of γ0 and γh to Φc and then the maximum dispersion equation order and the matrix size are applied to all curve points to avoid potential discontinuities. With the ‘No’ option equation (2) and 4 × 4 scattering matrices are used as in the previous version of GID_sl. Fig. 2 shows a comparison of the ‘Fly’ option with the full 4 × 4 calculations in the grazing incidence case (germanium 100 crystal, 311 Bragg reflection, X-ray energy 8.3 keV). Below the incidence angle of 1.5° the Fly method uses equation (5) and above it it applies equation (4), while the no-reduction method uses equation (2) for the whole curve. Obviously the difference in the results is negligible while the Fly calculations are up to 10× faster and more stable numerically, especially in the cases of weak Bragg reflections and large-number multilayers.

Figure 2.

Figure 2

Comparison of simplified calculations automatically switching between 3 × 3 and 2 × 2 matrix sizes against full 4 × 4 calculations in the grazing-incidence case (germanium 100 crystal, 311 Bragg reflection, X-ray energy 8.3 keV).

3. Calculations of X-ray standing waves  

As first shown by Batterman (1964), when dynamical X-ray diffraction occurs in a crystal, interference of transmitted and diffracted waves forms an X-ray standing wave (XSW) with the nodes shifting with respect to the crystal matrix when the crystal is rocked around the Bragg angle. This effect allows the foreign atoms in the crystal structure to be located as their fluorescence is proportional to the intensity of the XSW at their location (Batterman, 1964; Afanas’ev & Kohn, 1978; Zegenhagen, 1993). Jach & Bedzyk (1993) extended studies of the XSW effect to grazing-incidence diffraction. Many researchers have contributed to the XSW field; see the comprehensive review by Zegenhagen (2020) for details and references.

Given the popularity of the XSW method, we expect that providing online XSW calculations may be helpful to the community. Since the GID_sl program calculates amplitudes for all X-ray waves in a crystal consisting of one or more layers, the XSW in each layer can be calculated as

3.

Here φ is the phase parameter corresponding to the position of the probe with respect to the Bragg planes; φ = 0 and φ = 1 correspond to the positions at the Bragg planes and halfway between the Bragg planes, respectively; z is the depth at which the XSW is calculated, m is the index of the layer in the multilayer stack which corresponds to z, and z m is the coordinate of the upper interface of that layer. The parameters Inline graphic, Inline graphic and Inline graphic are the solutions to the dynamical diffraction equations discussed in Section 2. The user enters two parameters, z and φ. Then the GID_sl program finds the layer m in the stack and calculates the XSW using equation (8) for each given deviation from the Bragg condition. The example calculation presented in Fig. 3 demonstrates the well known XSW effect for symmetric Bragg diffraction. Since GID_sl is designed for any Bragg-case geometry, it provides a tool to model XSWs in a wide variety of cases including for strained crystals and multilayers. If the pattern needs to be integrated over the fluorescence yield depth, GID_sl has an option to calculate the XSW for multiple depth positions in one run or it can be called in a loop from user software as discussed in the Introduction .

Figure 3.

Figure 3

X-ray standing wave calculations for a probe located in the Bragg planes (φ = 0) and halfway between the Bragg planes (φ = 1) superimposed with the Bragg curve. Calculations are for a germanium crystal, 111 symmetric Bragg reflection and X-ray energy 8.0 keV.

4. New provisions for calculating reflections from monolayers  

As noted by Jenichen et al. (2005), when calculating the Fourier components χh of crystal polarizability in each layer, the origin of the unit cell is chosen independently for each layer, usually according to the symmetry of the respective layer. The phase factor exp(i h · R) that arises if the origin is shifted by a real-space distance R is not taken into consideration. Such a phase factor does not appear if all epitaxial layers have a similar structure. However, if the structures are different, the relative positions of the unit cells in different layers are not known in advance and an additional phase factor in the polarizability of one layer with respect to another may appear. One example is binary alloy structures, which can grow either as ABAB… or as BABA…. The new version of the GID_sl program introduces an option to specify the shift for each layer. The shift is expressed in multiples of π and can be specified in the range [−2, 2].

5. Conclusions  

We have described three important updates to the popular web-based GID_sl program for simulation of dynamical X-ray diffraction. The first (matrix size reduction) is aimed at improving the program speed and numerical stability, and the other two (output of X-ray standing waves and option to specify relative phases of X-ray polarizability  χh for each crystal layer) extend the program capabilities. The GID_sl program is freely accessible to the community through the X-ray Server project (https://x-server.gmca.aps.anl.gov) with­out the need for compiling and local installation. An additional benefit of such an approach is that all bug fixes are done in a single place and everyone uses the latest and the most debugged software version.

Acknowledgments

The author thanks Dr Terrence Jach (National Institute of Standards and Technology) and Dr Vladimir Kaganer (Paul Drude Institut) for helpful discussions.

Funding Statement

This work was funded by National Cancer Institute grant ACB-12002; National Institute of General Medical Sciences grants AGM-12006 and P30GM138396.

References

  1. Afanas’ev, A. M. & Kohn, V. G. (1978). JETP, 48, 154–161.
  2. Batterman, B. W. (1964). Phys. Rev. 133, A759–A764.
  3. Jach, T. & Bedzyk, M. J. (1993). Acta Cryst. A49, 346–350.
  4. Jenichen, B., Kaganer, V. M., Herfort, J., Satapathy, D. K., Schönherr, H. P., Braun, W. & Ploog, K. H. (2005). Phys. Rev. B, 72, 075329.
  5. Kohn, V. G. (1991). J. Mosc. Phys. Soc. 1, 425–434.
  6. Rebuffi, L. & Sanchez del Rio, M. (2017). Proc. SPIE, 10388, 169–177.
  7. Sanchez del Rio, M., Rebuffi, L., Demšar, J., Canestrari, N. & Chubar, O. (2014). Proc. SPIE, 9209, 259–263.
  8. Stepanov, S. (2004). Proc. SPIE, 5536, 16–26.
  9. Stepanov, S. (2007). Thin Solid Films, 515, 5700–5703.
  10. Stepanov, S. & Forrest, R. (2008). J. Appl. Cryst. 41, 958–962.
  11. Stepanov, S. A., Kondrashkina, E. A., Köhler, R., Novikov, D. V., Materlik, G. & Durbin, S. M. (1998). Phys. Rev. B, 57, 4829–4841.
  12. Zegenhagen, J. (1993). Surf. Sci. Rep. 18, 199–271.
  13. Zegenhagen, J. (2020). Synchrotron Light Sources and Free-Electron Lasers, edited by E. J. Jaeschke, S. Khan, J. R. Schneider & J. B. Hastings, pp. 1825–1855. Cham: Springer.

Articles from Journal of Applied Crystallography are provided here courtesy of International Union of Crystallography

RESOURCES