.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/thin_films/plot_bragg_mirror.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_thin_films_plot_bragg_mirror.py: Dielectric Bragg mirror ======================= Build an alternating high/low-index quarter-wave stack and observe how adding layer pairs increases reflectance around the design wavelength. .. GENERATED FROM PYTHON SOURCE LINES 10-31 .. code-block:: Python import matplotlib.pyplot as plt import numpy from TypedUnit import ureg from PyOptik import ThinFilmLayer, thin_film_stack design_wavelength = 800 * ureg.nanometer high_index, low_index = 2.25, 1.45 wavelengths = numpy.linspace(500, 1100, 700) * ureg.nanometer def mirror_layers(pair_count): """Return ``pair_count`` high/low quarter-wave layer pairs.""" pair = [ ThinFilmLayer(high_index, design_wavelength / (4 * high_index)), ThinFilmLayer(low_index, design_wavelength / (4 * low_index)), ] return pair * pair_count .. GENERATED FROM PYTHON SOURCE LINES 32-51 .. code-block:: Python figure, axis = plt.subplots(layout="constrained") for pair_count in (2, 4, 8): result = thin_film_stack( wavelengths, mirror_layers(pair_count), substrate_index=1.52, ) axis.plot(wavelengths.magnitude, 100 * result.reflectance, label=f"{pair_count} pairs") axis.axvline(design_wavelength.magnitude, color="black", linestyle="--", alpha=0.6) axis.set( xlabel="Wavelength [nm]", ylabel="Reflectance [%]", title="Quarter-wave dielectric mirror", ylim=(0, 101), ) axis.grid(alpha=0.25) axis.legend() plt.show() .. image-sg:: /gallery/thin_films/images/sphx_glr_plot_bragg_mirror_001.png :alt: Quarter-wave dielectric mirror :srcset: /gallery/thin_films/images/sphx_glr_plot_bragg_mirror_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 2.201 seconds) .. _sphx_glr_download_gallery_thin_films_plot_bragg_mirror.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_bragg_mirror.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_bragg_mirror.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_