Invntr
Source

All instruments

thin_film

Multilayer thin-film stack by the transfer-matrix (characteristic-matrix) method: reflectance, transmittance and absorptance for s and p polarisation at one wavelength and angle, across a wavelength band and across an angle scan.

Layers are listed from the incident side to the substrate, each with a complex index n + i k (k ≥ 0 absorbs) and a thickness in nm or in quarter-waves at the design wavelength.

Indices are constants: give them at the wavelength of interest (no dispersion model, no material table).

Coherent, flat, isotropic layers; the substrate is semi-infinite (no back-face reflection).

Field
Waves, optics and circuits
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replaythin_film 0.1.0 · files 53adc6cac4fd…cd06
  1. r0001Fresnel, normal incidence, air to glass n = 1.5: R = ((1 - 1.5)/(1 + 1.5))² = 0.04, T = 0.96, reflection phase 180° (Hecht, Optics, sec. 4.6); closed form, 10⁻⁹passed

    Rs0.04 ± 4 × 10⁻¹¹0.04lockedunder 0.01 % of the tolerance used
    Rp0.04 ± 4 × 10⁻¹¹0.04lockedunder 0.01 % of the tolerance used
    R_avg0.04 ± 4 × 10⁻¹¹0.04lockedunder 0.01 % of the tolerance used
    Ts0.96 ± 9.6 × 10⁻¹⁰0.96lockedunder 0.01 % of the tolerance used
    Tp0.96 ± 9.6 × 10⁻¹⁰0.96lockedunder 0.01 % of the tolerance used
    phase_r_s_deg180 ± 10⁻⁹180lockedunder 0.01 % of the tolerance used
    layer_count= 00lockedexact match
  2. r0002Ideal quarter-wave antireflection layer, n₁ = √(n₀ ns) = √(1.5): R = 0 and T = 1 at the design wavelength 550 nm, and the band minimum sits there; closed form (abs 10⁻¹² on R; 10⁻³ nm on the refined minimum)passed

    Rs0 ± 10⁻¹²1.24822 × 10⁻³²lockedunder 0.01 % of the tolerance used
    Rp0 ± 10⁻¹²1.24822 × 10⁻³²lockedunder 0.01 % of the tolerance used
    Ts1 ± 10⁻⁹1lockedunder 0.01 % of the tolerance used
    R_avg_min0 ± 10⁻¹²2.59628 × 10⁻²³lockedunder 0.01 % of the tolerance used
    wavelength_at_R_min_nm550 ± 0.001550lockedunder 0.01 % of the tolerance used
  3. r0003Quarter-wave MgF₂-like layer n₁ = 1.38, d = 552/(4·1.38) = 100 nm, on ns = 1.52 at 552 nm: R = ((n₀ ns - n₁²)/(n₀ ns + n₁²))² = 0.01260079021463 (1.26 %), minimum of the band at 552 nm; closed form, 10⁻⁹passed

    Rs0.0126008 ± 1.3 × 10⁻¹¹0.0126008lockedunder 0.01 % of the tolerance used
    R_avg0.0126008 ± 1.3 × 10⁻¹¹0.0126008lockedunder 0.01 % of the tolerance used
    Ts0.987399 ± 9.9 × 10⁻¹⁰0.987399lockedunder 0.01 % of the tolerance used
    R_avg_min0.0126008 ± 1.3 × 10⁻¹¹0.0126008lockedunder 0.01 % of the tolerance used
    wavelength_at_R_min_nm552 ± 0.001552locked0.56 % of the tolerance used
    total_thickness_nm100 ± 10⁻¹⁰100lockedunder 0.01 % of the tolerance used
  4. r0004Half-wave (absentee) layer n₁ = 2.3 on ns = 1.52: R is the bare-substrate value ((1 - 1.52)/(1 + 1.52))² = 0.04257999496095; closed form, 10⁻⁹passed

    Rs0.04258 ± 4.3 × 10⁻¹¹0.04258lockedunder 0.01 % of the tolerance used
    Rp0.04258 ± 4.3 × 10⁻¹¹0.04258lockedunder 0.01 % of the tolerance used
    T_avg0.95742 ± 9.6 × 10⁻¹⁰0.95742lockedunder 0.01 % of the tolerance used
  5. r0005Brewster angle atan(1.5) = 56.30993247402° on bare glass: Rp = 0, Tp = 1, Rs = ((n² - 1)/(n² + 1))² = 0.147928994083, and the angle scan finds the same angle; closed form (abs 10⁻¹² on Rp, 10⁻⁵ deg on the refined scan minimum)passed

    Rp0 ± 10⁻¹²3.08149 × 10⁻³³lockedunder 0.01 % of the tolerance used
    Tp1 ± 10⁻⁹1lockedunder 0.01 % of the tolerance used
    Rs0.147929 ± 1.5 × 10⁻¹⁰0.147929lockedunder 0.01 % of the tolerance used
    brewster_bare_deg56.3099 ± 5.6 × 10⁻¹¹56.3099lockedunder 0.01 % of the tolerance used
    angle_at_Rp_min_deg56.3099 ± 10⁻⁵56.3099locked0.015 % of the tolerance used
    Rp_min0 ± 10⁻¹²2.62085 × 10⁻²²lockedunder 0.01 % of the tolerance used
  6. r0006Fresnel at 45° on glass n = 1.5: Rs = ((cos t - √(n² - sin² t))/(cos t + √(n² - sin² t)))² = 0.0920133630455 and the exact identity Rp = Rs² = 0.00846645897895; closed form, 10⁻⁹passed

    Rs0.0920134 ± 9.2 × 10⁻¹¹0.0920134lockedunder 0.01 % of the tolerance used
    Rp0.00846646 ± 8.5 × 10⁻¹²0.00846646lockedunder 0.01 % of the tolerance used
    R_plus_Ts1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    R_plus_Tp1 ± 10⁻¹²1locked0.044 % of the tolerance used
  7. r0007Quarter-wave mirror air|(HL)⁴|glass, nH = 2.3, nL = 1.38, ns = 1.52: Y = (nH/nL)⁸ ns, R = ((1 - Y)/(1 + Y))² = 0.956760461605 (Macleod, Thin-Film Optical Filters, quarter-wave stack); closed form, 10⁻⁹passed

    Rs0.95676 ± 9.6 × 10⁻¹⁰0.95676lockedunder 0.01 % of the tolerance used
    Ts0.0432395 ± 4.3 × 10⁻¹⁰0.0432395lockedunder 0.01 % of the tolerance used
    layer_count= 88lockedexact match
  8. r0008Absorbing substrate N = 0.2 + 3i at normal incidence: R = ((n - 1)² + k²)/((n + 1)² + k²) = 9.64/10.44, T = 4n/((n + 1)² + k²) = 0.8/10.44 (Born and Wolf, metal reflection); closed form, 10⁻⁹passed

    Rs0.923372 ± 9.2 × 10⁻¹⁰0.923372lockedunder 0.01 % of the tolerance used
    Rp0.923372 ± 9.2 × 10⁻¹⁰0.923372lockedunder 0.01 % of the tolerance used
    Ts0.0766284 ± 7.7 × 10⁻¹¹0.0766284lockedunder 0.01 % of the tolerance used
  9. r0009Absorbing film N = 2.0 + 0.5i, 80 nm, on ns = 1.52, 600 nm, 30°: Airy single-film formula r = (r01 + r12 e^{2i d})/(1 + r01 r12 e^{2i d}) with Fresnel coefficients, evaluated apart from this program; closed form, 10⁻⁹passed

    Rs0.238455 ± 2.4 × 10⁻¹⁰0.238455lockedunder 0.01 % of the tolerance used
    Ts0.342251 ± 3.4 × 10⁻¹⁰0.342251lockedunder 0.01 % of the tolerance used
    As0.419294 ± 4.2 × 10⁻¹⁰0.419294lockedunder 0.01 % of the tolerance used
    Rp0.145144 ± 1.5 × 10⁻¹⁰0.145144lockedunder 0.01 % of the tolerance used
    Tp0.379971 ± 3.8 × 10⁻¹⁰0.379971lockedunder 0.01 % of the tolerance used
    Ap0.474885 ± 4.7 × 10⁻¹⁰0.474885lockedunder 0.01 % of the tolerance used
  10. r0010Total internal reflection, glass n = 1.5 to air at 45° (critical angle asin(1/1.5) = 41.8103148958°): R = 1, T = 0 for both polarisations; exactpassed

    Rs1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    Rp1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    Ts0 ± 10⁻¹²0lockedunder 0.01 % of the tolerance used
    Tp0 ± 10⁻¹²0lockedunder 0.01 % of the tolerance used
    critical_angle_deg41.8103 ± 4.2 × 10⁻¹¹41.8103lockedunder 0.01 % of the tolerance used
  11. r0011Energy conservation, lossless five-layer stack at 45°, 633 nm: R + T = 1 and A = 0 for s and p (T comes from the transmitted flux, not from 1 - R); exact, abs 10⁻¹²passed

    R_plus_Ts1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    R_plus_Tp1 ± 10⁻¹²1locked0.022 % of the tolerance used
    A_avg0 ± 10⁻¹²0lockedunder 0.01 % of the tolerance used
    energy_ok= truetruelockedexact match
    lossless= truetruelockedexact match
11 of 11 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
n_incident11.0Refractive index of the lossless medium the light comes from (1.0 for air).
layers[]Layers from the incident side to the substrate. Each is {"n": index, "k": extinction (optional, ≥ 0), and either "d_nm": physical thickness or "qwot": optical thickness in quarter-waves at design_wavelength_nm, "name": optional label}. Empty list: a bare interface.
repeat11The layer list is laid down this many times in a row, e.g. [H, L] with repeat 8 is a 16-layer mirror. At most 2000 layers in all.
substrate_n11.52Real part of the substrate (exit medium) index.
substrate_k10.0Extinction coefficient of the substrate (0 for a clear one; a metal has k of a few).
wavelength_nmnm550.0Vacuum wavelength of the headline readings and of the angle scan.
design_wavelength_nmnm550.0Reference wavelength for thicknesses given as qwot: d = qwot · design_wavelength / (4 n).
angle_degdeg0.0Angle of incidence from the normal, in the incident medium; used for the headline readings and the spectrum.
wavelength_min_nmnm400.0Start of the spectrum.
wavelength_max_nmnm800.0End of the spectrum.
wavelength_points1201Points in the spectrum, evenly spaced in wavelength.
angle_max_degdeg89.0The angle scan runs from 0 to this angle at wavelength_nm.
angle_points190Points in the angle scan.

Readings

NameUnitMeaning
Rs1Reflectance (fraction of incident power), s polarisation, at wavelength_nm and angle_deg.
Rp1Reflectance, p polarisation.
R_avg1Reflectance of unpolarised light, (Rs + Rp) / 2.
Ts1Transmittance into the substrate, s; from the transmitted flux, not from 1 - R.
Tp1Transmittance into the substrate, p.
T_avg1Transmittance of unpolarised light.
As1Absorptance in the layers, 1 - R - T, s (|A| below 10⁻¹² is written as 0).
Ap1Absorptance in the layers, p.
A_avg1Absorptance of unpolarised light.
R_plus_Ts1R + T for s as computed: 1 for a lossless stack, below 1 with absorption.
R_plus_Tp1R + T for p as computed.
phase_r_s_degdegPhase of the amplitude reflection coefficient, s, exp(-i w t) convention; null when r is zero.
phase_r_p_degdegPhase of r for p in the tangential-E (admittance) convention, in which r_p = r_s at normal incidence; null when r is zero.
brewster_bare_degdegatan(substrate_n / n_incident), the Brewster angle of the uncoated interface; null for an absorbing substrate.
critical_angle_degdegasin(substrate_n / n_incident) when the substrate is the rarer lossless medium; otherwise null.
R_avg_min1Lowest unpolarised reflectance in the band at angle_deg (grid minimum refined between its neighbours).
wavelength_at_R_min_nmnm
R_avg_max1Highest unpolarised reflectance in the band.
wavelength_at_R_max_nmnm
R_avg_band_mean1Mean unpolarised reflectance over the band (trapezoid rule on the wavelength grid).
T_avg_band_mean1Mean unpolarised transmittance over the band.
Rp_min1Lowest p reflectance in the angle scan.
angle_at_Rp_min_degdegAngle of that minimum: the Brewster angle of a bare dielectric, a pseudo-Brewster angle otherwise.
layer_count1
total_thickness_nmnm
losslesstrue when every layer and the substrate have k = 0.
energy_oktrue when R + T ≤ 1 + 10⁻⁹ and every number is finite at the headline point, over the spectrum and over the angle scan.
warningsPlain-language cautions: total internal reflection, evanescent layers, very thick layers.
layersThe layer list as resolved (one period), incident side first.
spectrum.csvwavelength_nm, Rs, Rp, R_avg, Ts, Tp, T_avg, As, Ap, A_avg at angle_deg.
angle_scan.csvangle_deg and the same nine columns at wavelength_nm.

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call