Introduction

Image-forming x-ray and electron tools are beautiful demonstrations of leveraging the particle-wave dualism with ramifications to basic and applied sciences of, e.g., energy, quantum, and magnetic materials and enable a seamless integration of arts with sciences. The latter has been proposed by the National Academies of Sciences, Engineering, and Medicine [1, 2] to broaden science literacy and foster a diverse science, technology, engineering, and mathematics (STEM) workforce. Choosing appropriate approximations and the correct formalisms is critical for solving scientific questions and overcoming technological challenges and strongly dependent on the problem at hand. One contemporary example is the emergent field of three-dimensional (3D) nanomagnetism [3,4,5] that has stimulated the development of advanced characterization techniques, including x-ray [6,7,8] and electron vector field tomography [9,10,11,12,13,14,15]. These techniques leverage the wave character of x-rays and electrons, respectively, to probe the electromagnetic interaction with matter and visualize the 3D magnetization configuration. They rely on phase contrast imaging techniques, such as ptychography [16,17,18,19] and holography [20,21,22], which combine high sensitivity and high spatial resolution as well as, upon resonant excitation, element and chemical specificity. The inherently long data acquisition of vector field tomography and required long-term thermal and mechanical stability combined with challenges with in-operando measurements guarantee the continued success and development of versatile two-dimensional (2D) phase contrast imaging.

Since the first demonstration using an electric wire as biprism [22], nearly seven decades ago, off-axis electron holography [23, 24] has become a powerful tool to visualize topological magnetic states [25,26,27,28]. The need for a reference beam typically limits these investigations to confined structures [Fig. 1(a)]. The high spatial resolution and sensitivity provided by the plane wave interference pattern requires a similar degree of mechanical stability as known from atomic-resolution transmission electron microscopy that makes cryogenic measurements challenging, although not impossible. In contrast, in-line electron holography is based on Fresnel mode imaging, first proposed seventy years ago [20, 21, 29] and a quantitative non-interferometric phase determination that takes advantage of the superimposition of coherent scattered and unscattered waves along the same optical axis and in the same focal plane [Fig. 1(a)]. The results are characteristic interference patterns observable with conventional microscopy [Fig. 1(b), (c)] that change as they propagate through space [Fig. 2(a)]. To ensure clean interference fringes, the sample thickness should be, as typical for transmission electron microscopy, \(<100\) nm to limit multiple scattering events that reduce spatial resolution and sensitivity and potentially cause partial incoherence due to inelastic scattering. Unintended changes with time due to charging or degradation under the beam should be prevented by, e.g., grounding nonmetallic materials or freezing organic compounds. The experimental implementation of in-line holography is feasible without the need for physical modifications to the transmission electron microscope that is particularly appealing to user facilities. Retrieving the electron phase from the electron intensity taken at different focal planes requires advanced data analysis. The most common phase retrieval is the transport-of-intensity equation (TIE) [30,31,32,33] approach that relates the change of intensity along the electron trajectory to the electron intensity and phase in different focal planes. Despite distinct implementation, the underlying physics remain the same making a quantitative comparison between off-axis and in-line holography possible [34,35,36]. There are numerous advantages of using in-line holography: the phase error is less than with off-axis holography [34]; less stringent requirements on mechanical stability; and imaging is possible anywhere in the sample, including particularly extended films and device architectures. As a result, TIE-based Lorentz microscopy has extensively been used to study magnetic phases, thermal excitations, and phase transitions in materials systems hosting topological spin textures [37,38,39,40].

Figure 1
figure 1

Contrast formation with electron holography. (a) Comparison between off-axis and in-line holography using coherent (unscattered) incident wave (gray) and scattered wave (purple). Both schematics and real-world application of off-axis holography neglect in-line holography contributions and consider planar incident waves. The position of sample, detector, or focal plane (via Lorentz lens) can be changed to record intensities in Fresnel imaging mode. Interference fringes originating from (b) one-dimensional and (c) two-dimensional distributions of the electromagnetic potentials (phase shift \(\phi\)).

Figure 2
figure 2

Principle of in-line holography: electron wave propagation. (a) Information about the electromagnetic interaction within the specimen (materials properties), stored in the electron phase shift \(\phi\), is transferred into the electron amplitude \(\psi\), which is accessible as intensity \(\vert \psi \vert ^2\) in conventional microscopy. The electron wave propagation is modeled for a polar phase shift due to, e.g., structural defects, voids, grains, or magnetic vortices, demonstrating sensitivity and contrast enhancement at the expense of a reduced spatial resolution. (b) Selection of electron phase shifts associated with non-collinear topological spin textures illustrating sensitivity to spin chirality and topology. The phase shift is caused by the in-plane magnetic induction components, which generally coincides with the magnetization. Bright (dark) contrast refer to positive (negative) phase shift.

Throughout the years, several alternatives have been proposed using, e.g., differential phase contrast [41] and exit wave reconstruction [42,43,44,45,46] to enhance the spatial resolution and sensitivity of in-line holography, which are critical for investigations of inhomogeneous specimens, i.e., materials under investigation, where structural imperfections can disturb the magnetic and electronic properties and reconstruction. This includes bulk (\(\lesssim 100\) nm) and interfaces/surfaces governing, e.g., topological magnetism, superconductivity, topological surface states, charge and spin density waves, and magneto-electricity—all of which are key to next-generation microelectronics. In addition, the unambiguous identification of complex metastable states [27, 39, 47], topological knots [48, 49], and magnetization configurations with thickness profile dependence [50] or differentiation between magnetic stray fields and magnetization contributions [51, 52] would undoubtedly benefit from a more sophisticated phase retrieval algorithm. Phase contrast imaging with exit wave reconstruction has allowed for, e.g., compensating aberrations [19] and transformed atomic-resolution and sub-ångström-resolution microscopy [17]. Although widely used in scalar microscopy and tomography, the implementation of exit wave reconstruction for phase contrast imaging of magnetic and electronic properties has been slow. A recent numerical comparison [53] between the transport-of-intensity equation [30, 54] and the Gerchberg–Saxton algorithm [55]—one representative exit wave reconstruction algorithm—substantially undervalues the latter whose potential was experimentally demonstrated [51, 56]. These works debunked earlier belief that the successful application of “Gerchberg and Saxton [...] depends on the availability of a good initial estimate of the form of the induction distribution” [57].

This article gives an experimental and numerical quantitative comparison between the non-iterative transport-of-intensity equation and the iterative Gerchberg–Saxton algorithm to highlight the strength and potential of each. The physical and mathematical background of phase contrast imaging with in-line electron holography is derived step by step in Sect. 2 from a physics rather than a microscopy perspective. Discussing the magnetic and electric phase shift due to electromagnetic interaction with matter, electron wave propagation, and phase retrieval algorithms will empower the reader to model and reconstruct the electron phase shift and electron wave propagation for arbitrary magnetization configurations based on a profound understanding of the underlying mechanisms. In this process, measurement artifacts due to beam aberration, astigmatism, divergence, and incoherence are addressed. Experimental demonstration is given in Sect. 3 by application to inhomogeneous magnetic films, i.e., domain wall imaging in amorphous ferrimagnets [51] and visualizing topological states and helical spins alongside structural defects in amorphous thick films [56]. This includes specifically the dependence of the exit wave reconstruction on the number of iterations that enable a differentiation between structural features, magnetization, and magnetic stray field. The numerical analysis leverages experimental data, i.e., focal planes, published in and available from these references. The reader is encouraged to consult these original works for information about synthesis, complementary characterization, and scientific conclusions.

Theory

The propagation of free electrons through space can be described in either particle or wave picture. For virtually all scenarios where spatial resolution or interference are of no concern, the default setting is the particle picture. This pertains to particle acceleration, electron optics to steer the electron trajectory, correct aberrations or focus, and conventional microscopy that maps the intensity distribution. The latter is determined by spatial variations in, e.g., absorption due to differences in thickness, density, elements, and ionization state and deflection by electrostatic and magnetic fields. The movement of electrically charged particles, such as electrons with a negative elementary charge \(q=-e\), obeys the Lorentz force \({\textbf{F}}= q\left( {\textbf{E}}+{\textbf{v}}\times {\textbf{B}}\right)\) with electric field \({\textbf{E}}\), magnetic induction \({\textbf{B}}\), and velocity \({\textbf{v}}\). The deflection angle \(\varepsilon =p_x/p_z\), representing the ratio between initially vanishing perpendicular momentum \(p_x\) and original momentum \(p_z\), scales linearly with the magnetic induction and electric field components as \(\frac{eB_yt}{mv_z}\) and \(\frac{eE_xt}{mv_z^2}\), respectively. Here, m is the rest electron mass and t is the interaction length (approximately capacitor width, coil length or thickness of specimen). While electric fields are easier to generate involving voltages, magnetic fields are more efficient for high-energy electrons (\(v_z^{-1}\) vs. \(v_z^{-2}\)). Moreover, magnetic fields do not affect the total momentum of electrons (\({\textbf{v}}{\textbf{F}}=-q{\textbf{v}}{\textbf{E}}\)), which is critical for preserving a monochromatic electron beam generated by, e.g., a Schottky field emission gun in aberration-corrected transmission electron microscopes.

For all other cases, the wave picture is beneficial, if not required.

Magnetic and electric phase shift

Electrons emanating from field emission guns in transmission electron microscopes possess a relativistic momentum \({\textbf{p}}=\hbar {\textbf{k}}_0 =\sqrt{2meU+\left( \frac{eU}{c}\right) ^2}\varvec{{\hat{k}}}\) due to acceleration from rest in an electric field. The appeal of transmission electron microscopy becomes clear from the equivalent de Broglie wavelength \(\lambda =h/p=1.97\) pm (for an acceleration voltage \(U=300\) keV) that is substantially smaller than atomic scales enabling high-resolution microscopy and tomography. Comparison with the non-relativistic momentum (2.24 pm) showcases the importance of using the relativistic description when concerning electromagnetic interactions and interference/holography. The presence of an electric potential \(-eV\) and a vector potential \({\textbf{A}}\), related to the magnetic induction \({\textbf{B}} = \nabla \times {\textbf{A}}\), yields the modified relativistic momentum described by the relativistic Klein–Gordon equation [58, 59] for the wave vector \({\textbf{k}}\):

$$\begin{aligned} {\textbf{k}}&=\frac{1}{\hbar }\sqrt{2me(U+V)+\left( \frac{e}{c}(U+V)\right) ^2}\varvec{{\hat{k}}}-\frac{e}{\hbar }{\textbf{A}}\nonumber \\&\approx {\textbf{k}}_0+\left( \sigma V +\frac{eU}{\hbar mc^2}\right) \varvec{{\hat{k}}}-\frac{e}{\hbar }{\textbf{A}}\,. \end{aligned}$$
(1)

The latter equivalence uses the first-order Taylor expansion for \(U\gg V\) with \(\sigma =\frac{me}{\hbar ^2k}\) (\(\vert {\textbf{k}}\vert =k\), \({\textbf{k}}=k\varvec{{\hat{k}}}\)) and infers that the momentum of the image-forming free electrons is substantially larger than the change in momentum due to interaction with the electromagnetic field within the material under investigation. The three terms in Eq. (1) are similar to the non-relativistic result \({\textbf{k}}=\frac{1}{\hbar }\sqrt{2me(U+V)}\varvec{{\hat{k}}}-\frac{e}{\hbar }{\textbf{A}}\approx {\textbf{k}}_0+\sigma V \varvec{{\hat{k}}}-\frac{e}{\hbar }{\textbf{A}}\) except for \(\frac{eU}{\hbar mc^2}\varvec{{\hat{k}}}\), which is independent of the trajectory and thus irrelevant to the relative change across the specimen. The latter is important to phase contrast imaging. The mathematical relation between wavelength and phase \(\phi\) given by \(\frac{\Delta s}{\lambda }=\frac{\Delta \phi }{2\pi }\) can be written in integral form for the eikonal \(\phi =\int {\textbf{k}}\text {d}{\textbf{s}}\) describing the phase shift along the path segment \(\text {d}{\textbf{s}}\). Subtracting the geometrical optical path difference \(\int {\textbf{k}}_0\text {d}{\textbf{s}}\) unveils the phase shift due to electromagnetic interaction within the specimen:

$$\begin{aligned} \phi = \int \left( {\textbf{k}}-{\textbf{k}}_0\right) \text {d}{\textbf{s}} = \sigma \int V\text {d}s -\frac{e}{\hbar }\int {\textbf{A}}\text {d}{\textbf{s}}. \end{aligned}$$
(2)

This line integral representation implies that only projected properties matter, which corresponds to thickness-averaged quantities upon normal incidence. Hence, an investigation of specimens with thickness profile-dependent properties requires tomographic imaging using, e.g., vector field tomography [9,10,11,12,13,14,15]. The electric phase shift (first term) may be caused by the mean inner potential [60], contact potential, dopants in semiconductors [61, 62], ferroelectric polarization [63, 64], charging under the beam, adsorbed ions, grain boundaries, and voids. The second term represents the magnetic phase shift [65, 66] that depends on the propagation direction, while the electric scalar field does not. This feature allows for isolating electric and magnetic contributions by, e.g., flipping the sample up-side-down.

Under the assumption that the momentum changes marginally due to the electrostatic potential and that the magnetic induction is confined to the film, i.e., no outside stray fields, the phase difference between two quasi-parallel electron trajectories along \({{\hat{z}}}\) can be approximated using only magnetic contributions as

$$\begin{aligned} \Delta \phi _m&=-\frac{e}{\hbar }\left( \int _{\zeta _1} {\textbf{A}}\text {d}{\textbf{s}}-\int _{\zeta _2} {\textbf{A}}\text {d}{\textbf{s}}\right) = -\frac{e}{\hbar }\oint {\textbf{A}}\text {d}{\textbf{s}}\nonumber \\&= -\frac{e}{\hbar }\int \int \left( \nabla \times {\textbf{A}}\right) _x \text {d}z\ \text {d}y = -\frac{e}{\hbar }\Phi _B\,. \end{aligned}$$
(3)

The integration along \({{\hat{z}}}\) is over the film thickness t. This equation links the magnetic phase shift to the enclosed flux (Aharonov–Bohm effect) [67,68,69] and shows that a magnetic flux \(\Phi _B=h/e=4.135\cdot 10^{-15}\) Vs (twice the magnetic flux quantum \(\Phi _0=\frac{h}{2e}\)) is sufficient to cause a \(2\pi\) phase shift. The latter is equal to a phase difference \(\Delta s=\lambda\) causing one interference fringe [Fig. 1(b), (c)]. The in-plane components of the magnetic induction within the specimen can be derived from the 2D gradient of the magnetic phase:

$$\begin{aligned} \nabla _\perp \phi _m=-\frac{e}{\hbar }t (-B_y,B_x,0). \end{aligned}$$
(4)

This relation assumes a thickness profile-independent magnetization and a constant film thickness.

Generally, the vector potential inside a specimen is caused by the magnetization vector field \({\textbf{M}}\) and given by \({\textbf{A}}\left( {\textbf{r}}\right) = \frac{\mu _0}{4\pi }\int \frac{{\textbf{M}}\left( {\textbf{r}}'\right) \times \left( {\textbf{r}}-{\textbf{r}}'\right) }{\vert {\textbf{r}}-{\textbf{r}}'\vert ^3}\text {d}^3{\textbf{r}}'\) with the spatial coordinate \({\textbf{r}}\) and integration over the entire sample volume. Stray fields from Bloch lines [Fig. 7], Bloch points, magnetization divergence (reorientation) [Fig. 9], etc. are other contributions that may need to be considered for proper analysis. For practical reasons, computation intense integral calculations for both vector potential and magnetic phase shift are typically avoided by switching to the reciprocal space using 3D (\({\mathcal {F}}_{\text {3D}}\)) and 2D (\({\mathcal {F}}\)) Fourier transforms and taking advantage of the Fourier theorem stating the equivalence of real and reciprocal domain. It is also natural, since the electron wave propagation (Sect. 2.2) and exit wave reconstruction (Sect. 2.4) take place in reciprocal space. For a thickness profile-independent magnetization configuration, i.e., \({\textbf{M}}\left( {\textbf{r}}\right) =M_s{\textbf{m}}(x,y)\) with the saturation magnetization \(M_s\) and \(q_z\simeq 0\ (\lambda _z\simeq \infty )\), the 3D Fourier transform can be Taylor expanded for \(q_zt\ll 1\) to yield \({\mathcal {F}}_{\text {3D}}\left[ {\textbf{m}}\right] \approx t\cdot {\mathcal {F}}\left[ {\textbf{m}}\right]\). This approximation is common use since \(t\lesssim 100\) nm and otherwise tomographic imaging was required to properly visualize the magnetization vector field in the specimen. With the approximated 3D Fourier transform \({\mathcal {F}}_{\text {3D}}\left[ {\textbf{A}}\right] \propto M_s\cdot {\mathcal {F}}_{\text {3D}}\left[ {\textbf{m}}\right] \times {\mathcal {F}}_{\text {3D}}\left[ \frac{\left( {\textbf{r}}-{\textbf{r}}'\right) }{\vert {\textbf{r}}-{\textbf{r}}'\vert ^3}\right] \approx M_st\cdot {\mathcal {F}}\left[ {\textbf{m}}\right] \times \left( 4\pi \frac{{\textbf{q}}}{q^2_x+q^2_y}\right)\), the magnetic phase shift of electrons propagating along \({{\hat{z}}}\) can be obtain from the z-component as [70]

$$\begin{aligned} \phi _m(q_x, q_y) = \frac{e\mu _0M_st}{\hbar }\cdot \frac{{\mathcal {F}}\left[ m_x\right] q_y-{\mathcal {F}}\left[ m_y\right] q_x}{q^2_x+q^2_y}. \end{aligned}$$
(5)

Note that this formula is valid only for a non-uniform magnetization (\(q\ne 0\)) since it predicts no phase shift for a uniform magnetization contrary to basic physics (Lorentz force) and experiment. However, this limitation has no practical implications since \(q=0\) is impossible to observe in finite-size materials. Indeed, such samples are better studied with magneto-optical Kerr microscopy [71].

To comprehend these abstract equations, Fig. 2(b) depicts the magnetic phase shift of common chiral topological spin textures. The skyrmions [40] are approximated as 3D spin textures with a thickness profile-independent magnetization defined in polar coordinates \((r,\varphi )\) as [56]

$$\begin{aligned} {\textbf{m}}= \left( \sin \Theta (r)\cos \Phi (\varphi ), \sin \Theta (r)\sin \Phi (\varphi ), P\cos \Theta (r)\right) . \end{aligned}$$
(6)

Depending on the topological charge N, chirality C, polarity P, \(\Phi (\varphi )=N(\varphi +C)\), and radial function \(\Theta (r)\) that determines the core size, different topological states emerge with distinct magnetic phase contrast. For instance, isotropic Bloch skyrmions cause a polar phase contrast (clockwise: dark; counterclockwise: bright) and Néel skyrmions with a gray (vanishing) phase are invisible to Lorentz microscopy. The relationship between acquired phase and in-plane magnetization components (spin chirality) given by Eq. (5) holds for any configuration and experimental setup as they are independent of the downstream imaging. An equivalent consideration for the electron intensity via the Lorentz force is more delicate. As the image-forming free electrons penetrate the magnetic film, the Lorentz force deflects the incident beam causing beam divergence (convergence) for a bright (dark) phase shift and high (low) intensity at a given focal plane [Fig. 2(a)]. However, this assertion is only correct for focal planes with positive defocus (overfocus). The opposite applies to underfocus images.

Furthermore, it is important to keep in mind that Eq. (5) is not unambiguous. A given electron phase may belong to multiple magnetization configurations as the third normal magnetization component is not reflected in the phase shift. This becomes important when dealing with 3D topological magnetic states whose identification will then rely on the contrast evolution with magnetic field, temperature, or other stimuli. It also necessitates the modeling of electron wave propagation to properly correlate interference fringes taken at different focal planes with the actual magnetic phase and magnetization configuration.

Electron wave propagation

The physical foundation for electron wave propagation is the time-independent non-relativistic Schrödinger equation [72] \(\left\{ \frac{1}{2\,m}\left( -i\hbar \nabla + e{\textbf{A}}\right) ^2 -eV\right\} \Psi = E\Psi\) with the plane wave solution \(\Psi =\Psi _0\exp \left( i{\textbf{k}}{\textbf{r}}\right)\), the energy eigenvalue \(E=\frac{{\textbf{k}}^2\hbar ^2}{2m}\), the scalar potential V giving rise to the potential energy \(U=-eV\), and the Laplace operator \(\nabla ^2=\partial ^2_x+\partial ^2_y+\partial ^2_z\). The kinetic energy can be approximated as \(T=\frac{{\textbf{p}}^2}{2\,m} = \frac{1}{2\,m}\left( -i\hbar \nabla +e{\textbf{A}}\right) ^2\approx \frac{1}{2\,m}\left( -\hbar ^2\nabla ^2-i2e\hbar A_z\partial _z\right)\) when taking into account negligible \(\frac{e^2}{2m}{\textbf{A}}^2\) and \(\nabla {\textbf{A}} +{\textbf{A}}\nabla \approx 2A_z\partial _z\) since the divergence of a vector field vanishes. The analytical expression for the electron wave propagation and basis for numerical modeling is derived by considering the Hamiltonian and eigenfunction as products, i.e., \((T+U-E)\Psi =L_+L_-\Psi =0\) with \(\Psi =\psi v\), \(L_+\psi =0\), and \(L_-v=0\). In this notation, \(\psi\) (v) is the eigenfunction of \(L_+\) (\(L_-\)) defined as

$$\begin{aligned} L_\pm&= \partial _z\mp ik\sqrt{1+\frac{\partial ^2_x+\partial ^2_y}{k^2}+\frac{2meV}{\hbar ^2k^2} +\frac{i2e}{\hbar k^2}A_z\partial _z}\nonumber \\&\approx \partial _z\mp \left\{ ik+ \frac{i}{2k}\left( \partial ^2_x+\partial ^2_y+\frac{2meV}{\hbar ^2} +\frac{i2e}{\hbar }A_z\partial _z\right) \right\} \,. \end{aligned}$$
(7)

The latter equivalence utilizes the first-order Taylor expansion for \(k^2\gg \partial ^2_x+\partial ^2_y+2meV/\hbar ^2+i2e/\hbar \cdot A_z\partial _z\), which is generally true for high-energy image-forming electrons. Exploiting the definition \(L_+\psi =0\) and \(L_-v=0\) and the first-order Taylor expansion of \(\frac{1}{1\mp \zeta }\) for \(1\gg \left| \zeta \right| =\left| \frac{e}{\hbar k}A_z\right|\) as well as considering only the first term of \(\frac{e}{\hbar k}A_z\left\{ ik+\frac{i}{2k}\left( \partial ^2_x+\partial ^2_y+\frac{2meV}{\hbar ^2}\right) \right\}\) due to the aforementioned relation, one obtains

$$\begin{aligned} \small \partial _z\left( {\begin{array}{c}\psi \\ v\end{array}}\right) = \pm \left\{ ik+ \frac{i}{2k}\left( \partial ^2_x+\partial ^2_y+\frac{2meV}{\hbar ^2}\right) \mp \frac{ie}{\hbar }A_z\right\} \left( {\begin{array}{c}\psi \\ v\end{array}}\right) . \end{aligned}$$
(8)

Aside from the sign change in front of the parenthesis and the vector potential, \(L_+\) and \(L_-\) are identical and describe the propagation along \({{\hat{z}}}\) and \(-{{\hat{z}}}\) direction. The corresponding transmitted and reflected waves are both solutions to the original Schrödinger equation. To this end, \(\psi\) is important to transmission electron microscopy on sufficiently thin specimens to guarantee single elastic scattering events and can be derived by integration as

$$\begin{aligned}&\psi (z+\Delta z) = \psi (z) \ \underbrace{\exp \left( i\int _z^{z+\Delta z} k \text {d}z \right) }_{\text {Vacuum contribution}} \cdot \nonumber \\&\underbrace{\exp \left( i\int _z^{z+\Delta z} \frac{1}{2k}\left( \partial ^2_x+\partial ^2_y\right) \text {d}z \right) }_{\text {Propagator } \Gamma _f(x,y)} \cdot \nonumber \\&\underbrace{\exp \left( i\int _z^{z+\Delta z}\left[ \sigma V -\frac{e}{\hbar }A_z\right] \text {d}z \right) }_{\text {Interaction}}\,. \end{aligned}$$
(9)

The resulting eigenfunction, typically abbreviated as \(\psi =\Gamma _f\cdot \psi _0e^{i\phi }\), is a plane wave (vacuum contribution) that is modified by the electromagnetic interaction causing a phase shift (interaction) and deflection described by the forward propagator \(\Gamma _f\). The electron phase shift due to electromagnetic interaction is identical to Eq. (2) underlining the appropriateness of the physical and mathematical approximations. As before, the vector field contribution depends on the propagation direction which can be exploited to isolate electric and magnetic contributions to the phase shift. By analogy with Eq. (5), computation intense integral calculations are avoided by expressing the propagator \(\Gamma _f(x,y)\) in reciprocal space \(\Gamma _f(q_x,q_y)\) using both Fourier transform \({\mathcal {F}}\) and inverse Fourier transform \({\mathcal {F}}^{-1}\):

$$\exp \left( {\frac{i}{{2k}}\left( {\partial _{x}^{2} + \partial _{y}^{2} } \right)\Delta z} \right)f(x,y) = {\mathcal{F}}^{{ - 1}} \left\{ {\exp \left( {i\pi \lambda \Delta z\left( {q_{x}^{2} + q_{y}^{2} } \right)} \right){\mathcal{F}}\left[ {f(x,y)} \right]} \right\}.$$
(10)

Here, \(\Delta z\) is the defocus value without restrictions to infinitesimal steps.

Microscope-specific artifacts, such as aberration, astigmatism, beam divergence, and incoherence, can be taken into account by modifying the forward propagator [23, 45, 73, 74]

$$\begin{aligned} \Gamma _f=\exp \left\{ i\left[ \pi \lambda \Delta z\left( q^2_x+q^2_y\right) + \chi \right] \right\} {\mathcal {E}}C_t \end{aligned}$$
(11)

and the backward propagator

$$\begin{aligned} \Gamma _b=\exp \left\{ -i\left[ \pi \lambda \Delta z\left( q^2_x+q^2_y\right) + \chi \right] \right\} . \end{aligned}$$
(12)

Spherical aberrations of third (\(C_3\)) and fifth (\(C_5\)) order contribute as perturbation to the contrast transfer function (exponent of the propagator) with

$$\begin{aligned} \chi =\frac{2\pi }{\lambda }\left[ \frac{1}{4}\lambda ^4\left( q^2_x+q^2_y\right) ^2 C_3 +\frac{1}{6}\lambda ^6\left( q^2_x+q^2_y\right) ^3 C_5\right] . \end{aligned}$$
(13)
Figure 3
figure 3

Effect of beam divergence, partial coherence, and aberration on electron wave propagation. Left column depicts the modeled electron intensities in overfocus (3 mm) of a honeycomb nanodisk array similar to that shown in Fig. 1(c). Right column displays the electron phases reconstructed from focal plane using the transport-of-intensity equation. Polynomial background may be subtracted to enhance contrast while preserving the poor spatial resolution apparent in both focal planes and electron phase. Astigmatism and aberration cause noticeable changes only at/near focus (not shown).

Astigmatism due to variation in defocus value \(\Delta (\Delta z)\) perpendicular to the propagation direction

$$\begin{aligned} C_t=\exp \left\{ \frac{1}{2}\left[ \Delta (\Delta z)\pi \lambda \left( q^2_x+q^2_y\right) \right] ^2\right\} \end{aligned}$$
(14)

are considered only in forward propagation as backward propagation is a purely mathematical operation during numerical exit wave reconstruction [Sect. 2.4]. While correcting aberrations and astigmatism is essential to atomic-resolution transmission electron microscopy [17, 19], aberrations and astigmatism play a minuscule role in Lorentz microscopy owing to the use of focal planes far from focus and a magnification of a few \(1000\times\). For these parameters, Eq. (13) yields an aberration \(\lesssim 10\) nm compared with millimeter defocus values. These imaging conditions amplify modifications to the contrast transfer function due to beam divergence [75]

$$\begin{aligned} \small {\mathcal {E}}=\exp \left\{ -\frac{\pi ^2\alpha ^2}{\lambda ^2\beta }\left( C_3\lambda ^3\left( q^2_x+q^2_y\right) ^{3/2}-\Delta z\lambda \sqrt{q^2_x+q^2_y}\right) ^2\right\} , \end{aligned}$$
(15)

with \(\beta =1+2\left[ \pi \alpha \Delta (\Delta z)\right] ^2\left( q^2_x+q^2_y\right) ^2\approx 1\) for small products of beam divergence \(\alpha\) and \(\Delta (\Delta z)\). Beam divergence can originate from both field emission gun and multiple scattering events in dense and thick specimens. The result is a loss of interference fringes, spatial resolution, and sensitivity [Fig. 3(a)–(c)]. A similar effect is observed with a partially coherent beam due to, e.g., inelastic scattering off the sample [Fig. 3(d)]. Recent developments in double-aberration-corrected transmission electron microscopes with monochromatic electron sources have caused a paradigm shift since, now, most “measurement artifacts” stem from the interaction with the specimen due to simplifications to, e.g., single elastic scattering events confined to the volume of the specimen discussed in this article.

Figure 4
figure 4

Inference of magnetization configuration from in-line holography. (a) Magnetization configuration in soft-magnetic nanodisk arrays with honeycomb symmetry forming macrovortex lattices and striped domains, obtained from micromagnetic simulations. (b) Modeled electron phase and (c) electron intensities in overfocus (1 mm) depicted for negligible structural (electric) and equivalent electric and magnetic contributions underscoring the well-known challenge of much weaker magnetic contributions and the possibility of identifying the magnetic state by correlation of modeled data with experiment. (d) Electron phase retrieved from one focal plane (c) using the transport-of-intensity equation confirming stored phase information and unambiguity. (e) 2D gradient of phase shift approximating the in-plane magnetization for pure magnetic phase shift. Color coincides with (a). (f) Electron phase derived with the Gerchberg–Saxton algorithm indicating superior spatial resolution and slow convergence of low-frequency components, which can be accelerated by blurring. Scale bar is 200 nm.

The impact of electric and magnetic phase shifts on the electron wave propagation is illustrated on the example of soft-magnetic nanodisk arrays. Figure 4(a) depicts the magnetization configuration in honeycomb lattices obtained from micromagnetic simulations near remanence. The 10-nm-thick nanodisks with a diameter of 100 nm and a nominal cell size of 6 nm (compared to exchange length 10 nm) reside at trigonal lattice sites with lattice constant 120 nm. The micromagnetic simulations were conducted for materials parameters for Permalloy (\(M_s=860\) kA/m, exchange stiffness: 13 pJ/m) [76] using Nmag v0.2 [77], a finite element method/boundary element method micromagnetic simulator, in combination with the HLib library [78, 79]. The formation of extended trigonal macrovortex lattices and striped domains along the \(30^\circ\) bias field agrees with literature [76]. The corresponding magnetic phase shift contains polar (vortex) and step-like (striped domains) regions [Fig. 4(b)] that cause complex interference fringes. Figure 4(c) displays the electron intensities at 1-mm defocus for pure magnetic phase shift and additional electric phase shift. The latter is approximated as 100% of the maximum magnetic contrast and confined to the location and size of the nanodisks. A realistic estimate for the electric phase shift is 10 to 100 times or more instead of 1. The electron wave propagation is modeled for 300-kV acceleration voltage without aberration and beam divergence and for a fully coherent beam using the same materials and geometry parameters as for micromagnetic simulations. The electric phase shift of isotropic disks yields circular interference fringes that themselves interfere due to proximity [Fig. 1(c)]. An in-plane magnetization breaks this symmetry causing highly complex anisotropic interference patterns. The latter can be used to correlate experimental with numerical data and identify the magnetization configuration. In practice, this approach is useful to obtain an idea of what to expect during experiment while surveying a large parameter space for the onset of magnetism or the emergence of chiral and topological states. These states are then reconstructed using phase retrieval algorithms.

Reconstruction à la transport-of-intensity equation

As mentioned in Sect. 2.1, the scalar and vector field are typically assumed to be confined to the specimen leading to localized electromagnetic interactions and electron phase shift. Once the electron wave escapes from the film, it propagates in free space that can be described by Eq. (8) with \(\psi =\sqrt{I}e^{ikz}e^{i\phi }\), \(V=0\), and \({\textbf{A}}={\textbf{0}}\):

$$\begin{aligned} \psi ^*\partial _z\psi&=\psi ^*\left\{ ik +\frac{i}{2k}\left( \partial ^2_x+\partial ^2_y\right) \right\} \psi \,, \end{aligned}$$
(16)
$$\begin{aligned} \psi \partial _z\psi ^*&=\psi \left\{ -ik -\frac{i}{2k}\left( \partial ^2_x+\partial ^2_y\right) \right\} \psi ^*\,. \end{aligned}$$
(17)

Here, I denotes the electron intensity defined as \(\vert \psi \vert ^2=\psi ^*\psi\) with the complex conjugate \(\psi ^*\). Calculating the sum of Eqs. (16) and (17) yields the transport-of-intensity equation \(-2k\sqrt{I}\ \partial _z \sqrt{I} =2\sqrt{I}\ \nabla _\perp \sqrt{I}\ \nabla _\perp \phi +I\nabla _\perp ^2\phi\), which can be rewritten using the relation \(2\sqrt{I}\ \partial _z \sqrt{I}=\partial _z I\) as [30,31,32,33]

$$\begin{aligned} -\frac{2\pi }{\lambda }\partial _z I =\nabla _\perp \left( I\ \nabla _\perp \phi \right) . \end{aligned}$$
(18)

The analytical solution for this partial differential equation is obtained by substituting \(\nabla _\perp \Phi =I\ \nabla _\perp \phi\) and solving \(\nabla _\perp ^2\phi =\nabla _\perp \left( \frac{1}{I}\nabla _\perp \Phi \right)\) for \(\phi\) [32, 33]:

$$\begin{aligned} \phi \approx -\frac{2\pi }{\lambda }\nabla _\perp ^{-2} \nabla _\perp \left[ \frac{1}{I}\nabla _\perp \nabla _\perp ^{-2}\left( \frac{I(\Delta z)-I_0}{\Delta z}\right) \right] . \end{aligned}$$
(19)

The inverse Laplace operator \(\nabla _\perp ^{-2}\) can be calculated in reciprocal space without the need for integration:

$$\begin{aligned} \nabla _\perp ^{-2} f(x,y)={\mathcal {F}}^{-1}\left\{ \frac{1}{q_x^2+q_y^2}{\mathcal {F}}\left[ f(x,y)\right] \right\} . \end{aligned}$$
(20)

The intensity change along the electron trajectory is approximated using only one single focal plane and assuming a homogeneous intensity in focus \(I_0\). A more rigorous calculation may compare intensities taken at different focal planes through, e.g., calculating the mean phase value or higher-order gradient calculation. In either case, the electron phase is obtained within seconds in a non-iterative manner. In comparison, iterative exit wave reconstruction relying on, e.g., the Gerchberg–Saxton algorithm require a large set of focal planes and may take days to converge depending on the number of focal planes and data size. The basically instantaneous gratification and data acquisition requiring only one focal plane make the transport-of-intensity equation remarkably attractive for mapping and time-resolved studies. Precise knowledge of the defocus value is not needed due to limited spatial resolution.

The transport-of-intensity equation (19) is a masterpiece of abstract mathematics and physics emerging from quantum mechanics. Its function is best assessed by application to the nanodisk array discussed above. Figure 4(d) depicts the reconstructed electron phase using only one focal plane for pure magnetic and magnetic plus electric phase contributions. While not perfect, the resemblance of reconstructed and modeled phase is striking. This even applies to cases with a sizable electric contribution, which highlights the location of the nanodisks. Discrepancies become apparent when calculating the 2D gradient of the electron phase using Eq. (4) to obtain the in-plane magnetic induction [Fig. 4(e)]. Even for absent electric phase contrast, the reconstructed in-plane magnetic induction exhibits artifacts that may influence the interpretation of both modeled and experimental data. In particular, one has to keep in mind that the obtained result is not the in-plane magnetization. This is true for any electron phase retrieval.

Figure 5
figure 5

Implementation of data processing and Gerchberg–Saxton algorithm. The flowchart shows preparation of data and exit wave retrieval on equivalent level since proper alignment and identification of defocus values are as critical as the reconstruction algorithm itself.

Exit wave reconstruction using the Gerchberg–Saxton algorithm

Iterative phase retrieval based on the Gerchberg–Saxton exit wave reconstruction algorithm [55] relies on the modeling of electron wave propagation in forward and backward direction using Eqs. (11) and (12), respectively. Its numerical implementation alongside data preparation, relevant to experimental data (discussed in Sect. 3.1), is shown as a flowchart in Fig. 5. For each iteration, the electron wave for a given focal plane, identified by its defocus value \(\Delta z\), is approximated as

$$\begin{aligned} \psi (\Delta z)=\sqrt{I(\Delta z)}\exp \left[ i\phi (\Delta z)\right] , \end{aligned}$$
(21)

with \(\phi (\Delta z)=\arctan \frac{\text {Im}\left[ \psi (\Delta z)\right] }{\text {Re}\left[ \psi (\Delta z)\right] }\) and the intensity of the experimental data I. Contrary to earlier belief [57], the initial guess for the phase can be arbitrary. In fact, all Gerchberg–Saxton reconstructions presented in this work used \(\phi (\Delta z)=0\) as initial guess. Nonetheless, an educated guess based on modeling or TIE phase retrieval can substantially accelerate convergence. The focal planes are then backward propagated into focus, denoted as \(\psi ^{(\Delta z)}(0)\), to calculate the Fourier transform of the mean electron wave averaged over all select focal planes:

$$\begin{aligned} {\mathcal {F}}\left[ \psi \right] =\overline{{\mathcal {F}}\left[ \psi ^{(\Delta z)}(0)\right] }=\overline{\Gamma _b(\Delta z) {\mathcal {F}}\left[ \psi (\Delta z)\right] }. \end{aligned}$$
(22)

Without leaving reciprocal space, the resulting in-focus wave is forward propagated to all focal planes:

$$\begin{aligned} \psi (\Delta z)={\mathcal {F}}^{-1}\left\{ \Gamma _f(\Delta z){\mathcal {F}}\left[ \psi \right] \right\} , \end{aligned}$$
(23)

commencing the next iteration step.

The convergence time, i.e., number of iterations needed for convergence, is inverse proportional to the square of the maximal defocus \(\Delta z_\text {max}\) of the focal series and proportional to the fourth power of the feature size, considered in terms of wave vector q [45]:

$$\begin{aligned} \tau \approx \frac{3}{\pi ^2\lambda ^2\left( q^2_x+q^2_y\right) ^2\Delta z^2_\text {max}}. \end{aligned}$$
(24)

This relation elucidates the slow convergence of low-frequency components (small \(q^2_x+q^2_y\)) apparent in both numerical and experimental data. Figure 4(f) depicts the electron phase derived with the Gerchberg–Saxton algorithm after 800 iterations indicating slow convergence of low-frequency components and hinting at a spatial resolution superior to the transport-of-intensity equation [Fig. 4(d)]. A rigorous proof of this statement is given in Sect. 3.2. Although the convergence of the Gerchberg–Saxton exit wave reconstruction can be accelerated by blurring, this simple example illustrates the need for thousands of iterations to obtain a phase information comparable with TIE phase retrieval. A systematic study of convergence as a function of select focal planes and stage of iteration is given in Sect. 3.2 using experimental data.

Alignment of the experimental focal planes may be corrected by comparing the phase crosscorrelation between reconstructed and experimental focal planes translated by small amounts [Fig. 5]. Similarly, the defocus values can be refined by comparing the reconstructed in-focus planes with the experimental backward-propagated focal planes using small variations in the defocus value. Although available, these features were not used in this work to minimize computing time and because of marginal improvements for focal planes with large defocus values initially aligned during the data preparation process (Sect. 3.1). Moreover, the presented results do not consider aberration, partial coherence, beam divergence, and temporal coherence.

Application to inhomogeneous materials

Figure 6
figure 6

Preparation of data to ensure high-quality reconstruction. (a) Experimental focal planes, (b) backward-propagated focal planes into focus, and (c) reconstructed focal planes using the Gerchberg–Saxton algorithm. Images are normalized to enhance contrast. The in-focus series improves image alignment and defocus determination but does not reflect the actual electron intensity or phase. Lack of shadow, double, and smeared peaks in the reconstructed focal planes corroborates proper alignment and defocus values. (d) Comparison of defocus values derived from Thon rings and backward propagation of focal planes revealing linear relation to Lorentz lens current and a slight deviation far from focus. Scale bar is 200 nm.

Alignment and defocus determination

The display of data preparation and phase retrieval on an equivalent level in Fig. 5 conveys the importance of the former to succeed in the latter. Visualizing magnetization configurations with relatively weak phase contributions requires large defocus values that amplify deviations of the beam trajectory from the optical axis and markably alter the image due to beam deflection (several fields of view), beam rotation (\(\approx 5^\circ\)), and magnification (80–120%). These artifacts persist even in state-of-the-art double aberration-corrected transmission electron microscopes since their optics are not optimized for out-of-focus imaging. Hence, accurate and precise alignment, i.e., translation, rotation, and magnification, and defocus determination are necessary. During data acquisition, structural defects can be used as fiducial markers to retain the region of interest by translating the sample holder or shifting the beam. The beam should be spread out as much as possible to prevent distortion since it shrinks with increasing distance from focus and the magnification near the edge of the beam spot is inhomogeneous. Using a single electron, direct electron detector can help accommodate the corresponding low beam intensity. Nevertheless, no matter how thorough these experimental adjustments are carried out, an iterative optimization of alignment and defocus determination needs to follow.

Manual alignment of 22 focal planes may take up to ten hours that fortunately can be shortened to a few hours using improved data processing and semi-automation. This includes, in particular, in-focus series obtained by backward propagation of the experimental focal planes into focus yielding sharp localized features (defects) [Fig. 6(a), (b)]. Note that the resulting set does not reflect the actual electron intensity due to unknown phase contributions. The magnification should be well estimated as it directly affects the defocus value for a given focal plane. This is typically an iterative process. The challenge with aligning focal planes is the lack of isomorphism due to interference fringes and emerging contrast that prevents the use of phase crosscorrelation or other advanced image registrations. A precision of a few pixels is very common for image alignment, which translates to a misalignment \(<10\) nm for a magnification of \(2000\times\) and a detector pixel size of 0.45 nm.

Lastly, the defocus values is derived from the angle-averaged (radial) power spectral density using the mathematical expression for the contrast transfer function, i.e., exponent of the propagator or from the focal planes backward propagated into focus. The former approach leverages Thon rings [80] emerging upon defocusing and simultaneously allows to assess beam aberration causing non-circular patterns. The contrast transfer function vanishes according to Eq. (11) for \(n=\frac{1}{2}\lambda \Delta z\left( q^2_x+q^2_y\right) +\frac{1}{2\pi }\chi\) with integer n. Large defocus values are well described without considering aberrations by analyzing the minima according to

$$\begin{aligned} \Delta z_k =-\frac{2n_k}{\lambda q_{0,k}^2}, \end{aligned}$$
(25)

with the \(n_k\)-th minima located at \(q_{0,k}\). Focal planes far from focus may be backward propagated near focus prior to calculating the power spectral density to reduce the uncertainty (\(\approx 10\%\)) originating from very few, small Thon rings. The omission of aberrations is justified since a spherical aberration \(C_3=20\) mm causes, for a magnification of \(2000\times\), a relative change \(<0.01\%\) or \(<10\) nm for defocus values exceeding hundreds of micrometers. For reference, typical experimental values for \(C_3<1~\mu\)m result in a minuscule change. In practice, the relationship between Lorentz lens current and defocus value is linear [Fig. 6(d)] and offers a convenient way to check whether magnification and defocus were properly determined and/or the beam spot was sufficiently spread out to ensure homogeneous magnification. Small deviations from the linear relationship become apparent far from focus in the in-focus series that make a manual determination of the in-focus plane, i.e., defocus value, faulty. Beam divergence and partial coherence can be excluded as cause as dozens of interference fringes are observed.

Ultimately, the quality assessment is given by comparison between experimental and reconstructed focal planes [Fig. 6(a), (c), Suppl. Movies 1, 2] and by the reconstructed electron phase (Figs. 7, 8, and 9). Since experiment and reconstruction will never match each other due to simplifications during reconstruction, uncertainty in defocus, and misalignment, other quality checks are important, such as resemblance of small and large features and lack of shadow, double, and smeared peaks. Satisfying these is necessary but not sufficient as the convergence of the exit wave reconstruction, i.e., electron phase, depends on the selection of focal planes and number of iterations.

Figure 7
figure 7

Convergence of exit wave reconstruction using the Gerchberg–Saxton algorithm and dependence on selection of focal planes. Electron phase of achiral Bloch walls in amorphous ferrimagnetic films with perpendicular magnetic anisotropy reconstructed from (a) 22 focal planes and a subset of (b) 10 and (c) 5 focal planes shown for different stages of iteration. (d) Normalized correlation of reconstructed electron phase with respect to final result obtained from the complete set suggesting ultimate convergence independent of select focal planes. (e) Normalized correlation and (f) standard deviation of reconstructed and experimental focal planes for different numbers of iteration revealing worse agreement for near-focus planes when using larger sets. (g) Electron phase retrieved from complete set of focal planes using the transport-of-intensity equation demonstrating the same distribution of medium- and low-frequency components and lack of high-frequency components (small features), such as grains with dark phase contrast. Scale bar is 200 nm.

Convergence of exit wave reconstruction

The characteristic frequency dependence (Eq. 24) of the Gerchberg–Saxton algorithm allows to differentiate between structural (high-frequency), magnetization (medium- and low-frequency), and stray field (low-frequency) contributions by selecting subsets of focal planes and/or varying the number of iterations. This unique capability is exemplarily demonstrated by visualizing structural defects alongside domain walls in amorphous ferrimagnets with perpendicular magnetic anisotropy [51] and chiral spins in amorphous thick films [56]. The phase retrieval coincides with Sect. 2.4 using an initial phase equal to zero and without considering aberrations, astigmatism, beam divergence, and incoherence. The neglect of aberrations and astigmatism is justified since modifications to the focal planes far from focus are negligible for any realistic values. Samples with a thickness \(\gtrsim 100\) nm may cause multiple or inelastic scattering events leading to beam divergence and incoherence, which can affect the quality of the reconstructed electron phase. Each GSR phase retrieval is compared with the TIE phase retrieval to highlight differences and validate the reconstructed electron phase. The TIE phase retrieval for different focal planes revealed variations in the form of a polynomial 2D background that was not subtracted prior to calculating the mean electron phase.

The experimental data were obtained, as discussed in the original research articles [51, 56], with a 300-keV aberration-corrected transmission electron microscope (TEAM I) equipped with a Gatan K2-IS direct electron detector operated in electron-counting mode at the Molecular Foundry (Berkeley, CA). Each focal plane was recorded for 6 s at room temperature using a magnification of \(2000\times\) (pixel size of 0.45 nm) and under normal incidence probing exclusively in-plane components of the magnetic induction.

Figure 7 depicts the electron phase reconstructed from three different sets of focal planes taken at remanence (zero magnetic bias field). A selection of the corresponding experimental and reconstructed focal planes is depicted in Fig. 6(a) and (c), respectively. The complete set, containing 22 focal planes up to \(-5.2\) mm [Suppl. Movies 1, 2], shows much faster convergence of low-frequency components (domains) than the subsets Fig. 7(a)–(c) in accordance with Eq. (24). The low-frequency magnetic phase contrast originates from Bloch walls as the out-of-plane magnetized domains do not deflect the electron beam under normal incidence. On the submicrometer length scale, the Bloch walls are chiral leading to the appearance of homogeneous domains emerging with progressing iteration with different gray tones. The final converged phase unveils two Bloch lines near the center of the field of view, identifiable by their quadrupole phase contrast, that reverse the chirality of the Bloch walls [Fig. 7(a)]. Small features emerge after less than 100 iterations due to structural defects and retain their shape, intensity, and location throughout the entire process. While structural defects, magnetization, and magnetic stray field contributions are clear in the final converged electron phase of the complete set, defects immediately jump out in the reconstructed electron phases obtained from focal series with small defocus values (subsets) and small numbers of iterations [Fig. 7(b), (c)]. This characteristic enables the correlation of pinning sites and defects with the magnetization configuration at an unprecedented spatial resolution. The vast majority of structural defects pin magnetic domain walls; not all defects act as pinning and, by extension, nucleation sites. Note that the corresponding TIE phase retrieval completely lacks high-frequency components (small features) preventing such a correlation [Fig. 7(g)]. The high spatial resolution and high sensitivity of the GSR phase retrieval enable a quantitative phase contrast imaging that has, thus far, only be known from off-axis electron holography.

A quantitative assessment of the convergence is given in terms of the normalized crosscorrelation function

$$\begin{aligned} g(n)&=\sum _{i,j}T(n)(i,j)\cdot T(n_\text {max})(i,j) \in (0,1)\,,\nonumber \\ T(n)(i,j)&=\frac{I(n)(i,j)-\overline{I(n)}}{\sqrt{N}\sigma (I(n))}\,, \end{aligned}$$
(26)

defined for each pixel coordinate (ij), with the number of iterations n, number of pixels N, standard deviation \(\sigma\), and mean intensity \({\overline{I}}\) of the electron phase. In every presented case, the crosscorrelation is calculated with respect to the final electron phase reconstructed from the complete set of focal planes \(T(n_\text {max})(i,j)\). Analyzing the asymptotical behavior for the complete set suggests near-convergence and validates the use of this metric [Fig. 7(d)] and the final electron phase as ground truth. Note that the number of iterations needed to obtain the ground truth depends on the defocus values, saturation magnetization, and feature sizes and is typically \(<10,000\). Hence, all reconstructions presented in this work ran for 9,000 iterations independent of convergence. The normalized correlations for partial sets reveal a steeper approach than the complete set hinting at the possibility that they reach the same electron phase at a later stage of iteration. This is also expected for artifact-free in-line holography. Together with the reconstructed electron phases [Fig. 7(a)–(c)], this underscores reliability of aligned data and reproducibility of the reconstruction. Such a self-consistency check is absent with the non-iterative TIE phase retrieval.

Figure 8
figure 8

Convergence of low- and high-frequency components in the Gerchberg–Saxton algorithm illustrated on the example of helical spins with isolated Bloch skyrmions in amorphous iron germanium films reconstructed from (a) 21 focal planes and a subset of (b) 10 and (c) 5 focal planes. The complete set reveals prominent low-frequency stray field contributions which also appear in the (d) averaged electron phase obtained with the transport-of-intensity equation. Enhanced spatial resolution of the Gerchberg–Saxton algorithm enables correlation of magnetization and magnetic stray field contributions to structural defects. Normalized correlation of (e) reconstructed electron phase with respect to final result obtained from the complete set and (f) reconstructed and experimental focal planes. Scale bar is 200 nm.

The reconstructed focal planes can be correlated with the experimental data by analogy with Eq. (26) using the defocus \(\Delta z\) instead of the number of iterations n as variable [Fig. 7(e)]. An alternate metric quantifies the ratio of standard deviation to mean value \(\sigma (\Delta I)/\vert \overline{\Delta I}\vert\) defined pixel-wise as intensity difference between reconstructed and experimental focal planes [Fig. 7(f)]. Aside from the in-focus plane, both metrics reveal the same trend. Near-focus focal planes deviate more significantly from each other than those farther away as the latter carry more weight during reconstruction and possess less sharp features. However, the correlation of experimental and reconstructed focal planes should be considered as an indicator for poorly matching planes instead of a quantitative measure for the convergence due to the neglect of beam divergence, astigmatism, aberration, and partial coherence, uncertainty in defocus, and misalignment that, at best, leads to a resemblance of small and large features. The quality and convergence of the reconstructed electron phase and its reproducibility for different subsets of focal planes are proper criteria.

The high spatial resolution and sensitivity of Gerchberg–Saxton provide further means to investigate the impact of structural defects on helical spins and topological magnetic states in inhomogeneous materials. This is demonstrated on the example of amorphous iron germanium films with nanocrystalline defects. The electron phase, depicted in Fig. 8, shows the room-temperature configuration recorded in the presence of a normal magnetic bias field (32 kA/m) generated by the objective lens current. Data preparation, phase retrieval, and analysis were carried out by total analogy with the previous example. The experimental and reconstructed focal planes are shown as Supplementary Movies 3 and 4, respectively. While structural defects are well resolved, the reconstructed electron phase appears overall blurry since the magnetic signal from in-plane magnetization components and stray fields are less confined. The striped domain contrast of the helical spin lattice reveals a spin dislocation (fork) and a decoration of Bloch skyrmions exhibiting a characteristic polar phase contrast [Fig. 2(b)]. Correlating the location of structural defects with the occurrence of the polar contrast divulges that some, not all, skyrmions are pinned at or reside near structural defects. On the other hand, not every defect pins a topological state. The larger sets, containing focal planes far from focus, reveal after thousands of iterations prominent low-frequency components in the form of domains superimposed with the striped domain contrast [Fig. 8(a), (b)]. The corresponding loop of the in-plane magnetic induction connects regions with polar phase contrast and is reproduced by the TIE phase retrieval [Fig. 8(d)]. While a significant contribution from magnetization divergence, i.e., stray fields, can be excluded since the orientation of the helical spin lattice changes only marginally, a systematic study of its physical origin is outside the scope of this work. The existence of the large domains causes a much slower convergence than in the previous example, particularly for subsets with near-focus focal planes [Fig. 8(e)]. Nonetheless, both convergence of the electron phase and correlation between experimental and reconstructed focal planes follow the same trend as in the previous example [Fig. 8(e), (f)].

The last two examples address challenges with phase contrast imaging of non-collinear spin textures that can lead to improper conclusions when using TIE phase retrieval alone. Figure 9 depicts the electron phase reconstructed from 20 focal planes taken at remanence [left column; Suppl. Movies 5, 6] and in the presence of a 64 kA/m normal magnetic bias field [right column; Suppl. Movies 7, 8] of two distinct materials systems. The left column shows the magnetic and electric phase contrast of chiral Néel walls in out-of-plane magnetized ferrimagnets. The low-frequency magnetic contrast is very weak since Néel spin textures are invisible to Lorentz microscopy [Fig. 2(b)]. The contrast emerging after thousands of iterations is caused by a small tilt \(\approx 2\%\) out of the horizontal [Fig. 9(a), (b)]. Hence, the out-of-plane magnetized domains exhibit projected in-plane components that deflect the image-forming electrons. The resulting phase contrast indicates the segments of domain boundaries not aligned parallel to the tilt axis. While these measurements suffice for an identification of the domain wall type, the electron phase and magnetization reconstruction are faulty rendering any differences between GSR and TIE phase retrieval irrelevant [Fig. 9(b), (c)]. A proper reconstruction of the morphology and spatial distribution of the magnetic domains (not the domain walls) requires tilt series along two perpendicular axes to correlate the phase contrasts or to perform vector field tomography [9,10,11,12,13,14,15]. However, a more convenient alternative for this particular task is x-ray magnetic circular dichroism imaging as demonstrated on the example of amorphous ferrimagnetic films with Bloch and Néel domain walls [51]. Note though that neither of the three techniques allows for visualizing Néel spin textures. The right column illustrates the sensitivity of electron holography to the in-plane magnetic induction rather than the magnetization itself. The helical spins with cobweb-like orientation yield a sizable divergence of the magnetization previously observed in magnetic force microscopy of boundary regions between helical spin lattices [81]. The corresponding low-frequency stray field appears in the GSR phase retrieval after thousands of iterations and coincides with the TIE phase retrieval [Fig. 9(b), (c)]. The stray field contributions outweigh contributions from the helical spin lattice and structural defects apparent at the early stages of iteration [Fig. 9(a)]. An inference of the magnetization from the TIE phase retrieval, typically done in literature, leads to a wrong conclusion which becomes only apparent by comparison with the GSR phase retrieval.

To minimize computing time without compromising quality, all numerical arrays are initially scaled and the selection of active focal planes is limited to 20 per iteration [Fig. 5]. This procedure is particular attractive since typical iterative phase retrievals take days to complete. For instance, an exit wave reconstruction based on 22 focal planes with 11 million pixels each and acceleration in the form of multiprocessing and Fourier transforms calculated on graphics card takes 45 s for each iteration totaling less than five days for 9000 iterations. These values are for Fig. 7(a) and the original data size and obtained with a high-performance computer (Ubuntu 22.04, python3.11) powered by 48 CPUs and one 24-GB GTX 3090 Ti GPU. Sets of ten and five focal planes [Fig. 7(b), (c)] reduce the computing time to 25 s and 15 s per iteration, respectively. However, the slow convergence of low-frequency components makes the use of large sets of focal planes with a wide range of defocus values more attractive since overall less iterations and computing time are required to reconstruct the same electron phase [Figs. 7(d), 8(e)].

Figure 9
figure 9

Electron phase of chiral Néel walls and helical spins with cobweb-like spatial orientation reconstructed using the Gerchberg–Saxton algorithm after (a) 300 and (b) 9000 iterations and the (c) transport-of-intensity equation. Thousands of iterations are needed to properly capture contributions from very weak magnetic interactions (Néel walls in out-of-plane magnetized films) or magnetic stray fields (divergence of magnetization). The chiral Néel walls are visible due to a misalignment of \(2^\circ\). Scale bar is 200 nm. Figure adapted from References [51, 56].

Conclusion

In-line electron holography has become an integral part of materials sciences as it provides means to study spatial variations in electric and spin distributions in quantum, energy, and magnetic materials. This work demonstrated how advanced data analysis can be employed to boost both spatial resolution and sensitivity of existing aberration-corrected transmission electron microscopes without the need for physical modifications that is particularly appealing to user facilities. Particular emphasis was given to the step-by-step derivation of the physical background and mathematical equations to demystify phase contrast imaging with Lorentz microscopy and empower the reader to model and reconstruct the electron phase shift and electron wave propagation for arbitrary magnetization configurations. Non-iterative and iterative phase retrieval algorithms were quantitatively compared using numerical and experimental data. The high spatial resolution and frequency-dependent convergence of the Gerchberg–Saxton exit wave reconstruction allowed for differentiating between structural features, magnetization, and magnetic stray fields in inhomogeneous materials hosting non-collinear spin textures. The unique capability to correlate magnetic and electronic properties with structural defects on relevant length scales comes at the expense of a significantly longer computing time compared with, e.g., the commonly used transport-of-intensity equation, which provides instantaneous results. Ongoing developments of cryogenic transmission electron microscopes reaching down to liquid helium temperature will likely broaden the field of application to include quantum information systems requiring the demonstrated high spatial resolution, sensitivity, and, ideally, temporal resolution.