{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# This file is part of nannos\n# License: GPLv3\n%matplotlib notebook" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Polarization conversion\n\nSimulation of conversion efficiency of a geometric metasurface.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import matplotlib.pyplot as plt\nimport numpy as np\n\nimport nannos as nn" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The unit cell is a rectangular Si structure on a SiO2 substrate\nas in :cite:p:`Yoon2021`.\nCircularly-polarized light of wavelength 635 nm is normally incident from the\nsubstrate to the structure\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "wl = 635 # wavelength\nP = 350 # period\nW = 100 # pillar width along x\nL = 190 # pillar length along y\neps_Si = (3.87 + 0.02j) ** 2\neps_SiO2 = 1.4573**2\nnh = 100" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Define a function to initialize simulation\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def simu(H, psi):\n lattice = nn.Lattice([[P, 0], [0, P]], discretization=2**9)\n sup = lattice.Layer(\"Superstrate\", epsilon=eps_SiO2)\n sub = lattice.Layer(\"Substrate\", epsilon=1)\n epsilon = lattice.ones()\n metaatom = lattice.rectangle((0.5 * P, 0.5 * P), (W, L))\n epsilon[metaatom] = eps_Si\n ms = lattice.Layer(\"Metasurface\", thickness=H, epsilon=epsilon)\n pw = nn.PlaneWave(wavelength=wl, angles=(0, 0, psi))\n return nn.Simulation([sup, ms, sub], pw, nh=nh)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Since the layer eigenmodes do not change with thickness we compute them\nonly once for the first iteration.\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "nb_thick = 100\nthicknesses = np.linspace(200, 500, nb_thick)\nconv_effs = np.zeros(nb_thick)\n\nfor ih, H in enumerate(thicknesses):\n # x-polarization\n if ih == 0:\n simx = simu(H, 0)\n else:\n simx.layers[1].thickness = H\n simx.reset(\"S\")\n rxi, txi = simx.diffraction_efficiencies(orders=True, complex=True)\n txx = simx.get_order(txi[0], (0, 0))\n\n # y-polarization\n if ih == 0:\n simy = simu(H, 90)\n else:\n simy.layers[1].thickness = H\n # print(self.is_solved)\n simy.reset(\"S\")\n ryi, tyi = simy.diffraction_efficiencies(orders=True, complex=True)\n tyy = simy.get_order(tyi[1], (0, 0))\n\n conv_effs[ih] = np.abs((tyy - txx) / 2) ** 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the efficiency\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plt.clf()\nplt.plot(thicknesses, conv_effs)\nplt.xlabel(\"H (nm)\")\nplt.ylabel(\"conversion efficiency\")\nplt.tight_layout()\nplt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot the unit cell\n\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "p = simx.plot_structure()\np.show_axes()\np.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import nannos.utils.jupyter\n%nannos_version_table" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.10.13" } }, "nbformat": 4, "nbformat_minor": 0 }