Wavefronts
The Wavefront class represents the complex amplitude of an electromagnetic field
. It is the object every optical element consumes and produces.
A torch.Tensor subclass
Wavefront inherits from torch.Tensor, so all tensor operations are available:
from svetlanna import Wavefront
# arithmetic
wf_sum = wf1 + wf2 # interference
wf_scaled = wf * 0.5 # attenuation
wf_conj = wf.conj() # complex conjugate
# move to the GPU
wf_gpu = wf.to("cuda")
# indexing
wf_slice = wf[100:400, 100:400]Factory methods
Plane wave
wf = Wavefront.plane_wave(params)By default a unit-amplitude, zero-phase field:
A tilted wave is obtained with wave_direction:
wf = Wavefront.plane_wave(params, wave_direction=[0.01, 0.0, 1.0])Gaussian beam
Basic
from svetlanna import Wavefront
from svetlanna.units import ureg
wf = Wavefront.gaussian_beam(params, waist_radius=0.5*ureg.mm)Gaussian amplitude distribution:
Parameters:
| Parameter | Description | Default |
|---|---|---|
waist_radius | Waist radius | — |
distance | Distance from the waist | 0.0 |
dx, dy | Offset of the centre | 0.0 |
Spherical wave
wf = Wavefront.spherical_wave(params, distance=50*ureg.mm)