Skip to main content

photonoxide/
lib.rs

1//! # photonoxide
2//!
3//! Validated photonics for Rust: materials with provenance, mode solvers, 2D and 3D FDFD with
4//! S-parameters and adjoints, components and circuits, and compact models, with a studio to
5//! watch every run live. Every method is checked against an analytic solution or a published
6//! result ([`validation`]).
7//!
8//! - [`material`]: dispersion models with their source, validity range and temperature, and a
9//!   catalogue of photonic materials, every number read from its paper.
10//! - [`mode`]: waveguide modes, from the exact slab and multilayers to full-vector finite
11//!   differences of a cross-section, with bends, dispersion and loss.
12//! - [`fdfd`]: frequency-domain finite differences in 2D and 3D on Yee's grid, with PMLs, mode
13//!   ports, S-parameters and adjoint gradients.
14//! - [`circuit`]: components with ports and S-matrices, connected into netlists, solved as one
15//!   sparse system and differentiated by the circuit adjoint.
16//! - [`compact`]: compact models by vector fitting, over parameters, and Touchstone files.
17//! - [`run`] and [`job`]: jobs as TOML files, and runs recorded as events that replay exactly;
18//!   the studio, the `photonoxide` program attached to each release, runs and shows them.
19//!
20//! **Alpha:** the API is being built milestone by milestone, and will change. FDTD, thermal and
21//! electro-optic devices, inverse design, layout and PDKs are planned, not here yet: see the
22//! [roadmap](https://github.com/tachsin/photonoxide/blob/main/ROADMAP.md).
23
24#![forbid(unsafe_code)]
25#![doc(
26    html_logo_url = "https://raw.githubusercontent.com/tachsin/photonoxide/main/assets/brand/logo.svg",
27    html_favicon_url = "https://raw.githubusercontent.com/tachsin/photonoxide/main/assets/brand/logo-32.png"
28)]
29#![warn(missing_docs)]
30#![warn(clippy::missing_errors_doc, clippy::missing_panics_doc)]
31
32pub mod circuit;
33pub mod compact;
34mod eigen;
35pub mod error;
36pub mod fdfd;
37pub mod geometry;
38pub mod job;
39pub mod material;
40pub mod mode;
41pub mod raster;
42pub mod run;
43pub mod stack;
44pub mod units;
45pub mod validation;
46
47pub use error::{Error, Result};
48
49/// photonoxide's version, e.g. `"0.2.0"`.
50pub const VERSION: &str = env!("CARGO_PKG_VERSION");
51pub use num_complex::Complex64;