Skip to content

qiu_classical_simulation.wave_optics.gaussian_beam

Gaussian beams through paraxial optical systems, with ABCD ray transfer matrices.

A Gaussian beam of waist radius w0, a distance d behind its waist, is described by its complex beam parameter q = d + i z_R, with the Rayleigh range z_R = pi w0**2 / wavelength. A system of ray transfer matrix [[A, B], [C, D]] maps it to q' = (A q + B) / (C q + D), from which the radius of curvature R of the wavefront and the beam radius w follow by 1 / q' = 1 / R - i wavelength / (pi w**2).

The matrices of a sequence of elements multiply in reverse order, the last element first: thin_lens_matrix(f) followed by propagation_matrix(d) is propagation_matrix(d) @ thin_lens_matrix(f).

Functions:

  • propagation_matrix –

    Return the ray transfer matrix of a free propagation over a distance.

  • thin_lens_matrix –

    Return the ray transfer matrix of a thin lens of a focal length.

  • rayleigh_range –

    Return the Rayleigh range of a Gaussian beam of a waist radius.

  • beam_after_system –

    Return the wavefront curvature radius and beam radius after an optical system.

  • beam_after_free_space –

    Return (R, w) of a beam after a propagation from its waist in a medium.

  • beam_after_thin_lens –

    Return (R, w) of a beam after a thin lens and a propagation behind it.

  • gaussian_signal –

    Return the field exp(-(x - mean)**2 / waist**2) of a Gaussian beam on an axis.

propagation_matrix

propagation_matrix(distance: float) -> NDArray[float64]

Return the ray transfer matrix of a free propagation over a distance.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
20
21
22
def propagation_matrix(distance: float) -> npt.NDArray[np.float64]:
    """Return the ray transfer matrix of a free propagation over a distance."""
    return np.array([[1.0, distance], [0.0, 1.0]])

thin_lens_matrix

thin_lens_matrix(focal_length: float) -> NDArray[float64]

Return the ray transfer matrix of a thin lens of a focal length.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
25
26
27
def thin_lens_matrix(focal_length: float) -> npt.NDArray[np.float64]:
    """Return the ray transfer matrix of a thin lens of a focal length."""
    return np.array([[1.0, 0.0], [-1 / focal_length, 1.0]])

rayleigh_range

rayleigh_range(waist: float, wavelength: float) -> float

Return the Rayleigh range of a Gaussian beam of a waist radius.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
30
31
32
def rayleigh_range(waist: float, wavelength: float) -> float:
    """Return the Rayleigh range of a Gaussian beam of a waist radius."""
    return np.pi * waist**2 / wavelength

beam_after_system

beam_after_system(waist: float, distance_from_waist: float, wavelength: float, matrix: NDArray[float64]) -> tuple[float, float]

Return the wavefront curvature radius and beam radius after an optical system.

Parameters:

  • waist (float) –

    The waist radius of the incoming beam.

  • distance_from_waist (float) –

    The distance the beam propagated from its waist to the entrance of the system.

  • wavelength (float) –

    The wavelength in the medium.

  • matrix (NDArray[float64]) –

    The ray transfer matrix of the system.

Returns:

  • float –

    The radius of curvature R of the wavefront, infinite for a flat one, and the

  • float –

    beam radius w, at the exit of the system.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
def beam_after_system(
    waist: float,
    distance_from_waist: float,
    wavelength: float,
    matrix: npt.NDArray[np.float64],
) -> tuple[float, float]:
    """Return the wavefront curvature radius and beam radius after an optical system.

    Args:
        waist: The waist radius of the incoming beam.
        distance_from_waist: The distance the beam propagated from its waist to the
            entrance of the system.
        wavelength: The wavelength in the medium.
        matrix: The ray transfer matrix of the system.

    Returns:
        The radius of curvature `R` of the wavefront, infinite for a flat one, and the
        beam radius `w`, at the exit of the system.
    """
    (a, b), (c, d) = matrix
    q_in = distance_from_waist + 1j * rayleigh_range(waist, wavelength)
    q_out = (a * q_in + b) / (c * q_in + d)
    inverse_q = 1 / q_out
    radius_of_curvature = np.inf if inverse_q.real == 0 else 1 / inverse_q.real
    beam_radius = np.sqrt(-wavelength / (np.pi * inverse_q.imag))
    return float(radius_of_curvature), float(beam_radius)

beam_after_free_space

beam_after_free_space(waist: float, distance: float, wavelength: float, refractive_index: float) -> tuple[float, float]

Return (R, w) of a beam after a propagation from its waist in a medium.

Parameters:

  • waist (float) –

    The waist radius of the beam.

  • distance (float) –

    The propagation distance from the waist.

  • wavelength (float) –

    The vacuum wavelength.

  • refractive_index (float) –

    The refractive index of the medium.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
63
64
65
66
67
68
69
70
71
72
73
74
75
76
def beam_after_free_space(
    waist: float, distance: float, wavelength: float, refractive_index: float
) -> tuple[float, float]:
    """Return `(R, w)` of a beam after a propagation from its waist in a medium.

    Args:
        waist: The waist radius of the beam.
        distance: The propagation distance from the waist.
        wavelength: The vacuum wavelength.
        refractive_index: The refractive index of the medium.
    """
    return beam_after_system(
        waist, 0.0, wavelength / refractive_index, propagation_matrix(distance)
    )

beam_after_thin_lens

beam_after_thin_lens(waist: float, distance: float, focal_length: float, wavelength: float, refractive_index: float, distance_from_waist: float = 0.0) -> tuple[float, float]

Return (R, w) of a beam after a thin lens and a propagation behind it.

Parameters:

  • waist (float) –

    The waist radius of the incoming beam.

  • distance (float) –

    The propagation distance behind the lens.

  • focal_length (float) –

    The focal length of the lens.

  • wavelength (float) –

    The vacuum wavelength.

  • refractive_index (float) –

    The refractive index of the medium around the lens.

  • distance_from_waist (float, default: 0.0 ) –

    The distance from the waist of the incoming beam to the lens.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
def beam_after_thin_lens(
    waist: float,
    distance: float,
    focal_length: float,
    wavelength: float,
    refractive_index: float,
    distance_from_waist: float = 0.0,
) -> tuple[float, float]:
    """Return `(R, w)` of a beam after a thin lens and a propagation behind it.

    Args:
        waist: The waist radius of the incoming beam.
        distance: The propagation distance behind the lens.
        focal_length: The focal length of the lens.
        wavelength: The vacuum wavelength.
        refractive_index: The refractive index of the medium around the lens.
        distance_from_waist: The distance from the waist of the incoming beam to the
            lens.
    """
    matrix = propagation_matrix(distance) @ thin_lens_matrix(focal_length)
    return beam_after_system(
        waist, distance_from_waist, wavelength / refractive_index, matrix
    )

gaussian_signal

gaussian_signal(axis: PhysicalAxis, waist: float, mean: float) -> AlgebraicSignal

Return the field exp(-(x - mean)**2 / waist**2) of a Gaussian beam on an axis.

Source code in packages/qiu-classical-simulation/src/qiu_classical_simulation/wave_optics/gaussian_beam.py
104
105
106
def gaussian_signal(axis: PhysicalAxis, waist: float, mean: float) -> AlgebraicSignal:
    """Return the field `exp(-(x - mean)**2 / waist**2)` of a Gaussian beam on an axis."""
    return AlgebraicSignal(axis, lambda x: np.exp(-((x - mean) ** 2) / waist**2))