{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Unitary Matrix Networks in the Time Domain" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Photontorch\n", "import photontorch as pt\n", "\n", "# Python\n", "import torch\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from tqdm.notebook import trange\n", "\n", "# numpy settings\n", "np.random.seed(6) # seed for random numbers\n", "np.set_printoptions(precision=2, suppress=True) # show less numbers while printing numpy arrays" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Schematic\n", "![Unitary Matrix Paper](images/clements.jpeg)\n", "\n", "(a) Reck Design\n", "\n", "(b) Clements Design" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Simulation and Design Parameters" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Here we will use the matrix network *with* delays." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
key | \n", "value | \n", "description | \n", "
---|---|---|
name | env | name of the environment |
t | [0.000e+00, 1.000e-13, ..., 1.980e-11] | [s] full 1D time array. |
t0 | 0.000e+00 | [s] starting time of the simulation. |
t1 | 1.990e-11 | [s] ending time of the simulation. |
num_t | 199 | number of timesteps in the simulation. |
dt | 1.000e-13 | [s] timestep of the simulation |
samplerate | 1.000e+13 | [1/s] samplerate of the simulation. |
bitrate | None | [1/s] bitrate of the signal. |
bitlength | None | [s] bitlength of the signal. |
wl | 1.550e-06 | [m] full 1D wavelength array. |
wl0 | 1.550e-06 | [m] start of wavelength range. |
wl1 | None | [m] end of wavelength range. |
num_wl | 1 | number of independent wavelengths in the simulation |
dwl | None | [m] wavelength step sizebetween wl0 and wl1. |
f | 1.934e+14 | [1/s] full 1D frequency array. |
f0 | 1.934e+14 | [1/s] start of frequency range. |
f1 | None | [1/s] end of frequency range. |
num_f | 1 | number of independent frequencies in the simulation |
df | None | [1/s] frequency step between f0 and f1. |
c | 2.998e+08 | [m/s] speed of light used during simulations. |
freqdomain | False | only do frequency domain calculations. |
grad | False | track gradients during the simulation |