Skip to content

Wavefront

svetlanna.Wavefront

Bases: Tensor

Class that represents wavefront. It is a subclass of torch.Tensor with additional properties and methods for wavefront analysis and generation.

intensity property

intensity: Tensor

Intensity of the wavefront.

Returns:

  • Tensor

    Intensity (\(|E|^2\)).

max_intensity property

max_intensity: float

Maximum intensity of the wavefront.

Returns:

  • float

    Maximum intensity value.

phase property

phase: Tensor

Phase of the wavefront.

Returns:

  • Tensor

    Phase angle in the range \([-\pi, \pi]\).

fwhm

fwhm(
    simulation_parameters: SimulationParameters,
) -> tuple[float, float]

Full width at half maximum (FWHM) of the wavefront intensity.

Parameters:

Returns:

  • tuple[float, float]

    FWHM along x and y axes.

plane_wave classmethod

plane_wave(
    simulation_parameters: SimulationParameters,
    distance: float = 0.0,
    wave_direction: Any = None,
    initial_phase: float = 0.0,
) -> Self

Create a plane wave wavefront defind by the formula $$ E(x, y) = \exp\left( i \left( k_x x + k_y y + k_z z + \phi_0 \right) \right) $$

Parameters:

  • simulation_parameters (SimulationParameters) –

    Simulation parameters.

  • distance (float, default: 0.0 ) –

    Free wave propagation distance \(z\), by default 0.

  • wave_direction (Any, default: None ) –

    Three component tensor-like vector with (\(d_x\), \(d_y\), \(d_z\)) coordinates, so \(\vec{k} = k \frac{\vec{d}}{||\vec{d}||}\) The resulting field propagates along the vector, by default the wave propagates along z direction.

  • initial_phase (float, default: 0.0 ) –

    Additional phase offset (\(\phi_0\)), by default 0.

Returns:

gaussian_beam classmethod

gaussian_beam(
    simulation_parameters: SimulationParameters,
    waist_radius: float,
    distance: float = 0.0,
    dx: float = 0.0,
    dy: float = 0.0,
) -> Self

Generates the Gaussian beam wavefront defined by the formula $$ E(x, y) = \frac{w_0}{w(z)} \exp\left( -\frac{(x - d_x)^2 + (y - d_y)^2}{w(z)^2} \right) \newline \cdot \exp\left( i \left( k z + k\frac{(x - d_x)^2 + (y - d_y)^2}{2 R(z)} - \zeta(z) \right) \right) $$ where \(w(z) = w_0 \sqrt{1 + \left( \frac{z}{z_R} \right)^2}\), \(R(z) = z \left( 1 + \left( \frac{z_R}{z} \right)^2 \right)\), \(\zeta(z) = \arctan\left( \frac{z}{z_R} \right)\), and \(z_R = \frac{\pi w_0^2}{\lambda}\) is the Rayleigh range.

Parameters:

  • simulation_parameters (SimulationParameters) –

    Simulation parameters.

  • waist_radius (float) –

    Beam waist radius (\(w_0\)).

  • distance (float, default: 0.0 ) –

    Free wave propagation distance \(z\), by default 0.

  • dx (float, default: 0.0 ) –

    Horizontal offset of the beam center (\(d_x\)), by default 0.

  • dy (float, default: 0.0 ) –

    Vertical offset of the beam center (\(d_y\)), by default 0.

Returns:

  • Wavefront

    Gaussian beam field in the oXY plane.

spherical_wave classmethod

spherical_wave(
    simulation_parameters: SimulationParameters,
    distance: float,
    initial_phase: float = 0.0,
    dx: float = 0.0,
    dy: float = 0.0,
) -> Self

Generate wavefront of the spherical wave $$ E(x, y) = \frac{1}{r} \exp\left( i \left( k r + \phi_0 \right) \right) $$ where \(r = \sqrt{(x - d_x)^2 + (y - d_y)^2 + z^2}\) is the distance from the point source to the point \((x, y)\) in the oXY plane.

Parameters:

  • simulation_parameters (SimulationParameters) –

    Simulation parameters.

  • distance (float) –

    Distance from the point source to the oXY plane (\(z\)).

  • initial_phase (float, default: 0.0 ) –

    Phase offset at the source (\(\phi_0\)), by default 0.

  • dx (float, default: 0.0 ) –

    Horizontal position of the point source (\(d_x\)), by default 0.

  • dy (float, default: 0.0 ) –

    Vertical position of the point source (\(d_y\)), by default 0.

Returns:

  • Wavefront

    Spherical wave field in the oXY plane.

hermite_gauss classmethod

hermite_gauss(
    simulation_parameters: SimulationParameters,
    waist_radius: float,
    distance: float = 0.0,
    dx: float = 0.0,
    dy: float = 0.0,
    m: int = 0,
    n: int = 0,
) -> Self

Generates the Hermite-Gaussian mode wavefront defined by the formula $$ E(x, y) = \frac{w_0}{w(z)} H_m\left(\frac{\sqrt{2}(x-d_x)}{w_0}\right) H_n\left(\frac{\sqrt{2}(y-d_y)}{w_0}\right) \exp\left( -\frac{(x - d_x)^2 + (y - d_y)^2}{w(z)^2} \right) \newline \cdot \exp\left( i \left( k z + k\frac{(x - d_x)^2 + (y - d_y)^2}{2 R(z)} - \zeta(z) \right) \right) $$ where \(w(z) = w_0 \sqrt{1 + \left( \frac{z}{z_R} \right)^2}\), \(R(z) = z \left( 1 + \left( \frac{z_R}{z} \right)^2 \right)\), \(\zeta(z) = (m+n+1)\arctan\left( \frac{z}{z_R} \right)\), and \(z_R = \frac{\pi w_0^2}{\lambda}\) is the Rayleigh range.

Parameters:

  • simulation_parameters (SimulationParameters) –

    Simulation parameters.

  • waist_radius (float) –

    Beam waist radius (\(w_0\)).

  • distance (float, default: 0.0 ) –

    Free wave propagation distance \(z\), by default 0.

  • dx (float, default: 0.0 ) –

    Horizontal offset of the mode center (\(d_x\)), by default 0.

  • dy (float, default: 0.0 ) –

    Vertical offset of the mode center (\(d_y\)), by default 0.

  • m (int, default: 0 ) –

    Mode index in the x direction, by default 0 (fundamental mode).

  • n (int, default: 0 ) –

    Mode index in the y direction, by default 0 (fundamental mode).

Returns: