AFLOW-EMERALD
ElectroMagnetic modes EngineeRing in Advanced LayereD materials
AFLOW-EMERALD is an open-source, modular Python/MATLAB framework for the quantitative simulation of electromagnetic wave propagation in layered and periodically structured (meta)materials. Starting from the dielectric response of the constituent materials — measured, from the literature, or computed ab initio — EMERALD combines a numerically stable scattering-matrix method (SMM) and rigorous coupled-wave analysis (RCWA) for finite multilayer stacks with plane-wave expansion (PWE) tools for the photonic bandstructure of infinite periodic media, delivering optical spectra, electromagnetic field distributions, and Bloch-mode dispersions from a single, unified codebase. AFLOW-EMERALD is part of the AFLOW ecosystem for computational materials design.
| Domain | What AFLOW-EMERALD computes |
|---|---|
| Optical spectra (finite stacks) | Reflectance, transmittance, absorptance (RTA) vs. energy or angle of incidence, for arbitrary numbers of periods |
| Electromagnetic fields | 1D field profiles and 2D (x–z) field maps (Hy, Ex, Ez, Poynting vector) across the multilayer stack |
| Photonic bandstructure | 1D/2D Bloch-mode dispersion of infinite periodic media, including complex-k (inverse-dispersion) formulation for dispersive/absorbing materials |
| Effective medium theory | Parallel/perpendicular effective permittivity and hyperbolic-type classification (isotropic, type-I, type-II) vs. energy or angle |
| Supported data input | Numerical (real/complex) dielectric constants, CSV datasets, Quantum ESPRESSO epsilon.x output, refractiveindex.info database lookups |
| Structured couplers | Laterally patterned (grating) layers enabling momentum matching between free-space radiation and the layered structure |
| Remote/batch execution | SLURM job submission for large 2D bandstructure calculations on remote HPC hosts, with optional job tracking database |
AFLOW-EMERALD is installable as a standard Python package from a local clone of this repository:
git clone https://github.com/aflow-org/emerald.git
cd emerald
pip install .This installs also the Python dependencies automatically.
One dependency cannot be installed via pip: the MATLAB Engine for Python (tested with R2024a), which is not distributed on PyPI. It must be installed from your local MATLAB installation.
If you plan to use the optional database connection used for the automatic submission of 2D bandstructure calculations to a remote HPC cluster. You can edit config.yml to set the database connection parameters.
cd enerald
cp config.default.yml config.yml
vim config.ymlIf you do not need this feature, you can leave the default values.
from emerald import Multilayer
import numpy as np
mat = Multilayer("systems.yaml", "sys1")
params={"periods": 5, "eps_in": 1, "eps_out": 1, "plot": "RTA"}
energy=np.linspace(0, 4, 400)
result = mat.rta_energy(energy, params)Every simulation follows the same three steps: instantiate Multilayer against a YAML file describing the structure geometry, then call one of the four core functionalities:
rta_energy— RTA spectra vs. energyrta_angles— RTA spectra vs. angle of incidencefields— electromagnetic field profiles and mapsbands2Dandbands1D— photonic bandstructure of the infinite periodic medium
System geometries — predefined materials, layer thicknesses, gratings, and block includes/prepends/appends — are described in a single YAML configuration file, which can hold multiple structures identified by unique keys. See the software documentation for the full configuration syntax and API reference.
- 📖 Documentation: full API reference, YAML configuration syntax, and theoretical background — see
documentation.mdin this repository - 🗂️ Examples: worked examples for photonic crystals, hyperbolic metamaterials, and surface-plasmon interfaces are discussed in the reference publication
AFLOW-EMERALD is released as free software under the GNU General Public License v3.0 or later (GPL-3.0-or-later), ensuring that the code can be used, modified, and redistributed while preserving the same freedoms in derivative versions. Source code, documentation, example input files, and scripts to reproduce the simulations reported in the reference publication are publicly available at github.com/aflow-org/emerald.
If you use AFLOW-EMERALD in published work, please cite:
S. Campanaro, L. Bursi, N. Anderson, S. Curtarolo, A. Calzolari, AFLOW-EMERALD: ElectroMagnetic modes EngineeRing in Advanced LayereD materials, 2026, preprint.