materials.gradient_material#
Gradient-index (GRIN) material.
This module defines GradientMaterial, a material whose refractive index
varies with position inside the medium.
Jie Cai (zhazhajust), 2025
Classes
|
Material with a radial and axial gradient index. |
- class GradientMaterial(n0: ScalarOrArray = 1.5, nr2: ScalarOrArray = 0.0, nr4: ScalarOrArray = 0.0, nr6: ScalarOrArray = 0.0, nz1: ScalarOrArray = 0.0, nz2: ScalarOrArray = 0.0, nz3: ScalarOrArray = 0.0, propagation_model: GRINPropagation | None = None)[source]#
Material with a radial and axial gradient index.
The index follows the Gradient 3 law
\[n(r, z) = n_0 + n_{r2} r^2 + n_{r4} r^4 + n_{r6} r^6 + n_{z1} z + n_{z2} z^2 + n_{z3} z^3,\]with \(r^2 = x^2 + y^2\). Coordinates are in mm, in the local frame of the surface where the medium starts. The index does not depend on wavelength, and the medium does not absorb.
Rays are traced through the medium by
GRINPropagation.- Parameters:
n0 – Index at the medium origin.
nr2 – Coefficient of \(r^2\), in mm⁻².
nr4 – Coefficient of \(r^4\), in mm⁻⁴.
nr6 – Coefficient of \(r^6\), in mm⁻⁶.
nz1 – Coefficient of \(z\), in mm⁻¹.
nz2 – Coefficient of \(z^2\), in mm⁻².
nz3 – Coefficient of \(z^3\), in mm⁻³.
propagation_model – The integrator settings. Defaults to
GRINPropagation().
- abbe() float#
Calculate the Abbe number (Vd) of the material.
The Abbe number is a measure of the material’s dispersion, defined as Vd = (n_d - 1) / (n_F - n_C), where n_d, n_F, and n_C are the refractive indices at the Fraunhofer d (587.5618 nm), F (486.1327 nm), and C (656.2725 nm) spectral lines, respectively.
- Returns:
The Abbe number of the material.
- Return type:
- classmethod from_dict(data: dict) GradientMaterial[source]#
Creates a material from a dictionary representation.
- Parameters:
data – The dictionary representation.
- Returns:
The material.
- index_and_gradient(x: BEArray, y: BEArray, z: BEArray, wavelength: ScalarOrArray) tuple[BEArray, BEArray, BEArray, BEArray][source]#
Returns the index and its gradient at points in the medium.
- Parameters:
x – x-coordinates in the medium frame, in mm.
y – y-coordinates in the medium frame, in mm.
z – z-coordinates in the medium frame, in mm.
wavelength – Wavelength in µm. Not used by this law.
- Returns:
The index
nand the partial derivativesdn/dx,dn/dyanddn/dz.
- k(wavelength: float | be.ndarray, **kwargs) float | be.ndarray#
Calculates the extinction coefficient at a given wavelength with caching.
- n(wavelength: float | be.ndarray, **kwargs) float | be.ndarray#
Calculates the refractive index at a given wavelength with caching.