Wave-router: Auto-router for photonic and RF waveguides
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-26 20:25:20 -08:00
docs Rewrite routing documentation for users and developers 2026-11-26 20:25:20 -08:00
examples Rewrite routing documentation for users and developers 2026-11-26 20:25:20 -08:00
inire Preserve probe budgets for alternate bend proxies 2026-11-26 20:21:22 -08:00
scripts Preserve probe budgets for alternate bend proxies 2026-11-26 20:21:22 -08:00
.gitignore ex07 works 2026-03-16 17:05:16 -07:00
.python-version Initial buildout 2026-03-07 08:26:29 -08:00
DOCS.md Rewrite routing documentation for users and developers 2026-11-26 20:25:20 -08:00
LICENSE.md initial commit 2026-03-06 18:48:04 -08:00
pyproject.toml Complete feasible stress layouts with verified routing fallbacks 2026-11-26 15:23:24 -08:00
README.md Rewrite routing documentation for users and developers 2026-11-26 20:25:20 -08:00
uv.lock initial pass on examples 2026-03-08 14:40:36 -07:00

inire

Inire routes waveguides between fixed ports on photonic and RF layouts. It uses straight segments, 90-degree bends, and S-bends, and checks the finished geometry for clearance. You supply the placement, keepouts, and allowed bend radii. The router returns the routes it could verify along with any partial results.

Install

From a checkout with Python 3.11 or newer, run pip install .. For development, uv sync also installs the test and lint tools.

Route a net

from inire import NetSpec, Port, RoutingProblem, route

problem = RoutingProblem(
    bounds=(0, 0, 1000, 1000),
    nets=(NetSpec("input", Port(50, 100, 0), Port(250, 100, 0), width=2),),
    clearance=2,
)

run = route(problem)
result = run.results_by_net["input"]
if result.is_valid:
    print(result.report.total_length)
else:
    print(result.outcome)

Use one coordinate unit throughout the layout. Port coordinates snap to the integer grid in that unit. Headings are in degrees, with 0 pointing east and 90 pointing north. The target heading is the direction of travel into the target.

Automatic routing is the default. For a layout with crossing devices, place the devices first and route each external segment as a separate net. Include device keepouts with access to their ports. To keep previously routed waveguides fixed, add their locked_geometry to the next problem's obstacles. API and tuning guide

Examples and development

  • Runnable examples cover clearance, locked waveguides, custom bends, and partial routes.
  • Architecture describes planner selection, detailed search, and verification.
  • Routing benchmarks explain the corpus, profiles, and measured coverage.
  • Diagnostics explains counters, timings, and trace tools.

Run python -m pytest for the correctness suite, including all 67 routing regression boards. Use python -m pytest -m "not routing_corpus" for a shorter local run. Performance checks

License

GNU Affero General Public License v3. License text