arXiv(opens in a new tab)physics.ins-detNov 2026

Manuscript Offprint

arXiv:2611.24776

4D-TEMPO: Differentiable 4D-STEM ptychography via fast Physics Optimizers

Ramani Duraiswami, Yichao Zhang

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

Electron ptychography recovers atomic structure from 4D-STEM data: diffraction patterns at multiple positions of a scanned probe. Current codes reconstruct an image and read atoms off it, or fit atoms under an L1L_{1} loss; neither gives per-atom uncertainty. We propose 4D-TEMPO, a differentiable physical renderer that fits the atoms, the microscope, and the detector directly to the recorded electron counts under a Poisson likelihood. The output is a list of atoms, each a Gaussian primitive with a 3D position, a thermal width, and a model-conditional error bar from the Fisher information. The Fisher information also conditions the solver, gives the dose (electrons per Å2) each parameter needs, and separates calibration from imaging. On a simulated WSe2 bilayer, starting from the published reconstruction, fitted atoms cut in-plane error by a third (3.2 vs. 4.8 pm) and depth error by 40–61% against its 3D peaks. Depth comes from multiple scattering into the dark field, the faint counts outside the direct beam. The two layers, 10×10\times closer than the depth of field, separate; per-atom depth then follows the layer geometry. When the model is well specified, the bars are calibrated (69% of position coordinates within 1σ1\sigma). On experimental WSe2, fitted atoms predict held-out patterns better than the three published codes we test. With free probe modes where atoms are incomplete, the same likelihood predicts best on all three held-out benchmarks, matches every WSe2 baseline in 5 min against up to 20.5 h, and passes torchslice at its released setting 180×\times sooner on PrScO3. Per-atom error bars, planned doses, and fast reconstruction point to low-dose, real-time 3D imaging of beam-sensitive and dynamic materials.

Figure

Figure 1: 4D-TEMPO fits every atom and the microscope directly to electron counts and returns each atom with an error bar. (a) A defocused electron probe scans the specimen; the detector records Poisson counts at every position (4D-STEM). (b) A physical multislice renderer maps the atoms (position ra,za\mathbf{r}_{a},z_{a}; thermal width UaU_{a}) and the instrument to expected counts hjh_{j}; the Poisson likelihood compares them with the measured counts yjy_{j}, and the Fisher information gives the error bars. (c) Real twisted WSe2 bilayer: every fitted atom (dot) on the reconstructed phase, with its 1σ1\sigma shot-noise (Fisher) position ellipse (39% joint coverage) magnified 50×\boldsymbol{50\times}; medians 0.5 pm (W) and 0.8 pm (Se). Dot pairs are two atoms on one beam path (the two Se of a column, or atoms of the two layers), each with its own ellipse. Top: length scales (log axis; 1 Å = 100 pm): electron optics at 25 mrad (blue; filled: 80 kV, these data), specimen (gray), and our accuracy against truth on simulated data (red); model error exceeds the shot-noise ellipses of (c) (§ 5.3).

1 Introduction

Can a microscope report every atom’s position with an error bar (Fig. 1)? Electron ptychography comes closest. A focused electron probe scans a thin specimen, and a detector records a diffraction pattern of Poisson counts at every position: a four-dimensional scanning transmission electron microscopy (4D-STEM) dataset (Fig. 1a). Current codes reconstruct a pixel image from these patterns and add freedom until the fit is good: free probe modes – mutually incoherent wavefields of unconstrained pixels – absorb what the physics misses, including part of the atoms’ own signal (Fig. 2). The fit improves, but it can no longer say how well it knows any one atom. 4D-TEMPO puts atoms before pixels: it fits atoms, the microscope, and the detector directly to the counts, as crystallographic refinement fits a structure to diffraction data [45]. In vision terms, this is inverse rendering via “analysis by synthesis”: a physical renderer – the multislice model of electron scattering – maps Gaussian atoms to expected patterns, much as NeRF fits a radiance field to photos [44]. The differentiable renderer gives its Jacobian and the Fisher information (FI): an error bar for every atom, which parameters the data determine, and the dose an experiment needs, in advance (Fig. 1c).

A 300 kV electron has wavelength λ=2\lambda=2 pm, but lens aberrations limit the beam to a cone of semi-angle α\alpha of tens of milliradians, setting the diffraction-limited resolution λ/α\lambda/\alpha to 0.66 Å (1 Å = 100 pm) at 30 mrad. Electron ptychography shifts this limit from optics to computation, reaching 0.39 Å in a 2D material [24] and the thermal-vibration limit (20 pm resolution) [6], recovering depth, and enabling low-dose imaging of frozen biological specimens [72]. The dose, the number of electrons sent through each Å2 of specimen, is capped by the specimen itself: each electron can deposit energy that breaks bonds or knocks atoms out. Frozen biological specimens tolerate tens of electrons per Å2; in the WSe2 bilayer studied here, selenium vacancies appear by about 5×1055\times 10^{5} [22]. Every electron must therefore count. 3D atom positions and vibrations reveal how twisted 2D crystal layers relax [22], how moiré phasons dominate atomic vibrations [69], how atoms vibrate under heating [2], and where hydrogen sits in metals [57]. Each question demands quantitative numbers with error bars; beam-sensitive and changing specimens also demand low dose and reconstruction fast enough to follow them.

Three computational obstacles stand in the way. 1) A dataset contains up to 10910^{9} measurements, and multiple scattering makes the renderer strongly nonlinear. 2) Microscope aberrations, coherence, and detector response are known only approximately and must be fitted with the specimen. 3) Existing codes reconstruct millions of pixels per slice with free probe modes [61], introduced for partial coherence but tied to neither source nor lens, so they absorb detector blur, drift, and model error with specimen signal.

Maximum-likelihood ptychography under Poisson or Gaussian noise [60, 47] reconstructs these pixel grids and extracts atom positions and uncertainties post hoc, as in the published pipeline for twisted tungsten diselenide (WSe2) bilayers [22]. Yet atoms are far fewer than pixels, and an atom’s potential is a known function of position, species, and thermal width. Diederichs et al. put atoms directly into the inversion, fitting atoms and a physical instrument to experimental 4D-STEM data via differentiable multislice under an L1L_{1} loss [11]. Meanwhile, the FI has designed STEM experiments for atom-column positions [64] and bounded 4D-STEM precision [12]. We take the next step: atoms, instrument, and pixels share one Poisson likelihood with a physical detector model. We add free modes only to test the likelihood and where atoms are incomplete.

\psi_{1}$$\psi_{2}free mode(a) probe statesdots: coherent copiesplane: their span, setby χ\chi, σf\sigma_{f} and σsrc\sigma_{\mathrm{src}}atom column \mathbf{a}_{k}$$|R_{kk}|$$|R_{kk}|(b) Jacobian columnsline: span of a physicalinstrumentplane: span with free modes

Figure 2: Free probe modes make each atom less determined. (a) A physical microscope makes probes only from a small family set by its aberrations χ\chi and coherence (σf\sigma_{f}, σsrc\sigma_{\mathrm{src}}): the dots, which lie in a plane (Eq. 13). A free probe mode can be any wave, so it can leave the plane. (b) Each arrow is how the predicted counts change when one parameter moves, in units of the noise. Only the part of an atom’s arrow ak\mathbf{a}_{k} that no instrument change can imitate, its height ∣Rkk∣|R_{kk}| above the instrument’s span, informs that atom and sets its error bar (§ 6). Free modes widen the span to the red plane, imitate more of the atom’s signal, and shrink ∣Rkk∣|R_{kk}|.

References (73)

  • Real-space refinement in PHENIX for cryo-EM and crystallography
  • Quantitative atomic resolution electron ptychography of thermal vibrations under in situ heating
  • On the optical stability of high-resolution transmission electron microscopes
  • Improving multislice electron ptychography with a generative prior (opens arXiv in a new tab)
  • Neural field-based 3D surface reconstruction of microstructures from multi-detector signals in scanning electron microscopy
  • Electron ptychography achieves atomic-resolution limits set by lattice vibrations
  • Dataset: Electron ptychography achieves atomic-resolution limits set by lattice vibrations
  • Space-time implicit neural representations for atomic electron tomography on dynamic samples
  • Diffusion posterior sampling for general noisy inverse problems (opens arXiv in a new tab)
  • The scattering of electrons by atoms and crystals
  • Exact inversion of partially coherent dynamical electron scattering for picometric structure retrieval
  • Quantum and classical Fisher information in four-dimensional scanning transmission electron microscopy
  • Dynamic black-hole emission tomography with physics-informed neural fields
  • A practical algorithm for the determination of phase from image and diffraction plane pictures
  • Bayes’ rays: Uncertainty quantification for neural radiance fields
  • Efficient algorithms for computing a strong rank-revealing QR factorization
  • Finding structure with randomness: Probabilistic algorithms for constructing approximate matrix decompositions
  • Effect of thermal diffuse scattering on propagation of high energy electrons through crystals
  • Thermal vibrations in the inversion of dynamical electron scattering
  • 3D mapping of defects and moiré corrugations via electron ptychography atomic coordinate retrieval
  • Event driven 4D STEM acquisition with a Timepix3 detector: Microsecond dwell time and faster scans for high precision and low dose applications
  • Electron ptychography of 2D materials to deep sub-ångström resolution
  • 3D Gaussian splatting for real-time radiance field rendering
  • Adam: A Method for Stochastic Optimization
  • Koenderink
  • PtyRAD: A high-performance and flexible ptychographic reconstruction framework with automatic differentiation
  • Airborne three-dimensional cloud tomography
  • Gravitationally lensed black hole emission tomography
  • CryoAI: Amortized inference of poses for ab initio reconstruction of 3D molecular volumes from real cryo-EM images
  • Missing wedge inpainting and joint alignment in electron tomography through implicit neural representations (opens arXiv in a new tab)
  • Liu and Jorge Nocedal
  • Thermal vibrations in convergent-beam electron diffraction
  • PtyRANNOSAUR: Ptychography with robust artificial neural networks optimized for sub-ångstrom accuracy and ultrafast reconstruction (opens arXiv in a new tab)
  • Maiden and John M. Rodenburg
  • Phonons in twisted transition-metal dichalcogenide bilayers: Ultrasoft phasons and a transition from a superlubric to a pinned phase
  • AnyAtom: Domain-randomized atomic priors for electron tomography
  • A randomized algorithm for the decomposition of matrices
  • C. McCray, Stephanie M. Ribet, Georgios Varnavides, and Colin Ophus (opens arXiv in a new tab)
  • NeRF: Representing scenes as neural radiance fields for view synthesis
  • Refinement of macromolecular structures by the maximum-likelihood method
  • Achieving sub-0.5-angstrom–resolution ptychography in an uncorrected electron microscope
  • Iterative least-squares solver for generalized maximum-likelihood ptychography
  • Deep learning techniques for inverse problems in imaging
  • Very-high dynamic range, 10,000 frames/second pixel array detector for electron microscopy
  • A phase retrieval algorithm for shifting illumination
  • 4D cloud scattering tomography
  • ELSEPA—Dirac partial-wave calculation of elastic scattering of electrons and positrons by atoms, positive ions and molecules
  • py4DSTEM: A software package for four-dimensional scanning transmission electron microscopy data analysis
  • Electron ptychography images hydrogen atom superlattices and 3D inhomogeneities in palladium hydride nanoparticles
  • A Gaussian parameterization for direct atomic structure identification in electron tomography (opens arXiv in a new tab)
  • High dynamic range pixel array detector for scanning transmission electron microscopy
  • Maximum-likelihood refinement for coherent diffractive imaging
  • Reconstructing state mixtures from diffraction measurements
  • High-resolution scanning X-ray diffraction microscopy
  • Deep image prior
  • Optimal experimental design of STEM measurement of atom column positions
  • Method for retrieval of the three-dimensional object potential by inversion of dynamical electron scattering
  • Iterative phase retrieval algorithms for scanning transmission electron microscopy, 2023 (opens arXiv in a new tab)
  • PtychoShelves, a versatile high-level framework for high-performance analysis of ptychographic data
  • Passive ultra-wideband single-photon imaging
  • Atom-by-atom imaging of moiré phasons with electron ptychography
  • Wide-field, high-resolution Fourier ptychographic microscopy
  • CryoDRGN2: Ab initio neural reconstruction of 3D protein structures from real cryo-EM images
  • Atoms start from the lattice, widths from a shared value per species
  • On real data every parameter is scaled by its Fisher standard deviation from a dense $K=8$ Fisher matrix computed once at an earlier nearby fit; the simulated-bilayer fits scale each parameter group by a fixed constant
  • Waves are single-precision complex, and the likelihood is accumulated in double precision
  • $T$ is the rest
  • Remove the exact gauge directions
  • The Schur complement over the instrument gives the profiled bars, and $\mathrm{sd}(\sqrt{U_{a}})=\mathrm{sd}(U_{a})/(2\sqrt{U_{a}})$
  • The ratio measures how far the species-width model is from the data
  • Cost: one fit per redraw
  • The gun (source size, energy spread), the detector, the aperture, $C_{s}$ and the second-order aberrations $\mathbf{A}_{2}$ and $\mathbf{B}_{2}$ transfer while the corrector is not retuned; on a second scan of the same session the coherence widths hold only to one or two low-dose thresholds (§S16)
  • A Gaussian spread of probe positions adds to $\sigma_{\mathrm{src}}$ in quadrature