maxwelllink.tools.transverse_components module

Evaluating the transverse components of a Gaussian polarization distribution in 3D, 2D, and 1D systems.

maxwelllink.tools.transverse_components.calc_transverse_components_3d(size=(20, 20, 20), dx=1.0, sigma=1.0, mu12=0.10, local_size=100, component='z')[source]

Calculate the transverse components of a 3D Gaussian polarization distribution with optional MPI optimization.

Parameters:
  • size (tuple of float of length 3) – The size of the simulation box in each dimension.

  • dx (float) – The spatial resolution (grid spacing) = 1 / resolution.

  • sigma (float) – The width of the Gaussian distribution.

  • mu12 (float) – The transition dipole moment scaling factor.

  • local_size (float) – The size of the local box for FFT calculations, which should be larger than size for convergence.

  • component (str) – The component of the polarization to calculate (‘x’, ‘y’, or ‘z’). Default is ‘z’.

maxwelllink.tools.transverse_components.calc_transverse_components_cylindrical(size=(20, 20, 20), dx=1.0, sigma=1.0, mu12=0.10, local_size=100)[source]

Calculate the transverse polarization kernel of an on-axis z-oriented dipole on the cylindrical (r, z) half-plane.

By azimuthal symmetry the kernel of a z dipole has only radial and axial components, which equal the x- and z-components of the 3D transverse kernel on the y = 0 plane: Pr_t(r, z) = Px_t(x=r, y=0, z) and Pz_t(r, z) = Pz_t(x=r, y=0, z).

Hence, we simply reuse the cached 3D computation at y = 0 for the cylindrical case.

Parameters:
  • size (tuple of float of length 3) – The 3D kernel box (Lx, Ly, Lz); cylindrical callers pass (L, L, Lz) for a molecule of transverse extent L (the slice assumes Lx == Ly).

  • dx (float) – The spatial resolution (grid spacing) = 1 / resolution.

  • sigma (float) – The width of the Gaussian distribution.

  • mu12 (float) – The transition dipole moment scaling factor.

  • local_size (float) – The size of the local box for FFT calculations.

Returns:

(r, z, Pr_t, Pz_t): half-plane coordinates relative to the kernel center (r >= 0) and the real 2D kernel tables of shape (r.size, z.size).

Return type:

tuple

maxwelllink.tools.transverse_components.project_transverse_field_3d(ex, ey, ez, dx)[source]

Return the transverse part of a sampled 3D electric field.

Parameters:
  • ex (numpy.ndarray) – Matching 3D arrays containing the sampled electric-field components.

  • ey (numpy.ndarray) – Matching 3D arrays containing the sampled electric-field components.

  • ez (numpy.ndarray) – Matching 3D arrays containing the sampled electric-field components.

  • dx (float) – Uniform grid spacing used to build the FFT wave vectors.

Returns:

Transverse-projected electric-field components (ex_t, ey_t, ez_t) on the same grid as the inputs.

Return type:

tuple of numpy.ndarray