pado.optical_element.SLM

class SLM(dim, pitch, wvl, device, polar='non')[source]
Parameters:
__init__(dim, pitch, wvl, device, polar='non')[source]

Spatial Light Modulator (SLM) optical element.

Parameters:
  • dim (tuple) – Field dimensions (B, 1, R, C) for batch, channels, rows, cols

  • pitch (float) – Pixel pitch in meters

  • wvl (float) – Wavelength in meters

  • device (str) – Device for computation (‘cpu’, ‘cuda:0’, etc.)

  • polar (str) – Polarization mode (‘non’ or ‘polar’)

Examples

>>> slm = SLM(dim=(1,1,1024,1024), pitch=6.4e-6, wvl=633e-9, device='cuda:0')
set_lens(focal_length, shift_x=0, shift_y=0)[source]

Set phase profile to implement a thin lens.

Parameters:
  • focal_length (float) – Focal length in meters

  • shift_x (float) – Lateral shift in x direction in meters

  • shift_y (float) – Lateral shift in y direction in meters

Return type:

None

Examples

>>> slm.set_lens(focal_length=0.5, shift_x=100e-6)  # 500mm focal length, 100μm x-shift
set_amplitude_change(amplitude, wvl)[source]

Set amplitude modulation profile of the SLM.

Parameters:
  • amplitude (torch.Tensor) – Amplitude modulation profile [B, 1, R, C]

  • wvl (float) – Operating wavelength in meters

Return type:

None

Examples

>>> amp = torch.ones((1,1,1024,1024)) * 0.8  # 80% transmission
>>> slm.set_amplitude_change(amp, wvl=633e-9)
set_phase_change(phase_change, wvl)[source]

Set phase modulation profile of the SLM.

Parameters:
  • phase_change (torch.Tensor) – Phase modulation profile [B, 1, R, C] in radians

  • wvl (float) – Operating wavelength in meters

Return type:

None

Examples

>>> phase = torch.ones((1,1,1024,1024)) * np.pi  # π phase shift
>>> slm.set_phase_change(phase, wvl=633e-9)