---
title: "Ptychography & Coherent Diffraction Imaging Interactive Lab | Sandbox Physics"
description: "How can overlapping illumination recover both the amplitude and the phase of an object without a lens?"
canonical_url: "https://sandboxphysics.com/labs/ptychography-coherent-diffraction-imaging/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/ptychography-coherent-diffraction-imaging/"
last_modified: "2026-10-27"
---

Optics 072 · Diffraction, Fourier optics, and computational imaging

# Ptychography & Coherent Diffraction Imaging

**How can overlapping illumination recover both the amplitude and the phase of an object without a lens?** Neighboring illuminated patches overlap, so every part of the object shows up in several diffraction patterns. That redundancy gives an iterative algorithm enough constraints to recover both amplitude and phase, with no lens. One thing stays unknown: adding a constant phase to the whole object changes no intensity.

Image a specimen without a lens from overlapping diffraction patterns. The specimen moves through the beam, the camera records Poisson counts, and the PIE algorithm recovers amplitude and phase with a known probe.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The specimen is synthetic, thin and scalar; the probe and scan positions are known, and the field uses a finite number of Fourier modes. The reconstruction is not blind. A constant phase offset and dark regions of the specimen cannot be observed.

Physics tutorial

## Audit the physics of Ptychography & Coherent Diffraction Imaging

**Background** A small, known probe beam lights part of an unknown thin specimen, and the exit wave is the probe times the specimen. Far downstream, a camera records only $I_j=|\mathcal F\{P\,O_j\}|^2$. The specimen moves between exposures, so every region lit more than once has to agree with several intensity patterns at the same time. There is no imaging lens between specimen and detector.

**Why it matters** How can overlapping illumination recover both the amplitude and the phase of an object without a lens?

Start with the essentials

- **Focus question**: How can overlapping illumination recover both the amplitude and the phase of an object without a lens?
- **One-sentence intuition**: Intensity cannot see a constant phase added to the whole field: $|\mathcal F\{e^{i\phi_0}P O_j\}|^2=I_j$. Adding such a phase rotates every phase color but leaves the predicted counts unchanged. If the lit regions form separate islands, each island can carry its own offset.

### Core mathematical model

#### Recording the intensity of the exit wave

$$
\begin{aligned}\psi_j&=P O_j\\\mu_{jq}&=\frac{N_{\rm in}|\mathcal F\psi_j|_q^2}{n^2\sum |P|^2}\\D_{jq}&\sim\operatorname{Poisson}(\mu_{jq})\end{aligned}
$$

The model uses a finite set of discrete Fourier modes and a detector with unit efficiency. The normalization conserves the transmitted power without undoing absorption. With noise turned off, the record holds the expected counts.

#### Measured modulus, estimated phase

$$
\psi'_j=\mathcal F^{-1}\!\left[\sqrt{D_j/a}\,e^{i\arg(\mathcal F\psi_j)}\right]
$$

At the detector plane, only the amplitudes from the measured photoelectron counts constrain the field. The scale factor is calibrated, and the true detector phase is never supplied.

#### Original soft-probe PIE

$$
\begin{aligned}W&=\frac{|P|}{|P|_{\max}}\frac{P^*}{|P|^2+0.01}\\O_j&\leftarrow O_j+\beta W(\psi'_j-\psi_j)\end{aligned}
$$

This is Eq. 6 of the reference chapter, with a step size you choose. Object pixels shared by several scan positions collect the constraints from every overlapping frame. The probe is known and is not estimated along with the object, so this is not blind ePIE.

#### Object and detector sampling are linked

$$
\Delta x_D=\frac{\lambda z}{n\Delta x_O}=2.078125\,\mathrm{mm}
$$

The values are a 532 nm wavelength, 250 mm of propagation and a 64 micrometre patch width. The model is a scalar, paraxial far field. It does not integrate over continuous pixels at high NA and is not a metrology tool.

### Common difficulties

#### Does a small residual prove the object is right?

**Typical misconception** Once the model fits a diffraction pattern, the whole specimen is known.

**Better mental model** No. With a single frame, unlit regions or phase ambiguities, other objects can fit the data too. Overlap ties the estimates together, but it does not guarantee a unique answer or convergence. The true object is stored separately and used only for scoring.

### Run the experiment

1. 01

   #### Scene 1: Overlapping scan · phase recovered

   Pause and look at the scan positions. The stage moves opposite to the probe coordinates, so the illuminated point on the lab axis stays fixed.

   **What to observe:** PIE never sees the diffraction phase or the true object. The known probe and the exact scan positions are calibration assumptions; this Lab does not recover them.

2. 02

   #### Scene 2: Disconnected illumination · ambiguity

   Replay from zero to thirty passes. Compare the acquired and predicted diffraction patterns, then compare the recovered amplitude and phase with the true answers, which are labelled separately.

   **What to observe:** Absorption lowers the expected total number of detected photoelectrons. Every frame keeps its physical scale, and the displays use a separate, fixed logarithmic scale.

3. 03

   #### Scene 3: Photon-starved diffraction

   Try disconnected illumination, a single frame, low Poisson counts and different seeds. Then rotate the phase offset, which the intensity data cannot detect.

   **What to observe:** Pixels that were never illuminated are shown dark in the reconstruction. Scoring against the true object removes only one constant phase, and the score is never fed back to the solver.

Physical conclusion

Overlapping scans let intensity measurements pin down one shared complex object. Keep track of what was measured, what was assumed and what still cannot be known.

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
