ToolPythonIntermediate Gerchberg-Saxton algorithm in NumPy: a phase-only hologram for 25 spots return np.round(np.mod(phi, 2 * np.pi) / (2 * np.pi) * M) % M * (2 * np.pi / M)phi_shifted = np.mod(phi_8bit + grating, 2 * np.pi)I_shift = intensity_with_leak(np.mod(phi + grating, 2 * np.pi))
ToolPythonIntermediate The wave equation with leapfrog finite differences: a pulse on a string s = np.mod(s, 2 * L)