  We report the publication of treams, a new software for electromagnetic
scattering computations based on the T-matrix method. Besides conventional
T-matrix calculations for individual scatterers and finite clusters of
particles, a unique feature of the code is its full support for periodic
boundaries in one, two, and all three spatial dimensions. We use highly
efficient and quickly converging lattice summation techniques based on the
Ewald method to evaluate the arising lattice sums in these cases. In addition
to the common use of vector spherical waves as a basis set for the T-matrix,
vector cylindrical waves are also implemented. To describe stratified media,
vector plane waves are used with an S-matrix description of the electromagnetic
scattering. All basis sets and the associated methods can be used together with
chiral constitutive relations.
  This contribution outlines the basic methods implemented and the program
structure. Two interfaces to the implemented functionality are available: a
flexible and fast low-level interface and a high-level interface for added
convenience and plausibility checks. We conclude with two examples: a
demonstration of the field calculation in various lattices and the explorations
of quasi-bound states in the continuum. The presented code was already used in
calculations for various physical systems: from the mode properties of
molecular arrays in cavities to analytical models for metasurfaces and from
moir\'{e} lattices to the homogenization of artificial photonic materials. With
the publication of treams and the associated documentation, we hope to empower
more scientists to make an efficient, fast, and precise exploration of
nanophotonic systems that can be described in the broader framework of
scattering theory. The full code is published at
https://github.com/tfp-photonics/treams with the documentation at
https://tfp-photonics.github.io/treams .
