interaction

Description

The interaction class applies the multipoles to model the interaction between an incident electromagnetic beam and a spherical scatterer using Mie theory defined in the glmt class. It supports incident beams of types: plane wave or focused. This class computes the resulting electric field contributions using the multipolar expansions and evaluates scattering, internal, and extinction cross-sections.
It uses the domain_class from the beam objects to enable spatial evaluation and visualization.

Initialization

interaction(beam, domain, nr, radius, mu=1, mu1=1, interaction="both")

beam_class instance. Defines the incident beam and provides parameters like wl, maxJ, mz_star, and polarization.

domain_class instance. Provides the 3D spatial grid and coordinate system for field evaluation.

float or array. Refractive index of the spherical scatterer relative to the surrounding medium.

float or array. Radius of the scatterer in microns.

float. Relative magnetic permeability of the scatterer (default: 1).

float. Relative magnetic permeability of the surrounding medium (default: 1).

str. Specifies which fields to compute. Options: "scattering", "internal", or "both" (default).

Methods


Returns True if both inputs are equal scalars or equal arrays, and False otherwise.


Computes the total multipolar field \(\mathbf{A}\) as a sum over angular momentum indices: \[\mathbf{A} = \sum_{j=j_0}^{\texttt{maxJ}} i^j \sqrt{2j+1} \cdot C_j \left[ a_j \mathbf{A}_{j,m}^{(e)} + b_j \mathbf{A}_{j,m}^{(m)} \right] \cdot \texttt{SCA} + \left[ c_j \mathbf{A}_{j,m}^{(m)} + d_j \mathbf{A}_{j,m}^{(e)} \right] \cdot \texttt{ABS}.\] If includeBeam=True, also computes the beam field without interaction.


Computes cross-sections: \[\begin{aligned} C_{\text{sca}} &= \frac{2\pi}{k^2} \sum_j (2j+1) |C_{j m p}|^2 \left( |a_j|^2 + |b_j|^2 \right) \\ C_{\text{ext}} &= \frac{2\pi}{k^2} \sum_j (2j+1) |C_{j m p}|^2 \Re(a_j + b_j) \\ C_{\text{int}} &= C_{\text{ext}}- C_{\text{sca}} \end{aligned}\]

"scattering", "internal", or "extinction".

0, 1, or 2. Specifies dimension of output.

if True, returns electric/magnetic contributions separately.

if True, generates a plot.

optional overrides: x, radius, nr, wavelength.


Visualizes the computed field intensity \(|\mathbf{A}|^2\). Can show circular polarization components (\(\xi_{\pm1}, \xi_0\)) or total intensity.

optional float. Overrides stored radius.

optional float. Overrides stored refractive index.

"components" or "total".

if True, normalize all subplots to global max.

Bool: If True, adds the electric field of the beam after the multipolar sum is computed and visualizes the total intensity.


Prints input beam and particle parameters when they are scalars, for debugging and verification.