# lightsmith

> The open photonics suite: one typed JSON problem spec solved by Mie, T-matrix, DDA, FDTD, TMM, RCWA, FDE, EME, FDFD, PWE and circuit solvers on CPU or GPU, with differentiable inverse design and JSON-first Python, CLI and MCP interfaces.

Units: nm, vacuum wavelengths. Time convention exp(-i omega t) (Im eps > 0 = loss). Problem kinds: scattering, layer_stack, periodic, mode, device, bands, circuit, optimization.

## Docs

- [README](README.md): install, quick start, solver table
- [AGENTS.md](AGENTS.md): conventions and workflow for agents (estimate -> solve -> check warnings)
- [Example spec](examples/drude_sphere.json): a complete scattering problem in JSON
- [Library landscape](docs/landscape.md): survey of existing solvers and backend choices

## API

- `lightsmith.problems.parse_problem(obj)` / `problem_json_schema()`: any problem kind from JSON
- `lightsmith.solve(problem, method="auto", device="auto")`
- `lightsmith.estimate(problem, method, device) -> dict` (no solve)
- `lightsmith.compare(problem, methods=None, device="auto") -> dict`
- `lightsmith.doctor() -> dict` (frameworks and GPUs)
- CLI: `lightsmith {doctor,backends,schema,estimate,solve,compare}`
- MCP server: `lightsmith-mcp`
