API reference

CoupledDipole.DipoleKind — Type
DipoleKind

Abstract type describing how a single dipole's polarisability is modelled. Concrete subtypes are the singletons PointDipole and ParticleDipole.

Using dispatchable types instead of raw strings ("point"/"particle") avoids typos silently falling through to an @error at runtime, and lets alpha_wrapper branch on isa rather than comparing strings in a hot loop.

source
CoupledDipole.HalfSpaceOpticalState — Type
HalfSpaceOpticalState

Optical parameters for a homogeneous planar interface:

  • upper medium refractive index n_upper,
  • lower (substrate) refractive index n_lower,
  • vacuum wavelength wavelength (same units as any geometric lengths used later).
source
CoupledDipole.PolarizabilityPrescription — Type
PolarizabilityPrescription

Abstract type describing which quasistatic/Mie-type prescription is used to compute a particle's polarisability. Concrete subtypes are the singletons Kuwata, Majic and MieApprox.

Using dispatchable types instead of raw strings avoids a typo silently falling through to a @warn-and-fallback branch, and lets alpha_particles dispatch on type rather than comparing strings in a hot loop.

source
CoupledDipole.SommerfeldContourPlan — Type
SommerfeldContourPlan

Piecewise-linear contour in complex k_ρ plane for Sommerfeld-type integrals. nodes are ordered polyline vertices; consecutive pairs define segments.

source
CoupledDipole.alpha_imaged — Method
alpha_imaged(α, d; ε_medium=1.0, ε_substrate=2.25, averaged=true)

Image-dipole correction for a polarizable dipole a distance d (nm) above a planar interface between ε_medium and ε_substrate.

  • with averaged=true (default), returns orientational average (2α∥ + α⊥)/3
  • with averaged=false, returns SVector(α∥, α∥, α⊥)
source
CoupledDipole.alpha_imaged — Method
alpha_imaged(α::SVector{3}, d; ε_medium=1.0, ε_substrate=2.25)

Component-wise image-dipole correction for a principal-axis polarisability vector (αx, αy, αz) at distance d above a planar interface.

The x/y components use the parallel-channel correction and z uses the perpendicular-channel correction.

source
CoupledDipole.alpha_particles — Method

alphaparticles(Epsilon, Sizes, εm, λ; prescription="kuwata")

Principal polarisability components of N particles

  • λ: wavelength
  • ε: complex dielectric function
  • ε_m: dielectric function of surrounding medium
  • Sizes: Vector of 3-SVectors of particle sizes
  • prescription: PolarizabilityPrescription (Kuwata()/Majic()/MieApprox()), or the legacy strings "kuwata"/"majic"/"mie"

Examples

julia> alpha_particles(500, -10+1im, 1.33^3, [SVector(30, 30, 50) for i in 1:4])
4-element Vector{SVector{3, ComplexF64}}:
 [83399.81975161123 + 64172.28157743772im, 83399.81975161123 + 64172.28157743772im, -86034.64340475321 + 79773.72029581512im]
 [83399.81975161123 + 64172.28157743772im, 83399.81975161123 + 64172.28157743772im, -86034.64340475321 + 79773.72029581512im]
 [83399.81975161123 + 64172.28157743772im, 83399.81975161123 + 64172.28157743772im, -86034.64340475321 + 79773.72029581512im]
 [83399.81975161123 + 64172.28157743772im, 83399.81975161123 + 64172.28157743772im, -86034.64340475321 + 79773.72029581512im]
source
CoupledDipole.alpha_rh6g — Method

alpha_rh6g(λ::Real)

bare polarisability of dye Rhodamine 6G retrieved from extinction measurements

lambda = 400:800 a1 = alpha_rh6g.(lambda)

α∞=9.6e-39, αk=5.76e-38, λk=526.0, µk=1.0e4

a2 = alphalorentzmolecule.(lambda) a3 = alphalorentzmolecule.(lambda; αk=[5.76e-38, 1.552e-38], λk=[526, 496], µ_k=[10000, 6000])

series([real.(a1), real.(a2), real.(a3), imag.(a1), imag.(a2), imag.(a3)])

source
CoupledDipole.alpha_voigt — Method
alpha_voigt(λ; α_∞=9.6e-39, α_k=5.76e-38, λ_k=526.0, µ_k=1.0e4, σ_k=10.0)

Complex scalar molecular polarizability using Gaussian-broadened Lorentz oscillators, evaluated analytically with the Faddeeva function (SpecialFunctions.faddeeva). σ_k is the standard deviation (in nm) of resonance-wavelength inhomogeneous broadening. Set σ_k=0 to recover the pure Lorentzian model.

source
CoupledDipole.alpha_wrapper — Method

alpha_wrapper(cl, mat, λ, prescription)

High-level wrapper for both types of polarisabilities

Examples

λ = 633.0
media = Dict([("Au", epsilon_Au), ("medium", x -> 1.33)])
mat = Material(λ, media)

cl = cluster_chain(5, 100, 1,2,3)
n_medium = mat.media["medium"](λ)

particle_dipoles = [true, false, true, true, false]
point_dipoles = .!particle_dipoles
alpha_wrapper(cl, mat, λ, "kuwata")
source
CoupledDipole.analyze_halfspace_poles — Method
analyze_halfspace_poles(state; previous_tm=nothing, include_te=false, tol=1e-10, maxiter=40)

Analyze candidate interface poles for a homogeneous substrate. This is intended as a dynamic pre-pass before selecting Sommerfeld contours.

When previous_tm is provided, it is used as continuation seed for TM poles across neighboring wavelengths or material parameters.

source
CoupledDipole.choose_halfspace_contour_plan — Method
choose_halfspace_contour_plan(state, rho, zsum; pole=nothing, offset_imag_factor=0.2, safety_margin_factor=0.02)

Build a piecewise-linear contour for half-space Sommerfeld integrals.

If pole is provided and close to the default contour, the intermediate node is shifted to keep a minimum lateral clearance from the pole.

source
CoupledDipole.cluster_mixture — Method
cluster_mixture(N, a, b, c, R; proportion=0.5, orientation="radial",
    position="fibonacci", material_A="Rhodamine", material_B="NileBlue",
    type="point", min_exclusion=1.0)

Spherical shell of N particles with two material labels mixed on one geometry. proportion is the fraction of particles assigned to material_A.

source
CoupledDipole.cluster_orientation — Method
cluster_orientation(N, a, b, c, R, tilt; position="fibonacci", material="Rhodamine",
    type="point", min_exclusion=1.0)

Spherical shell where each particle is tilted by a fixed tilt (radians) away from the local radial direction with random azimuth in the tangent plane.

source
CoupledDipole.cluster_pumpkin — Method
cluster_pumpkin(N, a, b, c, R, cone_angle; position="fibonacci", material="Rhodamine",
    type="point", min_exclusion=1.0, tilt=0.0)

Patchy spherical-shell cluster restricted to a polar cone around +z with half-angle cone_angle (radians). Optional tilt applies the same fixed tilt away from radial for all particles.

source
CoupledDipole.cluster_quadrimer — Function

cluster_quadrimer(r, d, material="Au", type="particle")

Particle cluster consisting of 4 identical spheres in a chiral geometry

  • r: sphere radius
  • d: gap between spheres
  • material: String referencing the material of every particle
  • type: DipoleKind (PointDipole()/ParticleDipole()), or the legacy strings "point"/"particle"

Examples

cluster_quadrimer(80, 10)
source
CoupledDipole.cluster_shell — Method
cluster_shell(N, a, b, c, R; orientation="radial", position="fibonacci", material="Rhodamine", type="point", min_exclusion=1.0)

Create a shell cluster on radius R with configurable position sampling and particle orientation.

source
CoupledDipole.cluster_shell_landings — Function
cluster_shell_landings(N, a, R, threshold_d=0.5; monomer_mat="NileBlueM", dimer_mat="NileBlueD", type="point")

Build a shell cluster from random landing points, labeling near-neighbor pairs as dimers.

source
CoupledDipole.contour_integral — Method
contour_integral(integrand, plan; rtol=1e-6, atol=1e-10)

Integrate a complex-valued spectral integrand(k_rho) along plan and return (value, diagnostics).

source
CoupledDipole.depolarisation_ellipsoid — Method

depolarisation_ellipsoid(a, b, c)

Depolarisation factor of an ellipsoid

  • a: semi-axis along x
  • b: semi-axis along y
  • c: semi-axis along z

Examples

julia> round.(depolarisation_ellipsoid(1, 1, 1.5), digits=5)
3-element SVector{3, Float64} with indices SOneTo(3):
 0.38351
 0.38351
 0.23298
source
CoupledDipole.dipole_kind — Method
dipole_kind(x)

Normalise x to a DipoleKind instance.

Accepts a DipoleKind directly (returned unchanged), or the legacy strings "point"/"particle" for backward compatibility with existing scripts.

source
CoupledDipole.epsilon_water — Method

epsilon_water(λ::Real; temperature::Real=20)

lambda = 400:800 eps = epsilonwater.(lambda) eps2 = epsilonwater.(lambda; temperature=10) series([eps, eps2])

source
CoupledDipole.expand_grid — Method

expand_grid(; kws...)

Expand all combinations of named arguments

  • kws...: named parameters

Examples

julia> expand_grid(a=[0.1,0.2,0.3], b = [1,2])
6×2 DataFrame
 Row │ a        b     
     │ Float64  Int64 
─────┼────────────────
   1 │     0.1      1
   2 │     0.2      1
   3 │     0.3      1
   4 │     0.1      2
   5 │     0.2      2
   6 │     0.3      2
source
CoupledDipole.far_field — Method
far_field(direction, k, positions, dipoles)

Evaluate the far-field electric contribution for a given scattering direction.

  • direction: SVector/tuple of Euler angles used by euler_unitvector
  • k: wavenumber in medium
  • positions: source dipole positions
  • dipoles: stacked dipole moments (3 rows per source)
source
CoupledDipole.fresnel_denominator_tm — Method
fresnel_denominator_tm(state, k_rho)

TM Fresnel denominator in k_rho form for nonmagnetic media: D_TM = ε₂ kz₁ + ε₁ kz₂, where media 1/2 are upper/lower half-spaces.

source
CoupledDipole.incidence_labels — Method
incidence_labels(d, Incidence)

Merging incidence information with dataframe of dispersion spectra

  • d: long-format output from dispersion_df
  • Incidence: vector of Rotation objects
source
CoupledDipole.incident_field_dip! — Method

incidentfielddip!(Ein, source, k, positions)

Incident field at particle positions, from a dipole source

  • Ein: 3N_dip x N_inc matrix, right-hand side of coupled-dipole system
  • source: 3-Svector, source position
  • k: wavenumber in incident medium
  • positions: N_dip-vector of 3-Svectors of particle positions
source
CoupledDipole.incident_field_probe — Method

incidentfieldprobe(Ejones, k, probe, IncidenceRotations)

evaluates the E and B fields at a probe location, for mapping purposes Note that much of the functionality is common with incidentfieldpw

  • probe: SVector, point where the scattered EM field is to be evaluated
  • k: wavenumber
  • n_medium
  • Ejones: 2-Svectors defining 2 orthogonal Jones polarisations
  • IncidenceRotations: N_inc-vector of rotation 3-Smatrices
source
CoupledDipole.incident_field_pw — Method
incident_field_pw(Ejones, kn, R, IncidenceRotations)

Allocate and return the plane-wave incident-field matrix used on the right-hand side of the coupled-dipole linear system.

source
CoupledDipole.incident_field_sphere! — Method
incident_field_sphere!(Esphere, Ejones, R, IncidenceRotations, Egrid)

Incident-field contribution scattered by a spherical core, evaluated at dipole positions for two orthogonal Jones polarisations.

  • Esphere: 3N_dip x 2N_inc output matrix
  • Ejones: tuple/vector of 2 Jones vectors (SVector{2})
  • R: dipole positions (Vector{SVector{3}})
  • IncidenceRotations: incident-direction rotations (Vector of 3x3 rotations)
  • Egrid: sphere-scattered field coefficients (theta, Ecr, Ect, Esf, Ep0)
source
CoupledDipole.incident_field_sphere — Method
incident_field_sphere(Ejones, R, IncidenceRotations, Egrid)

Allocate and return the sphere-scattered incident-field contribution at dipole positions for the supplied incidence set.

source
CoupledDipole.interaction_matrix_halfspace_labframe! — Method
interaction_matrix_halfspace_labframe!(F, k, R, AlphaBlocks, state; previous_poles=nothing, rtol=1e-6, atol=1e-10)

Fill F with the prototype half-space interaction matrix:

F = I - (G⁰ + Gᴿ) α

where the reflected contribution Gᴿ is assembled from the stage-A spectral reference kernels in reflected_coupling_matrix_halfspace_prototype.

Returns a named tuple with pole candidates used for contour steering ((; tm, te)), which can be fed back through previous_poles in subsequent calls as continuation seeds.

source
CoupledDipole.is_admissible_surface_pole — Method
is_admissible_surface_pole(state, k_rho)

Basic physical admissibility check for source/observer above substrate:

  • positive real part of lateral wavenumber,
  • non-growing vertical factors in both media (imag(kz₁), imag(kz₂) ≥ -atol).
source
CoupledDipole.is_inside — Method
is_inside(probe, positions, sizes, ParticleRotations)

Test whether probe lies inside any ellipsoidal particle and return (overall::Bool, ids) where ids are matching indices.

source
CoupledDipole.iterate_field! — Method
iterate_field!(E, P, σ_ext, Ein, F, kn, AlphaBlocks, tol=1e-4, maxiter=1000)

Order-of-scattering iteration of the total field

  • E: 3N_dip x N_inc matrix, total field for all incidences
  • P: 3N_dip x N_inc matrix, polarisations for all incidences
  • Ein: 3N_dip x N_inc matrix, total field for all incidences
  • F: 3N_dip x 3N_dip interaction matrix (I - G0 Alpha)
  • AlphaBlocks: N_dip-vector of 3x3 Smatrices (polarisability tensors in the lab frame)
source
CoupledDipole.kz_radiation_branch — Method
kz_radiation_branch(k_rho, k_medium)

Return kz = sqrt(k_medium^2 - k_rho^2) on the radiation branch:

  • imag(kz) ≥ 0,
  • if imag(kz) ≈ 0, enforce real(kz) ≥ 0.
source
CoupledDipole.locate_halfspace_surface_pole — Method
locate_halfspace_surface_pole(state; polarization=:TM, initial_guess=nothing, tol=1e-10, maxiter=40, admissibility_tol=1e-10)

Find one spectral pole candidate for a homogeneous half-space interface by solving D(k_rho)=0 with complex Newton/secant updates.

Returns nothing if:

source
CoupledDipole.map_nf — Method

map_nf(probes, cl::Cluster, mat::Material, Incidence; polarisation="linear", prescription="kuwata")

  • probes: array of SVectors, points where the scattered EM field is to be evaluated
  • 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
  • prescription: polarisability prescription for particles
  • evaluate_inside: logical, whether to compute the (unphysical) scattered field inside particles

example

x = -200.0:2.0:200

probes = SVector.(Iterators.product(x, x, zero(eltype(x))))[:]

probes = SVector.(Iterators.product(x, zero(eltype(x)), zero(eltype(x))))[:]

source
CoupledDipole.molecular_polarisability — Method
molecular_polarisability(cl, mat, λ, point_dipoles, n_medium)

Local-field-corrected molecular/point-dipole polarisabilities (alpha_embed then alpha_scale) for the dipoles flagged true in point_dipoles.

This is the "molecular local-field correction" component factored out of alpha_wrapper so it can be composed/tested independently of the particle prescription branch.

source
CoupledDipole.oa_analytical — Method

oa_analytical(kn, cl.positions, AlphaBlocks)

Interaction matrix

  • k: wavenumber in incident medium
  • R: N_dip-vector of 3-Svectors of particle positions
  • AlphaBlocks: N_dip-vector of 3x3 Smatrices (polarisability tensors in the lab frame)
source
CoupledDipole.oa_c_abs — Method

oacabs(k, G0, invA, diagInvAlpha)

Computes the OA absorption cross-section from the solution of CDA equations

PARAMETERS:

  • kn [scalar] wavenumber in medium
  • G0 3Nrx3Nr matrix of free-space Green tensor at positions r_i
  • invA 3Nrx3Nr inverse of the interaction matrix
  • diagInvAlpha 3Nrx3Nr inverse of the block-diagonal matrix of polarisabilities

RETURNS: absorption cross-section analytically orientation-averaged

DEPENDS: Asym

FAMILY: lowlevel, crosssection

source
CoupledDipole.oa_c_ext — Method

oacext(kn, G0, B, diagA, shift)

Computes the OA absorption cross-section from the solution of CDA equations

PARAMETERS:

  • kn [scalar] wavenumber in medium
  • G 3NrxN_inc matrix
  • W 3NrxN_inc matrix
  • invV 3NrxN_inc matrix

RETURNS: absorption cross-section analytically orientation-averaged

DEPENDS: Asym

FAMILY: lowlevel, crosssection

source
CoupledDipole.particle_polarisability — Method
particle_polarisability(cl, mat, λ, particle_dipoles, n_medium, prescription)

Particle polarisabilities (alpha_particles, under the chosen PolarizabilityPrescription) for the dipoles flagged true in particle_dipoles.

This is the "particle prescription" component factored out of alpha_wrapper so it can be composed/tested independently of the molecular local-field correction branch.

source
CoupledDipole.pmap_df — Method

pmap_df(p, f, kws...; join = true)

Expand all combinations of named arguments

  • p: DataFrame-like array of parameters
  • f: function to apply to each row vector
  • kws...: extra arguments passed to f
  • join: logical, join parameters and results
source
CoupledDipole.propagator_sphere_z — Method
propagator_sphere_z(theta, phi, Egrid)

Sphere-mediated Green tensor (cartesian blocks) in a rotated frame where the source dipole is placed on the +z axis.

Egrid must provide fields theta, Ep0, Ecr, Ect, Esf, Em0r, Em0t. Returns a 3N × 3 matrix where each 3-row block is the cartesian Green tensor block for one target position.

source
CoupledDipole.reflected_coupling_matrix_halfspace_prototype — Method
reflected_coupling_matrix_halfspace_prototype(k, R, AlphaBlocks, state; previous_poles=nothing, rtol=1e-6, atol=1e-10)

Prototype reflected coupling matrix contribution (off-diagonal blocks only) matching interaction_matrix_labframe! block conventions:

C[i,j] = Gᴿ_ij * α_j for i ≠ j, with zero diagonal.

previous_poles can provide continuation seeds as named tuple (; tm=<InterfacePole or nothing>, te=<InterfacePole or nothing>).

source
CoupledDipole.reflected_dyadic_block_j0_prototype — Method
reflected_dyadic_block_j0_prototype(state, r_obs, r_src; tm_pole=nothing, te_pole=nothing, rtol=1e-6, atol=1e-10)

Prototype reflected 3×3 dyadic block for source/observer above a homogeneous substrate, assembled from the Weyl/Sommerfeld tensor representation with explicit TE/TM projectors and azimuthal averaging.

source
CoupledDipole.reflected_kernel_j0_channels — Method
reflected_kernel_j0_channels(state, rho, zsum; tm_pole=nothing, te_pole=nothing, rtol=1e-6, atol=1e-10)

Evaluate both TM and TE reference J0-channel integrals and return (tm=value_tm, te=value_te, diagnostics=(tm=diag_tm, te=diag_te)).

This is a solver-agnostic prototype API for assembling reflected dyadic blocks.

source
CoupledDipole.reflected_kernel_reference_channels — Method
reflected_kernel_reference_channels(state, rho, zsum; tm_pole=nothing, te_pole=nothing, rtol=1e-6, atol=1e-10)

Evaluate TM/TE J0 and J2 reference channels for reflected-kernel prototyping. Returns values and per-channel diagnostics.

source
CoupledDipole.reflected_kernel_te_j0 — Method
reflected_kernel_te_j0(state, rho, zsum; pole=nothing, rtol=1e-6, atol=1e-10)

Reference Sommerfeld integral (TE, J0 channel) for source/observer above the substrate:

I_TE(ρ, Z) = ∫ k_ρ r_TE(k_ρ) J₀(k_ρ ρ) exp(i kz₁ Z) dk_ρ

where Z = z + z' > 0.

source
CoupledDipole.reflected_kernel_te_j2 — Method
reflected_kernel_te_j2(state, rho, zsum; pole=nothing, rtol=1e-6, atol=1e-10)

Reference Sommerfeld integral (TE, J2 channel):

I_TE,2(ρ, Z) = ∫ k_ρ r_TE(k_ρ) J₂(k_ρ ρ) exp(i kz₁ Z) dk_ρ.

source
CoupledDipole.reflected_kernel_tm_j0 — Method
reflected_kernel_tm_j0(state, rho, zsum; pole=nothing, rtol=1e-6, atol=1e-10)

Reference Sommerfeld integral (TM, J0 channel) for source/observer above the substrate:

I_TM(ρ, Z) = ∫ k_ρ r_TM(k_ρ) J₀(k_ρ ρ) exp(i kz₁ Z) dk_ρ

where Z = z + z' > 0.

This is a stage-A reference evaluator: direct contour integration with diagnostics, intended for correctness and algorithm development.

source
CoupledDipole.reflected_kernel_tm_j2 — Method
reflected_kernel_tm_j2(state, rho, zsum; pole=nothing, rtol=1e-6, atol=1e-10)

Reference Sommerfeld integral (TM, J2 channel):

I_TM,2(ρ, Z) = ∫ k_ρ r_TM(k_ρ) J₂(k_ρ ρ) exp(i kz₁ Z) dk_ρ.

source
CoupledDipole.reflected_self_block_halfspace_prototype — Method
reflected_self_block_halfspace_prototype(state, r; tm_pole=nothing, te_pole=nothing, rtol=1e-6, atol=1e-10)

Prototype reflected self-interaction dyadic block at point r above the substrate, evaluated through the reflected kernel only (z + z' = 2z).

This contribution is finite for z > 0 and excludes the free-space singular self term (which remains handled by existing radiative-reaction/polarizability prescriptions).

source
CoupledDipole.scattered_field — Function
scattered_field(probe, k, n_medium, positions, sizes, rotations, P, Epsilon=missing; evaluate_inside=true)
  • probe: SVector, point where the scattered EM field is to be evaluated
  • k: wavenumber
  • n_medium: refractive index of medium
  • positions: SVector of dipole positions
  • sizes: SVector of dipole sizes
  • rotations: SVector of particle rotation matrices
  • P: 3Ndipx2Ninc matrix of self-consistent dipole moments
  • Epsilon: list of dielectric function inside each particle (for internal fields)
  • evaluate_inside: logical, whether to compute the (unphysical) scattered field inside particles

Returns (Esca, Bsca, inside, id) where inside/id describe whether probe is inside one of the particles.

source
CoupledDipole.scattering_channels! — Method
scattering_channels!(Cup, Cdown, positions, ScatteringVectors, weights, kn, P)

Prototype hemisphere-resolved scattering channels for each incident angle.

Cup integrates free-space far-field intensity over directions with n_z ≥ 0 (upper hemisphere), while Cdown integrates n_z < 0 (lower hemisphere), using the same quadrature and normalization as scattering!, so:

Cup + Cdown ≈ Csca.

source
CoupledDipole.scattering_channels — Method
scattering_channels(positions, ScatteringVectors, weights, kn, P)

Allocate and return hemisphere-resolved prototype channels as a named tuple: (; upper, lower, total) with total = upper + lower.

source
CoupledDipole.scattering_channels_halfspace_prototype! — Method
scattering_channels_halfspace_prototype!(Cup, Cdown_trans, Cdown_raw, Closs,
    positions, ScatteringVectors, weights, kn, P, n_upper, n_lower)

Prototype interface-aware channel estimator using free-space angular dipole intensities with Fresnel transmission weighting on the lower hemisphere.

  • Cup: upper-hemisphere channel (unchanged from free-space angular intensity),
  • Cdown_raw: raw lower-hemisphere channel from free-space angular intensity,
  • Cdown_trans: lower channel weighted by average TE/TM Fresnel transmission,
  • Closs: estimate of substrate-channel loss (Cdown_raw - Cdown_trans, clamped).
source
CoupledDipole.scattering_channels_halfspace_prototype — Method
scattering_channels_halfspace_prototype(positions, ScatteringVectors, weights, kn, P, n_upper, n_lower)

Allocate and return prototype interface-aware channel estimates as a named tuple:

  • upper: upper-hemisphere channel,
  • lower_transmitted: Fresnel-weighted lower channel estimate,
  • lower_raw: unweighted lower channel,
  • substrate_loss_estimate: max(lower_raw-lower_transmitted, 0),
  • total_estimate: upper + lower_transmitted.
source
CoupledDipole.scattering_pattern — Method

scattering_pattern(probes, cl::Cluster, mat::Material, source; polarisation="linear", prescription="kuwata")

  • directions: array of SVectors, directions where the scattered EM field is to be evaluated
  • cl: cluster of particles
  • mat: dielectric functions
  • source: SVector of dipole source position
  • prescription: polarisability prescription for particles

example

φ = range(0,2π,36)

θ = range(0,π,18)

directions = SVector.(Iterators.product(φ, θ, 0.0))[:]

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
CoupledDipole.simulate_mixture — Function
simulate_mixture(proportion, rho_dye, uniaxiality, position_type, wavelength, medium, R0, d, N_inc=36; kwargs...)

Build and simulate a two-species molecular shell mixture around a spherical core.

source
CoupledDipole.solve_fields — Method
solve_fields(k, positions, alpha_blocks, incident; method="direct",
    interaction="pairwise", preconditioner="none", rtol=1e-8,
    atol=0.0, restart=50, maxiter=300, rhs_strategy="sequential",
    preconditioner_positions=nothing, preconditioner_rotation=nothing,
    preconditioner_blocksize=32)

Solve the homogeneous-host finite electric-dipole field equation. incident is a 3N x nrhs matrix; alpha_blocks contains local lab-frame 3x3 tensors. Return fields, polarizations, diagnostics and operator setup time. Direct LU uses private dense scratch; GMRES does not allocate a dense interaction matrix. FFT requires an axis-aligned xy Cartesian grid. Chan uses the mean local tensor as its reference response. Unsupported combinations and nonconvergence throw.

Preconditioners: "none", "chan" (FFT grid, or interaction="pairwise" with preconditioner_positions supplying the nominal grid for a position-disordered array), "nearfield" (block-Jacobi over contiguous storage-index groups of preconditioner_blocksize particles; geometry agnostic), and "circulant1d" (index-Toeplitz circulant in a frame co-rotating with preconditioner_rotation, e.g. RotZ(δ) for a uniform helix with angular step δ; identity when nothing). Preconditioners are built from primal values and never change the converged answer.

rhs_strategy="block" solves all right-hand sides with one shared block Arnoldi basis per restart cycle, evaluating each (pairwise) kernel sweep once for all columns; restart then counts block steps (memory ~(restart+1)*nrhs field vectors) and maxiter caps total block steps. Blocks at least as wide as the system (nrhs >= 3N) silently fall back to the sequential strategy.

GMRES: Saad & Schultz (1986), doi:10.1137/0907058, via IterativeSolvers.jl. Chan: doi:10.1137/0909051. See docs/src/finite_solvers.md for boundaries, autodiff support and dependency licences.

source
CoupledDipole.spectrum_coreshell_dipole — Method
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.spectrum_coreshell_oa — Method
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_mixture — Method
spectrum_mixture(cl, mat; kwargs...)

Compute spectra for mixed molecular shells around a core by delegating to the core-shell OA workflow.

source
CoupledDipole.spectrum_oa_analytical — Method
 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
  • method: solution of linear system (direct or iterative)
source
CoupledDipole.spheroid_ar — Method
spheroid_ar(a₀, χ)

Convert equivalent-radius a₀ and aspect ratio χ = c/a to spheroid semiaxes (a, c) preserving volume.

source
CoupledDipole.spheroid_projected_area — Method
spheroid_projected_area(a₀, χ)

Projected-area equivalent used in surface-density estimates for a spheroid parameterized by equivalent radius a₀ and aspect ratio χ.

source