treams_functions
The treams_functions
collection contains three functions
that enable a connection between PyScatter
and
treams
, a T-Matrix based library for scattering
calculations(Beutel,
Fernandez-Corbaton, and Rockstuhl 2024). More specifically, it
allows focusedBeam
objects to be defined with
treams
objects, such that this illumination can be used
with e.g. clusters that and other more complicated systems not available
with PyScatter
. The functions take inputs that define the
system (materials, positions and sizes of scatterers) with the
treams
syntax. They return coefficients which, in the
T-matrix formalism contain enough information to describe the electric
field in a given basis.
The three functions focusedBeam_treams()
,
focusedBeam_treams_xs()
and
focusedBeam_treams_xs_cluster()
are imported with
from src.treams_functions import *
.
To use the methods, treams
needs to be installed in a
virtual environment, which can be done by writing
pip install treams
in a terminal.
More information about the different treams
objects and
methods can be found in the documentation here.
Interface function between a focusedBeam
object and
treams
spheres. Converts the beam coefficients into the
appropriate spherical wave basis, applies the T-matrix filtering for the
given \(m_z\)-value in [eq:Cjmz], and returns incident and
scattered coefficients.
focusedBeam
instance. Contains beam parameters
(wl
, maxJ
, mz
,
C
).
treams.TMatrix
(one scatterer) or list of T-matrices
(multiple scatterers, corresponding radii inputs needed). Defines one or
multiple scatterers.
optional array-like. Positions of spheres (\(N \times 3\)). Defaults to (0,0,0) if not provided.
optional array-like. Radii of spheres.
Returns:
sca_coeffs
— scattered field coefficients.
beam_coeffs
— incident beam coefficients.
tm
— T-matrix object (possibly clustered).
Computes scattering and extinction cross-sections for a
focusedBeam
interacting with a single sphere for one or
more wavevector values. If a list is provided, \(k0\) values are taken from each
element.
focusedBeam
instance. Provides beam coefficients.
treams.TMatrix
or list. Single or multiple wavevector
values.
optional array-like. Sphere position. Defaults to origin.
Returns:
sca
— scattering cross-section(s) \([\text{nm}^2]\).
ext
— extinction cross-section(s) \([\text{nm}^2]\).
Computes scattering and extinction cross-sections for a
focusedBeam
interacting with a cluster of spheres at given
positions.
focusedBeam
instance. Provides beam coefficients.
list of treams.TMatrix
. Defines cluster of scatterers
(different radii).
array-like. Positions of spheres (\(N \times 3\)).
array-like. Wavenumbers for evaluation.
Returns:
sca
— list of scattering cross-sections \([\text{nm}^2]\).
ext
— list of extinction cross-sections \([\text{nm}^2]\).