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 particlesmat: dielectric functionsIncidence: N_inc vector of quaternions describing incidence directionspolarisation: incident field consists of 2 orthogonal "linear" or "circular" polarisationsN_sca: number of scattering angles for spherical cubature estimate of σ_scaprescription: 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 onlypreconditioner:"none","chan"(FFT grid, or pairwise withpreconditioner_positionssupplying the nominal grid),"nearfield"(block-Jacobi over contiguous index groups), or"circulant1d"(index-Toeplitz circulant, seesolve_fields)preconditioner_positions,preconditioner_rotation,preconditioner_blocksize: preconditioner inputs forwarded tosolve_fieldsrhs_strategy:"sequential"(default) or"block"(shared block Arnoldi basis across all right-hand sides, amortizing each pairwise kernel sweep;solver_restartthen counts block steps)solver_rtol,solver_atol: true-residual targetatol + rtol*norm(Ein)independently for each incident RHS; defaults1e-8,0.0solver_restart,solver_maxiter: GMRES restart length and total iteration limit; defaults 50 and 300return_diagnostics: opt into(cross_sections, diagnostics); GMRES diagnostics include primal/tangent residuals and iterations. Direct/OOS currently return an empty diagnostics vector.halfspace_state: optionalHalfSpaceOpticalState(orλ -> HalfSpaceOpticalState) enabling prototype planar-interface reflected coupling in matrix assemblyhalfspace_reflected_self: whentrue, 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: whentrue, add reflected plane-wave illumination at dipoles using TE/TM Fresnel coefficients
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 particlesmat: dielectric functionsCubature: spherical cubature methodN_inc: number of incident angles for spherical cubatureN_sca: number of scattering angles for spherical cubature estimate of σ_scaprescription: 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 onlypreconditioner:"none","chan"(FFT grid, or pairwise withpreconditioner_positionssupplying the nominal grid),"nearfield"(block-Jacobi over contiguous index groups), or"circulant1d"(index-Toeplitz circulant, e.g.preconditioner_rotation=RotZ(δ)for a uniform helix; seesolve_fields)preconditioner_positions,preconditioner_rotation,preconditioner_blocksize: preconditioner inputs forwarded tosolve_fieldsrhs_strategy:"sequential"(default) or"block"(one shared block Arnoldi basis across all2N_incright-hand sides per wavelength, amortizing each pairwise kernel sweep;solver_restartthen counts block steps and memory grows as ~(restart+1)*2N_incfield vectors)solver_rtol,solver_atol: true-residual targetatol + rtol*norm(Ein)independently for each incident RHS; defaults1e-8,0.0solver_restart,solver_maxiter: GMRES restart length and total iteration limit; defaults 50 and 300return_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.
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.
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.
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.
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.
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.
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 forcscaterms.
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_oareturns named tuples with:average: total shell-normalized cross-sections,differential: core-present minus bare-core contribution,dichroism: LCP-RCP orientation-average difference.
spectrum_coreshell_dipolereturns[cext, cabs, dabs] / N_shell, withdabs = cabs - cabs_core.simulate_core_shellreturns[cext, cabs, csca, dext, dabs, dsca, cdext, cdabs, cdsca]per shell dipole.simulate_miereturns coated-minus-bare multilayer Mie[cext, cabs, csca] / N_dye; withmloc=true, the result is divided byMLocAve.
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_mieis 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_scascale almost linearly in per-wavelength cost. - Larger
N_mie,N_esa, andN_thetaincrease sphere-kernel setup cost and memory, with the strongest impact in convergence sweeps and small-gap regimes.