Installation

Install Blaze2D with Python 3.10 or later:

python -m pip install blaze2d

Release wheels cover Linux x86_64 (glibc 2.17+), macOS 11+ on x86_64 and arm64, and Windows 10+ on x86_64. NumPy is required. Plotting and terminal progress are optional: python -m pip install 'blaze2d[plot,progress]'.

A first calculation

import blaze
 
result = blaze.solve(resolution=32, n_bands=8)
print(result["frequencies"].shape)  # (k_point, band)

The default model is a square lattice with one dielectric rod. Results are dictionaries with named NumPy arrays and numerical metadata. Use Examples to explore other models, or open the Workbench to configure a calculation in the browser.

A reproducible study

Download a TOML example or export a configuration from the Workbench:

blaze2d config validate calculation.toml
blaze2d run calculation.toml --output results.npz

The API & TOML reference describes normalization, sweeps, and operator extraction.

Build from source

Install Rust 1.91.1, then clone the repository:

git clone https://github.com/RnLe/blaze2d.git
cd blaze2d
python -m pip install ./crates/python
cargo build --release -p blaze2d-cli

The native CLI is written to target/release/blaze2d. To run the scientific and contract tests:

cargo test -p blaze2d-core -p blaze2d-interface -p blaze2d-runner
python -m pytest crates/python/tests

Benchmarks

The technical report describes the recorded experiments. The repository's benchmarks/ directory contains their data and scripts. Historical timings apply to the stated hardware, configuration, and solver revision; they are not performance guarantees for every model or release.

Blaze2D

Loading search…

Tab to move through results · Escape to close