treams_ebeam: Fast-Electron Spectroscopy Module
- treams_ebeam is an open-source module implementing fast-electron spectroscopy via cathodoluminescence and electron energy-loss within a unified T-matrix scattering formalism.
- It employs cylindrical and spherical wave basis transformations to model isolated scatterers, finite clusters, and periodic chains under various electron trajectories.
- Closed-form expressions for CL and EELS observables allow efficient simulation of nanophotonic experiments, bridging optical and electron-beam excitations.
treams_ebeam is an open-source extension module to the T-matrix-based nanophotonics suite treams that implements fast-electron spectroscopy—specifically cathodoluminescence (CL) and electron energy-loss spectroscopy (EELS)—within the same algebraic scattering framework used for optical excitation. It reuses T-matrix descriptions of individual scatterers and ensembles, adds an electron-beam source, supports cylindrical-wave and spherical-wave basis transformations, and provides closed-form CL and EELS observables for single particles, finite clusters, and one-dimensional periodic chains under aloof or parallel trajectories. The code is available at https://github.com/tfp-photonics/treams_ebeam (Stamatopoulou et al., 13 Feb 2026).
1. Definition and scope
The defining feature of treams_ebeam is the integration of free-electron excitation into a T-matrix formalism in which scatterers are represented by illumination-independent response operators. In this framework, the same object description can be reused across different excitations, including conventional electromagnetic illumination and the near field of a fast electron. The module therefore serves as a computational bridge between nanophotonic multiple-scattering theory and electron-beam spectroscopies such as CL and EELS (Stamatopoulou et al., 13 Feb 2026).
The scope of the implementation is explicitly threefold. First, it treats isolated scatterers, including analytically supported cases such as spheres and infinite cylinders. Second, it handles finite aggregates by combining per-particle T-matrices with translation and multiple-scattering operators. Third, it treats periodic one-dimensional chains, including electron motion parallel to the periodic axis and the associated diffracted cylindrical orders. In all three cases, the computational object remains the multipole coefficient vector rather than a real-space mesh, so the method is meshless in the sense emphasized by the implementation paper (Stamatopoulou et al., 13 Feb 2026).
The intended application domain is fast-electron spectroscopy in homogeneous vacuum or air. The presented formalism is classical electrodynamics with local material response, so it addresses CL as far-field radiation generated by electron-driven scattering, and EELS as the work done by the scattered field on the traversing electron. This places treams_ebeam squarely in the computational ecosystem used to design and interpret nanophotonic electron-beam experiments (Stamatopoulou et al., 13 Feb 2026).
2. Basis expansions and scattering formalism
The formalism expands electromagnetic fields in either a cylindrical wave basis (CWB) or a spherical wave basis (SWB). The incident and scattered electric fields are written as
where collects the modal indices and labels TM and TE polarization, respectively. Regular basis functions carry the superscript , while singular outgoing functions carry the superscript (Stamatopoulou et al., 13 Feb 2026).
In the cylindrical basis, , with longitudinal wave number and azimuthal index . Regular cylindrical waves use Bessel functions , and singular waves use Hankel functions . In the spherical basis, 0, regular waves use spherical Bessel functions 1, and singular waves use spherical Hankel functions 2. The implementation follows the conventions of the underlying treams package for normalization, basis ordering, and translation/addition theorems (Stamatopoulou et al., 13 Feb 2026).
At the single-scatterer level, the central relation is
3
with 4 the T-matrix, 5 the incident multipole coefficients, and 6 the scattered coefficients. A critical structural property is that 7 depends only on geometry and material composition, not on the illumination. That separation is what permits reuse of the same object response across optical and electron-beam excitation scenarios (Stamatopoulou et al., 13 Feb 2026).
For aggregates, treams_ebeam uses local expansions about each particle center. If particle 8 has T-matrix 9 and local incident coefficients 0, then multiple scattering is expressed as
1
with 2 the singular translation matrices. In stacked form, the local response operator is
3
A global expansion can then be formed by translating local coefficients to a common origin through regular translation matrices 4 (Stamatopoulou et al., 13 Feb 2026).
For periodic one-dimensional chains aligned with the electron trajectory, periodic coupling includes all lattice vectors and the phase factor 5. The implementation evaluates the lattice sums with a fast-converging Ewald method. This periodic formulation is particularly relevant for Smith–Purcell-type radiation channels and for lattice resonances in extended arrays (Stamatopoulou et al., 13 Feb 2026).
3. Electron-beam source and spectroscopic observables
The electron is modeled as moving in vacuum along a straight line at constant velocity 6, with reduced velocity 7 and Lorentz factor 8. In the frequency domain, its electric field is
9
with 0 modified Bessel functions and 1 cylindrical coordinates. Rewriting this field in cylindrical-wave form shows that the source is a singular TM cylindrical wave of fixed longitudinal wave number 2, with evanescent radial behavior because 3 (Stamatopoulou et al., 13 Feb 2026).
That representation is fundamental to the implementation. The electron source is naturally expressed in the cylindrical basis, then translated and, if necessary, converted into the spherical basis so that it matches the basis of the scatterer T-matrix. The code therefore relies on exact cylindrical-to-cylindrical and cylindrical-to-spherical addition theorems to couple the moving charge to local or global scatterer representations (Stamatopoulou et al., 13 Feb 2026).
CL and EELS are then computed directly from the multipole coefficients. In the spherical basis, the CL probability obtained from the far-field Poynting flux is
4
where 5 is the vacuum impedance and 6. In the cylindrical basis, integrating over a cylinder of length 7 gives
8
For infinitely long structures, the cylindrical expression is quoted per unit length (Stamatopoulou et al., 13 Feb 2026).
The EELS probability is defined from the work done by the scattered field on the electron trajectory. In spherical form,
9
and in cylindrical form,
0
with 1. These expressions make the division between radiative and nonradiative channels explicit: CL is constructed from far-field flux, whereas EELS contains both radiative and absorptive losses (Stamatopoulou et al., 13 Feb 2026).
4. Software architecture and computational workflow
treams_ebeam is implemented as a Python extension of treams and uses the same basis objects and T-matrix data structures. The standard workflow begins by constructing or importing per-particle T-matrices. Built-in analytic constructors exist for spheres in the spherical basis and for infinite cylinders in the cylindrical basis. For arbitrary shapes, the module accepts numerically computed spherical T-matrices, including data imported from BEM, FEM, or DDA workflows (Stamatopoulou et al., 13 Feb 2026).
Finite clusters are assembled through local per-particle bases and solved with the aggregate interaction operator. Infinite one-dimensional chains are assembled through lattice interactions with periodic Ewald summation. Electron excitation is then instantiated with the fast-electron source and expanded into the basis required by the target T-matrix. Once the incident coefficients are available, CL and EELS are evaluated through basis-aware post-processing routines (Stamatopoulou et al., 13 Feb 2026).
Several implementation details determine numerical stability. For subwavelength spheres, typical truncations are 2 up to 3–4, and the two-dimensional cluster example uses 5. For cylinders, the azimuthal cutoff mmax is chosen according to the needed azimuthal content and the convergence of Lorentzian spectral peaks. For periodic chains, the diffracted-order cutoff is set by 6, which selects the Smith–Purcell diffraction orders to retain. The recommended convergence procedure is to increase 7 or mmax until the spectra stabilize (Stamatopoulou et al., 13 Feb 2026).
The implementation paper characterizes the approach as meshless and emphasizes the reuse of per-particle T-matrices, exact translation/addition operators, and block-structured multiple scattering. It further states that T-matrix simulations can be orders faster than spatially discretized Maxwell solvers such as BEM, FEM, FDTD, or DGTD in multiscale or periodic settings, while remaining especially convenient for infinite periodic systems and radiation-channel analysis (Stamatopoulou et al., 13 Feb 2026).
5. Representative calculations and physical regimes
The paper demonstrates the method first on isolated scatterers. For a dielectric sphere of radius 8 nm with nondispersive 9, excited by an electron with 0 at an aloof distance 1 nm, the calculated EEL and CL spectra show magnetic dipole, electric dipole, and magnetic quadrupole resonances in increasing energy order. In this case EEL exceeds CL because of absorption associated with the complex permittivity (Stamatopoulou et al., 13 Feb 2026).
For an infinite metallic nanowire of radius 2 nm with Drude permittivity
3
using 4, 5 eV, and 6 meV, an electron with 7 launches TM surface plasmon polaritons along the wire axis. The resulting spectra exhibit Lorentzian peaks associated with azimuthal orders 8 (Stamatopoulou et al., 13 Feb 2026).
A third single-particle example uses an amorphous silicon elliptical nanodisk of height 9 nm and axes 0 nm and 1 nm. Its EEL and CL spectra show broader features with mixed multipolar character. This case illustrates the use of imported spherical T-matrices for shapes beyond analytic Mie-type geometries (Stamatopoulou et al., 13 Feb 2026).
The periodic-chain example is more distinctive. Using the same elliptical nanodisk, with pitch 2 nm along the electron trajectory, an electron with 3 and impact parameter satisfying 4 nm excites finite chains with 5 and the infinite-chain limit. The spectra reveal a lattice resonance near 6 eV that sharpens with increasing 7. In the infinite chain, CL is suppressed at this resonance, described in the paper as radiation quenching, whereas away from resonance the CL follows Smith–Purcell radiation. The emission angle of diffraction order 8 is
9
The angular CL develops the characteristic lobes, with node count tied to the number of unit cells (Stamatopoulou et al., 13 Feb 2026).
The finite two-dimensional array example uses aluminum nanospheres arranged on a square lattice of pitch 0 nm, each sphere having radius 1 nm and Drude parameters 2, 3 eV, and 4 eV. An electron with 5 passes transversely through the center, and arrays with 6 particles per side are considered. The single-sphere EEL spectrum contains 7 peaks and a higher-order cluster spanning 8–9. In the arrays, these features split through hybridization into bonding and antibonding modes. For 0 per side, the electric-dipole splitting is not resolved and instead appears as a broad feature near 1 eV, while a high-intensity feature near 2 eV emerges from coupled higher-order modes. CL lacks the tightly confined higher-order features because they are nonradiative (Stamatopoulou et al., 13 Feb 2026).
6. Assumptions, validity limits, and broader context
The implementation is explicitly restricted to classical electrodynamics in homogeneous vacuum or air, with 3 for the background. No substrate or host medium is included in the presented formalism. Material response is local and encoded through frequency-dependent permittivity models such as Drude forms, while nonlocal and quantum corrections are neglected. The electron follows a straight trajectory at constant velocity, and the excitation is introduced through its frequency-domain field rather than through an explicitly discretized current density (Stamatopoulou et al., 13 Feb 2026).
Basis validity imposes additional geometric constraints. A global spherical-wave expansion is valid only outside the circumscribing sphere of the full scatterer or aggregate, so aloof trajectories must stay outside that region when a global SWB is used. Local spherical expansions relax this requirement and allow smaller impact parameters, but they in turn require non-overlapping circumscribing spheres for the individual particles. For periodic systems, overlapping unit-cell circumscribing spheres invalidate a global SWB and force the calculation to remain in a local periodic representation. Very small beam–structure separations can stress multipole truncation and translation accuracy, so the recommended remedy is to increase 4 and remain in local bases (Stamatopoulou et al., 13 Feb 2026).
Within electron microscopy and spectroscopy more broadly, treams_ebeam belongs to the class of methods that treat the electron not merely as a point probe but as a structured excitation channel for specific electromagnetic or inelastic processes. Related work on phase-engineered probes in TEM and STEM has emphasized that electron-beam design can be matched to targeted interactions, including OAM-sensitive EELS and EMCD-style measurements, with representative vortex states written as 5 (Verbeeck et al., 2014). A plausible implication is that the algebraic source-handling strategy used in treams_ebeam could be a useful starting point for future extensions beyond the straight-line TM cylindrical-wave source treated in the present implementation.
In its present form, however, treams_ebeam is defined by a narrower and technically precise achievement: it embeds straight-line fast-electron CL and EELS into a reusable T-matrix scattering formalism, thereby enabling efficient spectroscopy calculations for isolated nanostructures, finite aggregates, and periodic chains with explicit control over basis choice, multiple scattering, and radiative versus nonradiative channels (Stamatopoulou et al., 13 Feb 2026).