explaingit

facebookresearch/fmmax

Analysis updated 2026-07-05 · repo last pushed 2026-02-10

147Jupyter NotebookAudience · researcherComplexity · 4/5MaintainedLicenseSetup · moderate

TLDR

FMMAX is a Python library that simulates how light interacts with nanostructured layered materials like photonic crystals and metasurfaces, using JAX for GPU acceleration and automatic gradient computation for design optimization.

Mindmap

mindmap
  root((repo))
    What it does
      Simulates light in materials
      Uses Fourier modal method
      Computes scattering matrices
    Tech stack
      Python
      JAX
      GPU acceleration
    Use cases
      Inverse design
      Nanostructured optics
      Micro-LED simulation
    Audience
      Optics researchers
      Photonics engineers
    License
      MIT license
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Simulate light scattering and absorption in nanostructured optical devices like metasurfaces.

USE CASE 2

Optimize photonic crystal designs using automatic gradient computation for inverse design.

USE CASE 3

Model localized light emission inside periodic structures using Brillouin zone integration.

USE CASE 4

Simulate anisotropic and magnetic optical materials for advanced device modeling.

What is it built with?

PythonJAXJupyter Notebook

How does it compare?

facebookresearch/fmmaxkrishnaik06/complete-machine-learning-2023krishnaik06/text-summarization-nlp-project
Stars147119198
LanguageJupyter NotebookJupyter NotebookJupyter Notebook
Last pushed2026-02-102023-09-162024-08-17
MaintenanceMaintainedDormantStale
Setup difficultymoderateeasyhard
Complexity4/51/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Installable via pip, but requires familiarity with photonics concepts and JAX, GPU recommended for performance but not strictly required.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

FMMAX is a tool from Facebook Research that simulates how light behaves when it passes through structured, layered materials, like photonic crystals, metasurfaces, or the tiny patterns found on advanced LEDs. If you are designing a nanostructured optical device and need to predict how it will scatter, transmit, or absorb light, this library computes those electromagnetic fields for you. Under the hood, it implements a technique called the Fourier modal method (FMM), which is a standard approach in computational photonics. The method works by breaking a periodic structure into flat layers, representing the light's field within each layer as a sum of Fourier components, and then stitching the layers together using a scattering matrix. This makes it relatively efficient for certain geometries compared to fully numerical solvers. The implementation is built on JAX, which means it can run on GPUs for speed and can automatically compute gradients, useful if you want to optimize a design rather than just analyze one. The project stands out for a few capabilities beyond the basics. It supports Brillouin zone integration, which lets you model localized light sources (like a single emitter or a focused beam) inside a periodic structure, rather than only uniform plane waves. It also includes advanced "vector FMM" formulations that improve simulation accuracy for tricky geometries, and it handles anisotropic and magnetic materials, broadening the range of devices you can model. The likely users are optics researchers and engineers working on things like metasurface-enhanced micro-LEDs, photonic crystal slabs, or other nanostructured optical components. The automatic differentiation support makes it particularly suited for inverse design, where you specify desired optical behavior and let an optimizer search for the structure that produces it. The project is installable via pip and released under the MIT license.

Copy-paste prompts

Prompt 1
Using the FMMAX library, write a JAX-based script that simulates a 2D photonic crystal slab and returns the transmission and reflection spectra for a range of incident angles.
Prompt 2
Using FMMAX with JAX autodiff, set up an inverse design loop that optimizes a metasurface unit cell geometry to maximize transmission at a target wavelength.
Prompt 3
Using FMMAX, simulate a localized dipole emitter inside a periodic photonic crystal structure using Brillouin zone integration and plot the far-field radiation pattern.
Prompt 4
Using FMMAX, model an anisotropic layered optical device and compute the electromagnetic fields and scattering matrix for each layer.

Frequently asked questions

What is fmmax?

FMMAX is a Python library that simulates how light interacts with nanostructured layered materials like photonic crystals and metasurfaces, using JAX for GPU acceleration and automatic gradient computation for design optimization.

What language is fmmax written in?

Mainly Jupyter Notebook. The stack also includes Python, JAX, Jupyter Notebook.

Is fmmax actively maintained?

Maintained — commit in last 6 months (last push 2026-02-10).

What license does fmmax use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is fmmax to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is fmmax for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub facebookresearch on gitmyhub

Verify against the repo before relying on details.