License: CC BY 4.0
arXiv:2506.00492v1 [physics.optics] 31 May 2025

Energy-Time Ptychography for one dimensional Phase Retrieval

Ankita Negi1,2,*, Leon Merten Lohse1,2, Sven Velten1, Ilya Sergeev1, Olaf Leupold1, Sakshath Sadashivaiah3,4, Dimitrios Bessas5, Aleksandr Chumakhov5, Christina Brandt6, Lars Bocklage1,2, Guido Meier7,2, and Ralf Röhlsberger1,2,3,4,8
Abstract

Phase retrieval is at the heart of adaptive optics and modern high-resolution imaging. Without phase information, optical systems are limited to intensity-only measurements, hindering full reconstruction of object structures and wavefront dynamics essential for advanced applications. Here, we address a one-dimensional phase problem linking energy and time, which arises in X-ray scattering from ultrasharp nuclear resonances. We leverage the Mössbauer effect, where nuclei scatter radiation without energy loss to the lattice, and are sensitive to their magneto-chemical environments. Rather than using traditional spectroscopy with radioactive gamma-ray sources, we measure nuclear forward scattering of synchrotron X-ray pulses in the time domain, providing superior sensitivity and faster data acquisition. Extracting spectral information from a single measurement is challenging due to the missing phase information, typically requiring extensive modeling. Instead, we use multiple energetically overlapping measurements to retrieve both the transmission spectrum and the phase of the scattering response, similar to ptychographic phase retrieval in imaging. Our robust approach can overcome the bandwidth limitations of gamma-ray sources, opening new research directions with modern X-ray sources and Mössbauer isotopes.

Keywords phase retrieval  \cdot ptychography  \cdot nuclear resonant scattering  \cdot Mössbauer spectroscopy  \cdot X-ray scattering  \cdot nuclear quantum optics  \cdot inverse problems  \cdot pytorch

1 Introduction

A fundamental challenge in photon science is the loss of phase information of the electromagnetic wavefield during measurement. This phase problem plagues the study of light-matter interactions across various energy scales and disciplines, e.g., in radar imaging [1, 2], astronomy [3, 4], microscopy [5, 6, 7, 8], and crystallography [9]. It also appears in imaging methods using electrons [10] and neutrons [11]. It arises because no detector can directly sample the electromagnetic field oscillations of optical and X-ray light. For instance, even the most advanced X-ray detectors, such as micro-channel plates, can only capture the intensity of the wavefield averaged over time windows greater than 10101010 ps [12, 13]. Meanwhile, reliable algorithms have been developed to retrieve the phase in two dimensions (e.g., diffraction imaging [14, 15, 16]) and higher dimensions (e.g., crystallography [17]). The one-dimensional phase problem is highly ill-posed and inherently more challenging to solve due to multiple non-trivial ambiguities [18]. The mathematical proof is derived from D’Alembert’s fundamental theorem of algebra, which states that, unlike single-variable polynomials, multidimensional polynomials are generally not factorable [19]. Unlike higher-dimensional problems, it is typically not possible to uniquely solve a one-dimensional phase problem using only one measurement, even when prior information such as non-negativity is assumed [20].

One-dimensional phase problems arise, for example, in ultrafast laser pulse diagnostics [21, 22]. The laser pulse is only a few femtoseconds long, and its temporal response cannot be measured directly. Instead, the pulse is gated with itself in time with the help of a non-linear optical medium, and its frequency spectrum is measured for different time delays. The temporal shape and length of the pulse are then retrieved from this two dimensional dataset, which is called the frequency-resolved optically gated (FROG) trace [23], using a phase retrieval algorithm based on the short-time Fourier transform [24]. Another example is the Griffin-Lim algorithm, which is used to separate speech signals from background noise in two-dimensional audio spectrograms [25].

An analogous problem arises in Mössbauer physics, when the nuclear forward scattering (NFS) signal of an object is measured. The recoilless scattering of X-ray photons by nuclei, known as the Mössbauer effect [26], offers unique insights [27, 28, 29, 30] into the magnetic and electronic structure of materials. The sharp natural linewidth of the nuclear transitions allows for extraordinary energy resolutions (1013108superscript1013superscript10810^{-13}-10^{-8}10 start_POSTSUPERSCRIPT - 13 end_POSTSUPERSCRIPT - 10 start_POSTSUPERSCRIPT - 8 end_POSTSUPERSCRIPT eV) compared to electron spectroscopy methods (102101superscript102superscript10110^{-2}-10^{-1}10 start_POSTSUPERSCRIPT - 2 end_POSTSUPERSCRIPT - 10 start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT eV) [31, 32]. For example, the 14.4 keV transition in the iron isotope Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe has an extremely narrow natural linewidth Γ=Γabsent\Gamma=roman_Γ = 4.7 neV, corresponding to a quality factor of 1012similar-toabsentsuperscript1012\sim 10^{12}∼ 10 start_POSTSUPERSCRIPT 12 end_POSTSUPERSCRIPT. Conventional lab-based methods to measure the energy spectrum of these sharp transitions are unsuitable for materials with unavailable or short-lived radioactive sources [33, 30], and for experiments requiring a small, focused beam [34, 35]. For the energy-resolved study of Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe-containing materials, synchrotron Mössbauer source (SMS) setups [36, 37] that use pure nuclear Bragg reflections from a FeBO357superscriptsubscriptFeBO357{}^{57}\mathrm{Fe}\mathrm{B}\mathrm{O}_{3}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_FeBO start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT crystal have been developed. This technique enables Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe Mössbauer spectroscopy at synchrotrons but introduces other challenges. The Doppler motion of the crystal to tune the energy often causes fluctuations in the reflected beam due to crystal imperfections. Moreover, maintaining the temperature stability of the setup is critical for achieving high energy resolution (3-6 ΓΓ\Gammaroman_Γ). In addition, high resolution reduces photon flux, resulting in a trade-off between resolution and intensity [38].

Instead, the sub-100 ps X-ray pulses from advanced synchrotron sources can be directly used to study the nuclear transitions in time domain. These pulses, with energy bandwidths monochromatized to approximately 1 meV (104absentsuperscript104\approx 10^{4}≈ 10 start_POSTSUPERSCRIPT 4 end_POSTSUPERSCRIPT times the hyperfine splitting of the resonances), contain fewer than 0.01 resonant photons per pulse. As the synchrotron pulse traverses an object, the entire nuclear ensemble coherently scatters a single resonant X-ray photon, forming a nuclear exciton-polariton [39, 40, 41]. Following this excitation, the exciton undergoes collective evolution and spontaneous decay, resulting in the emission of photons at delayed times. The linear response of the object to the weak driving field is described in the energy domain as E^s(ω)=O^(ω)E^in(ω)subscript^𝐸s𝜔^𝑂𝜔subscript^𝐸in𝜔\hat{E}_{\text{s}}(\omega)=\hat{O}(\omega)\hat{E}_{\text{in}}(\omega)over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT s end_POSTSUBSCRIPT ( italic_ω ) = over^ start_ARG italic_O end_ARG ( italic_ω ) over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT in end_POSTSUBSCRIPT ( italic_ω ), where E^insubscript^𝐸in\hat{E}_{\text{in}}over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT in end_POSTSUBSCRIPT and E^ssubscript^𝐸s\hat{E}_{\text{s}}over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT s end_POSTSUBSCRIPT represent the energy spectra of the input and scattered X-ray fields, respectively, and O^(ω)^𝑂𝜔\hat{O}(\omega)over^ start_ARG italic_O end_ARG ( italic_ω ) is the transmission function of the object. For X-rays of wavelength 2π/k2𝜋𝑘2\pi/k2 italic_π / italic_k passing through an object of thickness z𝑧zitalic_z, the transmission function is given as follows:

O^(ω)=eiχ0(ω)kz.^𝑂𝜔superscript𝑒isubscript𝜒0𝜔𝑘𝑧\hat{O}(\omega)=e^{-\mathrm{i}\chi_{\mathrm{0}}(\omega)kz}.over^ start_ARG italic_O end_ARG ( italic_ω ) = italic_e start_POSTSUPERSCRIPT - roman_i italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ( italic_ω ) italic_k italic_z end_POSTSUPERSCRIPT . (1)

It is inherently complex due to the complex susceptibility χ0subscript𝜒0\chi_{\mathrm{0}}italic_χ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT of the nuclear transition [42, 39]. We can assume that all spectral components E^insubscript^𝐸in\hat{E}_{\mathrm{in}}over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT roman_in end_POSTSUBSCRIPT of the input synchrotron pulse have an equal magnitude E0subscript𝐸0E_{\mathrm{0}}italic_E start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT within the narrow energy bandwidth of the monochromatizaion. The scattered field Essubscript𝐸sE_{\text{s}}italic_E start_POSTSUBSCRIPT s end_POSTSUBSCRIPT is then related to the object’s transmission function O^^𝑂\hat{O}over^ start_ARG italic_O end_ARG as

Es(t){E^s(ω)}=E0{O^(ω)},proportional-tosubscript𝐸s𝑡subscript^𝐸s𝜔subscript𝐸0^𝑂𝜔\displaystyle E_{\text{s}}(t)\propto\mathcal{F}\{\hat{E}_{\text{s}}(\omega)\}=% E_{\mathrm{0}}\mathcal{F}\{\hat{O}(\omega)\},italic_E start_POSTSUBSCRIPT s end_POSTSUBSCRIPT ( italic_t ) ∝ caligraphic_F { over^ start_ARG italic_E end_ARG start_POSTSUBSCRIPT s end_POSTSUBSCRIPT ( italic_ω ) } = italic_E start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT caligraphic_F { over^ start_ARG italic_O end_ARG ( italic_ω ) } , (2)

where \mathcal{F}caligraphic_F denotes the Fourier transform from the energy to the time domain. In the timing mode of operation, the filling pattern of the electron storage ring is chosen such that synchrotron pulses are temporally spaced at intervals longer than the lifetime of the nuclear transitions. Avalanche photodiodes detect delayed photons as a function of time after excitation, and the measured signal is proportional to the intensity of the scattered field |Es(t)|2superscriptsubscript𝐸s𝑡2|E_{\text{s}}(t)|^{2}| italic_E start_POSTSUBSCRIPT s end_POSTSUBSCRIPT ( italic_t ) | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT. The hyperfine structure of the object manifests in the beating patterns of this temporal response.

Despite advances in data analysis software and modeling [43, 44], interpreting the time domain response of NFS to extract the different hyperfine parameters remains challenging. On the other hand, if phase information of the photons is available, the inverse Fourier transform can yield the complex energy spectrum of an object from NFS measurements without relying on a fit model or SMS setups. Furthermore, the energy resolution is not limited by the bandwidth of the crystal reflection in the SMS setup. However, the phase shift experienced by the scattered X-ray wavefield is lost in these measurement techniques, presenting a one-dimensional phase problem.

Various methods have been developed to tackle this phase problem in nuclear resonant scattering. For example, interferometry has been attempted to measure the phase shifts of a nuclear forward scattering object using a triple Laue interferometer [45, 46]. However, the short wavelengths and near-unity refractive indices of most materials in the X-ray regime make designing and stabilizing such interferometers highly challenging. Contemporary approaches substitute the interferometer with a probe sample mounted on a Doppler drive, where the Doppler drive serves as the phase shifter, and the object and probe samples act as interferometer arms. Techniques such as Heterodyne Phase Reconstruction (HPR) [47] and Frequency-Frequency Correlation [48] are based on this setup, but are only applicable when the nuclear resonances of the probe and the object samples are so detuned in energy that their radiative coupling [49, 50, 41] can be neglected. Additionally, these methods require a probing beam with a narrow single-energy line, which is scanned in small detuning steps across the object to improve energy resolution. The probe beam can be generated using a nuclear scattering sample that acts as a two-level quantum system. However, to achieve this, it is difficult to eliminate the residual hyperfine interaction in quasi-single-line absorbers such as Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe-based stainless steel [51].

In this paper, we propose performing ptychography to retrieve the one-dimensional phase of an object. Ptychography is a scanning technique that uses multiple overlapping measurements to constrain the phase problem, and is commonly implemented in the field of X-ray diffraction imaging [52]. It is a mathematical cousin of the short-time Fourier transform, but has less stringent scanning requirements. For nuclear ptychography, the probe has a broad energy spectrum and can illuminate a wide energy range on the object, allowing the scanning of the object spectrum with fewer measurements. The overlap between the measurements is set by the energy detuning of the probe with respect to the object.

Early conceptual work on a phase-sensitive, ptychographic method for nuclear resonant systems by Haber [53], recognized its potential in the emerging field of hard X-ray quantum optics with nuclear exciton-polaritons, which exhibit long coherence times and unique quantum behaviors [54, 55, 56, 57], and inspire research in fundamental physics [58, 59] and quantum information [60, 61]. Accessing the spectral phase provides insights into the coherence properties of the excitonic state, which is key to its manipulation and control [62, 63, 64]. For example, the phase can help distinguish between incoherent line-broadening due to thickness effects and coherent features due to hyperfine distributions in the transmission spectrum.

In two-dimensional phase problems, blind ptychography approaches [65, 66] are widely used to simultaneously retrieve both the object and probe. We acknowledge the recent publication by Yuan et al. [67], which presents a similar inversion concept for nuclear resonant systems. However, in our experiment, the object transmission spectrum was too sparse (six well-separated Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe resonances) to support the simultaneous probe retrieval. Instead, we explicitly modeled the hyperfine splittings in the probe spectrum to accommodate them in our reconstruction algorithm. Their probe is a thinner, single-resonance analyzer (1 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m), whereas our use of a thicker 20 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m stainless-steel foil allows broad spectral coverage and demonstrates experimental robustness to probe-induced thickness effects. Similar to how ptychographic imaging has advanced spatial resolution in diffraction-limited systems [68, 69, 70], we propose that the development of a ptychographic spectroscopy method could unlock new resolution regimes for Mössbauer science.

Refer to caption
Figure 1: Ptychography scheme for nuclear forward scattering: Pulsed X-ray radiation is generated from the synchrotron source with wave vector k𝑘\vec{k}over→ start_ARG italic_k end_ARG and linear polarization along σ𝜎\vec{\sigma}over→ start_ARG italic_σ end_ARG. It is monochromatized by a high resolution monochromator (HRM) to a bandwidth of 1 meV around the nuclear resonance (ω0Planck-constant-over-2-pisubscript𝜔0\hbar\omega_{0}roman_ℏ italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 14.4 keV). A probe sample is mounted in front of an object sample and either of the two is moved with respect to the other with a velocity vkconditional𝑣𝑘\vec{v}\parallel\vec{k}over→ start_ARG italic_v end_ARG ∥ over→ start_ARG italic_k end_ARG using a Doppler drive. The X-ray pulses are scattered by the nuclei in the two samples. The magnitude of the transmission spectrum of the probe 𝑷^bold-^𝑷\boldsymbol{\hat{P}}overbold_^ start_ARG bold_italic_P end_ARG and object 𝑶^bold-^𝑶\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_O end_ARG is shown in the insets. The detector measures the combined response of the samples as counts of photons scattered over time. Changing the velocity of the Doppler drive changes the relative detuning of the samples in the energy domain, and leads to a different temporal response at the detector. This allows multiple intensity measurements (shown for different velocities v1,v2,v3,subscript𝑣1subscript𝑣2subscript𝑣3v_{1},v_{2},v_{3},\ldotsitalic_v start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , …) to be collected.

2 Ptychography using resonant scattering by a two-sample system

The goal of ptychography is to retrieve the complex object transmission function O^(ω)^𝑂𝜔\hat{O}(\omega)over^ start_ARG italic_O end_ARG ( italic_ω ). To achieve this, a probe sample is placed in front of the object sample in the X-ray beam path (Fig. 1). In imaging setups, the probing beam is shaped by a lens or aperture that spatially restricts the illumination to a localized spot on the object. In our setup, the probe transmission function P^(ω)^𝑃𝜔\hat{P}(\omega)over^ start_ARG italic_P end_ARG ( italic_ω ), must have a spectral width comparable to that of the hyperfine splittings of nuclear levels in the X-ray regime. A suitable choice is a quasi-single-line absorber such as stainless steel, whose thickness can be adjusted to achieve the desired spectral width.

Next, a mechanism is required to energetically detune the probe with respect to the object, so that a different energy range in the object spectrum is illuminated for each ptychographic measurement. This can be achieved via the Doppler effect if either the object sample or the probe sample is moved with respect to the other along the direction of beam propagation. This motion induces an additional time-dependent phase shift in the radiation scattered by the probe sample,

φ(D,t)=2πλ|v|t=Dt𝜑𝐷𝑡2𝜋𝜆𝑣𝑡𝐷𝑡\varphi(D,t)=\dfrac{2\pi}{\lambda}|\vec{v}|t=Dtitalic_φ ( italic_D , italic_t ) = divide start_ARG 2 italic_π end_ARG start_ARG italic_λ end_ARG | over→ start_ARG italic_v end_ARG | italic_t = italic_D italic_t (3)

where λ𝜆\lambdaitalic_λ is the wavelength of the X-rays and D=2π|v|/λ𝐷2𝜋𝑣𝜆D=2\pi|\vec{v}|/\lambdaitalic_D = 2 italic_π | over→ start_ARG italic_v end_ARG | / italic_λ is the Doppler shift (in angular frequency) induced by the relative motion with velocity v𝑣\vec{v}over→ start_ARG italic_v end_ARG. The combined transmission function of the probe-object sample system is given as

Z^(D,ω)^𝑍𝐷𝜔\displaystyle\hat{Z}(D,\omega)over^ start_ARG italic_Z end_ARG ( italic_D , italic_ω ) =P^(ω+D)O^(ω).absent^𝑃𝜔𝐷^𝑂𝜔\displaystyle=\hat{P}(\omega+D)\cdot\hat{O}(\omega).= over^ start_ARG italic_P end_ARG ( italic_ω + italic_D ) ⋅ over^ start_ARG italic_O end_ARG ( italic_ω ) . (4)

Assuming that all detected photons are coherently scattered, the intensity at the detector at any time is equal to the squared magnitude of the scattered wavefield, and can be modeled as

I(D,t)|{P^(ω+D)O^(ω)}|2.proportional-to𝐼𝐷𝑡superscript^𝑃𝜔𝐷^𝑂𝜔2\displaystyle I(D,t)\propto\left|\mathcal{F}\{\hat{P}(\omega+D)\cdot\hat{O}(% \omega)\}\right|^{2}.italic_I ( italic_D , italic_t ) ∝ | caligraphic_F { over^ start_ARG italic_P end_ARG ( italic_ω + italic_D ) ⋅ over^ start_ARG italic_O end_ARG ( italic_ω ) } | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (5)

This is the one-dimensional continuous ptychographic forward model. It is non-linear due to the presence of the modulus squared ||2\left|\cdot\right|^{2}| ⋅ | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT operator. Inverting Eq. (5) to obtain the complex object function O^(ω)^𝑂𝜔\hat{O}(\omega)over^ start_ARG italic_O end_ARG ( italic_ω ) is impossible using only one measurement. Even by imposing prior constraints on O^(ω)^𝑂𝜔\hat{O}(\omega)over^ start_ARG italic_O end_ARG ( italic_ω ), such as a compact support or sparsity, the one-dimensional phase problem can have an infinite number of solutions and is unstable [71, 72]. However, it is possible to use data diversity to impose the overlap constraint [65] in Eq. (5). Multiple related measurements are taken by changing the detuning D𝐷Ditalic_D such that the probed parts of the object overlap in energy, as shown in Fig. 1. This scheme of time and energy-resolved measurement of the scattering process encodes the phase of the one-dimensional object in a two-dimensional ptychographic dataset called a "ptychogram" [73], and may be recovered using a decoding algorithm. It is analogous to a traditional spectrogram that encodes the variation in a signal’s frequency content with time.

In ptychographic imaging setups, smaller spatial features in a sample result in larger scattering angles in detected diffraction patterns. The largest scattering angle that the detector can capture sets the minimum achievable spatial resolution for the reconstruction. In the nuclear ptychography setup, an analogous constraint arises due to the maximum acquisition time Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT at the detector, which is determined by the finite time interval between synchrotron pulses. This imposes a limit on the maximum achievable energy resolution of the reconstructed object spectrum (in units of ΓΓ\Gammaroman_Γ)

Δω=2πTmaxΓ=2πτTmaxPlanck-constant-over-2-piΔsuperscript𝜔2𝜋subscript𝑇maxPlanck-constant-over-2-piΓ2𝜋𝜏subscript𝑇max\hbar\Delta\omega^{\prime}=\frac{2\pi}{T_{\mathrm{max}}}\cdot\frac{\hbar}{% \Gamma}={2\pi}\cdot\frac{\tau}{T_{\mathrm{max}}}roman_ℏ roman_Δ italic_ω start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = divide start_ARG 2 italic_π end_ARG start_ARG italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT end_ARG ⋅ divide start_ARG roman_ℏ end_ARG start_ARG roman_Γ end_ARG = 2 italic_π ⋅ divide start_ARG italic_τ end_ARG start_ARG italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT end_ARG (6)

where τ=/Γ𝜏Planck-constant-over-2-piΓ\tau=\hbar/~{}\Gammaitalic_τ = roman_ℏ / roman_Γ is the lifetime of the excited nuclear state. Because nuclear transitions are extremely sharp in energy, their time response can extend beyond Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, fundamentally limiting the energy resolution of this technique. This contrasts with imaging experiments in which the resolution is typically constrained by factors such as the radiation dose on the sample [74], decoherence effects [75] and Poisson noise, rather than detector size.

3 Decoding scheme

The ptychogram can be inverted using numerical algorithms, for which we discretely approximate the continuous phase problem in Eq. (5). The discrete object and probe functions are expressed as one-dimensional arrays 𝑶^Nbold-^𝑶superscript𝑁\boldsymbol{\hat{O}}\in\mathbb{C}^{N}overbold_^ start_ARG bold_italic_O end_ARG ∈ blackboard_C start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT, 𝑷^Nbold-^𝑷superscript𝑁\boldsymbol{\hat{P}}\in\mathbb{C}^{N}overbold_^ start_ARG bold_italic_P end_ARG ∈ blackboard_C start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT on an energy grid of length N𝑁Nitalic_N and resolution ΔωΔ𝜔\Delta\omegaroman_Δ italic_ω. We take j=1,2M𝑗12𝑀j=1,2\cdots Mitalic_j = 1 , 2 ⋯ italic_M measurements corresponding to different probe detunings Djsubscript𝐷𝑗D_{j}italic_D start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT and detuned probe functions 𝑷^j,i=𝑷^(ωi,Dj)subscriptbold-^𝑷𝑗𝑖bold-^𝑷subscript𝜔𝑖subscript𝐷𝑗\boldsymbol{\hat{P}}_{j,i}=\boldsymbol{\hat{P}}(\omega_{i},D_{j})overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUBSCRIPT italic_j , italic_i end_POSTSUBSCRIPT = overbold_^ start_ARG bold_italic_P end_ARG ( italic_ω start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT , italic_D start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ). The intensity in the time domain is measured and binned into N𝑁Nitalic_N time points with a fixed interval ΔtΔ𝑡\Delta troman_Δ italic_t and modeled as 𝑰jNsubscript𝑰𝑗superscript𝑁\boldsymbol{{I}}_{j}\in\mathbb{R}^{N}bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∈ blackboard_R start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT. The phase problem can now be formulated as an optimization problem to solve for an object 𝑶^bold-^𝑶\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_O end_ARG that minimizes a cost function ρ:X[0,):𝜌𝑋0\rho:X\rightarrow[0,\infty)italic_ρ : italic_X → [ 0 , ∞ ) given by

ρ(𝑶^)𝜌bold-^𝑶\displaystyle\rho(\boldsymbol{\hat{O}})italic_ρ ( overbold_^ start_ARG bold_italic_O end_ARG ) =j=1M𝑰j𝒃j2absentsuperscriptsubscript𝑗1𝑀superscriptnormsubscript𝑰𝑗subscript𝒃𝑗2\displaystyle=\sum_{j=1}^{M}\left\|\sqrt{\boldsymbol{I}_{j}}-\sqrt{\boldsymbol% {b}_{j}}\right\|^{2}= ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_M end_POSTSUPERSCRIPT ∥ square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT
=j=1M|𝐅{𝑷^j 𝑶^}|𝒃j2.absentsuperscriptsubscript𝑗1𝑀superscriptnorm𝐅subscriptbold-^𝑷𝑗 bold-^𝑶subscript𝒃𝑗2\displaystyle=\sum_{j=1}^{M}\left\|\left|\mathbf{F}\left\{\boldsymbol{\hat{P}}% _{j}~{}\raisebox{1.0pt}{ \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture% \makeatletter\hbox{\hskip 1.40001pt\lower-1.40001pt\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}% \pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}% {0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to% 0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}% \pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ % }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.% 1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt% }{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{\hat{O}}\right\}\right|-\sqrt% {\boldsymbol{b}_{j}}\right\|^{2}.= ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_M end_POSTSUPERSCRIPT ∥ | bold_F { overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG } | - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (7)

where 𝐅𝐅\mathbf{F}bold_F represents the discrete Fourier transform,     denotes pointwise multiplication and \|\cdot\|∥ ⋅ ∥ denotes the 2superscript2\ell^{2}roman_ℓ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT norm. The cost function represents the distance between the measured intensities 𝒃jsubscript𝒃𝑗\boldsymbol{b}_{j}bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT and the modeled intensities 𝑰jsubscript𝑰𝑗\boldsymbol{I}_{j}bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT of the ptychogram and is based on the Poisson likelihood model for noise in the ptychogram ([76], Supplement 1: Sec. S4). In Eq. (3), we optimize an object of grid size N103similar-to𝑁superscript103N\sim 10^{3}italic_N ∼ 10 start_POSTSUPERSCRIPT 3 end_POSTSUPERSCRIPT, where global optimization methods struggle due to the curse of dimensionality [77, 78]. Therefore, a local search with gradient descent is performed to minimize ρ𝜌\rhoitalic_ρ by using its local gradient with respect to the object [79]. Owing to the non-convexity of the cost function ρ𝜌\rhoitalic_ρ, the gradient descent algorithm may converge to local minima and the uniqueness of the solution is not guaranteed. To mitigate slow convergence, we incorporate a stochastic gradient descent (SGD) algorithm where the ptychogram dataset is shuffled and divided into random “mini-batches" whose gradients are used to update the object [80]. In our case, we observe that SGD converges noisier than the classic gradient descent, but it achieves an optimum with an order of magnitude fewer iterations.

We implemented the reconstruction algorithm for Nuclear Ptychography in a software package which we call NuPty [81]. All NuPty algorithms were implemented using PyTorch [82]. This enables a flexible and faster analysis of the phase problem because PyTorch uses its automatic differentiation capabilities to efficiently compute gradients and supports GPU-accelerated computations. The NuPty reconstruction scheme takes into account two key nuances of the ptychography experiment:

1. Multimodal ptychography model:

Thickness variations in the transmitting probe sample may introduce several incoherent scattering paths into the setup. To account for this, the intensity at the detector is modeled as an incoherent superposition of the intensities of the scattered fields corresponding to different probe modes m𝑚mitalic_m illuminating the object [83, 84], i.e., in Eq. (3)

𝑰jsubscript𝑰𝑗\displaystyle\boldsymbol{I}_{j}bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT =mwm|𝐅{𝑷^j(m) 𝑶^}|2,absentsubscript𝑚subscript𝑤𝑚superscript𝐅subscriptsuperscriptbold-^𝑷𝑚𝑗 bold-^𝑶2\displaystyle=\sum_{m}w_{m}\left|\mathbf{F}\left\{\boldsymbol{\hat{P}}^{(m)}_{% j}~{}\raisebox{1.0pt}{ \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture% \makeatletter\hbox{\hskip 1.40001pt\lower-1.40001pt\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}% \pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}% {0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to% 0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}% \pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ % }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.% 1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt% }{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{\hat{O}}\right\}\right|^{2},= ∑ start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT italic_w start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT | bold_F { overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT ( italic_m ) end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG } | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT , (8)

where wmsubscript𝑤𝑚w_{m}italic_w start_POSTSUBSCRIPT italic_m end_POSTSUBSCRIPT is a scalar denoting the relative weight of each probe mode 𝑷^j(m)subscriptsuperscriptbold-^𝑷𝑚𝑗\boldsymbol{\hat{P}}^{(m)}_{j}overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT ( italic_m ) end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT.

2. Time window:

Nuclear resonant scattering occurs with a delay (ns timescale) compared with prompt electronic scattering (ps timescale). The time-resolving detector is synchronized to the synchrotron bunch clock and resets to zero when a new X-ray pulse hits the sample. To prevent the prompt signal from saturating the detection system, a veto interval is set around the bunch clock, establishing a data acquisition time window from Tminsubscript𝑇minT_{\mathrm{min}}italic_T start_POSTSUBSCRIPT roman_min end_POSTSUBSCRIPT to Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT for the nuclear scattered signal. To ensure that the reconstruction result is scale-independent with respect to the number of photons Nphsubscript𝑁phN_{\mathrm{ph}}italic_N start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT detected in the time window, the algorithm uses a normalized form of the cost function

ρ~(𝑶^)~𝜌bold-^𝑶\displaystyle\tilde{\rho}(\boldsymbol{\hat{O}})over~ start_ARG italic_ρ end_ARG ( overbold_^ start_ARG bold_italic_O end_ARG ) =1BfphLj=1B𝑾 𝑰jM𝐅2Nph/fph𝒃j2.absent1𝐵subscript𝑓ph𝐿superscriptsubscript𝑗1𝐵superscriptnorm𝑾 subscript𝑰𝑗𝑀superscriptnorm𝐅2subscript𝑁phsubscript𝑓phsubscript𝒃𝑗2\displaystyle=\dfrac{1}{B\cdot f_{\mathrm{ph}}\cdot L}\sum_{j=1}^{B}\left\|% \sqrt{\boldsymbol{W}~{}\raisebox{1.0pt}{ \leavevmode\hbox to2.8pt{\vbox to2.8% pt{\pgfpicture\makeatletter\hbox{\hskip 1.40001pt\lower-1.40001pt\hbox to0.0pt% {\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0}% \pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}% {0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to% 0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}% \pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ % }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.% 1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt% }{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{I}_{j}}-\sqrt{\dfrac{M\cdot\|% \mathbf{F}\|^{2}}{N_{\mathrm{ph}}/f_{\mathrm{ph}}}\cdot\boldsymbol{b}_{j}}% \right\|^{2}.= divide start_ARG 1 end_ARG start_ARG italic_B ⋅ italic_f start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT ⋅ italic_L end_ARG ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_B end_POSTSUPERSCRIPT ∥ square-root start_ARG bold_italic_W bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG - square-root start_ARG divide start_ARG italic_M ⋅ ∥ bold_F ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG italic_N start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT / italic_f start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT end_ARG ⋅ bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (9)

Here, B𝐵Bitalic_B is the batch-size, i.e., the number of measurements used at a time to update the gradient, M𝑀Mitalic_M is the total number of measurements and L=(TmaxTmin)/Δt𝐿subscript𝑇maxsubscript𝑇minΔ𝑡L=(T_{\mathrm{max}}-T_{\mathrm{min}})/\Delta titalic_L = ( italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT - italic_T start_POSTSUBSCRIPT roman_min end_POSTSUBSCRIPT ) / roman_Δ italic_t. To speed up the calculations of the ptychogram and the cost function, we use the fast Fourier transform (FFT) with the operator norm 𝐅=Nnorm𝐅𝑁\|\mathbf{F}\|=N∥ bold_F ∥ = italic_N. The symbol fphsubscript𝑓phf_{\mathrm{ph}}italic_f start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT denotes the probability of photon scattering within the time window

𝑾(ti)={1TmintiTmax,0otherwise.𝑾subscript𝑡𝑖cases1subscript𝑇minsubscript𝑡𝑖subscript𝑇max0otherwise\boldsymbol{W}(t_{i})=\begin{cases}1&T_{\mathrm{min}}\leq t_{i}\leq T_{\mathrm% {max}},\\ 0&\text{otherwise}.\end{cases}bold_italic_W ( italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) = { start_ROW start_CELL 1 end_CELL start_CELL italic_T start_POSTSUBSCRIPT roman_min end_POSTSUBSCRIPT ≤ italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ≤ italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL otherwise . end_CELL end_ROW (10)

This probability can be calculated through simulations of the experimental setup and an order-of-magnitude estimate is sufficient for practical purposes.

Refer to caption
Figure 2: Phase retrieval from simulation: (a) Ptychogram simulated as described in Sec. 4. The dotted white line marks τ=141𝜏141\tau=141italic_τ = 141 ns which is the lifetime of the 14.4 keV energy level of the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nucleus. The magnitude (b) and phase (c) of the probe spectrum are shown. (d) The magnitude of the transmission spectrum of the reconstructed object is plotted for Tmax=subscript𝑇maxabsentT_{\mathrm{max}}=italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 200200200200 ns (orange) and Tmax=subscript𝑇maxabsentT_{\mathrm{max}}=italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 1000100010001000 ns (green). The reconstructed spectrum in green overlaps perfectly with the true object spectrum (dotted black line). For lower Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, artificial peaks appear in the reconstructed spectrum. (e) Reconstructed phase spectrum for the two values of Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, showing distinct phase shifts at each resonance line. In the plots, ω0Planck-constant-over-2-pisubscript𝜔0\hbar\omega_{0}roman_ℏ italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT refers to the energy of the photons at resonance = 14.4 keV.

4 Simulation

To benchmark the phase retrieval algorithm, a simulation of the experiment was performed using the NEXUS software package [44] and is shown in Fig. 2 (a). A stainless steel foil with an enrichment 95%percent9595\%95 % Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe and a thickness 20202020 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m was taken as the probe sample. A 95%percent9595\%95 % enriched Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe metal foil of thickness 2.52.52.52.5 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m was taken as the object sample. Figures Fig. 2 (b), (c) and (d), (e) represent the simulated energy spectra of the object and the probe samples, respectively. The magnetic structure of the simulated samples is based on the foils used in the real experiment, details of which can be found in Supplement 1: Sec. S1-S2. The probe absorption function has an almost Lorentzian line profile with a full width half maximum (FWHM) of 10similar-toabsent10\sim 10∼ 10 ΓΓ\Gammaroman_Γ. The broad energy spectrum ensures sufficient overlap between adjacent measurements. The object transmission function is Zeeman split into six lines. The object sample is also modeled after the experimental values (see Sec. 5) to contain 94.2(3)%94.2percent394.2(3)\%94.2 ( 3 ) % magnetic moments parallel to the σ𝜎\vec{\sigma}over→ start_ARG italic_σ end_ARG direction, which coincides with the linear polarization vector of the incident synchrotron beam, and the remaining 5.8(3)%5.8percent35.8(3)\%5.8 ( 3 ) % are isotropically distributed. For both orientations of the magnetic moment, the selection rules of the 14.4 keV Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe transition prohibit the object sample from being optically active [42]. Therefore, we only aim to reconstruct the spectrum of the σσ𝜎𝜎\vec{\sigma}\to\vec{\sigma}over→ start_ARG italic_σ end_ARG → over→ start_ARG italic_σ end_ARG scattering channel. All other entries in the scattering matrix are zero.

To simulate the time-domain scattering signal and perform Fourier transforms efficiently, we used the discrete Fast Fourier Transform (FFT). The number of points NFFTsubscript𝑁FFTN_{\mathrm{FFT}}italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT used in the Fast Fourier Transform (FFT) of the time-domain signal determines its energy resolution as

Δω=2πNFFTΔtΓPlanck-constant-over-2-piΔ𝜔2𝜋subscript𝑁FFTΔ𝑡Planck-constant-over-2-piΓ\hbar\Delta\omega=\dfrac{2\pi}{N_{\mathrm{FFT}}\cdot\Delta t}\cdot\dfrac{\hbar% }{~{}\Gamma}roman_ℏ roman_Δ italic_ω = divide start_ARG 2 italic_π end_ARG start_ARG italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT ⋅ roman_Δ italic_t end_ARG ⋅ divide start_ARG roman_ℏ end_ARG start_ARG roman_Γ end_ARG (11)

where ΔtΔ𝑡\Delta troman_Δ italic_t denotes discretization of the temporal grid. To accurately compute the linear convolution of the probe and object signals of length N, NFFT>2N1subscript𝑁FFT2𝑁1N_{\mathrm{FFT}}>2N-1italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT > 2 italic_N - 1 to prevent circular convolution errors. A large NFFTsubscript𝑁FFTN_{\mathrm{FFT}}italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT ensures that ΔωΔ𝜔\Delta\omegaroman_Δ italic_ω is sufficiently small to resolve the sharp spectral peaks and avoid aliasing errors.

During the experiment, the energy resolution is fundamentally limited by the maximum acquisition time Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, as shown in Eq. (6). However, in the simulation, ΔωPlanck-constant-over-2-piΔ𝜔\hbar\Delta\omegaroman_ℏ roman_Δ italic_ω can be improved indefinitely by choosing larger values of NFFTsubscript𝑁FFTN_{\mathrm{FFT}}italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT. For Δt=0.5Δ𝑡0.5\Delta t=0.5roman_Δ italic_t = 0.5 ns, the probe and object spectra are defined in a NFFT=4096subscript𝑁FFT4096N_{\mathrm{FFT}}=4096italic_N start_POSTSUBSCRIPT roman_FFT end_POSTSUBSCRIPT = 4096 point energy grid from 886.6886.6-886.6- 886.6 ΓΓ\Gammaroman_Γ to 886.2886.2886.2886.2 ΓΓ\Gammaroman_Γ in 0.40.40.40.4 ΓΓ\Gammaroman_Γ steps, where ΓΓ\Gammaroman_Γ = 4.74.74.74.7 neV. The noiseless ptychogram was simulated by detuning the probe spectrum at M=512𝑀512M=512italic_M = 512 different Doppler shifted energies D(200,200)Planck-constant-over-2-pi𝐷200200\hbar D\in(-200,200)roman_ℏ italic_D ∈ ( - 200 , 200 ) ΓΓ\Gammaroman_Γ with 0.780.780.780.78 ΓΓ\Gammaroman_Γ steps. Due to the broad probe energy spectrum, this creates an overlap of 90%similar-toabsentpercent90\sim 90\%∼ 90 % between consecutive measurements.

To evaluate the performance of the phase retrieval algorithm as Poisson noise levels increase, we simulated ptychograms by varying the total delayed photon counts Nphsubscript𝑁phN_{\mathrm{ph}}italic_N start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT and perform the reconstruction (see Supplement 1: Sec. S5.A). We found a roughly linear dependence of the reconstruction accuracy on Nphsubscript𝑁phN_{\mathrm{ph}}italic_N start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT, without any anomalies. Thus, the algorithm is stable with respect to increasing levels of Poisson noise.

To investigate the impact of the time window, the number of photons Nphsubscript𝑁phN_{\mathrm{ph}}italic_N start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT was fixed at 109superscript10910^{9}10 start_POSTSUPERSCRIPT 9 end_POSTSUPERSCRIPT for the next set of tests, whereas only the maximum acquisition time at the detector, Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, was varied (see Supplement 1: Sec. S5.B). The energy discretization of the FFT grid was kept constant at ω=0.4Planck-constant-over-2-pi𝜔0.4\hbar\omega=0.4roman_ℏ italic_ω = 0.4 ΓΓ\Gammaroman_Γ, and the time-domain calculations were performed with zero-padding. As shown in Fig. 2(d) and 2(e), the reconstructed spectra for Tmax=200subscript𝑇max200T_{\mathrm{max}}=200italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 200 ns (orange) and Tmax=1000subscript𝑇max1000T_{\mathrm{max}}=1000italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 1000 ns (green) both show six inverted peaks at the same positions as the simulated spectrum (dotted black line). The X-ray scattering probability depends on the angle between the nuclear magnetic field and X-ray polarization. The higher intensity of the outermost peaks indicates that most of the magnetic moments were aligned parallel to the polarization direction. The outermost peak separation ΔEΔ𝐸\Delta Eroman_Δ italic_E can be used to calculate the magnetic hyperfine field

Bhf=ΔEμN(3|ge|+|gg|),subscript𝐵hfΔ𝐸subscript𝜇N3subscript𝑔esubscript𝑔gB_{\mathrm{hf}}=\dfrac{\Delta E}{\mu_{\mathrm{N}}\cdot\left(3|g_{\mathrm{e}}|+% |g_{\mathrm{g}}|\right)},italic_B start_POSTSUBSCRIPT roman_hf end_POSTSUBSCRIPT = divide start_ARG roman_Δ italic_E end_ARG start_ARG italic_μ start_POSTSUBSCRIPT roman_N end_POSTSUBSCRIPT ⋅ ( 3 | italic_g start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT | + | italic_g start_POSTSUBSCRIPT roman_g end_POSTSUBSCRIPT | ) end_ARG , (12)

where gg=0.18121subscript𝑔g0.18121g_{\mathrm{g}}=0.18121italic_g start_POSTSUBSCRIPT roman_g end_POSTSUBSCRIPT = 0.18121 and ge=0.10348subscript𝑔e0.10348g_{\mathrm{e}}=-0.10348italic_g start_POSTSUBSCRIPT roman_e end_POSTSUBSCRIPT = - 0.10348 are the nuclear g𝑔gitalic_g-factors for the ground and excited states of Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe, and μNsubscript𝜇N\mu_{\mathrm{N}}italic_μ start_POSTSUBSCRIPT roman_N end_POSTSUBSCRIPT is the nuclear magneton (5.05×1027J/Tabsent5.05superscript1027J/T\approx 5.05\times 10^{-27}~{}\text{J/T}≈ 5.05 × 10 start_POSTSUPERSCRIPT - 27 end_POSTSUPERSCRIPT J/T). The resulting Bhfsubscript𝐵hfB_{\mathrm{hf}}italic_B start_POSTSUBSCRIPT roman_hf end_POSTSUBSCRIPT values are 32.73(1) T and 32.72(3) T for the green and orange curves, respectively. For Tmax=200subscript𝑇max200T_{\mathrm{max}}=200italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 200 ns, which is close to the experimental condition of the bunch spacing (= 192 ns), the short time window causes spectral leakage due to sinc interpolation artifacts in the reconstruction. This occurs because zero-padding in the time domain is equivalent to applying a rectangular time window, whose Fourier transform is a Dirichlet kernel. To suppress these artifacts, the measurement time window should extend beyond four nuclear lifetimes between pulses. Additionally, the shortened time window affects both the relative phase shifts and the peak intensities of the resonance spectrum.

5 Results and discussion

Refer to caption
Figure 3: Phase retrieval from experiment: (a) Ptychogram measured in the PETRA III experiment. The dotted white line marks τ=141𝜏141\tau=141italic_τ = 141 ns which is the lifetime of the 14.4 keV energy level of the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nucleus. (b) Magnitude and (c) phase of the reconstructed object spectra for |Dmax|=70Planck-constant-over-2-pisubscript𝐷max70|\hbar D_{\mathrm{max}}|=70| roman_ℏ italic_D start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT | = 70 ΓΓ\Gammaroman_Γ (in green) and |Dmax|=210Planck-constant-over-2-pisubscript𝐷max210|\hbar D_{\mathrm{max}}|=210| roman_ℏ italic_D start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT | = 210 ΓΓ\Gammaroman_Γ (in orange) shown alongside the simulated object spectrum 𝑶^Hsuperscriptsubscriptbold-^𝑶𝐻\boldsymbol{\hat{O}}_{H}^{*}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUBSCRIPT italic_H end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT (dotted black line). (d) Intensity spectrum of the reconstructed objects plotted alongside the measured synchrotron Mössbauer spectrum of the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foil used in the experiment. All spectra are normalized from 0 to 1. (e) Time response of the reconstructed objects plotted alongside the measured nuclear forward scattering from the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foil. The gray shaded region lies outside the data acquisition time window of 17 to 178 ns.

We conducted a proof-of-principle experiment at the high-resolution dynamics beamline P01 at the PETRA III synchrotron source, providing X-ray pulses at 192 ns intervals in the timing mode of operation. X-rays were monochromatized to one meV bandwidth at the 14.4 keV Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nuclear transition. The probe and object foils were characterized using NFS measurements. The probe is given by a stainless steel foil, enriched to 95%percent9595\%95 % in Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe, with a Lamb-Mössbauer factor of 0.78. The thickness of the foil approximately follows a normal distribution, centered at 17.8 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m with a FWHM of 0.7 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m. The object under study is an iron metal foil, enriched to 95%percent9595\%95 % in Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe, with a Lamb–Mössbauer factor of 0.80 and a mean thickness of 2.4 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m (FWHM 0.3 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m).

The object foil was mounted on a Doppler drive and moved relative to the probe foil with a sinusoidally changing velocity profile. The drive velocity was tuned to a maximum of 20.720.720.720.7 mm s1superscripts1\mathrm{s}^{-1}roman_s start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT, to ensure Doppler detunings in the range D(210,210)Planck-constant-over-2-pi𝐷210210\hbar D\in(-210,210)roman_ℏ italic_D ∈ ( - 210 , 210 ) ΓΓ\Gammaroman_Γ. A 0.12 T magnetic field (Bσconditional𝐵𝜎\vec{B}\parallel\vec{\sigma}over→ start_ARG italic_B end_ARG ∥ over→ start_ARG italic_σ end_ARG, beam polarization) was applied to the object. Photons were detected using silicon-based avalanche photodiodes with a time resolution of 0.3similar-toabsent0.3\sim 0.3∼ 0.3 ns and binned into time channels such that Δt=0.5Δ𝑡0.5\Delta t=0.5roman_Δ italic_t = 0.5 ns. Their arrival times was recorded together with the Doppler velocity at the moment of detection using a multichannel data acquisition system. More details on the samples and setup are available in Supplement 1: Sec. S1-S2.

Phase information was captured in the ptychogram (Fig. 3(a)), with time and Doppler detuning as its axes. The measured data closely resemble the simulated ptychogram (Fig. 2(a)), except for the experimental data acquisition window from Tmin=17subscript𝑇min17T_{\mathrm{min}}=17italic_T start_POSTSUBSCRIPT roman_min end_POSTSUBSCRIPT = 17 ns to Tmax=178subscript𝑇max178T_{\mathrm{max}}=178italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 178 ns. This is due to the vetoing of the electronic scattering signal as described in Sec. 3. The results of the ptychographic reconstruction using the experimental measurements are also shown in Fig. 3. According to our simulations, the majority of the incident photons undergo prompt electronic scattering within the first few picoseconds. Only a small fraction, fph0.019subscript𝑓ph0.019f_{\mathrm{ph}}\approx 0.019italic_f start_POSTSUBSCRIPT roman_ph end_POSTSUBSCRIPT ≈ 0.019, is scattered within the delayed time window, resulting in the detection of approximately 2×1082superscript1082\times 10^{8}2 × 10 start_POSTSUPERSCRIPT 8 end_POSTSUPERSCRIPT total delayed photons. While reconstructing the object, the algorithm can reasonably extrapolate the missing intensities between 0 and 17 ns by taking advantage of the oversampled measurements. This is also performed in conventional two-dimensional ptychographic imaging in the presence of a beam stop [85, 86]. However, there is no information in the ptychogram for times beyond Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, where extrapolation obviously does not work. For a maximum acquisition time Tmax=178subscript𝑇max178T_{\mathrm{max}}=178italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 178 ns at the detector, the energies of the nuclear transitions are convolved with a sinc function with a main lobe width of 2Δω9.32Planck-constant-over-2-piΔsuperscript𝜔9.32\hbar\Delta\omega^{\prime}\approx 9.32 roman_ℏ roman_Δ italic_ω start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ≈ 9.3 ΓΓ\Gammaroman_Γ, which is roughly 23 times larger than ΔωPlanck-constant-over-2-piΔ𝜔\hbar\Delta\omegaroman_ℏ roman_Δ italic_ω. To evaluate the quality of the reconstruction despite the finite Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, we define a filtering window 𝑯𝑯\boldsymbol{H}bold_italic_H which is a discretized Heaviside step function:

𝑯(ti)={1tiTmax,0otherwise.𝑯subscript𝑡𝑖cases1subscript𝑡𝑖subscript𝑇max0otherwise\boldsymbol{H}(t_{i})=\begin{cases}1&t_{i}\leq T_{\mathrm{max}},\\ 0&\text{otherwise}.\end{cases}bold_italic_H ( italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) = { start_ROW start_CELL 1 end_CELL start_CELL italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ≤ italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL otherwise . end_CELL end_ROW (13)

Applying this filter to the simulated complex transmission spectrum of the object 𝑶^superscriptbold-^𝑶\boldsymbol{\hat{O}}^{*}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT (from Sec. 4) yields

𝑶^H=𝐅1{𝑯 𝐅{𝑶^}},subscriptsuperscriptbold-^𝑶𝐻superscript𝐅1𝑯 𝐅superscriptbold-^𝑶\boldsymbol{\hat{O}}^{*}_{H}=\mathbf{F}^{-1}\{\boldsymbol{H}~{}\raisebox{1.0pt% }{ \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1% .40001pt\lower-1.40001pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }% \definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}% \pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}\pgfsys@beginscope% \pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ }{}\pgfsys@moveto{% 1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}% \pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt}{0.0pt}% \pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\mathbf{F}\{\boldsymbol{\hat{O}}^{*}\}\},overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_H end_POSTSUBSCRIPT = bold_F start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT { bold_italic_H bold_F { overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT } } , (14)

where 𝐅𝐅\mathbf{F}bold_F is the FFT. The resulting transmission spectrum, 𝑶^Hsubscriptsuperscriptbold-^𝑶𝐻\boldsymbol{\hat{O}}^{*}_{H}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_H end_POSTSUBSCRIPT, accounts for sinc artifacts similar to those caused by the experimental measurement window. In Fig. 3 (b) and 3(c), the reconstructed object is compared with this filtered object.

The reconstruction of the complex transmission spectrum from the full data range D(210,210)Planck-constant-over-2-pi𝐷210210\hbar D\in(-210,210)roman_ℏ italic_D ∈ ( - 210 , 210 )ΓΓ~{}\Gammaroman_Γ (orange) deviates from the true object, while the limited range D(70,70)Planck-constant-over-2-pi𝐷7070\hbar D\in(-70,70)roman_ℏ italic_D ∈ ( - 70 , 70 )ΓΓ~{}\Gammaroman_Γ (green) achieves a closer match. We attribute this behavior to the coupling between the resonance peaks of the probe and the object in this regime (see Supplement 1: Sec. S5.C). This contrasts to the interference signal used in other techniques [47, 48] where the probe and object spectra are so detuned that the scattered field at the detector can be approximated as Z(D,t)={Z^(D,ω)}P(D,t)+O(t)𝑍𝐷𝑡^𝑍𝐷𝜔𝑃𝐷𝑡𝑂𝑡Z(D,t)=\mathcal{F}\{\hat{Z}(D,\omega)\}\approx P(D,t)+O(t)italic_Z ( italic_D , italic_t ) = caligraphic_F { over^ start_ARG italic_Z end_ARG ( italic_D , italic_ω ) } ≈ italic_P ( italic_D , italic_t ) + italic_O ( italic_t ), where P(D,t)𝑃𝐷𝑡P(D,t)italic_P ( italic_D , italic_t ) and O(t)𝑂𝑡O(t)italic_O ( italic_t ) are their respective temporal responses. The coupling signal has a higher information density and is less susceptible to background noise, velocity drive calibration errors and incoherent contributions to the data due to the thickness variations in the samples.

The reconstructed phase enables the calculation of an energy-domain spectrum for the object which can then be compared to its measured synchrotron Mössbauer source (SMS) spectrum. The positions of the four most prominent Lorentzian lines in Fig. 3(d) are fitted using a least squares fitting algorithm and are listed in Table 1. The four peak positions extracted from the reconstructed object in green match the SMS spectrum up to ±plus-or-minus\pm± 0.2 ΓΓ\Gammaroman_Γ, which is comparable to the resolution of the calculation grid (0.4 ΓΓ\Gammaroman_Γ). According to Eq. (12), the magnetic hyperfine field extracted from the reconstructed outer peak positions is 32.62(8) T, compared to 32.73(4) T from the SMS spectrum. To calculate the preferential orientation of the magnetic domains in the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foil, other peak properties, such as their relative heights and symmetry, are needed. Our reconstructed transmission spectrum reveals the presence of a dominant magnetic moment component parallel to the X-ray polarization direction. In Fig. 3(d), two additional small resonance peaks appear in the SMS spectrum at roughly ±plus-or-minus\pm± 31.5 ΓΓ\Gammaroman_Γ, due to a minor isotropic nuclear spin component of Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe (5.8(3)%absent5.8percent3\approx 5.8(3)\%≈ 5.8 ( 3 ) % from nuclear forward scattering measurement). Although these smaller peaks cannot be distinguished clearly from the artificial peaks in the reconstructed spectrum, presence of their subtle signatures indicates that nuclear ptychography is already approaching the sensitivity required to detect such fine features, implying a strong potential for further improvements in reconstruction accuracy with longer measurement time windows.

In Fig. 3(e), the time domain response of the reconstructed object shows that the algorithm accurately reconstructs the measured intensities, except for times between 120 and 140 ns. In this region, "bunch addition" incoherence in the experimental data is strong due to the finite time gap of 192 ns between the incident X-ray pulses (see Supplement 1: Sec. S3.B). The detector cannot distinguish between photons arriving at t>192𝑡192t>192italic_t > 192 ns after the incidence of the current pulse and those arriving from the next pulse at t192𝑡192t-192italic_t - 192 ns, causing systematic errors in the measured data. This incoherent contribution to the data cannot be taken into account by the ptychography algorithm while solving the phase problem and therefore affects the reconstruction.

Table 1: Positions of the peaks marked in Fig. 3(d).
Peak A B C D
SMS spectrum -54.21(2) ΓΓ\Gammaroman_Γ -8.64(3) ΓΓ\Gammaroman_Γ 8.51(3) ΓΓ\Gammaroman_Γ 54.4(1) ΓΓ\Gammaroman_Γ
Reconstruction (green) -54.06(3) ΓΓ\Gammaroman_Γ -8.54(4) ΓΓ\Gammaroman_Γ 8.59(3) ΓΓ\Gammaroman_Γ 54.2(3) ΓΓ\Gammaroman_Γ

The transverse coherence length of the setup is only a few nanometers (see Supplement 1: Sec. S3.A). The NFS fit on the stainless steel probe foil predicts a root-mean-square surface thickness variation of approximately 0.70.70.70.7 μm𝜇m{\mu}\mathrm{m}italic_μ roman_m. Therefore, to reconstruct the object spectrum, the multimodal ptychography model was used, where the complex transmission spectrum of the probe sample was simulated at eleven distinct points sampled from its thickness distribution.

The starting object guess was taken as cells with entry ’one’. As shown in Fig. 4, the algorithm converges to a solution in approximately 100 iterations. The first 50 iterations use stochastic gradient descent with a batch size of B=20𝐵20B=20italic_B = 20, leading to rapid improvement within the initial 10 iterations, followed by stagnation to a local minimum. Due to stochastic noise, the gradient no longer decreases significantly. To refine the solution, the remaining 50 iterations employ standard gradient descent (B=M𝐵𝑀B=Mitalic_B = italic_M), reducing stochastic noise and enabling further optimization.

Refer to caption
Figure 4: Convergence of the phase retrieval algorithm: Reconstruction cost ρ~~𝜌\tilde{\rho}over~ start_ARG italic_ρ end_ARG (solid line) and the norm of its gradient ρ~norm~𝜌\|\nabla\tilde{\rho}\|∥ ∇ over~ start_ARG italic_ρ end_ARG ∥ (dashed line) as the iterations increase. The algorithm converges to a solution in 100 iterations for the reconstruction from experimental data with |Dmax|=70Planck-constant-over-2-pisubscript𝐷max70|\hbar D_{\mathrm{max}}|=70| roman_ℏ italic_D start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT | = 70 ΓΓ\Gammaroman_Γ (shown in green in Fig. 3(b)-(e)).

6 Conclusion and outlook

We have demonstrated that ptychography provides a powerful framework to solve a one-dimensional phase problem and mitigate its instabilities by redundantly capturing overlapping information in a two-dimensional dataset. We used the method to reconstruct the energy resolved complex spectrum of a magnetized Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foil and calculate its hyperfine parameters. The retrieved values are in good agreement with the results predicted by the established measurement techniques of Synchrotron Mössbauer source (SMS) spectroscopy and nuclear forward scattering.

Our analysis shows that the energy resolution of nuclear ptychography is fundamentally related to the length of the temporal detection window. Quantum beats between closely spaced nuclear energy levels, split by less than 1Γ1Γ1~{}\Gamma1 roman_Γ, interfere on timescales longer than τ=/Γ𝜏Planck-constant-over-2-piΓ\tau={\hbar}/{\Gamma}italic_τ = roman_ℏ / roman_Γ, the natural lifetime of the Mössbauer nucleus. For detection windows extending beyond Tmax>2π/Γsubscript𝑇max2𝜋Planck-constant-over-2-piΓT_{\mathrm{max}}>2\pi\hbar/\Gammaitalic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT > 2 italic_π roman_ℏ / roman_Γ, energy resolution of sub-1 ΓΓ\Gammaroman_Γ becomes achievable (see Eq. (6)). Our method can thus surpass the limits set by the linewidth of the lab source of the gamma ray or the SMS crystal. However, to realize this improved resolution, increased pulse spacing between X-ray bunches is required. This, in turn, demands low bunch synchrotron timing modes which reduce the overall beam current and brightness. In our experiments, the 192 ns X-ray pulse spacing - although adequate - was not very long compared to the lifetime of Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe, resulting in reconstruction artifacts. Other Mössbauer isotopes, such as Sn119superscriptSn119{}^{119}\mathrm{Sn}start_FLOATSUPERSCRIPT 119 end_FLOATSUPERSCRIPT roman_Sn and Eu151superscriptEu151{}^{151}\mathrm{Eu}start_FLOATSUPERSCRIPT 151 end_FLOATSUPERSCRIPT roman_Eu, have significantly shorter lifetimes and would benefit from the high resolution offered by nuclear ptychography, especially since no suitable SMS is available for them. The synchrotron timing mode can be optimized to balance the X-ray brilliance and pulse intervals and enable the measurement of delayed responses over multiple lifetimes of these Mössbauer nuclei.

In conclusion, we have shown that one-dimensional nuclear ptychography provides a robust and versatile tool for exploring complex nuclear resonant phenomena. We can retrieve the spectral phase of the nuclear resonant scattering, which provides direct insight into how an X-ray pulse is reshaped in time as it passes through the nuclear system. This phase information is essential for understanding and engineering coherent phenomena such as electromagnetically induced transparency-like behavior in multilayered X-ray cavities with Mössbauer nuclei [54, 87], where sharp energy-dependent phase shifts from multiple scattering modulate the effective driving field on the nuclei. Beyond solving the phase problem, nuclear ptychography can enable sub-linewidth energy resolution and spectroscopic investigation of Mössbauer isotopes at synchrotrons, offering a pathway to resolve elusive features in nuclear spectra, such as the debated existence of magnetic order in hcp-iron [88, 89]. Our results pave the way for advanced implementations of this method in grazing-incidence and polarization-resolved geometries, enabling the study of nanostructured and anisotropic systems. The extension of the technique to X-ray free electron lasers offers exciting opportunities to study non-linear effects on the phase of the scattering. Together, these capabilities represent a significant step towards a new era in nuclear quantum optics.

Supplement 1: Energy-Time Ptychography for one-dimensional Phase Retrieval

1 Characterization of the Samples

To benchmark the ptychography algorithm and perform phase retrieval, the complex energy response of the probe and the object foils is required. Therefore, we characterize both samples mentioned in the main text to extract their structural and hyperfine parameters.

A. Stainless Steel Foil

The time response of the stainless steel foil was measured at PETRA III, P01. It was fitted using differential evolution [90] followed by Levenberg-Marquardt algorithm in NEXUS [44], with a correction for bunch spacing (192 ns). The foil has a Lamb-Mössbauer factor of 0.78 and a density of 7.80 g cm3superscriptcm3\text{cm}^{-3}cm start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT. In the austenitic phase, stainless steel does not exhibit ferromagnetic order, and the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nuclei exhibit a single-line resonance at 14.4 keV with no Zeeman splitting.

The time response, shown in Fig. S1(a), exhibits clear dynamical beats with minima around 45, 95, and 155 ns. Several models were tested to explain the line broadening in the energy response of the foil. A model assuming purely coherent broadening due to an isomer shift distribution fails to reproduce the minima in the time response at longer times. A model based only on incoherent broadening caused by foil thickness variation provides a better fit in the intermediate time range but deviates after 125 ns. The best-fitting model includes a combination of both broadening mechanisms: coherent broadening from a distribution of local isomer shifts (due to variations in the electronic environment of the nuclei) and incoherent broadening from thickness inhomogeneity.

The thickness variation is modeled as a Gaussian distribution centered at 17.83(1) μ𝜇\muitalic_μm with a full width at half maximum (FWHM) of 0.78(4) μ𝜇\muitalic_μm. This variation is consistent with measurements from atomic force microscopy, which show surface height variations between 0.75 and 1.20 μ𝜇\muitalic_μm across different regions of the foil surface, as shown in Fig. S1(b). The parameters corresponding to the best fit (shown in red in the figure) are summarized in Table S1. The resulting complex transmission function, simulated using these fitted parameters, is shown in Fig. 5 in the main text.

Refer to caption
Figure S1: Characterization of the stainless steel foil: (a) Measured time response (black) of the foil between 17 and 178 ns, shown alongside three fits. The green curve assumes only isomer shift variation, the orange curve assumes only thickness variation, and the red curve represents the best fit using a mixture of both mechanisms. (b) Atomic force micrograph showing topographic variation of the foil surface over an area comparable to the beam spot. Similar micrographs were taken over different spots on both sides of the foil, roughly at its center.
Table S1: Fitted parameters of the time response of the thick SS57superscriptSS57{}^{57}\text{SS}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT SS foil.
Parameter Fit Result
Thickness 17.83(1) μ𝜇\muitalic_μm
FWHM Thickness 0.78(4) μ𝜇\muitalic_μm
FWHM Isomer Shift 0.23(1) mm s1superscripts1\mathrm{s}^{-1}roman_s start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT

B. Iron Foil

The iron foil is 95% enriched with the resonant Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe isotope and was subjected to a 0.12 T magnetic field along the electric vector of the polarization of the synchrotron beam during measurements. To characterize the hyperfine parameters, we measured the time response of nuclear forward scattering at PETRA III, P01 and the synchrotron Mössbauer spectrum at at the beamline ID14 (formerly ID18) at ESRF, Grenoble, France. They were fitted simultaneously using a differential evolution and Levenberg Marquardt algorithm in NEXUS. The foil’s Lamb-Mössbauer factor and density are taken as 0.80 and 7.87 g cm3superscriptcm3\text{cm}^{-3}cm start_POSTSUPERSCRIPT - 3 end_POSTSUPERSCRIPT, respectively. We model the foil with two hyperfine sites: site 1 is magnetized along the beam polarization, while site 2 has no preferred magnetic orientation. Line broadening is modeled with a distribution in the thickness of the foil. The best fit (indicated in blue color in Fig. S2) was obtained after correcting for bunch spacing (192 ns) from the synchrotron source (See Sec. 3.B). The fit gives a thickness variation in the foil with mean 2.47(1) μ𝜇\muitalic_μm and FWHM 0.52(6) μ𝜇\muitalic_μm, with 94.2(3)% of Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nuclei magnetized along the direction of the external magnetic field. The remaining percentage is attributed to misaligned magnetic domains in the foil, possibly due to inhomogeneities or internal strain. The hyperfine magnetic field at both sites is approximately 32.7 T. The list of fit parameters is given in Table S2.

Refer to caption
Figure S2: Characterization of the iron foil: (a) Measured time response (black points) vs. fitted models with (blue line) and without (green line) bunch spacing correction. (b) Measured synchrotron Mössbauer spectrum of the foil (black points) plotted against the fitted model (blue line).
Table S2: Fit parameters of the time response of the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foil, shown in Fig. S2.
Parameter Fit Result
Thickness 2.47(1) μ𝜇\muitalic_μm
FWHM Thickness 0.52(6) μ𝜇\muitalic_μm
Site 1: Weight 94.2(3) %
Site 1: Magnetic Field 32.68(1) T
Site 2: Weight 5.8(3) %
Site 2: Magnetic Field 32.7(1) T

2 Details of the experiment

The experiment was conducted at beamline P01, PETRA III, using the setup shown in Fig. S3. The synchrotron storage ring was operating in the 40-bunch mode with X-ray pulses spaced by 192 ns (pulse duration  100 ps, repetition rate 5.205 MHz). The X-rays were monochromatized to a bandwidth of  1 meV around the 14.41 keV nuclear transition of Fe57superscriptFe57{}^{57}\text{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT Fe using a silicon double-crystal monochromator (DCM) and a silicon high-resolution monochromator (HRM). The beam cross section on the samples was 18 μ𝜇\muitalic_μm ×\times× 50 μ𝜇\muitalic_μm. Detection was performed using a silicon-based avalanche photodiode (APD) array with dark count rates in the tens of mHz, ensuring photon detection dominated by Poisson noise from the X-rays. Each APD is sized  1 cm × 1 cm and can handle photon fluxes up to 107ph/ssuperscript107ph/s10^{7}\,\text{ph/s}10 start_POSTSUPERSCRIPT 7 end_POSTSUPERSCRIPT ph/s, with photon-absorbing foils used for protection at higher flux levels.

The object foil, mounted on a Doppler drive (Wissel MVT-1000), was sinusoidally moved using a driving unit (MR-360). The frequency of the drive was tuned to 27similar-toabsent27\sim 27∼ 27 Hz, which is close to its natural resonance frequency (25similar-toabsent25\sim 25∼ 25 Hz), with minimal velocity error (0.1%0.5%)percent0.1percent0.5(0.1\%-0.5\%)( 0.1 % - 0.5 % ). This is equivalent to taking "fly scans" [91] in ptychographic imaging. The drive achieved a maximum velocity of  20.7 mm/s, resulting in a Doppler detuning range D(210,210)ΓPlanck-constant-over-2-pi𝐷210210Γ\hbar D\in(-210,210)\,\Gammaroman_ℏ italic_D ∈ ( - 210 , 210 ) roman_Γ and maintaining >90%absentpercent90>90\%> 90 % measurement overlap to ensure algorithmic convergence. A digital function generator (DFG-1000) controlled the drive signal. An external magnetic field (|B|=0.12T𝐵0.12T|\vec{B}|=0.12\,\text{T}| over→ start_ARG italic_B end_ARG | = 0.12 T) was applied to the object parallel to the electric vector of the beam’s polarization (Bσconditional𝐵𝜎\vec{B}\parallel\vec{\sigma}over→ start_ARG italic_B end_ARG ∥ over→ start_ARG italic_σ end_ARG).

Photon detection was synchronized via a multi-event digitizer (FAST ComTec MCS6A), which recorded not only the photon arrival times from the APDs, but also the drive velocity from the function generator sampled into 1024 equidistant channels. The MCS6A labels photons with their times of arrival and velocity channel numbers. The data is then histogrammed into a two-dimensional ptychogram. The MCS6A time resolution is 0.1 ns, but the counts were binned into channels separated by 0.5 ns.

Refer to caption
Figure S3: The ptychogram measurement setup at P01, PETRA III: X-rays from the synchrotron are monochromatized around the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe nuclear resonance by the double crystal monochromator (DCM) and high resolution monochromator (HRM). The object is mounted on a Doppler drive and moved along the direction of the probing beam by the driving unit. A digital function generator is used to give a sinusoidal velocity profile to the drive. The MCS6A collects the photon counts with their time of arrival at the APDs and the instantaneous velocity of the drive.

To retrieve the phase from the ptychograms, we need the probe detunings relative to the object, which is given by the Doppler drive velocities. Before the experiment, the drive velocity at each MCS6A channel is calibrated using a known probe and object. The detuning for the j𝑗jitalic_j-th channel is given by:

Dj=ω0cΓ(vmaxcos(2πjj01024)+viso),subscript𝐷𝑗subscript𝜔0𝑐Γsubscript𝑣max2𝜋𝑗subscript𝑗01024subscript𝑣isoD_{j}=\frac{\omega_{0}}{c\Gamma}\left(v_{\text{max}}\cdot\cos\left(2\pi\cdot% \frac{j-j_{0}}{1024}\right)+v_{\text{iso}}\right),italic_D start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = divide start_ARG italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG italic_c roman_Γ end_ARG ( italic_v start_POSTSUBSCRIPT max end_POSTSUBSCRIPT ⋅ roman_cos ( 2 italic_π ⋅ divide start_ARG italic_j - italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG 1024 end_ARG ) + italic_v start_POSTSUBSCRIPT iso end_POSTSUBSCRIPT ) ,

where ω0=14.41keVPlanck-constant-over-2-pisubscript𝜔014.41keV\hbar\omega_{0}=14.41\,\text{keV}roman_ℏ italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = 14.41 keV and Γ=4.66neVΓ4.66neV\Gamma=4.66\,\text{neV}roman_Γ = 4.66 neV for Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe, vmaxsubscript𝑣maxv_{\text{max}}italic_v start_POSTSUBSCRIPT max end_POSTSUBSCRIPT is the maximum velocity, and j0subscript𝑗0j_{0}italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT corresponds to the channel with maximum velocity. We have also included a term visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT to capture the isomer shift between the two samples. The calibration is done by simulating the ptychogram using the detunings with Poisson sampling such that we get the same number of total counts as the experiment. The velocity parameters are then fitted via least squares. The process is outlined in Algorithm 1, where the simulated photon counts are compared to the measured counts. The algorithm starts with initial guesses for vmaxsubscript𝑣maxv_{\text{max}}italic_v start_POSTSUBSCRIPT max end_POSTSUBSCRIPT and visosubscript𝑣isov_{\text{iso}}italic_v start_POSTSUBSCRIPT iso end_POSTSUBSCRIPT, and iterates until the best-fit values are obtained. To start the algorithm, we initialized (vmax,viso,j0)subscript𝑣maxsubscript𝑣isosubscript𝑗0(v_{\mathrm{max}},v_{\mathrm{iso}},j_{0})( italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT , italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT )= (25 mm s-1, 0 mm s-1, 1). Using the parameters of the pre-characterized stainless steel and Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe foils for simulations, we find vmax=20.70(3)mm s-1subscript𝑣max20.703mm s-1v_{\text{max}}=20.70(3)\,\text{mm s${}^{-1}$}italic_v start_POSTSUBSCRIPT max end_POSTSUBSCRIPT = 20.70 ( 3 ) mm s and viso=0.10(1)mm s-1subscript𝑣iso0.101mm s-1v_{\text{iso}}=-0.10(1)\,\text{mm s${}^{-1}$}italic_v start_POSTSUBSCRIPT iso end_POSTSUBSCRIPT = - 0.10 ( 1 ) mm s.

Algorithm 1 Velocity Calibration
1:Input: Photon counts {c0,c1,,cM1}subscript𝑐0subscript𝑐1subscript𝑐𝑀1\{c_{0},c_{1},\dots,c_{M-1}\}{ italic_c start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_c start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT }, energy domain responses 𝑶^superscriptbold-^𝑶\boldsymbol{\hat{O}}^{*}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT, 𝑷^superscriptbold-^𝑷\boldsymbol{\hat{P}}^{*}overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT, initial guesses for maximum velocity vmaxsubscript𝑣maxv_{\mathrm{max}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, isomer shift visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT, and channel j0subscript𝑗0j_{0}italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT
2:Output: Calibrated vmaxsubscript𝑣maxv_{\mathrm{max}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT
3:Step 1: Calculate detunings D0,D1,,DM1subscript𝐷0subscript𝐷1subscript𝐷𝑀1D_{0},D_{1},\dots,D_{M-1}italic_D start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_D start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_D start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT using current guesses for vmaxsubscript𝑣maxv_{\mathrm{max}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT, and j0subscript𝑗0j_{0}italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT:
4:          D0,D1,,DM1CALC_DETUNINGS(vmax,viso,j0)subscript𝐷0subscript𝐷1subscript𝐷𝑀1CALC_DETUNINGSsubscript𝑣maxsubscript𝑣isosubscript𝑗0D_{0},D_{1},\dots,D_{M-1}\leftarrow\mathrm{CALC\_DETUNINGS}(v_{\mathrm{max}},v% _{\mathrm{iso}},j_{0})italic_D start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_D start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_D start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT ← roman_CALC _ roman_DETUNINGS ( italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT , italic_j start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT )
5:Step 2: Simulate the ptychogram using the calculated detunings and object/probe responses:
6:          {𝒃0,𝒃1,,𝒃M1}SIM_HISTOGRAM(𝑶^,𝑷^,D0,D1,,DM1)subscriptsuperscript𝒃0subscriptsuperscript𝒃1subscriptsuperscript𝒃𝑀1SIM_HISTOGRAMsuperscriptbold-^𝑶superscriptbold-^𝑷subscript𝐷0subscript𝐷1subscript𝐷𝑀1\{\boldsymbol{b}^{\prime}_{0},\boldsymbol{b}^{\prime}_{1},\dots,\boldsymbol{b}% ^{\prime}_{M-1}\}\leftarrow\mathrm{SIM\_HISTOGRAM}(\boldsymbol{\hat{O}}^{*},% \boldsymbol{\hat{P}}^{*},D_{0},D_{1},\dots,D_{M-1}){ bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT } ← roman_SIM _ roman_HISTOGRAM ( overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT , overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT , italic_D start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_D start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_D start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT )
7:Step 3: Calculate the photon counts from the simulated ptychogram:
8:          c0,c1,,cM1q𝒃0,q𝒃1,,q𝒃M1formulae-sequencesubscriptsuperscript𝑐0subscriptsuperscript𝑐1subscriptsuperscript𝑐𝑀1subscript𝑞subscriptsuperscript𝒃0subscript𝑞subscriptsuperscript𝒃1subscript𝑞subscriptsuperscript𝒃𝑀1c^{\prime}_{0},c^{\prime}_{1},\dots,c^{\prime}_{M-1}\leftarrow\sum_{q}% \boldsymbol{b}^{\prime}_{0},\sum_{q}\boldsymbol{b}^{\prime}_{1},\dots,\sum_{q}% \boldsymbol{b}^{\prime}_{M-1}italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT ← ∑ start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , ∑ start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , ∑ start_POSTSUBSCRIPT italic_q end_POSTSUBSCRIPT bold_italic_b start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT
9:Step 4: Perform least squares fitting to update vmaxsubscript𝑣maxv_{\mathrm{max}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT and visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT:
10:          (vmax,viso)LSQFIT({c0,c1,,cM1},{c0,c1,,cM1},vmax,viso)subscriptsuperscript𝑣maxsubscriptsuperscript𝑣isoLSQFITsubscript𝑐0subscript𝑐1subscript𝑐𝑀1subscriptsuperscript𝑐0subscriptsuperscript𝑐1subscriptsuperscript𝑐𝑀1subscript𝑣maxsubscript𝑣iso(v^{\prime}_{\mathrm{max}},v^{\prime}_{\mathrm{iso}})\leftarrow\mathrm{LSQFIT}% (\{c_{0},c_{1},\dots,c_{M-1}\},\{c^{\prime}_{0},c^{\prime}_{1},\dots,c^{\prime% }_{M-1}\},v_{\mathrm{max}},v_{\mathrm{iso}})( italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT ) ← roman_LSQFIT ( { italic_c start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_c start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_c start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT } , { italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_c start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_M - 1 end_POSTSUBSCRIPT } , italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT )
11:Step 5: Update the velocity parameters:
12:          vmaxvmax,visovisoformulae-sequencesubscript𝑣maxsubscriptsuperscript𝑣maxsubscript𝑣isosubscriptsuperscript𝑣isov_{\mathrm{max}}\leftarrow v^{\prime}_{\mathrm{max}},v_{\mathrm{iso}}% \leftarrow v^{\prime}_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT ← italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT , italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT ← italic_v start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT
13:Step 6: Return calibrated vmaxsubscript𝑣maxv_{\mathrm{max}}italic_v start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, visosubscript𝑣isov_{\mathrm{iso}}italic_v start_POSTSUBSCRIPT roman_iso end_POSTSUBSCRIPT

For the phase reconstruction, a stepsize of 0.001 and momentum 0.66 were chosen to run the NuPty gradient descent algorithm.

3 Incoherent contributions to experimental data

A. Thickness variations in the probe

Refer to caption
Figure S4: Incoherence effects due to thickness variations: The synchrotron beam has a spot size of 18181818 μm𝜇m\mu\text{m}italic_μ m ×\times× 50505050 μm𝜇m\mu\text{m}italic_μ m on the probe. Varying thicknesses of the probe lead to several beam paths traversing the object, which sum up incoherently at the detector.

Transverse coherence refers to the length scale perpendicular to the beam where phase correlations in the wave field remain stable at a given time. Assuming the synchrotron beam is monochromatic with wavelength λ𝜆\lambdaitalic_λ, angular size σ0subscript𝜎0\sigma_{0}italic_σ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and upstream distance S𝑆Sitalic_S, the transverse coherence length ξTsubscript𝜉𝑇\xi_{T}italic_ξ start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT is usually approximated as

ξTλS2πσ0.similar-tosubscript𝜉𝑇𝜆𝑆2𝜋subscript𝜎0\xi_{T}\sim\dfrac{\lambda S}{2\pi\sigma_{0}}.italic_ξ start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT ∼ divide start_ARG italic_λ italic_S end_ARG start_ARG 2 italic_π italic_σ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG . (S1)

However, in our experiment, the detector size also significantly affects ξTsubscript𝜉𝑇\xi_{T}italic_ξ start_POSTSUBSCRIPT italic_T end_POSTSUBSCRIPT, as avalanche photodiodes integrate all the photons hitting their surface. We can calculate this by considering the time domain analogue of the double slit experiment, as explained in Ref. [92]. The effective transverse coherence length is given as

ξTe=λ2π1σTe,subscript𝜉𝑇𝑒𝜆2𝜋1subscript𝜎𝑇𝑒\xi_{Te}=\dfrac{\lambda}{2\pi}\dfrac{1}{\sigma_{Te}},italic_ξ start_POSTSUBSCRIPT italic_T italic_e end_POSTSUBSCRIPT = divide start_ARG italic_λ end_ARG start_ARG 2 italic_π end_ARG divide start_ARG 1 end_ARG start_ARG italic_σ start_POSTSUBSCRIPT italic_T italic_e end_POSTSUBSCRIPT end_ARG , (S2)

where σTe=(σ0S)2+(σLL)2subscript𝜎𝑇𝑒superscriptsubscript𝜎0𝑆2superscriptsubscript𝜎𝐿𝐿2\sigma_{Te}=\sqrt{\left(\dfrac{\sigma_{0}}{S}\right)^{2}+\left(\dfrac{\sigma_{% L}}{L}\right)^{2}}italic_σ start_POSTSUBSCRIPT italic_T italic_e end_POSTSUBSCRIPT = square-root start_ARG ( divide start_ARG italic_σ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT end_ARG start_ARG italic_S end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT + ( divide start_ARG italic_σ start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT end_ARG start_ARG italic_L end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG. Here, S𝑆Sitalic_S is the distance from the source to the sample, and L𝐿Litalic_L is the distance from the sample to the detector. The symbols σ0subscript𝜎0\sigma_{0}italic_σ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and σLsubscript𝜎𝐿\sigma_{L}italic_σ start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT represent the vertical sizes of the source and the detector, respectively. For our experiment, λ=0.086𝜆0.086\lambda=0.086italic_λ = 0.086 nm, L1similar-to𝐿1L\sim 1italic_L ∼ 1 m and σLsubscript𝜎𝐿\sigma_{L}italic_σ start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT 0.2similar-toabsent0.2\sim 0.2∼ 0.2 mm. Therefore, ξTesubscript𝜉𝑇𝑒\xi_{Te}italic_ξ start_POSTSUBSCRIPT italic_T italic_e end_POSTSUBSCRIPT is dominated by the detector size L𝐿Litalic_L, i.e.,

ξTeλL2πσL68.5nm.similar-tosubscript𝜉𝑇𝑒𝜆𝐿2𝜋subscript𝜎𝐿similar-to68.5nm\xi_{Te}\sim\dfrac{\lambda L}{2\pi\sigma_{L}}\sim 68.5\,\mathrm{nm}.italic_ξ start_POSTSUBSCRIPT italic_T italic_e end_POSTSUBSCRIPT ∼ divide start_ARG italic_λ italic_L end_ARG start_ARG 2 italic_π italic_σ start_POSTSUBSCRIPT italic_L end_POSTSUBSCRIPT end_ARG ∼ 68.5 roman_nm . (S3)

Thickness variations in the samples on the length scales larger than the transverse length will result in incoherent effects, as shown in Fig. S4.

B. Correction due to bunch spacing incoherence

In the experimental setup, scattered photons from various X-ray pulses hitting the sample are histogrammed into bins to generate the temporal response. Since the detectors are synchronised with the synchrotron’s bunch clock, they always reset to time zero with each repetition of the bunches. Photons from an earlier X-ray pulse may scatter at times later than Tbsubscript𝑇bT_{\mathrm{b}}italic_T start_POSTSUBSCRIPT roman_b end_POSTSUBSCRIPT, which is the bunch clock’s time period. The histogram at time tiTbsubscript𝑡𝑖subscript𝑇bt_{i}-T_{\mathrm{b}}italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - italic_T start_POSTSUBSCRIPT roman_b end_POSTSUBSCRIPT contains an incoherent addition of these photons scattered at time ti>Tbsubscript𝑡𝑖subscript𝑇bt_{i}>T_{\mathrm{b}}italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT > italic_T start_POSTSUBSCRIPT roman_b end_POSTSUBSCRIPT. The histogram with the bunch spacing correction Ibsubscript𝐼𝑏I_{b}italic_I start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT is thus given by

Ib(ti)={k=0NbI(tikTb),for tiTb,0otherwise.subscript𝐼𝑏subscript𝑡𝑖casessuperscriptsubscript𝑘0subscript𝑁𝑏𝐼subscript𝑡𝑖𝑘subscript𝑇𝑏for subscript𝑡𝑖subscript𝑇𝑏0otherwiseI_{b}(t_{i})=\begin{cases}\sum_{k=0}^{N_{b}}I(t_{i}-k\cdot T_{b}),&\text{for }% t_{i}\leq T_{b},\\ 0&\text{otherwise}.\end{cases}italic_I start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ( italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) = { start_ROW start_CELL ∑ start_POSTSUBSCRIPT italic_k = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_N start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT end_POSTSUPERSCRIPT italic_I ( italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - italic_k ⋅ italic_T start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ) , end_CELL start_CELL for italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ≤ italic_T start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT , end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL otherwise . end_CELL end_ROW

The bunch clock time period gives the X-ray pulse interval. In our experiment, Tb192subscript𝑇𝑏192T_{b}\approx 192italic_T start_POSTSUBSCRIPT italic_b end_POSTSUBSCRIPT ≈ 192 ns, as shown in Fig. S5.

Refer to caption
Figure S5: Timing structure of the synchrotron radiation in PETRA-III, 40-bunch mode: The synchrotron pulses are have a width of 100 ps and are separated by 192 ns. The detectors are given a veto signal to ensure detection occurs only between 17 ns and 178 ns after the X-ray pulse is scattered by the object.

4 Optimization by Maximum likelihood estimation

This section explains the choice of cost function (main text, Eq. 6) for the NuPty phase retrieval algorithm. In the maximum likelihood estimation scheme, we aim to formulate a cost function that incorporates some knowledge of the noise model in the experiment to yield a superior reconstruction. In further discussion, we would use the short-hand notation 𝒙isubscript𝒙𝑖\boldsymbol{x}_{i}bold_italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT to denote 𝒙(ti)𝒙subscript𝑡𝑖\boldsymbol{x}(t_{i})bold_italic_x ( italic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ), i.e., the value of the vector xN𝑥superscript𝑁x\in\mathbb{C}^{N}italic_x ∈ blackboard_C start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT at the i𝑖iitalic_i-th time point. The phase problem then becomes as follows: Maximize the joint likelihood function :N[0,):superscript𝑁0\mathcal{L}:\mathbb{C}^{N}\rightarrow[0,\infty)caligraphic_L : blackboard_C start_POSTSUPERSCRIPT italic_N end_POSTSUPERSCRIPT → [ 0 , ∞ ) given as

(𝑶^)=jip(𝒃ji|𝑶^)bold-^𝑶subscriptproduct𝑗subscriptproduct𝑖𝑝conditionalsubscript𝒃𝑗𝑖bold-^𝑶\mathcal{L}(\boldsymbol{\hat{O}})=\prod_{j}\prod_{i}{p}(\boldsymbol{b}_{ji}|% \boldsymbol{\hat{O}})caligraphic_L ( overbold_^ start_ARG bold_italic_O end_ARG ) = ∏ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∏ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_p ( bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT | overbold_^ start_ARG bold_italic_O end_ARG ) (S4)

where p(𝒃ji|𝑶^)𝑝conditionalsubscript𝒃𝑗𝑖bold-^𝑶{p}(\boldsymbol{b}_{ji}|\boldsymbol{\hat{O}})italic_p ( bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT | overbold_^ start_ARG bold_italic_O end_ARG ) is the Bayesian probability of measuring 𝒃jisubscript𝒃𝑗𝑖\boldsymbol{b}_{ji}bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT counts at the detector at time ti=(i1)Δtsubscript𝑡𝑖𝑖1Δ𝑡t_{i}=(i-1)\Delta titalic_t start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = ( italic_i - 1 ) roman_Δ italic_t and probe detuning Djsubscript𝐷𝑗D_{j}italic_D start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT, given the object’s energy domain response is 𝑶^bold-^𝑶\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_O end_ARG.

The likelihood function is a statistical metric for the consistency of the forward model with the measurements. If the model is changed to make the measurements more probable, the likelihood increases, indicating that the model is better. We try to find an object 𝑶^bold-^𝑶\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_O end_ARG that maximizes the likelihood \mathcal{L}caligraphic_L or, equivalently, minimizes the negative log-likelihood since it is more numerically stable. The cost function is thus given as

ρ(𝑶^)=log((𝓞^)).𝜌bold-^𝑶logbold-^𝓞\rho(\boldsymbol{\hat{O}})=-\mathrm{log}(\mathcal{L(\boldsymbol{\hat{O}})}).italic_ρ ( overbold_^ start_ARG bold_italic_O end_ARG ) = - roman_log ( caligraphic_L ( overbold_^ start_ARG bold_caligraphic_O end_ARG ) ) . (S5)

The probabilities in Eq. (S4) have to include modeling of all sources of noise in the forward process. Let us assume that each measurement can be modeled as

𝒃j=Poisson(𝑰j)+𝒏jsubscript𝒃𝑗Poissonsubscript𝑰𝑗subscript𝒏𝑗\boldsymbol{b}_{j}=\mathrm{Poisson}(\boldsymbol{I}_{j})+\boldsymbol{n}_{j}bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = roman_Poisson ( bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) + bold_italic_n start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT (S6)

where 𝑰j=|𝐅{𝑷^j 𝑶^}|2subscript𝑰𝑗superscript𝐅subscriptbold-^𝑷𝑗 bold-^𝑶2\boldsymbol{I}_{j}=\left|\mathbf{F}\left\{\boldsymbol{\hat{P}}_{j}~{}\raisebox% {1.0pt}{ \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{% \hskip 1.40001pt\lower-1.40001pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke% { }\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}% \pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}\pgfsys@beginscope% \pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ }{}\pgfsys@moveto{% 1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}% \pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt}{0.0pt}% \pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{\hat{O}}\right\}\right|^{2}bold_italic_I start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = | bold_F { overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG } | start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT, i.e., the noiseless modeled intensity, Poisson()Poisson\mathrm{Poisson}(\cdot)roman_Poisson ( ⋅ ) denotes sampling the measurement from a Poisson distribution based on the modeled intensities and 𝒏jsubscript𝒏𝑗\boldsymbol{n}_{j}bold_italic_n start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is a random noise vector sampled from a Gaussian distribution 𝒩(0,𝝈j2)𝒩0superscriptsubscript𝝈𝑗2\mathcal{N}(0,\boldsymbol{\sigma}_{j}^{2})caligraphic_N ( 0 , bold_italic_σ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ). If we suppose that there are no sources of random noise present in the experiment (i.e., 𝒏j=0subscript𝒏𝑗0\boldsymbol{n}_{j}=0bold_italic_n start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = 0), the probabilities can be written with a Poisson distribution model such that

p(𝒃ji|𝑶^)=𝑰ji𝒃jie𝑰ji𝒃ji!.𝑝conditionalsubscript𝒃𝑗𝑖bold-^𝑶superscriptsubscript𝑰𝑗𝑖subscript𝒃𝑗𝑖superscriptesubscript𝑰𝑗𝑖subscript𝒃𝑗𝑖\displaystyle p(\boldsymbol{b}_{ji}|\boldsymbol{\hat{O}})=\dfrac{\boldsymbol{I% }_{ji}^{\boldsymbol{b}_{ji}}\cdot\mathrm{e}^{-\boldsymbol{I}_{ji}}}{% \boldsymbol{b}_{ji}!}.italic_p ( bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT | overbold_^ start_ARG bold_italic_O end_ARG ) = divide start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT ⋅ roman_e start_POSTSUPERSCRIPT - bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_POSTSUPERSCRIPT end_ARG start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ! end_ARG . (S7)

From Eq. (S5) the cost function to be minimized is given as

ρ(𝑶^)𝜌bold-^𝑶\displaystyle\rho(\boldsymbol{\hat{O}})italic_ρ ( overbold_^ start_ARG bold_italic_O end_ARG ) =log(jip(𝒃ji|𝑶^))absentlogsubscriptproduct𝑗subscriptproduct𝑖𝑝conditionalsubscript𝒃𝑗𝑖bold-^𝑶\displaystyle=-\mathrm{log}\left(\prod_{j}\prod_{i}p(\boldsymbol{b}_{ji}|% \boldsymbol{\hat{O}})\right)= - roman_log ( ∏ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∏ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_p ( bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT | overbold_^ start_ARG bold_italic_O end_ARG ) )
=ji𝒃jilog(𝑰ji)+𝑰ji+log(𝒃ji!).absentsubscript𝑗subscript𝑖subscript𝒃𝑗𝑖logsubscript𝑰𝑗𝑖subscript𝑰𝑗𝑖logsubscript𝒃𝑗𝑖\displaystyle=\sum_{j}\sum_{i}-\boldsymbol{b}_{ji}\cdot\mathrm{log}(% \boldsymbol{I}_{ji})+\boldsymbol{I}_{ji}+\mathrm{log}(\boldsymbol{b}_{ji}!).= ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT - bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ⋅ roman_log ( bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ) + bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT + roman_log ( bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT ! ) . (S8)

If we make a Taylor expansion of log(𝑰ji)logsubscript𝑰𝑗𝑖\mathrm{log}\left(\sqrt{\boldsymbol{I}_{ji}}\right)roman_log ( square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG ) around 𝒃jisubscript𝒃𝑗𝑖\sqrt{\boldsymbol{b}_{ji}}square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG to the second order, i.e.,

log(𝑰ji)log(𝒃ji)+𝑰ji𝒃ji𝒃ji(𝑰ji𝒃ji)22𝒃jilogsubscript𝑰𝑗𝑖logsubscript𝒃𝑗𝑖subscript𝑰𝑗𝑖subscript𝒃𝑗𝑖subscript𝒃𝑗𝑖superscriptsubscript𝑰𝑗𝑖subscript𝒃𝑗𝑖22subscript𝒃𝑗𝑖\displaystyle\mathrm{log}\left(\sqrt{\boldsymbol{I}_{ji}}\right)\approx\mathrm% {log}\left(\sqrt{\boldsymbol{b}_{ji}}\right)+\dfrac{\sqrt{\boldsymbol{I}_{ji}}% -\sqrt{\boldsymbol{b}_{ji}}}{\sqrt{\boldsymbol{b}_{ji}}}-\dfrac{\left(\sqrt{% \boldsymbol{I}_{ji}}-\sqrt{\boldsymbol{b}_{ji}}\right)^{2}}{2{\boldsymbol{b}_{% ji}}}roman_log ( square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG ) ≈ roman_log ( square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG ) + divide start_ARG square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG end_ARG start_ARG square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG end_ARG - divide start_ARG ( square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT end_ARG start_ARG 2 bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG (S9)

and neglect the constant terms that only depend on 𝒃jisubscript𝒃𝑗𝑖\boldsymbol{b}_{ji}bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT, we get an approximation of the cost function in Eq. (S8) as

ρ(𝑶^)𝜌bold-^𝑶\displaystyle\rho(\boldsymbol{\hat{O}})italic_ρ ( overbold_^ start_ARG bold_italic_O end_ARG ) 2ji(𝑰ji𝒃ji)2=2j|𝐅{𝑷^j 𝑶^}|𝒃j2.absent2subscript𝑗subscript𝑖superscriptsubscript𝑰𝑗𝑖subscript𝒃𝑗𝑖22subscript𝑗superscriptnorm𝐅subscriptbold-^𝑷𝑗 bold-^𝑶subscript𝒃𝑗2\displaystyle\approx 2\sum_{j}\sum_{i}\left(\sqrt{\boldsymbol{I}_{ji}}-\sqrt{% \boldsymbol{b}_{ji}}\right)^{2}=2\sum_{j}\left\|\left|\mathbf{F}\left\{% \boldsymbol{\hat{P}}_{j}~{}\raisebox{1.0pt}{ \leavevmode\hbox to2.8pt{\vbox to% 2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.40001pt\lower-1.40001pt\hbox to0.% 0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor}{rgb}{0,0,0% }\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0% }{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont% \hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}% \pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ % }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.% 1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt% }{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{\hat{O}}\right\}\right|-\sqrt% {\boldsymbol{b}_{j}}\right\|^{2}.≈ 2 ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∑ start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( square-root start_ARG bold_italic_I start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT end_ARG ) start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT = 2 ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ∥ | bold_F { overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG } | - square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT . (S10)

The Poisson log-likelihood cost function is thus approximately proportional to the ‘amplitude-based’ cost function popular in the ptychography community [93, 94]. One advantage of the gradient-based methods is that the phase problem can now be flexibly solved by using the gradient of the cost function in Eq. (S8). We can calculate the gradient of ρ𝜌\rhoitalic_ρ with respect to the complex object 𝑶^bold-^𝑶\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_O end_ARG using Wirtinger calculus [95] as

𝑶^ρsubscriptbold-^𝑶𝜌\displaystyle\nabla_{\boldsymbol{\hat{O}}}\rho∇ start_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG end_POSTSUBSCRIPT italic_ρ =2j𝑷^j 𝐅1{𝐅{𝒁^j}} (1𝒃j|𝐅{𝒁^j}|)absent2subscript𝑗subscriptsuperscriptbold-^𝑷𝑗 superscript𝐅1𝐅subscriptbold-^𝒁𝑗 1subscript𝒃𝑗𝐅subscript^𝒁𝑗\displaystyle=2\sum_{j}\boldsymbol{\hat{P}}^{\dagger}_{j}~{}\raisebox{1.0pt}{ % \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.% 40001pt\lower-1.40001pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }% \definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}% \pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}\pgfsys@beginscope% \pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ }{}\pgfsys@moveto{% 1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}% \pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt}{0.0pt}% \pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\mathbf{F}^{-1}\left\{\mathbf{F}\left\{% \boldsymbol{\hat{Z}}_{j}\right\}\right\}~{}\raisebox{1.0pt}{ \leavevmode\hbox to% 2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.40001pt\lower-1.400% 01pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{% pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}% \pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{% }}{}{}{}{}{}{}{}{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6% pt}\pgfsys@invoke{ }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.607% 51pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt% }{0.60751pt}{-1.1pt}{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.% 1pt}{0.0pt}{-1.1pt}\pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt% }{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke% \pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\left(1-\dfrac{\sqrt{\boldsymbol{b}_{j}}}% {\left|\mathbf{F}\left\{\hat{\boldsymbol{Z}}_{j}\right\}\right|}\right)= 2 ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT bold_F start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT { bold_F { overbold_^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT } } ( 1 - divide start_ARG square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG end_ARG start_ARG | bold_F { over^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT } | end_ARG )
=2j𝑷^j (𝒁^j𝐅1{𝒃j|𝐅{𝒁^j}| 𝐅{𝒁^j})}\displaystyle=2\sum_{j}\boldsymbol{\hat{P}}^{\dagger}_{j}~{}\raisebox{1.0pt}{ % \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.% 40001pt\lower-1.40001pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }% \definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}% \pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}\pgfsys@beginscope% \pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ }{}\pgfsys@moveto{% 1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}% \pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt}{0.0pt}% \pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\left(\boldsymbol{\hat{Z}}_{j}-\mathbf{F}% ^{-1}\left\{\dfrac{\sqrt{\boldsymbol{b}_{j}}}{\left|\mathbf{F}\left\{\hat{% \boldsymbol{Z}}_{j}\right\}\right|}~{}\raisebox{1.0pt}{ \leavevmode\hbox to2.8% pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.40001pt\lower-1.40001% pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }\definecolor{pgfstrokecolor% }{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\pgfsys@setlinewidth{0.4pt}% \pgfsys@invoke{ }\nullfont\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }{{{% }}{}{}{}{}{}{}{}{}}\pgfsys@beginscope\pgfsys@invoke{ }\pgfsys@setlinewidth{0.6% pt}\pgfsys@invoke{ }{}\pgfsys@moveto{1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.607% 51pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}\pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt% }{0.60751pt}{-1.1pt}{0.0pt}\pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.% 1pt}{0.0pt}{-1.1pt}\pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt% }{0.0pt}\pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke% \pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}{\mathbf{F}\left\{\hat{\boldsymbol{Z}}_{j% }\right\}}\right)\right\}= 2 ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUPERSCRIPT † end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ( overbold_^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT - bold_F start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT { divide start_ARG square-root start_ARG bold_italic_b start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT end_ARG end_ARG start_ARG | bold_F { over^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT } | end_ARG bold_F { over^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT } ) } (S11)

where 𝒁^j=𝑷^j 𝑶^subscriptbold-^𝒁𝑗subscriptbold-^𝑷𝑗 bold-^𝑶\boldsymbol{\hat{Z}}_{j}=\boldsymbol{\hat{P}}_{j}~{}\raisebox{1.0pt}{ % \leavevmode\hbox to2.8pt{\vbox to2.8pt{\pgfpicture\makeatletter\hbox{\hskip 1.% 40001pt\lower-1.40001pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }% \definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}% \pgfsys@invoke{ }\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }% \pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox to0.0pt{% \pgfsys@beginscope\pgfsys@invoke{ }{{{}}{}{}{}{}{}{}{}{}}\pgfsys@beginscope% \pgfsys@invoke{ }\pgfsys@setlinewidth{0.6pt}\pgfsys@invoke{ }{}\pgfsys@moveto{% 1.1pt}{0.0pt}\pgfsys@curveto{1.1pt}{0.60751pt}{0.60751pt}{1.1pt}{0.0pt}{1.1pt}% \pgfsys@curveto{-0.60751pt}{1.1pt}{-1.1pt}{0.60751pt}{-1.1pt}{0.0pt}% \pgfsys@curveto{-1.1pt}{-0.60751pt}{-0.60751pt}{-1.1pt}{0.0pt}{-1.1pt}% \pgfsys@curveto{0.60751pt}{-1.1pt}{1.1pt}{-0.60751pt}{1.1pt}{0.0pt}% \pgfsys@closepath\pgfsys@moveto{0.0pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{ } \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope{}{}{}\hss}% \pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hss}}% \lxSVG@closescope\endpgfpicture}}}~{}\boldsymbol{\hat{O}}overbold_^ start_ARG bold_italic_Z end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT = overbold_^ start_ARG bold_italic_P end_ARG start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT overbold_^ start_ARG bold_italic_O end_ARG. It was shown in Ref. [96] that Rodenburg’s PIE algorithm [52] and its variants are equivalent to the stochastic gradient descent algorithm with the amplitude cost function in Eq. (S10).

5 Tests on simulated data

A. Varying Poisson noise

We simulate ptychograms with different levels of Poisson noise by changing the total number of delayed photon counts Nphsubscript𝑁𝑝N_{ph}italic_N start_POSTSUBSCRIPT italic_p italic_h end_POSTSUBSCRIPT. As described in Sec. 4, the phase retrieval algorithm maximizes the log likelihood of the simulation to the observed data under the assumed Poisson conditions. We always start the first iteration with a priori assumption that our object’s nuclei are mostly transparent to X-rays, as the foil’s nuclear resonant lines are very sharp. Therefore, we initialize the object 𝑶^(0)superscriptbold-^𝑶0\boldsymbol{\hat{O}}^{(0)}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ( 0 ) end_POSTSUPERSCRIPT as cells with entry ’one’. The object is updated for 100 algorithm iterations with stochastic gradients calculated at B=20𝐵20B=20italic_B = 20. We can determine if the algorithm has reached a solution by tracking the cost ρ~~𝜌\tilde{\rho}over~ start_ARG italic_ρ end_ARG per iteration. The performance of the algorithm can be quantified by the mean square error

MSE=1N|𝑶^r||𝑶^|2MSE1𝑁superscriptnormsuperscriptbold-^𝑶𝑟superscriptbold-^𝑶2\mathrm{MSE}=\dfrac{1}{N}{\||\boldsymbol{\hat{O}}^{r}|-|\boldsymbol{\hat{O}}^{% *}|\|^{2}}roman_MSE = divide start_ARG 1 end_ARG start_ARG italic_N end_ARG ∥ | overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT italic_r end_POSTSUPERSCRIPT | - | overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT | ∥ start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT (S12)

between the magnitudes of the transmission spectra of the final reconstructed object 𝑶^rsuperscriptbold-^𝑶𝑟\boldsymbol{\hat{O}}^{r}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT italic_r end_POSTSUPERSCRIPT and the simulated (true) object 𝑶^superscriptbold-^𝑶\boldsymbol{\hat{O}}^{*}overbold_^ start_ARG bold_italic_O end_ARG start_POSTSUPERSCRIPT ∗ end_POSTSUPERSCRIPT. In Fig. S6(a), we see that the MSE decreases as the number of delayed photons in the ptychogram increases and correspondingly the Poisson noise decreases. The algorithm is stable with respect to the increasing levels of Poisson noise. Orange and green colors mark results for total delayed photons of 106superscript10610^{6}10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT and 108superscript10810^{8}10 start_POSTSUPERSCRIPT 8 end_POSTSUPERSCRIPT, respectively. In Fig. S6(b), we show convergence curves of objects reconstructed from ptychograms with the two different levels of Poisson noise. In Fig. S6(c), we can see that for low photon counts (orange), the reconstructed resonance peaks are broader and the ratio of the heights of the peaks (which corresponds to the relative probabilities of the nuclear transitions) is not preserved. The algorithm reconstructs a "weakly" scattering object, with weaker phase shifts in Fig. S6(d), for the lower signal to noise ratio. In the ptychogram with higher photon counts, the Poisson noise is low enough that the reconstruction (green) matches perfectly with the true object. In both the low and high noise cases, the major resonance peaks can be identified at their correct locations.

Refer to caption
Figure S6: Effect of Poisson noise on phase retrieval: (a) Log-log plot of mean squared error (MSE) versus time integrated delayed photons, showing a linear relationship. The trend highlights improved accuracy (lower MSE) as photon counts increase. (b) Convergence of parameter ρ𝜌\rhoitalic_ρ over 100 iterations, stabilizing after initial decay, with colors indicating photon counts as in (a). Orange and green lines denote results for total delayed photons of 106superscript10610^{6}10 start_POSTSUPERSCRIPT 6 end_POSTSUPERSCRIPT and 108superscript10810^{8}10 start_POSTSUPERSCRIPT 8 end_POSTSUPERSCRIPT, respectively. Higher photon counts help the algorithm reach a deeper cost minimum. (c) Reconstructed magnitude spectrum as a function of energy detuning, ωω0𝜔subscript𝜔0\omega-\omega_{0}italic_ω - italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. (d) Reconstructed phase spectrum over the same energy range, showing distinct phase shifts at each resonance line.

B. Different time windows

We now test the effect of the time window cut off Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT on the phase retrieval. As described in the main text, short time windows of detection cause artificial sinc peaks in the transmission spectrum of the reconstructed object, as seen in Fig. S7(a). To completely get rid of the artifacts, one needs to increase the time gap between the synchrotron pulses, as seen in the MSE calculations plotted in Fig. S7(b).

Refer to caption
Figure S7: Effect of time windowing on phase retrieval: (a) Magnitude of the transmission spectrum of the reconstructed object is plotted as a function of energy detuning, ωω0Planck-constant-over-2-pi𝜔Planck-constant-over-2-pisubscript𝜔0\hbar\omega-\hbar\omega_{0}roman_ℏ italic_ω - roman_ℏ italic_ω start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT. Orange and green lines denote results for Tmax=subscript𝑇maxabsentT_{\mathrm{max}}=italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT = 200200200200 ns and 1000100010001000 ns, respectively. For lower Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT, artificial peaks appear in the reconstructed spectrum. (b) Log of mean squared error (MSE) decreases as the maximum acquisition time at the detector (in the unit of the Fe57superscriptFe57{}^{57}\mathrm{Fe}start_FLOATSUPERSCRIPT 57 end_FLOATSUPERSCRIPT roman_Fe lifetime τ𝜏\tauitalic_τ) increases.

C. Radiative coupling regime in the ptychogram

Neglecting electronic absorption, the total scattering response of the probe and the object can be separated in the time domain as P(t)=δ(t)RP(t)𝑃𝑡𝛿𝑡subscript𝑅𝑃𝑡P(t)=\delta(t)-R_{P}(t)italic_P ( italic_t ) = italic_δ ( italic_t ) - italic_R start_POSTSUBSCRIPT italic_P end_POSTSUBSCRIPT ( italic_t ) and O(t)=δ(t)RO(t)𝑂𝑡𝛿𝑡subscript𝑅𝑂𝑡O(t)=\delta(t)-R_{O}(t)italic_O ( italic_t ) = italic_δ ( italic_t ) - italic_R start_POSTSUBSCRIPT italic_O end_POSTSUBSCRIPT ( italic_t ), where RP(t)subscript𝑅𝑃𝑡R_{P}(t)italic_R start_POSTSUBSCRIPT italic_P end_POSTSUBSCRIPT ( italic_t ) and RO(t)subscript𝑅𝑂𝑡R_{O}(t)italic_R start_POSTSUBSCRIPT italic_O end_POSTSUBSCRIPT ( italic_t ) are their respective time delayed nuclear scattered responses. The response of the probe, Doppler shifted by angular frequency D=2πv/λ𝐷2𝜋𝑣𝜆D=2\pi v/\lambdaitalic_D = 2 italic_π italic_v / italic_λ, is given as

P(D,t)=eiφ(D,t)P(t)=eiDtP(t)𝑃𝐷𝑡superscriptei𝜑𝐷𝑡𝑃𝑡superscriptei𝐷𝑡𝑃𝑡P(D,t)=\mathrm{e}^{\mathrm{i}\varphi(D,t)}{P}(t)=\mathrm{e}^{\mathrm{i}Dt}{P}(t)italic_P ( italic_D , italic_t ) = roman_e start_POSTSUPERSCRIPT roman_i italic_φ ( italic_D , italic_t ) end_POSTSUPERSCRIPT italic_P ( italic_t ) = roman_e start_POSTSUPERSCRIPT roman_i italic_D italic_t end_POSTSUPERSCRIPT italic_P ( italic_t ) (S13)

and the scattered field at the detector is given by the convolution of their respective temporal responses, i.e.,

Z(D,t)𝑍𝐷𝑡\displaystyle Z(D,t)italic_Z ( italic_D , italic_t ) =P(D,t)O(t)absent𝑃𝐷𝑡𝑂𝑡\displaystyle=P(D,t)\ast O(t)= italic_P ( italic_D , italic_t ) ∗ italic_O ( italic_t ) (S14)
=0t𝑑tP(t)eiDtO(tt)absentsuperscriptsubscript0𝑡differential-dsuperscript𝑡𝑃superscript𝑡superscriptei𝐷superscript𝑡𝑂𝑡superscript𝑡\displaystyle=\int_{0}^{t}dt^{\prime}\,P(t^{\prime})\mathrm{e}^{\mathrm{i}Dt^{% \prime}}O(t-t^{\prime})= ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT italic_d italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_P ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) roman_e start_POSTSUPERSCRIPT roman_i italic_D italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT italic_O ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) (S15)
=δ(t)+eiDtRP(t)+RO(t)+RPO(D,t)absent𝛿𝑡superscript𝑒i𝐷𝑡subscript𝑅𝑃𝑡subscript𝑅𝑂𝑡subscript𝑅𝑃𝑂𝐷𝑡\displaystyle=\delta(t)+e^{\mathrm{i}Dt}R_{P}(t)+R_{O}(t)+R_{PO}(D,t)= italic_δ ( italic_t ) + italic_e start_POSTSUPERSCRIPT roman_i italic_D italic_t end_POSTSUPERSCRIPT italic_R start_POSTSUBSCRIPT italic_P end_POSTSUBSCRIPT ( italic_t ) + italic_R start_POSTSUBSCRIPT italic_O end_POSTSUBSCRIPT ( italic_t ) + italic_R start_POSTSUBSCRIPT italic_P italic_O end_POSTSUBSCRIPT ( italic_D , italic_t ) (S16)

The running time tsuperscript𝑡t^{\prime}italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in the integral is the time of emission of radiation from P𝑃Pitalic_P and the scattering in O𝑂Oitalic_O. The term RPO=0t𝑑tRP(t)eiDtRO(tt)subscript𝑅𝑃𝑂superscriptsubscript0𝑡differential-dsuperscript𝑡subscript𝑅𝑃superscript𝑡superscript𝑒i𝐷superscript𝑡subscript𝑅𝑂𝑡superscript𝑡R_{PO}=\int_{0}^{t}dt^{\prime}\,R_{P}(t^{\prime})e^{\mathrm{i}Dt^{\prime}}R_{O% }(t-t^{\prime})italic_R start_POSTSUBSCRIPT italic_P italic_O end_POSTSUBSCRIPT = ∫ start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_t end_POSTSUPERSCRIPT italic_d italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT italic_R start_POSTSUBSCRIPT italic_P end_POSTSUBSCRIPT ( italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) italic_e start_POSTSUPERSCRIPT roman_i italic_D italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_POSTSUPERSCRIPT italic_R start_POSTSUBSCRIPT italic_O end_POSTSUBSCRIPT ( italic_t - italic_t start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) describes the radiative coupling between the probe and the object. It refers to the events where photons get nuclear scattered from both of them such they are coupled by the forward scattered radiation and act as one coherent ensemble. For very large D𝐷Ditalic_D the integral RPO0subscript𝑅𝑃𝑂0R_{PO}\approx 0italic_R start_POSTSUBSCRIPT italic_P italic_O end_POSTSUBSCRIPT ≈ 0, leading to decoupling of the probe and the object and dominance of interference fringes such that Z(D,t)δ(t)+eiDtRP(t)+RO(t)𝑍𝐷𝑡𝛿𝑡superscript𝑒i𝐷𝑡subscript𝑅𝑃𝑡subscript𝑅𝑂𝑡Z(D,t)\approx\delta(t)+e^{\mathrm{i}Dt}R_{P}(t)+R_{O}(t)italic_Z ( italic_D , italic_t ) ≈ italic_δ ( italic_t ) + italic_e start_POSTSUPERSCRIPT roman_i italic_D italic_t end_POSTSUPERSCRIPT italic_R start_POSTSUBSCRIPT italic_P end_POSTSUBSCRIPT ( italic_t ) + italic_R start_POSTSUBSCRIPT italic_O end_POSTSUBSCRIPT ( italic_t ). Fig. S8(a) illustrates how the measured ptychogram intensities vary with the Doppler detuning, with a clear separation at D=±70Planck-constant-over-2-pi𝐷plus-or-minus70\hbar D=\pm 70roman_ℏ italic_D = ± 70 ΓΓ\Gammaroman_Γ between the coupling and interferometric regimes. The ptychography engine produces slightly different reconstructed objects depending on the selected data range from the ptychogram. As shown in Fig. S8(b), the mean square error of the reconstruction is minimized when using data with maximum Doppler energy detuning of ±70plus-or-minus70\pm 70± 70 ΓΓ\Gammaroman_Γ.

Refer to caption
Figure S8: Effect of probe-object coupling on phase retrieval: (a) Photon intensity measured at the detector is normalized from 0 to 1 and plotted with respect to Doppler energy detuning DPlanck-constant-over-2-pi𝐷\hbar Droman_ℏ italic_D at different times. (b) The mean squared error (MSE) of the reconstructed object for different maximum Doppler detunings of the probe relative to the object. The orange and green colors correspond to the plots in the main text, Fig. 3(b)-(d). The gray area in both sub-figures marks the interferometric regime (|Dmax|>70Planck-constant-over-2-pisubscript𝐷max70|\hbar D_{\mathrm{max}}|>70| roman_ℏ italic_D start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT | > 70 ΓΓ\Gammaroman_Γ) where the coupling between the probe and the object is negligible.

6 Regularization techniques for experimental phase retrieval

Refer to caption
Figure S9: Effect of regularization on phase retrieval: Magnitude (a),(c) and phase (b),(d) and (e) time response of the objects reconstructed from experimental data. The simulated object is plotted as black dotted line alongside the total variation regularized reconstruction (orange) and the 1superscript1\ell^{1}roman_ℓ start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT regularized reconstruction (green). The gray shaded region in (e) marks the region outside the data acquisition time window (from 17 ns to 178 ns).

A standard technique to cosmetically smoothen artifacts in the solution of an inverse problem is to add regularization terms to the cost function, i.e., optimize over ρr(𝑶^)=ρ(𝑶^)+r(𝑶^)subscript𝜌𝑟bold-^𝑶𝜌bold-^𝑶𝑟bold-^𝑶\rho_{r}(\boldsymbol{\hat{O}})=\rho(\boldsymbol{\hat{O}})+r(\boldsymbol{\hat{O% }})italic_ρ start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ( overbold_^ start_ARG bold_italic_O end_ARG ) = italic_ρ ( overbold_^ start_ARG bold_italic_O end_ARG ) + italic_r ( overbold_^ start_ARG bold_italic_O end_ARG ), where r𝑟ritalic_r is a carefully chosen regularization or penalty function on the object. In Fig. S9(a) and S9(b), we see the magnitude and phase of the object reconstructed from the experimentally measured ptychogram with total variation regularization r(𝑶^)=𝑶^1(𝑶^)i+1(𝑶^)i1𝑟bold-^𝑶subscriptnormbold-^𝑶1similar-tosubscriptnormsubscriptbold-^𝑶𝑖1subscriptbold-^𝑶𝑖1r(\boldsymbol{\hat{O}})=\left\|\nabla\boldsymbol{\hat{O}}\right\|_{1}\sim\left% \|(\boldsymbol{\hat{O}})_{i+1}-(\boldsymbol{\hat{O}})_{i}\right\|_{1}italic_r ( overbold_^ start_ARG bold_italic_O end_ARG ) = ∥ ∇ overbold_^ start_ARG bold_italic_O end_ARG ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ∼ ∥ ( overbold_^ start_ARG bold_italic_O end_ARG ) start_POSTSUBSCRIPT italic_i + 1 end_POSTSUBSCRIPT - ( overbold_^ start_ARG bold_italic_O end_ARG ) start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT (orange) and ( 1superscript1\ell^{1}roman_ℓ start_POSTSUPERSCRIPT 1 end_POSTSUPERSCRIPT regularization r(𝑶^)=1𝑶^1𝑟bold-^𝑶subscriptnorm1bold-^𝑶1r(\boldsymbol{\hat{O}})=\left\|1-\boldsymbol{\hat{O}}\right\|_{1}italic_r ( overbold_^ start_ARG bold_italic_O end_ARG ) = ∥ 1 - overbold_^ start_ARG bold_italic_O end_ARG ∥ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT (green). In both cases, the ptychography engine tries to continuously extrapolate the time response beyond Tmax(=178T_{\mathrm{max}}(=178italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT ( = 178 ns), as seen in Fig. S9(e). To some extent, this suppresses the sinc artifacts the reconstructed transmission spectrum (Fig. S9(a), (b)). The reconstruction is still not perfect, as one can observe in the zoomed-in plots (Fig. S9(c), (d)). This is to be expected since the extrapolated time response beyond Tmaxsubscript𝑇maxT_{\mathrm{max}}italic_T start_POSTSUBSCRIPT roman_max end_POSTSUBSCRIPT is also artificial. Our regularization constraints relying on the smoothness of the peaks of the energy domain transmission spectrum cannot fully compensate for the missing data in the time domain.

References

  • [1] L. Auslander and R. Tolimieri. Radar ambiguity functions and group theory. SIAM Journal on Mathematical Analysis, 16(3):577–601, May 1985.
  • [2] Aline Bonami, Gustavo Garrigós, and Philippe Jaming. Discrete radar ambiguity problems. Applied and Computational Harmonic Analysis, 23(3):388–414, November 2007.
  • [3] C Fienup and J Dainty. Phase retrieval and image reconstruction for astronomy. Image recovery: theory and application, 231:275, 1987.
  • [4] John E Krist and Christopher J Burrows. Phase-retrieval analysis of pre-and post-repair hubble space telescope images. Applied optics, 34(22):4951–4964, 1995.
  • [5] Dorian Kermisch. Image reconstruction from phase information only. Journal of the Optical Society of America, 60(1):15, January 1970.
  • [6] Yoav Shechtman, Yonina C. Eldar, Oren Cohen, Henry Nicholas Chapman, Jianwei Miao, and Mordechai Segev. Phase retrieval with application to optical imaging: A contemporary overview. IEEE Signal Processing Magazine, 32(3):87–109, May 2015.
  • [7] Jianwei Miao, Pambos Charalambous, Janos Kirz, and David Sayre. Extending the methodology of X-ray crystallography to allow imaging of micrometre-sized non-crystalline specimens. Nature, 400(6742):342–344, July 1999.
  • [8] Henry N. Chapman, Anton Barty, Michael J. Bogan, Sébastien Boutet, Matthias Frank, Stefan P. Hau-Riege, Stefano Marchesini, Bruce W. Woods, Saša Bajt, W. Henry Benner, Richard A. London, Elke Plönjes, Marion Kuhlmann, Rolf Treusch, Stefan Düsterer, Thomas Tschentscher, Jochen R. Schneider, Eberhard Spiller, Thomas Möller, Christoph Bostedt, Matthias Hoener, David A. Shapiro, Keith O. Hodgson, David van der Spoel, Florian Burmeister, Magnus Bergh, Carl Caleman, Gösta Huldt, M. Marvin Seibert, Filipe R. N. C. Maia, Richard W. Lee, Abraham Szöke, Nicusor Timneanu, and Janos Hajdu. Femtosecond diffractive imaging with a soft-X-ray free-electron laser. Nature Physics, 2(12):839–843, November 2006.
  • [9] Robert W. Harrison. Phase problem in crystallography. Journal of the Optical Society of America A, 10(5):1046, May 1993.
  • [10] Wim Coene, Guido Janssen, Marc Op de Beeck, and Dirk Van Dyck. Phase retrieval through focus variation for ultra-resolution in field-emission transmission electron microscopy. Physical Review Letters, 69(26):3743–3746, December 1992.
  • [11] B. E. Allman, P. J. McMahon, K. A. Nugent, D. Paganin, D. L. Jacobson, M. Arif, and S. A. Werner. Phase radiography with neutrons. Nature, 408(6809):158–159, November 2000.
  • [12] J. Va’vra, D.W.G.S. Leith, B. Ratcliff, E. Ramberg, M. Albrow, A. Ronzhin, C. Ertley, T. Natoli, E. May, and K. Byrum. Beam test of a time-of-flight detector prototype. Nuclear Instruments and Methods in Physics Research Section A: Accelerators, Spectrometers, Detectors and Associated Equipment, 606(3):404–410, July 2009.
  • [13] Anton S. Tremsin, John V. Vallerga, Oswald H. W. Siegmund, Justin Woods, Lance E. De Long, Jeffrey T. Hastings, Roland J. Koch, Sophie A. Morley, Yi-De Chuang, and Sujoy Roy. Photon-counting mcp/timepix detectors for soft X-ray imaging and spectroscopic applications. Journal of Synchrotron Radiation, 28(4):1069–1080, May 2021.
  • [14] J. R. Fienup. Phase retrieval algorithms: a comparison. Applied Optics, 21(15):2758, August 1982.
  • [15] Emmanuel J. Candès, Xiaodong Li, and Mahdi Soltanolkotabi. Phase retrieval from coded diffraction patterns. Applied and Computational Harmonic Analysis, 39(2):277–299, September 2015.
  • [16] Christopher Metzler, Phillip Schniter, Ashok Veeraraghavan, and Richard Baraniuk. prDeep: Robust phase retrieval with a flexible deep network. In Jennifer Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 3501–3510. PMLR, Jul 2018.
  • [17] Kevin Cowtan. Phase problem in X-ray crystallography, and its solution. Encyclopedia of Life Sciences, May 2003.
  • [18] Robert Beinert and Gerlind Plonka. Ambiguities in one-dimensional discrete phase retrieval from Fourier magnitudes. Journal of Fourier Analysis and Applications, 21(6):1169–1198, 4 2015.
  • [19] M. H. Hayes and J. H. McClellan. Reducible polynomials in more than one variable. Proceedings of the IEEE, 70(2):197–198, 1982.
  • [20] Robert Beinert and Gerlind Plonka. Enforcing uniqueness in one-dimensional phase retrieval by additional signal information in time domain. Applied and Computational Harmonic Analysis, 45(3):505–525, November 2018.
  • [21] Rick Trebino and Daniel J. Kane. Using phase retrieval to measure the intensity and phase of ultrashort pulses: frequency-resolved optical gating. Journal of the Optical Society of America A, 10(5):1101, May 1993.
  • [22] D. Spangenberg, E. Rohwer, M. H. Brügmann, and T. Feurer. Ptychographic ultrafast pulse reconstruction. Optics Letters, 40(6):1002, 3 2015.
  • [23] Rick Trebino, Kenneth W. DeLong, David N. Fittinghoff, John N. Sweetser, Marco A. Krumbügel, Bruce A. Richman, and Daniel J. Kane. Measuring ultrashort laser pulses in the time-frequency domain using frequency-resolved optical gating. Review of Scientific Instruments, 68(9):3277–3295, September 1997.
  • [24] Kishore Jaganathan, Yonina C. Eldar, and Babak Hassibi. STFT phase retrieval: Uniqueness guarantees and recovery algorithms. IEEE Journal of Selected Topics in Signal Processing, 10(4):770–781, 2016.
  • [25] D. Griffin and Jae Lim. Signal estimation from modified short-time Fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 32(2):236–243, 4 1984.
  • [26] Rudolf L. Mössbauer. Kernresonanzfluoreszenz von Gammastrahlung in Ir191. Zeitschrift für Physik, 151(2):124–143, April 1958.
  • [27] Byeongkwan Ko, Eran Greenberg, Vitali Prakapenka, E. Ercan Alp, Wenli Bi, Yue Meng, Dongzhou Zhang, and Sang-Heon Shim. Calcium dissolution in bridgmanite in the earth’s deep mantle. Nature, 611(7934):88–92, October 2022.
  • [28] S. H. Lohaus, M. Heine, P. Guzman, C. M. Bernal-Choban, C. N. Saunders, G. Shen, O. Hellman, D. Broido, and B. Fultz. A thermodynamic explanation of the invar effect. Nature Physics, 19(11):1642–1648, July 2023.
  • [29] M. Miglierini, V. Prochazka, S. Stankov, P. Svec, M. Zajac, J. Kohout, A. Lancok, D. Janickovic, and P. Svec. Crystallization kinetics of nanocrystalline alloys revealed by in situ nuclear forward scattering of synchrotron radiation. Physical Review B, 86(2):020202, July 2012.
  • [30] Yu. V. Knyazev, A. I. Chumakov, A. A. Dubrovskiy, S. V. Semenov, I. Sergueev, S. S. Yakushkin, V. L. Kirillov, O. N. Martyanov, and D. A. Balaev. Nuclear forward scattering application to the spiral magnetic structure study in ϵitalic-ϵ\epsilonitalic_ϵ-Fe2O3. Physical Review B, 101(9):094408, March 2020.
  • [31] C.S. Fadley. X-ray photoelectron spectroscopy: Progress and perspectives. Journal of Electron Spectroscopy and Related Phenomena, 178–179:2–32, May 2010.
  • [32] R.F. Egerton. Limits to the spatial, energy and momentum resolution of electron energy-loss spectroscopy. Ultramicroscopy, 107(8):575–586, August 2007.
  • [33] D. Bessas, D. G. Merkel, A. I. Chumakov, R. Rüffer, R. P. Hermann, I. Sergueev, A. Mahmoud, B. Klobes, M. A. McGuire, M. T. Sougrati, and L. Stievano. Nuclear forward scattering of synchrotron radiation by Ru99superscriptRu99{}^{99}\mathrm{Ru}start_FLOATSUPERSCRIPT 99 end_FLOATSUPERSCRIPT roman_Ru. Physical Review Letters, 113(14):147601, October 2014.
  • [34] Alexander G. Gavriliuk, Viktor V. Struzhkin, Igor S. Lyubutin, Sergey G. Ovchinnikov, Michael Y. Hu, and Paul Chow. Another mechanism for the insulator-metal transition observed in mott insulators. Physical Review B, 77(15):155112, April 2008.
  • [35] Karunakar Kothapalli, Eunja Kim, Tomasz Kolodziej, Philippe F. Weck, Ercan E. Alp, Yuming Xiao, Paul Chow, C. Kenney-Benson, Yue Meng, Sergey Tkachev, Andrzej Kozlowski, Barbara Lavina, and Yusheng Zhao. Nuclear forward scattering and first-principles studies of the iron oxide phase Fe4O5. Physical Review B, 90(2):024430, July 2014.
  • [36] G. V. Smirnov, U. van Bürck, A. I. Chumakov, A. Q. R. Baron, and R. Rüffer. Synchrotron Mössbauer source. Physical Review B, 55(9):5811–5815, March 1997.
  • [37] Vasily Potapkin, Aleksandr I. Chumakov, Gennadii V. Smirnov, Jean-Philippe Celse, Rudolf Rüffer, Catherine McCammon, and Leonid Dubrovinsky. The57fe synchrotron Mössbauer source at the ESRF. Journal of Synchrotron Radiation, 19(4):559–569, May 2012.
  • [38] Sergey Yaroslavtsev and Aleksandr I. Chumakov. Synchrotron Mössbauer source: trade-off between intensity and linewidth. Journal of Synchrotron Radiation, 29(6):1329–1337, 2022.
  • [39] G. V. Smirnov. General properties of nuclear resonant scattering. Hyperfine Interactions, 123/124(1/4):31–77, 1999.
  • [40] J. P. Hannon and G. T. Trammell. Coherent γ𝛾\gammaitalic_γ-ray optics. Hyperfine Interactions, 123/124(1/4):127–274, 1999.
  • [41] G. V. Smirnov, U. van Bürck, W. Potzel, P. Schindelmann, S. L. Popov, E. Gerdau, Yu. V. Shvyd’ko, H. D. Rüter, and O. Leupold. Propagation of nuclear polaritons through a two-target system: Effect of inversion of targets. Physical Review A, 71(2), 2005.
  • [42] Ralf Röhlsberger. Nuclear Condensed Matter Physics with Synchrotron Radiation. Springer Tracts in Modern Physics, vol. 208. Springer Berlin Heidelberg, 2005.
  • [43] W. Sturhahn. CONUSS and PHOENIX: Evaluation of nuclear resonant scattering data. Hyperfine Interactions, 125(1/4):149–172, 2000.
  • [44] Lars Bocklage. Nexus - Nuclear Elastic X-ray scattering Universal Software. Zenodo (2024), https://zenodo.org/doi/10.5281/zenodo.7716207.
  • [45] Yuji Hasegawa, Yoshitaka Yoda, Koichi Izumi, Tetsuya Ishikawa, Seishi Kikuta, Xiaowei Zhang, Hiroshi Sugiyama, and Masami Ando. Time-delayed interferometry with nuclear resonant scattering of synchrotron radiation. Japanese Journal of Applied Physics, 33(6A):L772, 1994.
  • [46] Koichi Izumi, Yoshitaka Yoda, Tetsuya Ishikawa, Xiao-Wei Zhang, Masami Ando, and Seishi Kikuta Seishi Kikuta. Time domain interferometry in X-ray region using nuclear resonant scattering. Japanese Journal of Applied Physics, 34(8R):4258, 1995.
  • [47] R. Callens, C. L’abbé, J. Meersschaut, I. Serdons, W. Sturhahn, and T. S. Toellner. Phase determination in nuclear resonant scattering using a velocity drive as an interferometer and phase shifter. Physical Review B, 72(8), 8 2005.
  • [48] Lukas Wolff and Jörg Evers. Unraveling time- and frequency-resolved nuclear resonant scattering spectra. Phys. Rev. Res., 5:013071, 2 2023.
  • [49] W. Potzel, U. van Bürck, P. Schindelmann, G. M. Kalvius, G. V. Smirnov, E. Gerdau, Yu. V. Shvyd’ko, H. D. Rüter, and O. Leupold. Investigation of radiative coupling and of enlarged decay rates of nuclear oscillators. Physical Review A, 63(4):043810, 3 2001.
  • [50] U. van Bürck, W. Potzel, P. Schindelmann, G. V. Smirnov, S. L. Popov, E. Gerdau, Yu. V. Shvyd’ko, H. D. Rüter, and O. Leupold. Inversion of target sequence in nuclear forward scattering of synchrotron radiation. Hyperfine Interactions, 141/142(1/4):151–155, 2002.
  • [51] B. Sahoo, K. Schlage, J. Major, U. von Hörsten, W. Keune, H. Wende, R. Röhlsberger, Amitabha Ghoshray, Bilwadal Bandyopadhyay, and Chandan Mazumdar. Preparation and characterization of ultrathin stainless steel films. In AIP Conference Proceedings, pages 57–60. AIP, 2011.
  • [52] H. M. L. Faulkner and J. M. Rodenburg. Movable aperture lensless transmission microscopy: A novel phase retrieval algorithm. Phys. Rev. Lett., 93:023903, Jul 2004.
  • [53] Johann Haber. Hard X-ray quantum optics in thin-film nanostructures. PhD thesis, Universität Hamburg, 2017.
  • [54] Ralf Röhlsberger, Hans-Christian Wille, Kai Schlage, and Balaram Sahoo. Electromagnetically induced transparency with resonant nuclei in a cavity. Nature, 482(7384):199–203, February 2012.
  • [55] Ralf Röhlsberger, Kai Schlage, Balaram Sahoo, Sebastien Couet, and Rudolf Rüffer. Collective lamb shift in single-photon superradiance. Science, 328(5983):1248–1251, June 2010.
  • [56] Thomas J. Bürvenich, Jörg Evers, and Christoph H. Keitel. Nuclear quantum optics with X-ray laser pulses. Physical Review Letters, 96(14):142501, April 2006.
  • [57] Johann Haber, Kai S. Schulze, Kai Schlage, Robert Loetzsch, Lars Bocklage, Tatiana Gurieva, Hendrik Bernhardt, Hans-Christian Wille, Rudolf Rüffer, Ingo Uschmann, Gerhard G. Paulus, and Ralf Röhlsberger. Collective strong coupling of X-rays and nuclei in a nuclear optical lattice. Nature Photonics, 10(7):445–449, May 2016.
  • [58] R. Coussement, Y. Rostovtsev, J. Odeurs, G. Neyens, H. Muramatsu, S. Gheysen, R. Callens, K. Vyvey, G. Kozyreff, P. Mandel, R. Shakhmuratov, and O. Kocharovskaya. Controlling absorption of gamma radiation via nuclear level anticrossing. Physical Review Letters, 89(10):107601, August 2002.
  • [59] Wen-Te Liao and Sven Ahrens. Gravitational and relativistic deflection of X-ray superradiance. Nature Photonics, 9(3):169–173, February 2015.
  • [60] Po-Han Lin, Yu-Hung Kuan, Yen-Yu Fu, and Wen-Te Liao. Time-delayed magnetic control of X-ray spectral enhancement in two-target nuclear forward scattering. Phys. Rev. Appl., 18:L051001, Nov 2022.
  • [61] Sven Velten, Lars Bocklage, Xiwen Zhang, Kai Schlage, Anjali Panchwanee, Sakshath Sadashivaiah, Ilya Sergeev, Olaf Leupold, Aleksandr I. Chumakov, Olga Kocharovskaya, and Ralf Röhlsberger. Nuclear quantum memory for hard X-ray photon wave packets. Science Advances, 10(26):eadn9825, 2024.
  • [62] Ilkka Tittonen, Mikk Lippmaa, Panu Helistö, and Toivo Katila. Stepwise phase modulation of recoilless gamma radiation in a coincidence experiment: Gamma echo. Physical Review B, 47(13):7840–7846, April 1993.
  • [63] Kilian P. Heeg, Johann Haber, Daniel Schumacher, Lars Bocklage, Hans-Christian Wille, Kai S. Schulze, Robert Loetzsch, Ingo Uschmann, Gerhard G. Paulus, Rudolf Rüffer, Ralf Röhlsberger, and Jörg Evers. Tunable subluminal propagation of narrow-band X-ray pulses. Physical Review Letters, 114(20):203601, May 2015.
  • [64] Lars Bocklage, Jakob Gollwitzer, Cornelius Strohm, Christian F. Adolff, Kai Schlage, Ilya Sergeev, Olaf Leupold, Hans-Christian Wille, Guido Meier, and Ralf Röhlsberger. Coherent control of collective nuclear quantum states via transient magnons. Science Advances, 7(5), January 2021.
  • [65] Pierre Thibault, Martin Dierolf, Oliver Bunk, Andreas Menzel, and Franz Pfeiffer. Probe retrieval in ptychographic coherent diffractive imaging. Ultramicroscopy, 109(4):338–343, 3 2009.
  • [66] Albert Fannjiang and Pengwen Chen. Blind ptychography: uniqueness and ambiguities. Inverse Problems, 36(4):045005, February 2020.
  • [67] Ziyang Yuan, Hongxia Wang, Zhiwei Li, Tao Wang, Hui Wang, Xinchao Huang, Tianjun Li, Ziru Ma, Linfan Zhu, Wei Xu, Yujun Zhang, Yu Chen, Ryo Masuda, Yoshitaka Yoda, Jianmin Yuan, Adriana Pálffy, and Xiangjin Kong. Nuclear phase retrieval spectroscopy using resonant X-ray scattering. Nature Communications, 16(1), March 2025.
  • [68] Guoan Zheng, Roarke Horstmeyer, and Changhuei Yang. Wide-field, high-resolution Fourier ptychographic microscopy. Nature Photonics, 7(9):739–745, July 2013.
  • [69] Yi Jiang, Zhen Chen, Yimo Han, Pratiti Deb, Hui Gao, Saien Xie, Prafull Purohit, Mark W. Tate, Jiwoong Park, Sol M. Gruner, Veit Elser, and David A. Muller. Electron ptychography of 2D materials to deep sub-ångström resolution. Nature, 559(7714):343–349, July 2018.
  • [70] M. Holler, A. Diaz, M. Guizar-Sicairos, P. Karvinen, Elina Färm, Emma Härkönen, Mikko Ritala, A. Menzel, J. Raabe, and O. Bunk. X-ray ptychographic computed tomography at 16 nm isotropic 3D resolution. Scientific Reports, 4(1), January 2014.
  • [71] Adriaan Walther. The question of phase retrieval in optics. Optica Acta: International Journal of Optics, 10(1):41–49, 1 1963.
  • [72] Philipp Grohs, Sarah Koppensteiner, and Martin Rathmair. Phase retrieval: Uniqueness and stability. SIAM Review, 62(2):301–350, 1 2020.
  • [73] Manuel Guizar-Sicairos and Pierre Thibault. Ptychography: A solution to the phase problem. Physics Today, 74(9):42–48, 9 2021.
  • [74] Andreas Schropp and Christian G Schroer. Dose requirements for resolving a given feature in an object by coherent X-ray diffraction imaging. New Journal of Physics, 12(3):035016, March 2010.
  • [75] J.N. Clark, X. Huang, R. Harder, and I.K. Robinson. High-resolution three-dimensional partially coherent diffraction imaging. Nature Communications, 3(1), August 2012.
  • [76] P. Thibault and M. Guizar-Sicairos. Maximum-likelihood refinement for coherent diffractive imaging. New Journal of Physics, 14(6):063004, 6 2012.
  • [77] Stephen Chen, James Montgomery, and Antonio Bolufé-Röhler. Measuring the curse of dimensionality and its effects on particle swarm optimization and differential evolution. Applied Intelligence, 42(3):514–526, November 2014.
  • [78] David Guirguis, Nikola Aulig, Renato Picelli, Bo Zhu, Yuqing Zhou, William Vicente, Francesco Iorio, Markus Olhofer, Wojciech Matusik, Carlos Artemio Coello Coello, and Kazuhiro Saitou. Evolutionary black-box topology optimization: Challenges and promises. IEEE Transactions on Evolutionary Computation, 24(4):613–633, 2020.
  • [79] B.T. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, January 1964.
  • [80] Herbert Robbins and Sutton Monro. A Stochastic Approximation Method. The Annals of Mathematical Statistics, 22(3):400 – 407, 1951.
  • [81] Ankita Negi and Leon Merten Lohse. NuPty - Nuclear Ptychography with PyTorch. Zenodo (2025), https://zenodo.org/doi/10.5281/zenodo.1551691.
  • [82] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An imperative style, high-performance deep learning library. arXiv:1912.01703 (2019).
  • [83] Pierre Thibault and Andreas Menzel. Reconstructing state mixtures from diffraction measurements. Nature, 494(7435):68–71, February 2013.
  • [84] Peng Li, Tega Edo, Darren Batey, John Rodenburg, and Andrew Maiden. Breaking ambiguities in mixed state ptychography. Optics Express, 24(8):9038, April 2016.
  • [85] Atoosa Dejkameh, Ricarda Nebling, Uldis Locans, Hyun-Su Kim, Iacopo Mochi, and Yasin Ekinci. Recovery of spatial frequencies in coherent diffraction imaging in the presence of a central obscuration. Ultramicroscopy, 258:113912, 4 2024.
  • [86] Juliane Reinhardt, Robert Hoppe, Georg Hofmann, Christian D. Damsgaard, Jens Patommel, Christoph Baumbach, Sina Baier, Amélie Rochet, Jan-Dierk Grunwaldt, Gerald Falkenberg, and Christian G. Schroer. Beamstop-based low-background ptychography to image weakly scattering objects. Ultramicroscopy, 173:52–57, 2 2017.
  • [87] Kilian P. Heeg, Hans-Christian Wille, Kai Schlage, Tatyana Guryeva, Daniel Schumacher, Ingo Uschmann, Kai S. Schulze, Berit Marx, Tino Kämpfer, Gerhard G. Paulus, Ralf Röhlsberger, and Jörg Evers. Vacuum-assisted generation and control of atomic coherences at X-ray energies. Physical Review Letters, 111(7), August 2013.
  • [88] Dimitrios Bessas, Ilya Sergueev, Konstantin Glazyrin, Cornelius Strohm, Ilya Kupenko, Daniel G. Merkel, Gary J. Long, Fernande Grandjean, Aleksandr I. Chumakov, and Rudolf Rüffer. Revealing the hidden hyperfine interactions in ϵitalic-ϵ\epsilonitalic_ϵ -iron. Physical Review B, 101(3), January 2020.
  • [89] R. D. Taylor, G. Cort, and J. O. Willis. Internal magnetic fields in hcp-iron. Journal of Applied Physics, 53(11):8199–8201, November 1982.
  • [90] Francesco Biscani, Dario Izzo, Wenzel Jakob, GiacomoAcciarini, Marcus Märtens, Michiboo, Alessio Mereta, Cord Kaldemeyer, Sergey Lyskov, Sylvain Corlay, Moritz V. Looz, Benjamin Pritchard, Akash Patel, Manuel López-Ibáñez, Oliver Webb, Tmiasko, Johan Mabille, Giacomo Acciarini, Kishan Manani, Axel Huebl, Alex Biddulph, Jakirkham, Hulucc, Jeongseok Lee, Andrea Mambrini, Doodle1106, Erik O’Leary, Felipe Lema, Huu Nguyen, and Ivan Smirnov. esa/pagmo2: pagmo 2.17.0. Zenodo (2021), https://zenodo.org/doi/10.5281/zenodo.4585131.
  • [91] Xiaojing Huang, Kenneth Lauer, Jesse N. Clark, Weihe Xu, Evgeny Nazaretski, Ross Harder, Ian K. Robinson, and Yong S. Chu. Fly-scan ptychography. Scientific Reports, 5(1), March 2015.
  • [92] Alfred Q. R. Baron. Transverse coherence in nuclear resonant scattering of synchrotron radiation. Hyperfine Interactions, 123/124(1/4):667–680, 1999.
  • [93] Li-Hao Yeh, Jonathan Dong, Jingshan Zhong, Lei Tian, Michael Chen, Gongguo Tang, Mahdi Soltanolkotabi, and Laura Waller. Experimental robustness of fourier ptychography phase retrieval algorithms. Optics Express, 23(26):33214, 2015-12.
  • [94] Chao Zuo, Jiasong Sun, and Qian Chen. Adaptive step-size strategy for noise-robust fourier ptychographic microscopy. Optics Express, 24(18):20724, 2016-08.
  • [95] Raphael Hunger. An introduction to complex differentials and complex differentiability. Technical Report TUM-LNS-TR-07-06, Technical University of Munich, 2007.
  • [96] Oleh Melnyk. Stochastic amplitude flow for phase retrieval, its convergence and doppelgängers. arXiv:2212.04916 (2022).