{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Design of a Coupled Resonator Optical Waveguide band-pass filter with Photontorch" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", "from tqdm.notebook import tqdm # [pip install tqdm]\n", "import torch # [conda install pytorch -c pytorch, only python 3!]\n", "import photontorch as pt # [pip install photontorch] my simulation/optimization library" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Coupled Resonator Optical Waveguide" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A coupled resonator optical waveguide is a cascade of ring resonators.\n", "Such a network with $n$ rings has $2n+1$ parameters that you can optimize: $n$ ring phases and $n+1$ couplings." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameters" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's define some global simulation parameters:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "c = 299792458.0 # speed of light\n", "ring_length = 50e-6 #[m]\n", "ng=3.4 # group index\n", "neff=2.34 # effective index" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Simulation Environment" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Photontorch expects a simulation environment to be set. This environment contains all global parameters for a simulation, such as the timestep of the simulation, the speed of light for the simulation, the wavelength, ..." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
key | \n", "value | \n", "description | \n", "
---|---|---|
name | env | name of the environment |
t | 0.000e+00 | [s] full 1D time array. |
t0 | 0.000e+00 | [s] starting time of the simulation. |
t1 | None | [s] ending time of the simulation. |
num_t | 1 | number of timesteps in the simulation. |
dt | None | [s] timestep of the simulation |
samplerate | None | [1/s] samplerate of the simulation. |
bitrate | None | [1/s] bitrate of the signal. |
bitlength | None | [s] bitlength of the signal. |
wl | [1.500e-06, 1.500e-06, ..., 1.600e-06] | [m] full 1D wavelength array. |
wl0 | 1.500e-06 | [m] start of wavelength range. |
wl1 | 1.600e-06 | [m] end of wavelength range. |
num_wl | 1001 | number of independent wavelengths in the simulation |
dwl | 1.000e-10 | [m] wavelength step sizebetween wl0 and wl1. |
f | [1.999e+14, 1.998e+14, ..., 1.874e+14] | [1/s] full 1D frequency array. |
f0 | 1.999e+14 | [1/s] start of frequency range. |
f1 | 1.874e+14 | [1/s] end of frequency range. |
num_f | 1001 | number of independent frequencies in the simulation |
df | -1.332e+10 | [1/s] frequency step between f0 and f1. |
c | 2.998e+08 | [m/s] speed of light used during simulations. |
freqdomain | True | only do frequency domain calculations. |
grad | False | track gradients during the simulation |