Running the Pluto examples

The gallery is generated from the same .jl files that you open in Pluto. No Julia installation is needed to read the rendered results on this website. To edit and rerun them, use a local checkout with Julia 1.10 or later.

From the repository root:

julia --project=examples -e 'using Pkg; Pkg.develop(path=pwd()); Pkg.instantiate()'
julia --project=examples -e 'using Pluto; Pluto.run()'

Open one of these files in Pluto:

ExampleNotebook sourceFocus
01 Chiral dimer01_dimer.pluto.jlCoupling and circular dichroism
02 Mirror-image helices02_helix.pluto.jlHandedness and orientation averaging
03 Near-field map03_nearfield.pluto.jlSpatial intensity and particle exclusion
04 Dye molecules04_dyes.pluto.jlUniaxial molecular point dipoles
05 Core-shell OA spectra05coreshelloa.pluto.jlSphere-mediated coupling switches in core-shell response
06 Core-shell CDA vs Mie06coreshellmie_compare.pluto.jlExplicit dipole shell versus effective multilayer-Mie model
07 Core-shell convergence sweeps07coreshellconvergence.pluto.jlN_mie / N_esa / N_theta error-runtime trade-offs
08 Planar-interface dimers (prototype)08planarinterface_dimer.pluto.jl45° incidence, orientation/separation sweeps, and differential absorption above a plane
17 Finite solvers17finitesolvers.pluto.jlDiffractive-array and helix-CD solver studies: direct vs GMRES, preconditioners, disorder, block multi-RHS

Machine-dependent benchmark notebooks and saved-result performance studies (numbered 09–16 during development) are local research material and are not distributed with the package or included in the static documentation build. Notebook 17 supersedes them using only integrated package APIs.

The explicit Pkg.activate(joinpath(@__DIR__, "..")) cell selects the shared examples environment. This deliberately uses the local development checkout rather than Pluto's automatic per-notebook package manager: it ensures that examples exercise the code being developed, even before it is published. Run the setup command once before opening notebooks; a generated local manifest records resolved versions. Keep the notebooks in their examples directory, or update their activation path if you copy them elsewhere.

The first run may take time to install/precompile plotting packages. Subsequent runs reuse the environment. Edit geometry and material cells to explore the response. Static pages show the default parameter values, not interactive widgets.

Book figure scripts

Finite solver example

Run julia --project=examples examples/finite_solvers.jl for a small oblique direct/GMRES comparison. The rendered finite-solvers notebook shows the diffractive-array and helix-CD studies: direct-vs-iterative crossover, preconditioner behaviour under size and positional disorder, array-size scaling, and orientation-averaged CD with block multi-RHS solves. It calls only integrated package APIs. See Finite-cluster solvers for executable documentation.

Figure-generation scripts ported from the book repository are available under examples/figures/. They are organized by chapter and share common output helpers so generated files land in predictable folders.

See examples/figures/README.md for layout, conventions, and run instructions.

Planar-interface prototype examples

The Phase-10 planar-interface prototype now includes focused dimer workflows:

  • examples/figures/06_interface/fig_planar_dimer_dabs_sweep.jl Fixed incidence at 45°, two polarisations, four dimer orientation cases (head-to-tail/side-by-side × dipole axis parallel/perpendicular to plane), inter-dipole separation sweep, differential absorption Δσ_abs, and wavelength-dispersive gold substrate response ε_Au(λ).
  • examples/figures/06_interface/fig_planar_dimer_substrate_compare.jl Single dimer geometry with substrate comparison (matched, dielectric, dispersive gold) for both differential absorption and prototype substrate-loss channel differences.
  • examples/figures/06_interface/fig_planar_dimer_gold_model_compare.jl Before/after comparison of fixed-index gold (n_Au(600nm)) versus wavelength-dispersive gold (n_Au(λ)) across the same dimer orientation cases.

Both scripts place dipoles close to the plane (z = 0.5 nm) and enable prototype reflected self-interaction to make near-interface reaction effects visible.