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.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