pyoptics.materials

Simple dispersion models for optical materials.

Glass catalogues characterize a glass by its refractive index n_d at the helium d line and its Abbe number

V_d = (n_d - 1)/(n_F - n_C),

with the hydrogen F and C lines. The functions here build a dispersion curve n(wavelength) from these two numbers using the two-term Cauchy formula

n(wavelength) = A + B/wavelength**2,

whose coefficients are chosen such that n(lambda_d) = n_d and n(lambda_F) - n(lambda_C) = (n_d - 1)/V_d hold exactly. This is a fair approximation in the visible for normally dispersive glasses, but not in the UV or IR, where Sellmeier data should be used instead.

Wavelengths are in nanometres by default. Other units work as long as the line wavelengths are passed in the same unit as the evaluation wavelengths.

Media for the polarization ray trace

Material objects describe a medium by its complex refractive index n + i*k (k > 0 for absorption, as in pyoptics.thin_films) and, for anisotropic media, by the index seen by the two polarization eigenstates of a ray:

  • Isotropic: n and the extinction coefficient k (see extinction_from_absorption() for an absorption coefficient alpha).

  • Uniaxial: ordinary and extraordinary indices n_o + i*k_o and n_e + i*k_e with an optic axis. n_e != n_o gives retardance (linear birefringence), k_e != k_o dichroism (diattenuation).

  • CubicCrystal: the intrinsic birefringence of CaF2 and other cubic crystals at short wavelengths.

Rays are refracted with the real part of a reference index (Material.n_geometric(), n_o for uniaxial media); the anisotropic and absorbing part of the index only acts on the polarization along the ray (Material.propagation()). This is the usual model for weak anisotropy (|n_e - n_o| << 1): the splitting of the ordinary and extraordinary rays and their walk-off are neglected, their phase difference is not. Index data are evaluated at wavelengths in nm; a value can be a number, a function n(wavelength_nm) or a pair (n_d, V_d) for abbe_dispersion().

References

I. H. Malitson, “Interspecimen comparison of the refractive index of fused silica”, J. Opt. Soc. Am. 55, 1205-1209 (1965).

J. H. Burnett, Z. H. Levine and E. L. Shirley, “Intrinsic birefringence in calcium fluoride and barium fluoride”, Phys. Rev. B 64, 241102 (2001).

    1. Smith, “Modern Optical Engineering”, 4th ed., McGraw-Hill (2008).

M. Born and E. Wolf, “Principles of Optics”, 7th ed., Cambridge University Press (1999).

Classes

CubicCrystal

Intrinsic (spatial dispersion induced) birefringence of a cubic crystal such as CaF2.

Isotropic

Isotropic, possibly absorbing medium of index n + i*k.

Material

Medium for the polarization ray trace (see the module docstring).

Uniaxial

Uniaxial medium: retardance (n_e != n_o) and dichroism (k_e != k_o).

Functions

abbe_dispersion

Refractive index n(wavelength) of a glass given by n_d and V_d.

abbe_number

Abbe number V_d = (n_d - 1)/(n_F - n_C).

absorption_from_extinction

Intensity absorption coefficient from the extinction coefficient.

cauchy_coeffs_from_abbe

Coefficients A, B of n = A + B/wavelength**2 for given n_d and V_d.

cauchy_n

Two-term Cauchy formula n = A + B/wavelength**2.

complex_index

Complex refractive index n + i*k of a material description.

expm_2x2

Matrix exponentials of a stack of complex 2 x 2 matrices (..., 2, 2).

extinction_from_absorption

Extinction coefficient from the intensity absorption coefficient.

transverse_basis

Orthonormal vectors (N, 3, 2) perpendicular to the unit directions k (N, 3): k x z (k x x along z) and k x (k x z).

pyoptics.materials.abbe_number(n_d, n_F, n_C)[source]

Abbe number V_d = (n_d - 1)/(n_F - n_C).

Parameters:
n_d, n_F, n_Cnumbers or arrays

Refractive indices at the d, F and C lines.

Returns:
V_dnumber or array
pyoptics.materials.cauchy_coeffs_from_abbe(n_d, V_d, lambda_d=587.5618, lambda_F=486.1327, lambda_C=656.2725)[source]

Coefficients A, B of n = A + B/wavelength**2 for given n_d and V_d.

Parameters:
n_ddouble

Refractive index at lambda_d.

V_ddouble

Abbe number, must be positive. np.inf gives a dispersion free medium.

lambda_d, lambda_F, lambda_Cdouble, optional

Wavelengths of the d, F and C lines. Defaults are in nm; pass them in another unit to get B in that unit squared.

Returns:
A, Bdouble

Cauchy coefficients; B has the unit of wavelength squared.

pyoptics.materials.cauchy_n(wavelength, A, B)[source]

Two-term Cauchy formula n = A + B/wavelength**2.

Parameters:
wavelengthnumber or array

Wavelength in the unit used for B.

A, Bnumbers

Cauchy coefficients, see cauchy_coeffs_from_abbe().

Returns:
nnumber or array
pyoptics.materials.abbe_dispersion(wavelength, n_d, V_d, lambda_d=587.5618, lambda_F=486.1327, lambda_C=656.2725)[source]

Refractive index n(wavelength) of a glass given by n_d and V_d.

Uses the two-term Cauchy formula through n_d with the given Abbe number.

Parameters:
wavelengthnumber or array

Wavelength, in nm with the default line wavelengths.

n_dnumber

Refractive index at lambda_d.

V_dnumber

Abbe number (positive; np.inf: no dispersion).

lambda_d, lambda_F, lambda_Cnumbers, optional

Wavelengths of the d, F and C lines, see cauchy_coeffs_from_abbe().

Returns:
nnumber or array

Examples

>>> n_bk7 = abbe_dispersion([450, 550, 650], 1.5168, 64.17)
pyoptics.materials.extinction_from_absorption(alpha, wavelength)[source]

Extinction coefficient from the intensity absorption coefficient.

Parameters:
alphanumber or array

Intensity absorption coefficient: the intensity decays as exp(-alpha*z); in the inverse unit of the wavelength.

wavelengthnumber

Vacuum wavelength.

Returns:
knumber or array

Imaginary part of the refractive index, alpha*wavelength/(4*pi).

pyoptics.materials.absorption_from_extinction(k, wavelength)[source]

Intensity absorption coefficient from the extinction coefficient.

Parameters:
knumber or array

Imaginary part of the refractive index.

wavelengthnumber

Vacuum wavelength.

Returns:
alphanumber or array

4*pi*k/wavelength, in the inverse unit of the wavelength.

pyoptics.materials.complex_index(material, wavelength_nm=None)[source]

Complex refractive index n + i*k of a material description.

Parameters:
materialMaterial, number, callable or (n_d, V_d)

A Material, a (complex) number, a function n(wavelength_nm) or a pair (n_d, V_d) for abbe_dispersion().

wavelength_nmnumber, optional

Vacuum wavelength in nm (needed for dispersive materials).

Returns:
ncomplex
pyoptics.materials.expm_2x2(A)[source]

Matrix exponentials of a stack of complex 2 x 2 matrices (…, 2, 2).

With A = a*I + B, a = trace(A)/2 and B**2 = d**2*I (d**2 = -det(B)), exp(A) = exp(a)*(cosh(d)*I + sinh(d)/d*B), which holds for defective matrices too.

pyoptics.materials.transverse_basis(k)[source]

Orthonormal vectors (N, 3, 2) perpendicular to the unit directions k (N, 3): k x z (k x x along z) and k x (k x z).

class pyoptics.materials.Material[source]

Bases: object

Medium for the polarization ray trace (see the module docstring).

Subclasses define index() and, if anisotropic, delta_index(). Directions are given in the local frame of the surface the medium belongs to (the surface in front of it).

index(wavelength_nm=None)[source]

Mean complex refractive index n + i*k.

n_geometric(wavelength_nm=None)[source]

Real index used for the ray directions and the optical path.

delta_index(k, basis, wavelength_nm=None)[source]

Anisotropic part of the complex index on the transverse ray bases.

The isotropic medium returns (index() - n_geometric()) times the identity; anisotropic subclasses override this.

Parameters:
k(N, 3) array

Unit directions of the rays.

basis(N, 3, 2) array

Transverse bases of the rays.

wavelength_nmnumber, optional

Vacuum wavelength in nm.

Returns:
dN(N, 2, 2) array

Complex index matrices minus n_geometric().

propagation(k, length, wavelength, wavelength_nm=None)[source]

Polarization ray tracing matrices of paths in the medium.

Retardance, diattenuation and absorption beyond the geometric optical path n_geometric()*length.

Parameters:
k(N, 3) array

Unit directions of the rays.

length(N,) array

Geometrical path lengths.

wavelengthnumber

Vacuum wavelength in the unit of the lengths.

wavelength_nmnumber, optional

Vacuum wavelength in nm for the dispersion.

Returns:
P(N, 3, 3) array
class pyoptics.materials.Isotropic(n, k=0.0)[source]

Bases: Material

Isotropic, possibly absorbing medium of index n + i*k.

Parameters:
nnumber, callable or (n_d, V_d)

Refractive index (may be complex).

knumber or callable, optional

Extinction coefficient, added as i*k.

index(wavelength_nm=None)[source]

Mean complex refractive index n + i*k.

class pyoptics.materials.Uniaxial(n_o, n_e, axis=(0.0, 0.0, 1.0), k_o=0.0, k_e=0.0)[source]

Bases: Material

Uniaxial medium: retardance (n_e != n_o) and dichroism (k_e != k_o).

A ray along the unit vector k at the angle theta to the optic axis has the ordinary eigenstate (D perpendicular to the plane of k and the axis) with n_o + i*k_o and the extraordinary one with

1/n(theta)**2 = cos(theta)**2/(n_o + i*k_o)**2 + sin(theta)**2/(n_e + i*k_e)**2.

Rays are refracted with n_o. A quarter wave plate cut with the axis in the plate has the thickness wavelength/(4*abs(n_e - n_o)).

Parameters:
n_o, n_enumber, callable or (n_d, V_d)

Ordinary and extraordinary index.

axis3 vector, optional

Optic axis in the local frame of the surface in front of the medium (default z, along the axis of a centred system).

k_o, k_enumber or callable, optional

Extinction coefficients of the two eigenstates (k_e > k_o: a dichroic polarizer passing the ordinary polarization).

index(wavelength_nm=None)[source]

Mean complex refractive index n + i*k.

n_geometric(wavelength_nm=None)[source]

Real index used for the ray directions and the optical path.

delta_index(k, basis, wavelength_nm=None)[source]

Index matrices of the ordinary and extraordinary eigenstates.

Parameters:
k(N, 3) array

Unit directions of the rays.

basis(N, 3, 2) array

Transverse bases of the rays.

wavelength_nmnumber, optional

Vacuum wavelength in nm.

Returns:
dN(N, 2, 2) array

Complex index matrices minus n_geometric().

class pyoptics.materials.CubicCrystal(delta_n, axis='111', clocking=0.0, n=None)[source]

Bases: Material

Intrinsic (spatial dispersion induced) birefringence of a cubic crystal such as CaF2.

Cubic crystals are isotropic to lowest order, but at short wavelengths the finite wave vector makes them weakly birefringent (Burnett, Levine and Shirley, Phys. Rev. B 64, 241102 (2001)). The lowest order term allowed by cubic symmetry changes the index for a ray along the unit vector k (crystal axes) by

dn = -2*delta_n*(B^T diag(k_x**2, k_y**2, k_z**2) B - trace/2)

on its transverse polarization basis B. It vanishes along the <100> and <111> axes and is largest along the <110> axes, where delta_n = n([001] polarization) - n([1-10] polarization). Burnett et al. measured abs(delta_n) = 3.4e-7 (3.4 nm/cm) at 193 nm and 11.2e-7 at 157 nm for CaF2, which made it hard to use at 157 nm. The pattern over the pupil has the symmetry of the axis along the lens axis (threefold for [111], fourfold for [100]), so clocking elements against each other (e.g. two [111] elements by 60 degrees) cancels the non rotationally symmetric part.

Parameters:
delta_nnumber

Birefringence along <110> (see above), e.g. -3.4e-7.

axis{“111”, “100”, “110”}, optional

Crystal axis along the local z axis (the lens axis).

clockingnumber, optional

Rotation of the crystal about the local z axis, radians.

nnumber, callable or (n_d, V_d), optional

Mean refractive index, needed when the crystal is the material of a raytrace.Surface (not as a medium override that keeps the index of the system).

index(wavelength_nm=None)[source]

Mean complex refractive index n + i*k.

index_change(k, basis)[source]

Intrinsic birefringence on the transverse bases of the rays.

Parameters:
k(N, 3) array

Unit directions of the rays in the local frame.

basis(N, 3, 2) array

Transverse bases of the rays.

Returns:
dN(N, 2, 2) array

Change of the refractive index.

delta_index(k, basis, wavelength_nm=None)[source]

Intrinsic birefringence plus the difference of the mean index to n_geometric().

Parameters:
k(N, 3) array

Unit directions of the rays.

basis(N, 3, 2) array

Transverse bases of the rays.

wavelength_nmnumber, optional

Vacuum wavelength in nm.

Returns:
dN(N, 2, 2) array