High-level Interface

See Finite-cluster solvers for matrix-free GMRES, Chan preconditioning, convergence diagnostics, autodiff and algorithm sources.

CoupledDipole.spectrum_dispersion — Function
 spectrum_dispersion(cl::Cluster, mat::Material,
                     Incidence, N_sca::Int=36)

Simulating far-field cross-sections for multiple wavelengths and directions of incidence

  • cl: cluster of particles
  • mat: dielectric functions
  • Incidence: N_inc vector of quaternions describing incidence directions
  • polarisation: incident field consists of 2 orthogonal "linear" or "circular" polarisations
  • N_sca: number of scattering angles for spherical cubature estimate of σ_sca
  • prescription: polarisability prescription for particles (kuwata, majic, or mie)
  • method: "direct" (in-place dense LU, default), "gmres" (matrix-free), or legacy "oos" (dense order of scattering)
  • interaction: "pairwise" (arbitrary positions) or "fft" (xy Cartesian grid), for GMRES only
  • preconditioner: "none", "chan" (FFT grid, or pairwise with preconditioner_positions supplying the nominal grid), "nearfield" (block-Jacobi over contiguous index groups), or "circulant1d" (index-Toeplitz circulant, see solve_fields)
  • preconditioner_positions, preconditioner_rotation, preconditioner_blocksize: preconditioner inputs forwarded to solve_fields
  • rhs_strategy: "sequential" (default) or "block" (shared block Arnoldi basis across all right-hand sides, amortizing each pairwise kernel sweep; solver_restart then counts block steps)
  • solver_rtol, solver_atol: true-residual target atol + rtol*norm(Ein) independently for each incident RHS; defaults 1e-8, 0.0
  • solver_restart, solver_maxiter: GMRES restart length and total iteration limit; defaults 50 and 300
  • return_diagnostics: opt into (cross_sections, diagnostics); GMRES diagnostics include primal/tangent residuals and iterations. Direct/OOS currently return an empty diagnostics vector.
  • halfspace_state: optional HalfSpaceOpticalState (or λ -> HalfSpaceOpticalState) enabling prototype planar-interface reflected coupling in matrix assembly
  • halfspace_reflected_self: when true, include prototype reflected near-interface self-reaction for point dipoles via image-dipole corrected polarisabilities (and keep off-diagonal reflected coupling enabled)
  • halfspace_reflected_incident: when true, add reflected plane-wave illumination at dipoles using TE/TM Fresnel coefficients
source
CoupledDipole.spectrum_oa — Function
 spectrum_oa(cl::Cluster, mat::Material,
            Cubature = "gl", N_inc::Int = 36, N_sca::Int=36)

Orientation-averaged far-field cross-sections for multiple wavelengths

  • cl: cluster of particles
  • mat: dielectric functions
  • Cubature: spherical cubature method
  • N_inc: number of incident angles for spherical cubature
  • N_sca: number of scattering angles for spherical cubature estimate of σ_sca
  • prescription: polarisability prescription for particles (kuwata, majic, or mie)
  • method: solution of linear system ("direct", "gmres" or "oos")
  • interaction: "pairwise" (arbitrary positions) or "fft" (axis-aligned xy grid), for GMRES only
  • preconditioner: "none", "chan" (FFT grid, or pairwise with preconditioner_positions supplying the nominal grid), "nearfield" (block-Jacobi over contiguous index groups), or "circulant1d" (index-Toeplitz circulant, e.g. preconditioner_rotation=RotZ(δ) for a uniform helix; see solve_fields)
  • preconditioner_positions, preconditioner_rotation, preconditioner_blocksize: preconditioner inputs forwarded to solve_fields
  • rhs_strategy: "sequential" (default) or "block" (one shared block Arnoldi basis across all 2N_inc right-hand sides per wavelength, amortizing each pairwise kernel sweep; solver_restart then counts block steps and memory grows as ~(restart+1)*2N_inc field vectors)
  • solver_rtol, solver_atol: true-residual target atol + rtol*norm(Ein) independently for each incident RHS; defaults 1e-8, 0.0
  • solver_restart, solver_maxiter: GMRES restart length and total iteration limit; defaults 50 and 300
  • return_diagnostics: opt into (average, dichroism, diagnostics); GMRES diagnostics include residuals and iteration counts per RHS. Direct/OOS currently return an empty diagnostics vector.

Note that orientation averaging uses 2N_inc right-hand sides per wavelength: a direct LU is shared across all of them, whereas sequential GMRES iterates each RHS separately. Prefer rhs_strategy="block" for iterative orientation averaging; the direct path remains attractive while the dense matrix fits in memory.

source

Hybrid core-shell workflows (CDA + Mie)

The sphere-coupled workflows augment free-space CDA with a sphere-mediated incident and coupling field, then report shell-normalized observables.

CoupledDipole.spectrum_coreshell_dispersion — Function
spectrum_coreshell_dispersion(cl, mat, Incidence; kwargs...)

Compute wavelength-resolved cross-sections for a molecular shell around a spherical core for explicit incidence directions.

source
CoupledDipole.spectrum_coreshell_oa — Function
spectrum_coreshell_oa(cl, mat; kwargs...)

Compute orientation-averaged core-shell spectra and related differential and dichroic observables.

Returns a named tuple with:

  • average::CrossSections (total shell-normalized response),
  • differential::CrossSections (core-present minus bare-core response),
  • dichroism::CrossSections (LCP-RCP orientation-averaged difference),
  • dipole_absorption (shell-only absorption from coupled dipoles).

Key numerical controls:

  • N_mie: multipole truncation for sphere response expansions,
  • N_esa: electrostatic asymptotic blending order for near-sphere dipole fields,
  • N_theta: angular interpolation grid for sphere-mediated kernels,
  • N_inc, N_sca: cubature orders for orientation and scattering integrals.
source
CoupledDipole.spectrum_coreshell_dipole — Function
spectrum_coreshell_dipole(cl, mat; kwargs...)

Hybrid workflow that augments a shell cluster with an explicit core dipole and reports shell-normalized extinction/absorption observables.

Returns an N_λ × 3 matrix with columns: [cext, cabs, dabs] / N_shell, where dabs = cabs - cabs_core and cabs_core = 4πk·Im(tr(α_core))/3.

source
CoupledDipole.simulate_core_shell — Function
simulate_core_shell(rho_dye, tensor_type, position_type, wavelength, medium, R0, d, N_inc=36; kwargs...)

Convenience wrapper that builds a shell cluster/material model and returns core-shell spectra as a dense matrix.

The returned matrix columns are: [cext, cabs, csca, dext, dabs, dsca, cdext, cdabs, cdsca], each normalized per shell dipole.

source
CoupledDipole.simulate_mie — Function
simulate_mie(rho_dye, R0, d, spacer, wavelength, medium, N_nmax=20, shell=false, mloc=false)

Compute multilayer Mie-based shell cross-sections with optional local-field correction.

Returns an N_λ × 3 matrix with columns [cext, cabs, csca] / N_dye, built from coated-minus-bare multilayer Mie cross-sections.

When mloc=true, outputs are additionally divided by the multilayer MLocAve enhancement factor.

source

Numerical knobs and when to increase them

  • N_mie: multipole truncation for spherical-wave expansions. Increase first when resonant peaks shift with settings.
  • N_esa: asymptotic-order cap used in near-sphere dipole correction blends. Increase for very small core-shell gaps.
  • N_theta: angular interpolation grid for precomputed sphere fields. Increase when angle-sensitive quantities (especially dichroism) oscillate with settings.
  • N_inc: orientation cubature order (spectrum_coreshell_oa).
  • N_sca: scattering-direction cubature order for csca terms.

Practical strategy: hold geometry/material fixed, then raise one knob at a time until the target observable changes less than your tolerance.

Output conventions and normalization

  • spectrum_coreshell_oa returns named tuples with:
    • average: total shell-normalized cross-sections,
    • differential: core-present minus bare-core contribution,
    • dichroism: LCP-RCP orientation-average difference.
  • spectrum_coreshell_dipole returns [cext, cabs, dabs] / N_shell, with dabs = cabs - cabs_core.
  • simulate_core_shell returns [cext, cabs, csca, dext, dabs, dsca, cdext, cdabs, cdsca] per shell dipole.
  • simulate_mie returns coated-minus-bare multilayer Mie [cext, cabs, csca] / N_dye; with mloc=true, the result is divided by MLocAve.

Scope boundaries

  • These workflows model sphere-mediated coupling around a single spherical core with shell dipoles.
  • They are not planar-interface or general multilayer-substrate solvers.
  • simulate_mie is an effective multilayer-Mie shell model; use it for comparison/trend studies against explicit-dipole shell calculations, not as a one-to-one substitute in every geometry.

Runtime/complexity guidance

  • Dense CDA solves scale cubically with shell dipole count (O((3N)^3)).
  • Higher N_inc/N_sca scale almost linearly in per-wavelength cost.
  • Larger N_mie, N_esa, and N_theta increase sphere-kernel setup cost and memory, with the strongest impact in convergence sweeps and small-gap regimes.