Skip to main content

Rust-backed photonics mode solver with a small Python API.

Project description

micromode

An electromagnetic mode solver using the FDFD method on a regular Yee-grid, written in native Rust.

License Tests Coverage

pip install micromode

Why Use It?

  • Grid-first API: pass arrays directly, with no required geometry model.
  • Fast, portable Rust sparse backend: one production solve path.
  • Practical outputs: fields, n_eff, k_eff, mode area, polarization fractions, Lorentz overlaps, plotting, dataframe export, and HDF5 save/load.
  • Tensor-aware: supports scalar, diagonal anisotropic, and full tensor material grids.
  • Works for both 2D cross sections and 1D slices.

You give it a material grid. It returns guided modes: effective indices, six-component fields, polarization metrics, mode area, overlaps, diagnostics, plots, and HDF5 output. MicroMode is intentionally not a CAD or geometry package. It is the solver piece you use after geometry has already been rasterized onto a mode-plane grid.

Micromode is the default mode solver in the BEAMZ FDTD engine.

Quick Start

import micromode as mm

wavelength_um = 1.55
freq = mm.C_0 / wavelength_um

# Arrays from your own rasterizer.
eps_xx, x_edges, y_edges = mode_plane_arrays(...)

materials = mm.Materials.from_diagonal(
    eps_xx=eps_xx,
    x_edges=x_edges,
    y_edges=y_edges,
)

data = mm.solve_modes(
    material_grid=materials,
    freqs=[freq],
    num_modes=2,
    target_neff=2.5,
)

print(data.n_eff.values)
data.plot_field("Ex", mode_index=0)
data.to_hdf5("modes.h5")

High Performance

MicroMode is designed to make high-performance mode solving available without requiring users to install external solver stacks. The production backend is a portable Rust sparse shift-invert eigensolver, so source installs and wheels do not depend on ARPACK, UMFPACK, SuiteSparse, BLAS/ LAPACK, or a Fortran compiler. That matters for simulation workflows that need to run in CI, notebooks, container images, FDTD plugins, and cross-platform design tools.

The native solver is not a dense fallback. It uses sparse finite-difference operators throughout, applies AMD fill-reducing ordering before sparse LU factorization, stores LU factors in a packed format for repeated triangular solves, and runs an Arnoldi iteration targeted around the requested effective index. The Arnoldi stage uses shift-invert, adaptive Ritz-pair checkpointing, early stopping once requested modes are stable, and selective Ritz vector reconstruction so work is spent on the modes that will actually be returned.

On the repository benchmark problem, the pure Rust backend solves larger grids in the same performance class as the previous optional UMFPACK-backed path while remaining much easier to install and distribute. For example, a release build on an Apple Silicon development machine solves an 80x50 diagonal benchmark grid in roughly 90 ms for two modes with residuals around 1e-12. Exact timings depend on hardware and problem shape, but the important point is architectural: MicroMode keeps the deployability of a pure Rust package without giving up the sparse-solver performance expected for practical waveguide grids.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

micromode-0.1.0a3.tar.gz (10.7 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

micromode-0.1.0a3-cp313-cp313-win_amd64.whl (299.9 kB view details)

Uploaded CPython 3.13Windows x86-64

micromode-0.1.0a3-cp313-cp313-manylinux_2_35_x86_64.whl (431.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.35+ x86-64

micromode-0.1.0a3-cp313-cp313-macosx_11_0_arm64.whl (378.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

micromode-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.whl (395.0 kB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

micromode-0.1.0a3-cp312-cp312-win_amd64.whl (300.0 kB view details)

Uploaded CPython 3.12Windows x86-64

micromode-0.1.0a3-cp312-cp312-manylinux_2_35_x86_64.whl (432.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

micromode-0.1.0a3-cp312-cp312-macosx_11_0_arm64.whl (378.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

micromode-0.1.0a3-cp312-cp312-macosx_10_12_x86_64.whl (395.5 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

micromode-0.1.0a3-cp311-cp311-win_amd64.whl (300.9 kB view details)

Uploaded CPython 3.11Windows x86-64

micromode-0.1.0a3-cp311-cp311-manylinux_2_35_x86_64.whl (433.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.35+ x86-64

micromode-0.1.0a3-cp311-cp311-macosx_11_0_arm64.whl (382.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

micromode-0.1.0a3-cp311-cp311-macosx_10_12_x86_64.whl (397.9 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

micromode-0.1.0a3-cp310-cp310-win_amd64.whl (300.8 kB view details)

Uploaded CPython 3.10Windows x86-64

micromode-0.1.0a3-cp310-cp310-manylinux_2_35_x86_64.whl (433.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

micromode-0.1.0a3-cp310-cp310-macosx_11_0_arm64.whl (382.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

micromode-0.1.0a3-cp310-cp310-macosx_10_12_x86_64.whl (397.8 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file micromode-0.1.0a3.tar.gz.

File metadata

  • Download URL: micromode-0.1.0a3.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for micromode-0.1.0a3.tar.gz
Algorithm Hash digest
SHA256 4b752c92ec4fc3acb3d0f13347c422be1bf79ee1c6a776e17aef5fb2485d36b9
MD5 48b17b169375b622c01a547db380aec7
BLAKE2b-256 1ec0718b6a9bdb41085f14607c4cbc0688de515186691e0dffc5ed9350d3122c

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3.tar.gz:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: micromode-0.1.0a3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 299.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for micromode-0.1.0a3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 2e301913487ea8825992ea7a8e60de9ad58ec69b503dce1b658cf54b867f5131
MD5 faead8d5acf8b0333c7f566aae6ac229
BLAKE2b-256 7dada5c13234430b3a76bad4726abb4eefa009e4fe24803a012d4ed932f91734

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp313-cp313-win_amd64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp313-cp313-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp313-cp313-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3231f0cb19868fc9c09e61aba0c319d0ef659d8d01ebe0cb2065c12d0e2dbe8d
MD5 5ec13fc7d78c272dcb105565e756925d
BLAKE2b-256 8e90ea650d863aa01097664da4ead367ea3365380493a7ac89d251ddb578c61a

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp313-cp313-manylinux_2_35_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 afb7ad36661ac3504c3badf215c9b80a7d77ca1295f3d5b10d33f958f18717c2
MD5 ca98e41220e98bf1b8e3f5bd27a83042
BLAKE2b-256 8b3d78198156769414834d507a76cfbc04d4157a4c62e0dae2eaecda4ab7a82e

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7733093944a606ae4df28bc371868c6d9b35ed203e8f33923f78ec0ad7e97c21
MD5 2e0e13355076a40dd4be428e3cf7e7d6
BLAKE2b-256 bdd05ed16f9b66fd3cd3c103e543d00f0520a9f9a68007228e285cdce4a2d193

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp313-cp313-macosx_10_12_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: micromode-0.1.0a3-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 300.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for micromode-0.1.0a3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 ed22795aa1afb4f960270b5fb6a7b4e9bf7c4479c4b87fc21f0af498961c9f50
MD5 8ca6887f91f323537a61006777e9d219
BLAKE2b-256 ceac973bb4b78d90e3a33536f8430e71472ab42f484104a26d289d9b23acaad4

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 c57e20265c7780e8b599c78e66dfdc9e0fd4752285bf58b55be9e5b1d0713f61
MD5 e1e49b37207b36d4b5848bbff26bd325
BLAKE2b-256 4d19ed1e9f96badea2ead8cf1cf1720d3c49451682dab530002b397267d427cb

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp312-cp312-manylinux_2_35_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5cbeead587fcc438833f279e8220aa3241539bc0a6e6466ca466cc741d17fe10
MD5 6258e6ca446e4bc7c2bfc837b1f9c9f3
BLAKE2b-256 e2794eaa02599a382b64fabacb735aca569042a9ff7dfd5d8a25bac271d3fb3d

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2f2627cd7a1467849305eecb98f17e578e45f5b2a6b904567c9a56ecbf08b041
MD5 d4e04d13a7111cab2f199d7cc94e3fc7
BLAKE2b-256 6e93bdaccc7517236b15c520775e9a78a78212618b8e40f39b4cf3fde1a65120

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: micromode-0.1.0a3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 300.9 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for micromode-0.1.0a3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a50e457842dbfd4e8a50653ca12cc8615aab4e1378423b0556c06a95a26fe640
MD5 1be90b3734d9010b71db411a59f64b69
BLAKE2b-256 3532448717eb7e7ca696bb0c3544b8300046cf35c489c0fd3b001ace90c83e4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp311-cp311-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp311-cp311-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 b18b3288dbecbd5fcd3809de7f28e6b80f1f63543c280c9f604935cf559fa385
MD5 600fdd9b47d402ff2bd12e9b8b663766
BLAKE2b-256 065e3be928d548289a5bc0fd5b5f90599cef891d93556bb73d3bddc320764e72

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp311-cp311-manylinux_2_35_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7311effa78b049f22b961c698d06c047cdd9c31ea6870b21aa3e8675a58a022a
MD5 fab6b9fbd7b036e85c75f4298f8278dd
BLAKE2b-256 0faf8adfce7e484a9e9a1077d85cd846ad1addf7c9018e414a3453f9be9edc65

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7a917600a1127d4922496537a9f93899f43521b8ae659b075cf18348a2052770
MD5 471105770d888c55d351e1133d24c30e
BLAKE2b-256 f19d33aaa90f522794b5ab6ce93defe70f9fec134b16ea0c3b8df7d59687ac1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: micromode-0.1.0a3-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 300.8 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for micromode-0.1.0a3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 71ea4fbecde5fa4fb354fcaaf730e4c4cbc98fd0a7fa6b3f9d6ad3205c3acca9
MD5 039f5c40f3102ad0f3275c76c82d7f9d
BLAKE2b-256 717ae3ed2105e8d2708b155831558fdafb956253fe01b93e4dc6eb9079859033

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 8d469f63b73bf0a7a60ba5d68de3c506089d049ac99b816e32b534d8c928f6b9
MD5 4f74627e41e11a7389eddcc648c79085
BLAKE2b-256 f3ed6b74c721a2e27cb013139d7da02e8116cd9a5ba29159953a6d73882b4925

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp310-cp310-manylinux_2_35_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 45936ec864fef69e47467fcba4cf05fbdf5e5dcd8b437af0fd0562eec868beba
MD5 48bd199bcac1ae28a9c709f8ff3f30b1
BLAKE2b-256 23d427f457d33b196527b17e373228a7eb05249eb109ad07f0dd280b52b99997

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file micromode-0.1.0a3-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for micromode-0.1.0a3-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f01950e35421ac59108131e7685c2fa0c30670213b4e69cc4f84dd24e9b9999c
MD5 528d65adfade179d0bcfacef6831dcdd
BLAKE2b-256 01cf17457e534fd192d4cb746216c4986f683268657e44803a51c1dba238db9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for micromode-0.1.0a3-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: publish.yml on QuentinWach/micromode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page