← Back to Lab

Electrostatics finite differences

Self-consistent quasistatic response of coupled two-dimensional nanostructures, by finite differences. Eigenmodes and bands for any geometry; cross sections under a plane wave, the local density of states around a dipole, and electron energy loss for a swift electron — drift-biased and substrate-coupled throughout.
First load downloads ~35 MB (Pyodide + numpy + scipy) — cached after.

v0.1.0·Updated 2026-11-08
Model & Assumptions Experimental
Model
Quasistatic self-consistent response, discretised by finite differences. A single dimensionless η(ω)\eta(\omega) carries all the material and frequency dependence; the geometry enters through a Coulomb kernel V(q)\mathcal{V}^{(q)} and a second-derivative operator D(q)\mathcal{D}^{(q)}, and the potential solves ϕ⃗=[1−(M+Mˉ)]−1ϕ⃗ ext\vec\phi=[\mathbb{1}-(\mathcal{M}+\bar{\mathcal{M}})]^{-1}\vec\phi^{\,\rm ext}. Perturbative orders (SHG, THG with the cascaded contribution) are each screened at their own harmonic. Runs this project's Python reference library in the browser through Pyodide — the same code its test suite exercises, not a port. The charts name three rungs of the one formalism: Level 1 is the unpatterned sheet, Level 2 the ribbon eigenmodes and their bands, Level 3 the LDOS map.
Assumptions
Quasistatic: every dimension and separation well below the free-space wavelength, retardation entering only through the sources' Lorentz factors. Sheets are strictly two-dimensional and carry no thickness. σ\sigma is local in real space — nonlocal in QQ only through the drift tensor — and is evaluated pointwise at the guided qq. Swift electrons are aloof and parallel: there is no penetrating-trajectory formalism here.
Validity
Graphene with ∣EF∣≫kBT|E_{\rm F}|\gg k_{\rm B}T in the plasmonic window below the interband edge at 2∣EF∣2|E_{\rm F}|; thin metal films for t≪Wt\ll W. The drift closed forms are T=0T=0 in the tensor itself, though the Drude weight carries temperature. Nonlinear conductivities keep field gradients to linear order, valid for optical wave vectors ≲1 nm−1\lesssim 1\,\mathrm{nm}^{-1}. η\eta carries the intraband (Drude) conductivity alone, with no interband term, so a mode drawn above roughly 0.83×2∣EF∣0.83\times2|E_{\rm F}| is an artefact of a conductivity that has stopped being valid there, not a prediction.
Limitations
Nanoribbons only for now; nanotubes and nanodisks are not wired up. Nonlinear orders and drift have never been derived together, and the tool refuses the pair rather than guessing. A substrate screens both the response and the source through the same reflection coefficient, but it has no third-party implementation to have been checked against; what is checked is its perfect-mirror limit, which reproduces the textbook image construction to 2×10−13 — and that test drives the linear solve, not the screened eigenproblem the Modes and Dispersion views take whenever a stack is set, which nothing has checked. The EELS loss probability, the dissymmetry gg, and the band and peak-tracking routines are unchecked against any outside code in the same way. The LDOS is in arbitrary units: its 2π2∣p∣22\pi^2|\mathbf{p}|^2 normalisation has no external confirmation. Absolute magnitudes carry a 3–12 % modelling choice in the edge cell weights, though peak positions do not.
References
Rasmussen et al., Nanoscale 15, 3150 (2023); Sci. Adv. 10, eadn6312 (2024); Rodríguez Echarri, García de Abajo & Cox, Nat. Commun. 17, 1114 (2026). Full list below.
System
Parameters

Parameters

Geometry Ribbon 1
Discretization
Material

Source

Normal incidence, polarised across the ribbons. That is the q=0q=0 case.

Grid

to

Environment

Starting the Python solver…
Cross section vs energy
Export this result
Geometry
Ribbons

Estimate — Route — Headline —

Export the geometry

Notes

One self-consistent problem. Every structure here is a two-dimensional sheet whose induced charge responds to the total potential, external plus induced. Discretising the sheet on LL nodes turns that into a linear system

ϕ⃗=[1−(M+Mˉ)]−1ϕ⃗ ext,Mjj′=Vjj′(q) Dj′(q)\vec\phi = \big[\mathbb{1}-(\mathcal{M}+\bar{\mathcal{M}})\big]^{-1}\vec\phi^{\,\rm ext}, \qquad \mathcal{M}_{jj'} = \mathcal{V}^{(q)}_{jj'}\,\mathcal{D}^{(q)}_{j'}

in which V(q)\mathcal{V}^{(q)} is the Coulomb kernel between node cells, D(q)\mathcal{D}^{(q)} the finite-difference second derivative, and Mˉ\bar{\mathcal{M}} the reflected interaction a layered substrate adds. All the material physics sits in one dimensionless number, η(ω)=iσ(ω)/ωWεˉ\eta(\omega)=\mathrm{i}\sigma(\omega)/\omega W\bar\varepsilon, so the eigenvalues of the geometric operator are material-independent and the resonances are wherever η(ω)=ηj\eta(\omega)=\eta_j. That is why Modes and Dispersion are offered under every excitation: they are properties of the structure, not of how you drive it.

Drift is not a Doppler shift

A drift current is carried by a skewed Fermi–Dirac distribution, and solving the Boltzmann equation on it gives an anisotropic, nonlocal conductivity tensor — with α=vFQ/(ω+iγ)\alpha = v_{\rm F}Q/(\omega+\mathrm{i}\gamma) and β=vd/vF\beta = v_{\rm d}/v_{\rm F},

σ∥(Q)=2σω(α+β)2(1+αβ1−α2−1−β2)\sigma_\parallel(Q)=\frac{2\sigma_\omega}{(\alpha+\beta)^2}\left(\frac{1+\alpha\beta}{\sqrt{1-\alpha^2}}-\sqrt{1-\beta^2}\right)

Three things a frame shift would get wrong, and this does not: the drift survives Q→0Q\to 0, so it renormalises even the plane-wave response; the non-reciprocity lives in (α+β)2(\alpha+\beta)^2 and the αβ\alpha\beta cross term, so q→−qq\to-q is a symmetry only at β=0\beta=0; and η\eta becomes a tensor, which is why Dispersion refuses a drifted run and falls back to the extended-sheet map — a single eigenvalue spectrum then has no resonance condition to invert. The drifted ribbon dispersion is read off the LDOS map instead.

What the numbers mean

  • The Dirac cone is electron–hole symmetric, so every conductivity takes ∣EF∣|E_{\rm F}| and hole doping gives exactly the electron-doped answer. Signed formulas would return Re σ<0\mathrm{Re}\,\sigma<0 — gain from a passive sheet.
  • Eigenvalues are geometric. The same ηj\eta_j come out under any conductivity convention, so they cannot be used to pin one. The tool hides the operator's charge-neutrality null mode, whose η\eta diverges; it is an artefact, not a resonance.
  • The LDOS is in arbitrary units. Read peak positions and relative weights.
Examples

References

  • [1]T. P. Rasmussen, A. Rodríguez Echarri, F. J. García de Abajo & J. D. Cox, Nonlocal and cascaded effects in nonlinear graphene nanoplasmonics, Nanoscale 15, 3150 (2023).
  • [2]T. P. Rasmussen, A. Rodríguez Echarri, J. D. Cox & F. J. García de Abajo, Generation of entangled waveguided photon pairs by free electrons, Sci. Adv. 10, eadn6312 (2024).
  • [3]A. Rodríguez Echarri, F. J. García de Abajo & J. D. Cox, Nonreciprocal plasmons in one-dimensional carbon nanostructures, Nat. Commun. 17, 1114 (2026), doi:10.1038/s41467-025-67872-5.
  • [4]Cox, Yu & García de Abajo, Phys. Rev. B 96, 045442 (2017) — the nonlinear sheet conductivities.
  • [5]Yu, Cox, García de Abajo et al., ACS Photonics 4, 3106 (2017) — the coupled-ribbon geometry one example uses. The only evidence tying those parameters to that paper's Fig. 5c is a comment in the reference code, so read the example as the parameters the reference attributes to it.
  • [6]G. W. Hanson, Dyadic Green's functions and guided surface waves for a surface conductivity model of graphene, J. Appl. Phys. 103, 064302 (2008) — the interband logarithm.
  • [7]M. Jablan, H. Buljan & M. Soljačić, Plasmonics in graphene at infrared frequencies, Phys. Rev. B 80, 245435 (2009) — the 2D plasmon dispersion the sheet pole reproduces.

Induced field, every component

Re Ex
Re Ey
Re Ez
Im Ex
Im Ey
Im Ez
|E|

The induced field only, on an arbitrary common scale. Black marks the ribbons; a dot marks a dipole and a dashed line an electron's path.

Geometry

Each ribbon is drawn as its line of discretisation nodes. The sheets are two-dimensional and carry no thickness; the vertical axis is to the same scale as the horizontal one.