Materials API
Material Library
- prismo.materials.get_material(name)[source]
Get a material from the global library.
- Parameters:
name (str) – Material name.
- Returns:
Material object.
- Return type:
Examples
>>> si = get_material('Si') >>> sio2 = get_material('SiO2') >>> au = get_material('Gold')
- prismo.materials.list_materials()[source]
List all available materials in the global library.
- Returns:
List of material names.
- Return type:
- prismo.materials.add_material(name, material)[source]
Add a custom material to the global library.
- Parameters:
name (str) – Material name.
material (DispersiveMaterial) – Material object.
- Return type:
Dispersion Models
DispersiveMaterial (Base Class)
- class prismo.materials.dispersion.DispersiveMaterial(epsilon_inf=1.0, name='')[source]
Abstract base class for dispersive materials.
All dispersive material models must implement methods for: - Computing permittivity at a given frequency - Generating ADE update coefficients for FDTD
LorentzMaterial
- class prismo.materials.dispersion.LorentzMaterial(epsilon_inf, poles, name='')[source]
Material with Lorentz dispersion model.
The Lorentz model describes resonant dielectric behavior, suitable for dielectrics with resonances.
- Parameters:
epsilon_inf (float) – High-frequency permittivity.
poles (List[LorentzPole]) – List of Lorentz poles.
name (str, optional) – Material name.
DrudeMaterial
- class prismo.materials.dispersion.DrudeMaterial(epsilon_inf, omega_p, gamma, name='')[source]
Material with Drude dispersion model (metals, plasmas).
The Drude model describes free carrier behavior, suitable for metals and doped semiconductors.
- Parameters:
DebyeMaterial
- class prismo.materials.dispersion.DebyeMaterial(epsilon_inf, epsilon_s, tau, name='')[source]
Material with Debye dispersion model.
The Debye model describes dielectric relaxation, suitable for polar dielectrics.
- Parameters:
SellmeierMaterial
- class prismo.materials.dispersion.SellmeierMaterial(B_coeffs, C_coeffs, name='')[source]
Material with Sellmeier dispersion formula.
The Sellmeier formula is commonly used for transparent optical materials. n²(λ) = 1 + Σ (B_i λ² / (λ² - C_i))
- Parameters:
Data Classes
LorentzPole
DrudePole
DebyePole
Anisotropic Materials
TensorMaterial
- class prismo.materials.tensor.TensorMaterial(epsilon, mu=None, name='', backend=None)[source]
Material with anisotropic tensor properties.
Supports materials with tensor permittivity and/or permeability: D = ε₀ [ε] · E B = μ₀ [μ] · H
where [ε] and [μ] are 3×3 tensors.
- Parameters:
epsilon (TensorComponents) – Permittivity tensor components (relative).
mu (TensorComponents, optional) – Permeability tensor components (relative). Default is isotropic μ=1.
name (str, optional) – Material name.
backend (Backend, optional) – Computational backend.
- apply_to_e_field(E)[source]
Apply permittivity tensor to E field: D = ε₀ [ε] · E
- Parameters:
E (Tuple of arrays) – Electric field components (Ex, Ey, Ez).
- Returns:
D field components (Dx, Dy, Dz).
- Return type:
Tuple of arrays
- apply_to_h_field(H)[source]
Apply permeability tensor to H field: B = μ₀ [μ] · H
- Parameters:
H (Tuple of arrays) – Magnetic field components (Hx, Hy, Hz).
- Returns:
B field components (Bx, By, Bz).
- Return type:
Tuple of arrays
TensorComponents
- class prismo.materials.tensor.TensorComponents(xx, yy, zz, xy=0.0, xz=0.0, yz=0.0, yx=None, zx=None, zy=None)[source]
Components of a 3x3 material tensor.
For diagonal tensors, only xx, yy, zz are needed. For symmetric tensors, also need xy, xz, yz. For full tensors, all 9 components.
- xx, yy, zz
Diagonal components.
- Type:
float or array
- xy, xz, yz
Off-diagonal components (symmetric).
- Type:
float or array, optional
- yx, zx, zy
Off-diagonal components (full tensor).
- Type:
float or array, optional
- to_full_matrix(backend)[source]
Convert to full 3x3 matrix representation.
- Returns:
Tensor as 3x3 matrix or (…, 3, 3) array for spatially varying.
- Return type:
ndarray
- __init__(xx, yy, zz, xy=0.0, xz=0.0, yz=0.0, yx=None, zx=None, zy=None)
Helper Functions
- prismo.materials.tensor.create_uniaxial_material(n_ordinary, n_extraordinary, optic_axis='z', name='')[source]
Create a uniaxial material (e.g., liquid crystal).
Uniaxial materials have different refractive indices parallel and perpendicular to the optic axis.
- Parameters:
- Returns:
Uniaxial material with diagonal tensor.
- Return type:
ADE Solver
- class prismo.materials.ade.ADESolver(material, dt, grid_shape, backend=None)[source]
Auxiliary Differential Equation solver for dispersive materials.
Implements time-domain updates for dispersive materials by solving auxiliary differential equations alongside the main FDTD equations.
- For Lorentz materials:
d²P/dt² + γ dP/dt + ω₀² P = ε₀ Δε ω₀² E
- For Drude materials:
dJ/dt + γ J = ε₀ ω_p² E
- For Debye materials:
dP/dt + P/τ = ε₀ (ε_s - ε_∞) E/τ
- Parameters:
material (DispersiveMaterial) – Dispersive material model.
dt (float) – Time step (s).
grid_shape (tuple) – Shape of the spatial grid.
backend (Backend, optional) – Computational backend.
- update_polarization(E_field)[source]
Update auxiliary polarization fields.
- Parameters:
E_field (array) – Electric field at current time step.
- Return type:
- class prismo.materials.ade.ADEManager(grid_shape, dt, backend=None)[source]
Manager for multiple ADE solvers in different regions.
Handles spatial distribution of different materials and their corresponding ADE solvers.
- Parameters:
- add_material_region(material, region_mask)[source]
Add a dispersive material in a specific spatial region.
- Parameters:
material (DispersiveMaterial) – Dispersive material model.
region_mask (array) – Boolean mask indicating where material is present.
- Return type:
- update_all(E_field)[source]
Update all ADE solvers.
- Parameters:
E_field (array) – Electric field array.
- Return type: