Fastest open-source differentiable photonic optimizer. JAX-accelerated 2D FDTD with free adjoint gradients.
Project description
Strelka
Fastest open-source differentiable photonic optimizer.
JAX-accelerated 2D FDTD with free adjoint gradients. Designed for inverse design of photonic neural network chips.
Key Numbers
| Metric | Value |
|---|---|
| Speed vs Meep | 85× faster (single-threaded) |
| Gradient method | jax.grad — free adjoint, no separate sim |
| Largest demonstrated | 64×64 matrix (240K DOF, 28 min on M2) |
| Platform | Apple Silicon, x86, any JAX backend |
| License | Apache 2.0 |
Install
pip install strelka-fdtd
Quick Start
Python API
from strelka import optimize, simulate
# Design an 8-port photonic matrix multiplier
result = optimize(n_ports=8, design_um=14.0, resolution=10)
# → Topology optimized in ~10 seconds
# Simulate a topology
sim = simulate(result['rho'], n_ports=8)
print(f"Output power: {sim['total_power']:.4f}")
CLI
# Optimize
strelka optimize --ports 8 --res 10
# Full 64×64 (takes ~30 min on M2)
strelka optimize --ports 64 --res 5 --iters 50
# Benchmark your machine
strelka benchmark
# Decompose a weight matrix into photonic blocks
strelka decompose weights.npy --block-size 8
Block Clements Cascade
Decompose any N×N matrix into 8×8 monolithic photonic blocks:
from strelka.cascade import GivensBlockCascade
import numpy as np
W = np.random.randn(64, 64) # your weight matrix
gbc = GivensBlockCascade(N=64, block_size=8)
result = gbc.inference(W)
print(f"Reconstruction error: {result['reconstruction_error']:.2e}")
print(f"Devices: {result['total_devices']} (vs {result['clements_mzis']} Clements MZIs)")
# → error: ~1e-15, 4× fewer devices
How It Works
- FDTD Simulation: Full-wave electromagnetic simulation of 2D photonic structures
- JAX Autodiff:
jax.gradcomputes the gradient of transmission w.r.t. every pixel — no separate adjoint simulation - Adam Optimizer: Gradient ascent with sigmoid binarization schedule
- Block Clements: Exact decomposition of large matrices into small monolithic blocks
Architecture
Your weight matrix (64×64)
↓ SVD
U (64×64 unitary) + Σ (diagonal) + V* (64×64 unitary)
↓ GivensBlockCascade
8×8 monolithic blocks + cross-block couplers
↓ strelka optimize
Foundry-ready GDS for each block
Benchmarks
On Apple M2 (8-core, 16GB):
| Design | Grid | DOF | Time/iter | Full optimization |
|---|---|---|---|---|
| 2-port | 124×124 | 3,600 | 0.6s | 6s |
| 8-port | 196×196 | 19,600 | 0.4s | 8s |
| 64-port | 538×538 | 240,100 | 0.9s | 28 min |
Citing
If you use Strelka in your research, please cite:
Pushinka, "strelka-fdtd: Fastest open-source differentiable photonic optimizer," 2026.
https://github.com/venticedcappuccino/strelka-fdtd
Contributing
We welcome contributions. See CONTRIBUTING.md for guidelines.
Founding contributors receive named credit and priority access to paid work.
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file strelka_fdtd-0.1.0.tar.gz.
File metadata
- Download URL: strelka_fdtd-0.1.0.tar.gz
- Upload date:
- Size: 19.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ca0331703deaa87d9cee568f299dc50b6fb2e7a657aad81556f86c1b45c9c5e
|
|
| MD5 |
da58b2e1d966893330026db12744f965
|
|
| BLAKE2b-256 |
fd58f4dc1f0f37e34d020c3bba587f3cde9ff1beabbf2a8ebec42cae9c29127e
|
File details
Details for the file strelka_fdtd-0.1.0-py3-none-any.whl.
File metadata
- Download URL: strelka_fdtd-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72c81052284ef8770042fd709c182b4ecc4fa5270f51778c0c6ea4401ed54abe
|
|
| MD5 |
60d3e9c35bf0f206cc2503c21cad234b
|
|
| BLAKE2b-256 |
2a88cd44ec548fa7a163100b7ade82a6e141382be49650e975c7d717bbcc0faf
|