TERMS stands for T-matrix for Electromagnetic Radiation with Multiple Scatterers — it is a Fortran program to simulate the near-field and far-field optical properties of collections of particles. TERMS solves rigorously the Maxwell equations via the superposition T-matrix method, where incident and scattered fields are decomposed into a basis of multipolar electric and magnetic spherical waves.
In a multiple-scattering problem the net field exciting a given particle is composed of the incident field plus the scattering contribution from neighbouring particles, restulting in a coupled system of equations to be solved for the total fields. TERMS implements several algorithms to describe the self-consistent electromagnetic interaction between multiple scatterers, and from there compute optical properties such as absorption, scattering, extinction, circular dichroism, as well as near-field intensities and the local degree of optical chirality.
By describing the incident and scattered fields in a basis of spherical waves the T-matrix framework lends itself to analytical formulas for orientation-averaged quantities such as far-field cross-sections and near-field intensities, greatly reducing the computational time needed to simulate particles and systems of particles in random orientation.
The possible computations are divided into three main modes:
The computational cost scales with the size of the linear system, proportional to the number of particles Np, and to the square of the maximum multipolar order Nmax. On a typical PC we may treat up to ∼ 500 particles with Nmax = 1, and a dimer with Nmax up to ∼ 60.
Notable features of TERMS include:
The electromagnetic field is expanded in the basis of vector spherical waves, with the Bessel/Hankel functions computed using TOMS644 library (source included in TERMS). Determining the collective scattering amounts to either solving or inverting a large linear system, which is done using LAPACK. All the relevant LAPACK routines are included in TERMS, but it is recommended to link with your system installed BLAS/LAPACK at compilation stage, because it can enable multi-threading during runtime.
Results are output in plain text files, or, alternatively, in HDF5
data format, which requires suitable hdf5
libraries to be available on your system.
We recommend using the cross platform compilation tool cmake, to resolve all dependencies for your system. From within the build/
directory, type
to produce the executable terms
. Note: if Cmake doesn’t find hdf5 (or another library path) by default, you may need to export it explicitly beforehand. For example on MacOS, the following has proved useful:
Alternatively, a minimal build script is available in the build/
directory; the program can be compiled by executing bash buildTERMS.sh
from a Linux terminal with bash. Edit ‘buildTERMS.sh’ to specify a compiler other than GFortran.
We recommend downloading the latest release here [terms_code_1.0.2(.zip|.tar)
]. You can also browse/clone/fork the entire repository, but note that it contains many files used to generate the website, which are not relevant for using TERMS.
When running the stand-alone executable, main input parameters are read from a plain text input file (line by line and from left to right). Each line is interpreted as a sentence and split into space-separated words. The first (left-most) word is interpreted as a keyword, and the subsequent words as arguments for that keyword. In each sentence, text from the first word starting with the hash character (#
) is interpreted as a human-readable comment and thus ignored by the program. All the supported keywords and corresponding arguments are documented on this page. The order of keywords generally doesn’t matter, with just two exceptions: ModeAndScheme
must be the first keyword, and Scatterers
must be the last. Two examples of input files are provided in the /test
directory.
If you use TERMS, please cite the following user guide, as well as other publications listed below if relevant: