Blaze2D is a solver for light that can travel through two-dimensional photonic crystals, written in Rust and about an order of magnitude faster than MPB in recorded parameter sweeps. It began as the solver for my master’s thesis and has grown into a long-term research project.

Light in a crystal

A photonic crystal is a material whose structure repeats on the scale of the wavelength of light, such as a material pierced by a regular pattern of long, parallel air holes. That pattern decides which light can travel through it and which is blocked, much as the atomic lattice of a semiconductor decides how electrons move.

The map of which light can pass is the band structure. Computing it means solving an eigenvalue problem from Maxwell’s equations, repeated for every wavevector the diagram samples.

An electronic crystal and a photonic crystal side by side: graphene’s honeycomb of carbon atoms with the Schrödinger equation, and a honeycomb of air holes in a dielectric with the photonic master equation
The same idea in two settings: electrons in graphene, light in a honeycomb of air holes.

Checked against MPB

MPB, developed at MIT, is the established reference solver for photonic band structures. Blaze computes the same bands, and in recorded parameter sweeps it is about an order of magnitude faster.

0.00.51.01.5ΓXMΓFrequency (c/a)

TM MPBTE MPBTM BlazeTE Blaze

Square lattice of rods (ε = 8.9, radius 0.2a), 32 × 32 grid, ten bands; Blaze in mixed precision.

Time per configuration (ms, lower is faster)

050010001500200025003000Square TM, MPB: 1501.5 ± 66.3 ms1502Square TM, Blaze f64: 240.1 ± 0.1 ms240Square TM, Blaze mixed: 157.5 ± 0.2 ms158Square TE, MPB: 2419.3 ± 96.5 ms2419Square TE, Blaze f64: 312.4 ± 1.0 ms312Square TE, Blaze mixed: 169.2 ± 0.3 ms169Triangular TM, MPB: 1304.3 ± 49.3 ms1304Triangular TM, Blaze f64: 232.9 ± 1.2 ms233Triangular TM, Blaze mixed: 149.6 ± 1.8 ms150Triangular TE, MPB: 2520.3 ± 74.9 ms2520Triangular TE, Blaze f64: 350.0 ± 5.5 ms350Triangular TE, Blaze mixed: 169.6 ± 2.2 ms170SquareTMSquareTETriangularTMTriangularTE

MPBBlaze f64Blaze mixed

Recorded 16-thread parameter sweeps, 64 × 64 grid, eight bands. MPB threads each solve; Blaze runs independent configurations in parallel.

Blaze’s core

Blaze writes the light field as a sum of plane waves and finds the bands with a mixed-precision block eigensolver (LOBPCG), applying Maxwell’s operator through fast Fourier transforms instead of storing large matrices. A study runs whole calculations in parallel rather than splitting each one across threads.

It returns more than bands: projected Maxwell operators, the quantities my master’s thesis needed. And it is a research ground of its own: new numerical ideas, such as reusing the crystal’s symmetries or starting the next geometry from the last one’s solution, are designed to go in as modules and be measured against the plain solver, regressions included.

One step of the block eigensolver: blocks of eigenvector candidates, search directions, and preconditioned residuals, projected by Rayleigh–Ritz onto a small dense eigenproblem
One step of the block eigensolver (LOBPCG): three blocks of trial vectors, projected onto a small dense problem.

Blaze is easy

Blaze was built to be easy to use from the start. Its website explains the theory and can even run the solver in the browser: the Workbench helps design a study, runs it, and exports the results.

For scripts and larger studies, Blaze has clear, modern interfaces in Python, Rust, and TOML, all sharing one configuration format. The Python package installs from PyPI with a single command.

The Blaze2D Workbench in a browser window: a square lattice of holes in its geometry view, with lattice, material, and calculation settings in the sidebar

Scope and scale

Blaze is substantially more than a shell around an existing numerical library: it is a full solver, written from scratch. Behind its interfaces sits a Rust workspace of separate parts: the solver core, one configuration contract shared by every interface, a runner for parallel studies, the command-line tool, the Python bindings, and backends for the CPU, the browser, and CUDA. Release workflows build portable Python wheels and test the installation outside the repository.

50,399 lines of Rust

the solver and its interfaces

663 automated tests

in Rust, Python, and the browser

8 crates

in one Rust workspace

17,636 lines of TypeScript

the website and the Workbench

443 commits

since November 2025

As of September 2026.

Where Blaze is headed

Blaze aims to become a full drop-in replacement for MPB workflows, and to enable research that is currently prohibitive due to computational limits or MPB’s legacy codebase. Blaze’s roadmap has multiple stages. The first builds a reliable research core: the solver is done, its use of the crystal’s symmetries is in development, warm starts are planned, and the pages on theory and benchmarks are being written.

The second makes the two-dimensional solver general and faster: crystals of any shape, quicker solves, calculations at a chosen frequency, gradients for optimizing a design automatically, and running existing MPB calculations in Blaze.

The third adds GPU computing and three dimensions: full 3D crystals, and photonic slabs, thin patterned films that confine light vertically. Every new feature is checked against MPB.

Context

Primary references

  1. Johnson & Joannopoulos (2001): Block-iterative frequency-domain methods for Maxwell’s equations in a planewave basis (the MPB reference method)
  2. Knyazev (2001): Toward the optimal preconditioned eigensolver (LOBPCG)
  3. Joannopoulos, Johnson, Winn & Meade: Photonic Crystals: Molding the Flow of Light (2nd ed.)
  4. MPB developers: User interface, run functions (MPB documentation; on reusing fields between runs)
  5. Georg, Ackermann, Corno & Schöps (2019): Uncertainty quantification for Maxwell’s eigenproblem based on isogeometric analysis and mode tracking
  6. Börm, Köhl & Talebi (2023): Computing Maxwell eigenmodes with Bloch boundary conditions (preprint)
  7. Minkov et al. (2020): Inverse design of photonic crystals through automatic differentiation
  8. Jin & Xie (2026): A robust GPU-accelerated kernel compensation solver with novel discretization for photonic crystals in anisotropic media (preprint)
  9. Feng (2024): Inverse design of photonic crystal waveguides using neural networks and dispersion optimization (preprint)
  10. Zanotti et al. (2024): Legume, a free implementation of the guided-mode expansion method for photonic crystal slabs

Novelty scope: Plane-wave expansion, the LOBPCG eigensolver, and MPB-style preconditioning are established methods; Blaze’s contribution is what it builds on them. It is an independent solver in modern Rust that computes the same bands as MPB, much faster in recorded parameter sweeps, and is easier to use in research. Its modular design leaves plenty of room for new methods and optimizations, each validated against MPB, to make band calculations and research on photonic crystals faster and more practical while keeping their accuracy.