{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Materials\n", "\n", "We have different materials available thanks to the [materialspy](https://opticalmaterialspy.readthedocs.io/en/latest/index.html) library" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import opticalmaterialspy as mat\n", "import modes as ms\n", "\n", "m = mat.SiO2()\n", "\n", "# Refractive index @ 1550nm.\n", "print('n(1.55e-6m):', m.n(1.55e-6)) # Knows 1.55e-6 must be [m].\n", "print('n(1.55um):', m.n(1.55)) # Knows 1.55 must be [um].\n", "print('n(1550nm):', m.n(1550)) # Knows 1550 must be [nm].\n", "\n", "# Group velocity refractive index @ 900nm.\n", "print('n_gv(900nm):', m.ng(900))\n", "\n", "# Group velocity dispersion @ 808nm.\n", "print('GVD(0.808um):', m.gvd(0.808))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wavelengths = np.linspace(1.3, 1.6, 10)\n", "n = [ms.materials.si(w) for w in wavelengths]\n", "\n", "plt.plot(wavelengths, n)\n", "plt.xlabel('wavelength (um)')\n", "plt.ylabel('Refractive index')\n", "plt.title('Silicon refractive index')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "if your material is not defined in the materials module you can always add it" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def nitride(wl):\n", " return mat.RefractiveIndexWeb(\n", " \"https://refractiveindex.info/?shelf=main&book=Si3N4&page=Luke\"\n", " ).n(wl)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "nsin = [nitride(w) for w in wavelengths]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.plot(wavelengths, nsin)\n", "plt.xlabel('wavelength (nm)')\n", "plt.ylabel('Refractive index')\n", "plt.title('Silicon nitride refractive index (Si3N4)')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "help(ms.materials)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "wavelengths = np.linspace(1.3, 1.6, 10)\n", "n = [ms.materials.sio2(w) for w in wavelengths]\n", "\n", "plt.plot(wavelengths, n)\n", "plt.xlabel('wavelength (um)')\n", "plt.ylabel('Refractive index')\n", "plt.title('SiO2')" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.7" } }, "nbformat": 4, "nbformat_minor": 4 }