This application computes holographic phase masks for
optical tweezers. A Spatial Light Modulator (SLM) displays
the computed phase pattern, shaping a laser beam to create multiple
tightly focused traps that can hold and manipulate microscopic particles.
How to Use
Set the desired resolution, wavelength, and iteration parameters.
Click Initialize to configure the phase mask generator.
Select Create mode, then click on the Trap Positions canvas to place traps.
The phase mask updates automatically after each action. You can also click Recalculate manually.
Interaction Modes
Create — Click on the trap canvas to add a new optical trap at that position.
Move — Click near an existing trap to select it, then drag to reposition.
Delete — Click near an existing trap to remove it.
Parameters
Resolution — Width and height of the phase mask in pixels (e.g., 512x512). Higher values give finer control but take longer to compute.
Wavelength — Laser wavelength in nanometers (e.g., 632 nm for He-Ne). Determines the wave vector used in phase calculations.
Max Iterations — Maximum number of Gerchberg-Saxton iterations. More iterations may improve trap uniformity.
Tolerance — Convergence threshold. The algorithm stops early if the relative change in error falls below this value.
Phase Mask Visualization
The right panel shows the computed phase mask as a grayscale image.
Each pixel value (0–255) maps to a phase shift of 0 to 2π applied
by the SLM. The pattern encodes the interference of all trap
contributions and produces the desired focal-plane intensity distribution
when illuminated by a plane wave.
Convergence Graph
The convergence plot shows the RMS intensity error across iterations.
A decreasing curve indicates the algorithm is successfully equalizing
trap intensities. If the curve plateaus, the algorithm has converged to
a stable solution. The uniformity metric (Imin/Imax)
quantifies how equal the trap intensities are, with 1.0 being perfect.