Design an antireflection coating in Python#
Choose the refractive index and thickness of an ideal single-layer coating, then compare coated and uncoated glass. The plot shows the reflection minimum at the 550 nm design wavelength.
Ideal quarter-wave coating compared with bare glass at normal incidence.#
Run the notebook with Runtime → Run all, or download the
notebook or
Python script to run locally.
Run locally#
python -m pip install PyOptik
python antireflection_coating.py
No material database download is needed for this ideal coating example.
Calculate and plot#
import matplotlib.pyplot as plt
import numpy as np
from TypedUnit import ureg
from PyOptik import ThinFilmLayer, thin_film_stack
# Ideal, lossless materials at normal incidence; no catalog download needed.
design_wavelength = 550 * ureg.nanometer
substrate_index = 1.52
coating_index = np.sqrt(substrate_index)
coating_thickness = design_wavelength / (4 * coating_index)
wavelengths = np.linspace(350, 900, 600) * ureg.nanometer
uncoated = thin_film_stack(wavelengths, [], substrate_index=substrate_index)
coated = thin_film_stack(
wavelengths,
[ThinFilmLayer(coating_index, coating_thickness)],
substrate_index=substrate_index,
)
figure, axis = plt.subplots(figsize=(7, 4), layout="constrained")
axis.plot(wavelengths.magnitude, 100 * uncoated.reflectance, label="Uncoated glass")
axis.plot(wavelengths.magnitude, 100 * coated.reflectance, label="Quarter-wave coating")
axis.axvline(design_wavelength.magnitude, color="black", linestyle="--", alpha=0.6)
axis.set(xlabel="Vacuum wavelength [nm]", ylabel="Reflectance [%]",
title="Reduce glass reflection with a quarter-wave coating")
axis.grid(alpha=0.25)
axis.legend()
print(f"Ideal coating index: {coating_index:.3f}")
print(f"Coating thickness: {coating_thickness.to(ureg.nanometer):.1f}")
plt.show()
Understand the result#
At normal incidence, an ideal coating between air and a lossless substrate has index \(n_c = \sqrt{n_0 n_s}\) and thickness \(d = \lambda_0/(4n_c)\). Here \(n_0=1\) and \(n_s=1.52\), giving \(n_c \approx 1.233\) and \(d \approx 111.5\) nm. Reflections from the two coating interfaces cancel at the design wavelength.
The index is an ideal design value, not a selected real coating material. The calculation assumes constant, lossless indices, a coherent isotropic layer, and normal incidence. A practical coating should use a measured material model and account for dispersion and manufacturing constraints.
Try another design#
Change design_wavelength to 800 nm and rerun the plot. Then replace
coating_index with 1.38 to see how an imperfect index match changes
the minimum reflectance.
See Physical and numerical conventions for physical conventions and Materials and catalog for source selection and provenance.