Problems¶
problems
¶
Problem types beyond single-object scattering.
Every problem is a pydantic model with a kind discriminator, so any of them
can be passed as JSON to solve/estimate/the CLI/MCP. Shared conventions:
lengths in nm, vacuum wavelengths, exp(-i omega t) (Im(eps) > 0 is loss).
Coordinate conventions:
- layer_stack / periodic: layers are stacked along z and listed from the
superstrate side to the substrate side; light is incident from the
semi-infinite superstrate and travels towards the semi-infinite substrate
(+z). R is measured in the superstrate, T in the substrate.
- mode: the waveguide cross-section lies in the xy plane; propagation is along +z.
- device: structures live in 3D (or the xy plane when dimension == 2); ports are
planes whose normal is the axis where size_nm is zero.
Profile
module-attribute
¶
Geometry
module-attribute
¶
Problem
module-attribute
¶
Problem = Annotated[Union[Simulation, LayerStackProblem, PeriodicProblem, ModeProblem, DeviceProblem, BandProblem, CircuitProblem, OptimizationProblem], Field(discriminator='kind')]
PROBLEM_KINDS
module-attribute
¶
PROBLEM_KINDS = ('scattering', 'layer_stack', 'periodic', 'mode', 'device', 'bands', 'circuit', 'optimization')
Rectangle
¶
Circle
¶
Ellipse
¶
Bases: _Model
Polygon
¶
Prism
¶
Bases: _Model
A 2D profile in the xy plane extruded from z_min to z_max (with optional sidewall angle).
sidewall_angle_deg
class-attribute
instance-attribute
¶
Box
¶
Ball
¶
Structure
¶
Structure2D
¶
Layer
¶
Bases: _Model
LayerStackProblem
¶
Bases: _Model
Planar multilayer: reflection/transmission/absorption vs wavelength and angle.
layers
class-attribute
instance-attribute
¶
layers: list[Layer] = Field(default_factory=list, description='From the superstrate side to the substrate side.')
angles_deg
class-attribute
instance-attribute
¶
polarizations
class-attribute
instance-attribute
¶
options
class-attribute
instance-attribute
¶
PatternedLayer
¶
Bases: _Model
shapes
class-attribute
instance-attribute
¶
shapes: list[Structure2D] = Field(default_factory=list, description='Inclusions in one unit cell (xy).')
Incidence
¶
PeriodicProblem
¶
Bases: _Model
A 1D/2D-periodic stack of patterned layers under plane-wave illumination.
lattice_a2_nm
class-attribute
instance-attribute
¶
lattice_a2_nm: tuple[float, float] | None = Field(None, description='None for 1D gratings: periodic along a1, invariant perpendicular to it; shapes are sampled along the line through the origin in the a1 direction.')
layers
class-attribute
instance-attribute
¶
layers: list[PatternedLayer] = Field(min_length=1, description='From the superstrate side to the substrate side.')
options
class-attribute
instance-attribute
¶
ModeProblem
¶
Bases: _Model
Eigenmodes of a waveguide cross-section (xy plane), propagation along +z.
window_center_nm
class-attribute
instance-attribute
¶
target_neff
class-attribute
instance-attribute
¶
target_neff: float | None = Field(None, description='Search near this effective index (default: highest index).')
bend_radius_nm
class-attribute
instance-attribute
¶
options
class-attribute
instance-attribute
¶
Port
¶
Bases: _Model
size_nm
class-attribute
instance-attribute
¶
size_nm: tuple[float, float, float] = Field(description='Zero along the port normal. In 2D devices z may also be zero, e.g. (0, w, 0) for an x-normal port.')
direction
class-attribute
instance-attribute
¶
direction: Literal['+', '-'] = Field(description='Direction of propagation *into* the device along the normal.')
GdsLayout
¶
Bases: _Model
Import geometry from a GDS file: each layer/datatype is extruded with a material.
DeviceProblem
¶
Bases: _Model
A photonic device (waveguides, couplers, gratings, ...) characterised by its S-matrix.
KPoint
¶
BandProblem
¶
Bases: _Model
Band structure of a photonic crystal along a k-path.
lattice_vectors_nm
class-attribute
instance-attribute
¶
structures_2d
class-attribute
instance-attribute
¶
structures_2d: list[Structure2D] = Field(default_factory=list, description='Unit-cell inclusions for 2D crystals.')
structures
class-attribute
instance-attribute
¶
structures: list[Structure] = Field(default_factory=list, description='Unit-cell inclusions for 3D crystals.')
polarization
class-attribute
instance-attribute
¶
polarization: Literal['te', 'tm', 'both'] = Field('both', description='2D only: TE = E in plane, TM = E along z.')
options
class-attribute
instance-attribute
¶
Instance
¶
CircuitProblem
¶
Bases: _Model
A netlist of components with S-parameter models; solves the circuit S-matrix.
parse_problem
¶
Parse a problem from a model, dict or JSON string. Missing kind means scattering (v0.1 specs).