---
title: "Mach–Zehnder Sensor Interactive Lab | Sandbox Physics"
description: "Can a Mach–Zehnder’s two outputs tell a refractive-index change from absorption or polarization marking? Partly."
canonical_url: "https://sandboxphysics.com/labs/mach-zehnder-sensor/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/mach-zehnder-sensor/"
last_modified: "2026-10-27"
---

Optics 047 · Interference, coherence, cavities, and metrology

# Mach–Zehnder Sensor

**Can a Mach–Zehnder’s two outputs tell a refractive-index change from absorption or polarization marking?** Partly. An index change only moves power from one output to the other, so the two outputs still add up to the same total. Absorption, and polarizers that reject the tagged light, take power out of both. Keeping track of where all the power goes tells these apart; a drop in fringe contrast alone cannot say which one caused it.

Light passes once through twin cells on a 3D Mach–Zehnder bench with correct mirror geometry. Watch the two complementary outputs, add sample absorption and project polarization with Jones matrices, then take a four-step phase measurement.

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

The modes are ideal, monochromatic and collinear; the beam splitters are lossless, balanced and nonpolarizing; the cell windows are compensated; the index change is uniform and nondispersive; and the sample transmission is prescribed. Diffraction, image reconstruction, detector noise, absolute fringe order, quantum photon statistics and delayed-choice arguments are not included, and no precision is claimed. The hardware is enlarged, and the flow markers are slowed.

Physics tutorial

## Audit the physics of Mach–Zehnder Sensor

**Background** In a Mach–Zehnder interferometer, each beam passes through its own arm just once. When the two cells have identical windows and the geometric paths match, the sample adds a phase of $\phi_s=2\pi L_c\Delta n/\lambda_0$. The sample is a uniform bulk cell that the beam fills completely; this is not a waveguide sensor that reads an effective index. The index difference is set directly and is not calculated from a gas pressure, temperature or concentration.

**Why it matters** Can a Mach–Zehnder’s two outputs tell a refractive-index change from absorption or polarization marking?

Start with the essentials

- **Focus question**: Can a Mach–Zehnder’s two outputs tell a refractive-index change from absorption or polarization marking?
- **One-sentence intuition**: Phase shifts power from one output to the other, while absorption and the analyzers take power out of the two measured outputs. The four powers always add up to the input: $P_++P_-+P_{\mathrm{abs}}+P_{\mathrm{rej}}=P_{\mathrm{in}}$. A drop in contrast on its own cannot tell you whether the cause is absorption, decoherence or which-path detection. The polarization effects here use classical Jones optics; no quantum measurement or nonlocality is simulated.

### Core mathematical model

#### One pass through the sample, not two as in a Michelson

$$
\begin{aligned}\phi&=\beta+\phi_s\\\phi_s&=\frac{2\pi L_c\Delta n}{\lambda_0}\\\Delta n_{\mathrm{period}}&=\frac{\lambda_0}{L_c}\end{aligned}
$$

The vacuum wavelength and cell length are both converted to metres. The two cells grow longer together, so the air paths stay matched. The bias comes from an ideal calibrated phase element; it is not worked out from the detector data. A longer cell gives more phase for each change in index, but the range of index that can be read without ambiguity gets smaller.

#### Lossless beamsplitters add fields, not powers

$$
\begin{aligned}B&=\frac1{\sqrt2}\begin{pmatrix}1&i\\i&1\end{pmatrix}\\\mathbf E_+&=\tfrac{i\sqrt{P_{\mathrm{in}}}}2(\mathbf v_r+\sqrt\tau e^{i\phi}\mathbf v_s)\\\mathbf E_-&=\tfrac{\sqrt{P_{\mathrm{in}}}}2(\mathbf v_r-\sqrt\tau e^{i\phi}\mathbf v_s)\end{aligned}
$$

At the first beamsplitter the reference beam is transmitted and the sample beam is reflected. The two folding mirrors add the same common phase. At zero phase, the plus output of the combiner interferes constructively and the minus output destructively. The field amplitude scales as the square root of the power transmission. The beamsplitters both transmit and reflect; the two opaque folding mirrors only reflect.

#### Polarization projection and output powers

$$
\begin{aligned}\mathbf v_r&=A\binom10,\quad\mathbf v_s=A\binom{\cos\theta}{\sin\theta}\\R&=\|\mathbf v_r\|^2,\ S=\tau\|\mathbf v_s\|^2\\C&=\sqrt\tau\,\mathbf v_r\!\cdot\!\mathbf v_s\\P_\pm&=\tfrac14P_{\mathrm{in}}(R+S\pm2C\cos\phi)\end{aligned}
$$

Without analyzers, A is the identity. With both analyzers in, A projects onto their common linear direction. The tag is an ideal lossless half-wave plate whose fast axis sits at half the chosen polarization rotation. The overlap after projection has a sign, so analyzers at minus 45 degrees flip the eraser fringes. With a 90-degree tag and 45-degree analyzers, the contrast comes back but half the power is blocked. The cited paper uses lossy polarizers in the arms and a different input normalization, so its factor of one eighth does not carry over to this lossless tag.

#### Where the power goes and how steep the response is

$$
\begin{aligned}P_{\mathrm{abs}}&=\tfrac12P_{\mathrm{in}}(1-\tau)\\P_{\mathrm{rej}}&=\tfrac12P_{\mathrm{in}}(1+\tau-R-S)\\V&=\frac{2|C|}{R+S}\\\frac{\partial(P_+-P_-)}{\partial\Delta n}&=-P_{\mathrm{in}}C\sin\phi\frac{2\pi L_c}{\lambda_0}\end{aligned}
$$

If no power reaches the detectors, the visibility is reported as zero. With the sample arm blocked, half the input stays in the reference arm and a quarter reaches each output, so neither detector goes completely dark. The response is steepest at quadrature; at a bright or dark extreme the intensity has zero first-order slope. The transmission is set independently, and the Lab claims no dispersion law linking absorption to index and no instrument detection limit.

#### Recovering the phase from four detector pairs

$$
\begin{aligned}\delta_j&=j\pi/2,\quad D_j=P_{+,j}-P_{-,j}\\\widehat\phi&=\operatorname{atan2}[s(D_3-D_1),s(D_0-D_2)]\\s&=\operatorname{sgn}C\\\widehat{\Delta n}_{\mathrm{pr}}&=\frac{\lambda_0}{2\pi L_c}\operatorname{wrap}_{(-\pi,\pi]}(\widehat\phi-\beta)\end{aligned}
$$

The recovery uses only four simulated power pairs, taken at known extra phase steps, and the calibrated sign of the overlap. If there is no modulation, no phase can be recovered and no reading is shown. Otherwise the result is still only a principal value: adding any whole number of the displayed index period gives exactly the same data. The principal branch excludes its endpoints. These noiseless, ideal measurements do not show real precision or the absolute fringe order.

### Common difficulties

#### The recovered value is not the absolute index

**Typical misconception** Four phase steps reveal the full index change no matter how long the cell is.

**Better mental model** Four steps remove the sign ambiguity of a single intensity reading, but they cannot fix the whole number of fringes. Increase the cell length and index until the principal reading wraps around. The index you set is the known true value, and the recovery cannot use it as extra information. With orthogonal tags and no analyzers, the data carry no phase modulation to recover.

### Run the experiment

1. 01

   #### Scene 1: Compensated index sensing

   Sweep the phase bias and the sample index. Compare the two complementary output powers with the four acquired pairs below the apparatus.

   **What to observe:** Two opaque mirrors fold the arms into the second beamsplitter, and both outputs end on the entrance faces of the photodiodes. No diagnostic chart sits in the optical path.

2. 02

   #### Scene 2: Phase versus absorption

   Switch to the absorption preset. Block the sample arm, then restore it, and compare the detected, absorbed and rejected fractions on one fixed scale.

   **What to observe:** The side view and the cell close-up show two matched cells of adjustable length and the open apertures in their mounts. Beam width and hardware size are schematic.

3. 03

   #### Scene 3: Polarization tag and eraser

   Set a 90-degree polarization tag. Insert the analyzers at 45 degrees, then at minus 45 degrees. The contrast returns both times, with the fringes flipped in sign.

   **What to observe:** Every plot shows simulated detector power. The phase sweep is a virtual calibrated scan, not a time record. The moving markers only show the beam routes.

Physical conclusion

A Mach–Zehnder sensor has to keep single-pass phase, power loss and polarization overlap apart, and to be clear about what its data cannot pin down.

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)
