254 lines
78 KiB
Plaintext
254 lines
78 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"# Ring Resonator Dynamics\n",
|
||
|
"The following analysis is base on the model from Yariv's PTL, \"Critical Coupling and Its Control in Optical Waveguide-Ring Resonator Systems\", in 2002. We mainly focus on the dynamic of how it reach the static state. We start from the light reach the coupler at the bus wavguide.\n",
|
||
|
"\n",
|
||
|
"P.S.: We split the time to discrete step of each round trip of light in the ring."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 1,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"import numpy as np\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"%matplotlib inline\n",
|
||
|
"\n",
|
||
|
"T = 0.99\n",
|
||
|
"K = 1 - T\n",
|
||
|
"Alpha = 0.99\n",
|
||
|
"t = np.sqrt(T) + 0.0j\n",
|
||
|
"k = 0.0 + 1j * np.sqrt(K)\n",
|
||
|
"alpha = np.sqrt(Alpha)\n",
|
||
|
"theta = 2.0 * np.pi"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"We define a function to generate the time series of a1, a2, b1 & a2: \n",
|
||
|
"**a[n] => [a1(n-step), a2(n-step)]** \n",
|
||
|
"**b[n] => [b1(n-step), b2(n-step)]** "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 2,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYIAAAEICAYAAABS0fM3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJza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ObWETyDM9rPs1UN7vXzH8YZLq8I+EJEZuMMRbjUnayu69fX68WZD/L5viw2JnZrzmxMDOjXKZ07zuvfqNeo6ocikl+teRLOEIIAM3Eujf1Lt/1ZdS7j+5mItBaRbFXd2oywTSioQmU5VB6GiiPufZnf4yPOc18FaCX4fO59Zc1t37h326uGZVAF9Nh9vW3UMh3HHuedDD3GBuSjaFYiqOULMwxnbM91ACLyPM6XpQgnGSymji0REZmKO8BEXl7e8RMc3sc5hTM4mZbc0u4vlEtSc96CMQ3VoWrlrqpbqwbOwRnKsNBvuiK37bhEUG/fNo2nCod2w/7tcKAEDu6AA+7t4A4o2wtH9sPhfc7t6OP9UH6QEA8EFlinXB8eiaAWNX0xTgZmAH8VkYk4Y5rWSFUfBx4HGDp06PH/peRWtLr4MVo9dyH/yJ8D4+4JZOzGNFZNo3nVuHapt2+bmqnC/mLYvgJKVsLOtbCnEEo3QWkhHNlX8+tSMyElA5JaQXJLaNkekro5j5PT0YQUKuKSKSeRI5JAOYlUSDLlkkClJFEuiW5bPOUqVPjiqFChQoUjGo+POHwIlTiPK/2eVyL4iMengg9QVXwIPgVFqPThPj52r25X8qkAgk/UffuC4twQObphcHJeG84M0EccjERQ4xfDHZP2RwFZQs+z4FtXwmcPQ6+zodsZAZm
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x1cd14a583c8>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"def propagate_in_cycle(t, k, alpha, theta, num_cycle = 1000):\n",
|
||
|
" a1_0 = 1.0 + 0.0j\n",
|
||
|
" a2_0 = 0.0 + 0.0j\n",
|
||
|
" a = np.zeros((num_cycle, 2), dtype=complex)\n",
|
||
|
" b = np.zeros((num_cycle, 2), dtype=complex)\n",
|
||
|
"\n",
|
||
|
" a[0] = [a1_0, a2_0]\n",
|
||
|
" \n",
|
||
|
" coupler = np.array([[t, k],\n",
|
||
|
" [-k.conjugate(), t.conjugate()]])\n",
|
||
|
"\n",
|
||
|
" for n in range(num_cycle - 1):\n",
|
||
|
" b[n] = coupler@a[n]\n",
|
||
|
" a[n+1] = np.array([a1_0, b[n][1] * alpha * np.exp(1.j * theta)])\n",
|
||
|
"\n",
|
||
|
" b[num_cycle - 1] = coupler@a[num_cycle - 1]\n",
|
||
|
" \n",
|
||
|
" return a, b\n",
|
||
|
"\n",
|
||
|
"a, b = propagate_in_cycle(t=t, k=k, alpha=alpha, theta=theta, num_cycle = 1000)\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.subplot(121)\n",
|
||
|
"plt.plot(abs(a[:,0])**2, label='a1')\n",
|
||
|
"\n",
|
||
|
"plt.plot(abs(b[:,0])**2, label='b1')\n",
|
||
|
"plt.yscale('log')\n",
|
||
|
"plt.title('a1 & b1 in Bus WG')\n",
|
||
|
"plt.legend()\n",
|
||
|
"plt.subplot(122)\n",
|
||
|
"plt.plot(abs(a[:,1])**2, label='a2')\n",
|
||
|
"plt.plot(abs(b[:,1])**2, label='b2')\n",
|
||
|
"plt.title('a2 & b2 in Resonator')\n",
|
||
|
"plt.yscale('linear')\n",
|
||
|
"plt.legend()\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"You can invitigate the change of bus waveguide output intensity & the ring intensity gain from the coupler by each cycle (normalized by the input intensity a1)."
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 3,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yL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NfiEkIIfwr45N4lyihB0OIrZk5sh1OHpUtGCGEqAZ/cO4QEEWkLIqelyf2nj437vhO9F5QQQvhZwCd3MK6YaXHLfd/n0CVVaskIIUzFHMk92sbxohb8SrWiBA5/A+fKte1CCHMxRXJv8Q+ZDn0N9io490LvByWEEH5kkuQeSm5JBTXNHUt13+cQFAY9R/kmMCGE8BNTJPeuUTZq7Jr85g7ase9zSBoDwTbfBCaEEH5iiuTu/JVqc06qFmZB3h7pkhFCmJIpknuLfsh0cK1x30sGwRZCmI85kntLShAc+hps0dB5oI+iEkII/zFFcu8UEYrVoprXLXPwa+g5GiymeAuEEOIMpshsVouia5SN7FMeJvfi43ByH5wz2reBCSGEn5giuQN0j7GRdeq0ZwsfWmfcJ/llZEAhhPA50yT3HjFhHGtOcg8Oh66DfBuUEEL4iWmSe/eYMI4Xlnv2Q6ZDX0PPEWD1aHxwIYQIOKZK7tV2TW5xEz9kOn0KcnZIf7sQwtRMk9x7xIQBcLSprpmjm437hGE+jkgIIfzHNMm9uyO5N9nvfnQzoKB7uu+DEkIIPzFRcjd+yNRkyz1rI8SfB7aoNohKCCH8wzTJPdIWTJQtqPGWu9aQtQkSMtouMCGE8APTJHcwumYaTe4FB+D0SeghyV0IYW6mSu49YsI42tivVLN
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x1cd15ca4c88>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"bus_output = abs(b[:, 0]/a[:,0])**2\n",
|
||
|
"gain_per_cycle = (abs(b[:, 1])**2 - abs(a[:, 1])**2)/abs(a[:,0])**2\n",
|
||
|
"\n",
|
||
|
"plt.plot(bus_output, label='Bus WG Output')\n",
|
||
|
"plt.plot(gain_per_cycle, label='Energy gain of ring after coupler per cycle')\n",
|
||
|
"plt.plot(bus_output + gain_per_cycle, label=\"Sum of both\")\n",
|
||
|
"plt.legend()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"We can see that the bus waveguide output power: \n",
|
||
|
"**enegry loss from the ring via coupler + enegry from a1 does not coupled to the ring** \n",
|
||
|
"\n",
|
||
|
"is same as the enegry gain of the ring after coupler: \n",
|
||
|
"**enegry gain from bus waveguide + energy of the ring does not coupled out to bus waveguide** \n",
|
||
|
"\n",
|
||
|
"Therefore, when the distructive interference happened in bus output port (b1) of the coupler, the energy will transfer to the port of the ring (b2). It must be true since the coupler is lossless (coupler martrix is unitary, i.e., |t|^2 + |k|^2 = 1) \n",
|
||
|
"It is an interesting constructive & distructive interference porporty of wave 😉 "
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "markdown",
|
||
|
"metadata": {},
|
||
|
"source": [
|
||
|
"### Play with other parameters\n",
|
||
|
"Enjoy~ 😊"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 4,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEICAYAAACwDehOAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl8VPW5+PHPkz0QAiEkEAgkQXYUBREXrHWpFlAL2vZ1XfqrrVa0rVtbr9Vqb+3ibbW91VKXutbltnhtqxWtitalaMUFRNmRgEAiIQTCHkK25/fH+U4Yw2QhmZkzy/N+veaVme+cOeeZyXfOM2d5zldUFWOMMQYgxe8AjDHGxA5LCsYYY1pZUjDGGNPKkoIxxphWlhSMMca0sqRgjDGmlSWFKBKRR0XkF2Ga149E5K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H3du2D+SHiUFVV0gIqVtmqfgjWW6HkBEnsT7QlXiJYYP6WALRURm4wbLGDZs2KETNNZRWv4EQxXObvgl+8g+dBpjnH7Z6R0lhVAGqmoVgKpWBQb7wRuWsSJoukrX1l77ITrt26Z7mptgbzVNuz5l99YK6nZupXFvLc11tej+nUj9DlIP7CK9cQ9pzfWktdST0XKADN1Plh5od7aCN/pQetTeSNe1qPDujl2xlxTaEepLcjwwB7hbRM7GG8M1JFV9AHgAYPLkyYcO9pCZQ/GlT8Afp7P8hNdh5j3hjN2Y9oQajUw7aD+0sbO+bdp3YA8HqlZRW7GSus1r0O3lZO3ZRE7DVnKbd5CCkoY3Nmj/wEs0jd30ZqfmUEtv9qfm0JiST1NKFk0
|
||
|
"text/plain": [
|
||
|
"<matplotlib.figure.Figure at 0x1cd15c2b780>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"T2 = 0.999\n",
|
||
|
"K2 = 1 - T2\n",
|
||
|
"Alpha2 = 0.999\n",
|
||
|
"t2 = np.sqrt(T2) + 0.0j\n",
|
||
|
"k2 = 0.0 + 1j * np.sqrt(K2)\n",
|
||
|
"alpha2 = np.sqrt(Alpha2)\n",
|
||
|
"theta2 = 2.0 * np.pi\n",
|
||
|
"a2, b2 = propagate_in_cycle(t=t2, k=k2, alpha=alpha2, theta=theta2, num_cycle = 10000)\n",
|
||
|
"plt.figure()\n",
|
||
|
"plt.subplot(121)\n",
|
||
|
"plt.plot(abs(a2[:,0])**2, label='a1')\n",
|
||
|
"\n",
|
||
|
"plt.plot(abs(b2[:,0])**2, label='b1')\n",
|
||
|
"plt.yscale('log')\n",
|
||
|
"plt.title('a1 & b1 in Bus WG')\n",
|
||
|
"plt.legend()\n",
|
||
|
"plt.subplot(122)\n",
|
||
|
"plt.plot(abs(a2[:,1])**2, label='a2')\n",
|
||
|
"plt.plot(abs(b2[:,1])**2, label='b2')\n",
|
||
|
"plt.title('a2 & b2 in Resonator')\n",
|
||
|
"plt.yscale('linear')\n",
|
||
|
"plt.legend()\n",
|
||
|
"\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 5,
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl8VNXZwPHfmex7IAkBEiAgm5AECAHCpkQrAiLUhQp1ARGttda2VlppaxG7qK++r1arVeu+V3CBIu6CgiD7IvsaJBAgCSQhCSHJzHn/uDPjkEySIZnJZC7P9/OZz8y998y9586dPHNy7rnPVVprhBBCmIvF3xUQQgjhfRLchRDChCS4CyGECUlwF0IIE5LgLoQQJiTBXQghTEiCuxBCmJAEdyGEMCEJ7kIIYULB/tpwYmKiTktL89fmhRAiIK1fv75Ia53UVDm/Bfe0tDTWrVvnr80LIURAUkod9KScdMsIIYQJSXAXQggTkuAuhBAmJMFdCCFMSIK7EEKYUJPBXSn1olLquFJqawPLlVLqCaXUXqXUFqVUlverKYQQ4lx40nJ/GRjXyPLxQC/74zbgXy2vlhBCiJZocpy71vprpVRaI0UmA69q43593yql4pVSnbTWBV6q41mW7PmGT/cvp2eHaF+sXrhjs4KtFrTV/tpa/7W2gdaANp61zf7a5jKv7rTLa/jh2Zhweemt+W7moc+eNA1T7pRpjOlzDen9pvh0G964iCkFOOQynW+fVy+4K6Vuw2jd07Vr12ZtbOGOVXxz4k2+PNqst4uG/ui1B2WEEF7R4VByQAR35Wae2+igtX4OeA4gOzu7WRHkR52v45OVF/L17Fy6JkQ2ZxXm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
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"plt.figure()\n",
|
||
|
"bus_output = abs(b2[:, 0]/a2[:,0])**2\n",
|
||
|
"gain_per_cycle = (abs(b2[:, 1])**2 - abs(a2[:, 1])**2)/abs(a2[:,0])**2\n",
|
||
|
"\n",
|
||
|
"plt.plot(bus_output, label='Bus WG Output')\n",
|
||
|
"plt.plot(gain_per_cycle, label='Energy gain of ring after coupler per cycle')\n",
|
||
|
"plt.plot(bus_output + gain_per_cycle, label=\"Sum of both\")\n",
|
||
|
"plt.legend()\n",
|
||
|
"plt.show()"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"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.6.4"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 2
|
||
|
}
|