HELIOS is a C++ / Python toolkit for simulating electromagnetic scattering from objects embedded either in homogeneous media (isolated objects and periodic structures) or layered media, using the surface integral equation (SIE) method. It provides a modern, scriptable workflow around two compiled applications (SIENano and SIENanoPP) and a set of Python utilities for job generation, mesh conversion, post-processing, and visualization.
- Citations
- Highlights
- Repository layout
- Dependencies
- Quick start
- Input data and configuration
- Running simulations
- Visualization
- Graphical user interface
- Logging, progress, and exit codes
- P.S. Mavrikakis, O.J.F. Martin, arXiv (2026). https://doi.org/10.48550/arXiv.2602.23097.
- A.M. Kern, O.J.F. Martin, J. Opt. Soc. Am. A 26 (2009) 732β740. https://doi.org/10.1364/JOSAA.26.000732.
- B. Gallinet, A.M. Kern, O.J.F. Martin, J. Opt. Soc. Am. A Opt. Image Sci. Vis. 27 (2010) 2261β2271. https://doi.org/10.1364/JOSAA.27.002261.
- Three modes:
- isolated scatterer in homogeneous background,
- periodic structure in homogeneous background, and
- isolated scatterer in layered background.
- Scriptable orchestration with
run_sie.py: prepare jobs, run solvers, and post-process results from the command line. - Robust job generation from a compact
config.txtusingpytools/jobwriter.py, including layered stacks and tabulated materials. - COMSOL mesh imports: convert
.mphtxtto the compact.meshformat withpytools/meshconvert.py, including optional periodic cropping. - Near-field & cross-section visualization with
pytools/visualization.pyin 2D, 3D, and 1D line-cut modes. - Designed to work with C++11 builds of
apps/SIENanoandapps/SIENanoPP.
Helios/
βββ docs/ # C++ code documentation folder
βββ include/ # header files and blitz++ files
βββ materials/ # Ξ΅(Ξ») tables for named materials
βββ pytools/ # python orchestration & utilities
β βββ drude_model.py # Drude model for tabulated materials
β βββ jobwriter.py # turns sim_data/<sim>/config.txt into jobs/job.N.xml
β βββ meshconvert.py # COMSOL .mphtxt β .mesh
β βββ plot_mesh.py # plot simulation mesh
β βββ visualization.py # plot cross sections and near-fields
βββ sim_data/ # your data inputs (per simulation)
β βββ <SimName>/ # simulation data folder(s)
β βββ config.txt # compact configuration for jobwriter.py
β βββ mesh.mphtxt # COMSOL text mesh (.mphtxt)
βββ sim_res/ # data outputs (auto-created per simulation)
β βββ <SimName>/ # simulation results folder(s)
β βββ jobs/ # folder where job.N.xml files are found
β βββ logs/ # one logfiles per run (different for solver/post-processor)
β βββ out/ # solver & post-processor data outputs
β β ββ csc/ # cross sections' data
β β ββ fields/ # .ein/.esc/.hin/.hsc fields' data organized by points set
β β ββ media/ # location for PNG plots
β βββ points/ # generated sampling points sets (.pos)
β βββ lambdalist.txt # Ξ»[nm] mapping for plots
β βββ mesh.mesh # converted surface mesh
βββ src/ # C++ source code
βββ third_party/ # third-party fortran files
β βββ amos/ # amos library files
β βββ legacy_f # congugate gradient solver
β βββ quadpack # quadpack routines
β βββ regridpack # regridpack routines
β βββ erfc.bin # erfc lookup table for periodic jobs
βββ dist_run_helios.py # parallel job launcher for distributed runs
βββ environment.yml # conda env (see below)
βββ helios_gui.py # Python GUI
βββ makefile # compilation instructions
βββ README.md # this file
βββ run_sie.py # orchestration: prepare β solve β generate points β post-processThe project consists of:
- C++11 core code (compiled via
makefile), - Fortran numerical kernels (AMOS, QUADPACK, REGRIDPACK),
- Python tools (for job management, post-processing, and visualization),
- Optional bash launchers (for distributed runs).
All builds have been tested on Linux using
condacompilers and OpenBLAS.
| Category | Package | Purpose |
|---|---|---|
| Compiler (C++) | gxx_linux-64 |
C++11 compiler used for all main code. |
| Compiler (Fortran) | gfortran_linux-64 |
Fortran compiler for numerical submodules. |
| Math Library | openblas |
Provides BLAS and LAPACK routines. |
| C++ Array Library | blitz++ |
High-performance multi-dimensional arrays used in the solver. |
| Threads | pthread (system) |
Required by OpenBLAS. |
Fortran sources included in the project:
third_party/amos/*.fβ Bessel and Hankel functions,third_party/quadpack/*.fβ Gauss-Kronrod integration,third_party/regridpack/*.f90β interpolation routines,third_party/legacy_f/cg.fβ conjugate-gradient solver.
These are compiled automatically and do not require separate installation.
Used by the helper tools under pytools/ and for running the main run_sie.py script and helios_gui.py.
| Package | Purpose |
|---|---|
python β₯ 3.10 |
Base interpreter. |
numpy |
Numerical processing and mesh handling. |
scipy |
Numerical routines. |
matplotlib |
Plotting and visualization. |
PySide6 |
Qt bindings. |
tqdm |
Progress bars. |
miepython |
Mie theory. |
The documentation is already provided, but the following packages are required to regenerate it with Doxygen.
| Package | Purpose |
|---|---|
doxygen |
Generates HTML and PDF documentation from C++ comments. |
graphviz |
Renders dependency and call graphs (used by Doxygen). |
The project uses Miniconda to manage dependencies. The file environment.yml is provided to produce the proper conda environment. After installing Miniconda for linux, you can create and activate the environment with the following commands:
cd Helios/
conda env create -f environment.yml
conda activate HeliosLinux users can clone the repository and install HELIOS with the following steps. For Windows users, the Windows Subsystem for Linux (WSL) is recommended.
- Install git and clone the repository:
sudo apt install git git-lfs && git lfs install
git clone https://github.com/mavrikak/Helios.git- Create a conda environment with Miniconda and activate it:
cd Helios
conda env create -f environment.yml
conda activate Helios- Build the project:
mkdir apps
mkdir build
make clean && make -j-
Place inputs for a simulation under
sim_data/<SimName>/:config.txtβ simulation configuration (check examples insim_data/and next section for details)mesh.mphtxtβ COMSOL mesh text file
-
[Optional] Rebuild the documentation:
cd docs
bash build.sh- [Optional] Generate
erfc(z)lookup table:
make table
python run_sie.py make-table erfc.bin --maxRe 10.0 --maxIm 10.0 --incRe 0.1 --incIm 0.1Each simulation lives under sim_data/<SimName>/ and provides a config.txt. From this compact text, pytools/jobwriter.py produces the solver job XMLs. The configuration supports:
-
Wavelength sweep: Specify one value or a
start stop stepvalue range. -
Domain description: tokens for each domain; plain materials can be either literals (real/complex numbers) or names of tabulated materials found in
materials/. -
Incident domain: the index of the domain where the illuminating field lives.
-
Polarization:
s, p, TE, TM, LCP, RCP. -
Incidence angles:
$\theta$ and$\phi$ in degrees; specify one value or astart stop stepvalue range.
Add two extra lines to list, per layered stack:
-
Materials per stack (comma-separated stacks, space-separated within a stack):
1 SiO2 1, Ag Au -
Interface z-positions per stack (same structure):
0 150, 20 -
jobwriter.py expands each
LayeredM#token in your domain line into a<domainLayers>section with<layer>entries (properties at the current wavelength) and<interface>tags.
Material tokens in config.txt can be:
-
Literals:
$\varepsilon_r = \alpha + i \beta$ (2.25, 2.25+0.1i, 2.25+0.1j, (2.25, 0.1), [2.25,0.1], {2.25,0.1}). -
Tabulated files in
materials/<name>.txtwith the format: $ \quad \lambda , [nm] \quad \Re(\varepsilon_r) \quad \Im(\varepsilon_r) \quad$.
Linear interpolation fills intermediate wavelengths; endpoints are linearly extrapolated.
Add one extra line to list:
(px, py): Unit cell dimensions in the x and y directions, respectively.(cx, cy): Unit cell centers in the x and y directions, respectively.z: Cut-off z position for the lower semi-infinite part of the unit cell.
The helios_gui.py script can be used to open the GUI and interactively prepare simulations, run them (both locally and distributed), and post-process the results. Additionally, it can be used to visualize the mesh and results of a simulation. All the user has to do is run python3 helios_gui.py in a terminal.
-
Every external run is tee-logged under
sim_res/<sim>/logs/with concise TTY progress when interactive. -
Non-zero exit codes indicate user-facing errors (bad paths/flags/inputs).
-
On non-interactive terminals, spinners are suppressed to keep logs clean.
