wofry.propagator.util package

Submodules

wofry.propagator.util.gaussian_schell_model module

Gaussian-Schell model for partially coherent beams (1D and 2D).

class wofry.propagator.util.gaussian_schell_model.GaussianSchellModel1D(A, sigma_s, sigma_g)[source]

Bases: object

1-D Gaussian-Schell model for a partially coherent beam.

Implements the cross-spectral density W(x1, x2) = sqrt(S(x1)) sqrt(S(x2)) g(x1-x2) following Mandel and Wolf, Optical Coherence and Quantum Optics, p. 253.

S(x)[source]

Spectral density (intensity profile).

Parameters:

x (array_like) – Transverse coordinate [m].

Returns:

S(x) = A^2 exp(-x^2 / (2 sigma_s^2)).

Return type:

numpy.ndarray

a()[source]

Auxiliary parameter a = 1 / (4 sigma_s^2).

Return type:

float

b()[source]

Auxiliary parameter b = 1 / (2 sigma_g^2).

Return type:

float

beta(n)[source]

Eigenvalue of the n-th coherent mode.

Parameters:

n (int) – Mode order (0 = fundamental).

Returns:

beta_n = A^2 sqrt(pi/(a+b+c)) * (b/(a+b+c))^n.

Return type:

float

c()[source]

Auxiliary parameter c = sqrt(a^2 + 2ab).

Return type:

float

evaluate(x_1, x_2)[source]

Evaluate the cross-spectral density W(x1, x2).

Parameters:
  • x_1 (array_like) – First transverse coordinate [m].

  • x_2 (array_like) – Second transverse coordinate [m].

Returns:

W(x1, x2) = sqrt(S(x1)) sqrt(S(x2)) g(x1-x2).

Return type:

numpy.ndarray

g(x)[source]

Spectral degree of coherence.

Parameters:

x (array_like) – Coordinate difference x1 - x2 [m].

Returns:

g(x) = exp(-x^2 / (2 sigma_g^2)).

Return type:

numpy.ndarray

phi(n, x)[source]

n-th coherent-mode eigenfunction (normalised Hermite-Gaussian).

Parameters:
  • n (int) – Mode order.

  • x (array_like) – Transverse coordinate [m].

Returns:

phi_n(x).

Return type:

numpy.ndarray

class wofry.propagator.util.gaussian_schell_model.GaussianSchellModel2D(A, sigma_s_x, sigma_g_x, sigma_s_y, sigma_g_y)[source]

Bases: object

2-D Gaussian-Schell model for a partially coherent beam.

Separable product of two independent GaussianSchellModel1D instances (one per transverse axis), following Mandel and Wolf, Optical Coherence and Quantum Optics, p. 253.

beta(n_x, n_y)[source]

Eigenvalue of the (n_x, n_y) coherent mode.

Parameters:
  • n_x (int) – Mode order in x.

  • n_y (int) – Mode order in y.

Returns:

beta(n_x, n_y) = beta_x(n_x) * beta_y(n_y).

Return type:

float

evaluate(r_1, r_2)[source]

Evaluate the 2-D cross-spectral density W(r1, r2).

Parameters:
  • r_1 (array_like, shape (2,)) – First position vector [x1, y1] in metres.

  • r_2 (array_like, shape (2,)) – Second position vector [x2, y2] in metres.

Returns:

W(r1, r2) = W_x(x1, x2) * W_y(y1, y2).

Return type:

float or numpy.ndarray

phi(n_x, n_y, x, y)[source]

(n_x, n_y) coherent-mode eigenfunction evaluated at scalar coordinates.

Parameters:
  • n_x (int) – Mode order in x.

  • n_y (int) – Mode order in y.

  • x (float or array_like) – x coordinate [m].

  • y (float or array_like) – y coordinate [m].

Returns:

phi(n_x, n_y, x, y) = phi_x(n_x, x) * phi_y(n_y, y).

Return type:

numpy.ndarray

phi_nm(n_x, n_y, x_coords, y_coords)[source]

(n_x, n_y) coherent-mode eigenfunction on a 2-D grid (outer product).

Parameters:
  • n_x (int) – Mode order in x.

  • n_y (int) – Mode order in y.

  • x_coords (array_like, shape (Nx,)) – x coordinates [m].

  • y_coords (array_like, shape (Ny,)) – y coordinates [m].

Returns:

phi_nm = outer(phi_x(n_x, x_coords), phi_y(n_y, y_coords)).

Return type:

numpy.ndarray, shape (Nx, Ny)

sortedModeIndices(index_energy, n_points=50)[source]

Return mode indices (n, m) sorted by descending eigenvalue.

The sorted list is computed once and cached.

Parameters:
  • index_energy (int) – Rank of the desired mode (0 = highest eigenvalue).

  • n_points (int, optional) – Number of mode orders to consider in each direction. Default 50.

Returns:

  • n (int) – x-mode order of the requested ranked mode.

  • m (int) – y-mode order of the requested ranked mode.

Module contents