Quantum Cryptography BB84 simulation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

348 lines
173 KiB

{
"cells": [
{
"cell_type": "code",
"execution_count": 19,
"id": "cc79f1dd",
"metadata": {},
"outputs": [],
"source": [
"from matplotlib import pyplot as plt\n",
"import sympy as sp\n",
"sp.init_printing()\n",
"plt.style.use('seaborn-deep')\n",
"plt.rcParams['figure.dpi'] = 140\n",
"f, mu, delta, l, p_dc, p_opt, f, eta, n = sp.symbols(r'f \\mu \\delta l p_{dc} p_{opt} f \\eta n')"
]
},
{
"cell_type": "code",
"execution_count": 20,
"id": "1ac718e2",
"metadata": {},
"outputs": [],
"source": [
"approx_values = {\n",
" r'\\mu': 1,\n",
" 'f': 1,\n",
" r'\\delta': 0.2,\n",
" 'l': 1,\n",
" r'p_{dc}': 0.02,\n",
" r'p_{opt}': 0.01,\n",
" r'\\eta': 0.2\n",
"}\n",
"variables = {\n",
" r'\\mu': mu,\n",
" 'f': f,\n",
" r'\\delta': delta,\n",
" 'l': l,\n",
" r'p_{dc}': p_dc,\n",
" r'p_{opt}': p_opt,\n",
" r'\\eta': eta\n",
"}"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "b65f4f73",
"metadata": {},
"outputs": [],
"source": [
"def pop_in_place(d, k):\n",
" return {key: d[key] for key in d.keys() if key != k}"
]
},
{
"cell_type": "markdown",
"id": "01aa0680",
"metadata": {},
"source": [
"**Key generation rate:**\n",
"\n",
"$$R=\\dfrac 12 f (\\mu t \\eta + 2p_{dc})$$\n",
"\n",
"**Error rate:**\n",
"\n",
"$$E=\\dfrac{p_{dc} + p_{opt} n t \\eta}{2 p_{dc} + n t \\eta}$$"
]
},
{
"cell_type": "code",
"execution_count": 21,
"id": "e7c63373",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAADIAAAAWCAYAAACCAs+RAAAACXBIWXMAAA7EAAAOxAGVKw4bAAACkUlEQVRYCc2X0XEUMQyG7zIpIAMdhA6SUAGkA0IHkA7C8HZvTOgAKIF0EDoIuRLSQTLp4Pg+nbXjeDNzezvArWZ0ki3Zq9+yZd98tVrNpkqLxeItsR3Cv9GXxom0/RP+gn5ln7S3FpP9DRBEJ6Aggr9DeYAD2Lp3+kDOCPSO4L9mwEWeFEBd92QzQqAHgoBvix5Bo2eWOhAqkwRCsEfEdok8R/6CP8JJbrMn20rDJIEQ1w/40gCha/hVaOuf49JXdU0XyIxsuK2k17BVKsmMWMXeZYdyv25MSP9EoG4nq9M9utsryZKrrSu9Gub1PcIA96boj9EfdWiJ/kz5PTZT7l7O1Wvd/1t7nyCsDu5J0Z/AVoVnCd9bDN1FVMZaVU7hnYIRiCtvvZ6hXyDMSo+wmc4DZJdS9MfS/obt1EG0o+Kob6BzfJ+Apz36mbHNGRFsr+zRdwNfEIQgBaZPgEJuRYydbzWgct4GiNXiezU21VxV7V220jhGAsjtbZbPXJyco/RbrfymPlf0xfcHAcHZc7SJXmxyGGLnW25Ng3zurFqI3uAT4JCeWe+VwRdiBtmtjoMbGgK2GdJvEtwS7mWWPuc/RNYx2I7v7vWnGt3zcvTIYQNdTCtrTbYjc0OBtBPUk2W2vFf+JRlDfiu/YzsyNAhIlc5IY85SZPbloW/Mf6dZYmi/4RN/+GEvofhMiDQ2oeUq1c+IxmV4k8CO8LYCOu9n2jdwnhmrmHedwWuP+w85G1S1dISsGPk8iY7yY9XwgEaKa8MYnXmWzge3f6Zm2ATQ6/c77dbKA5urrE8Qk3iHPCC7Vye62+o9/CGcdvgTj0YCcrUlU2pwrojorwsA1Hh+aDMrrr6H2ye2by/9d0p/ANSZ1s05WxCuAAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle 10^{- \\frac{\\delta l}{10}}$"
],
"text/plain": [
" -\\delta⋅l \n",
" ──────────\n",
" 10 \n",
"10 "
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"t = 10 ** (-l * delta / 10)\n",
"t"
]
},
{
"cell_type": "code",
"execution_count": 22,
"id": "9a69c84c",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAALYAAAA8CAYAAADL20C6AAAACXBIWXMAAA7EAAAOxAGVKw4bAAALlElEQVR4Ae2d65HUOhCFB2oDAG4EFzLgEQGQAVwiWMgAil/wj4IMgAh4ZABEwCMDyIAtMuCeT6s2kix7PJ7RjpdtVXltSa1W6+io9fDM7Lnfv3+vTiI8ffr0per5oPv7k6jP6/i7EBBvLqhFn3Td1POvda07v05gF/mR1Jec1LtA82zqiGQ+VOu/6hmSj4bmxJYR92XBdd3vjlrimY7AGgTEoW8Sea7r9RrR1bmWSxEZclUGMH38q+e108c6Yz2/PQLqp1uq5bKuL5FIK92Jv9P1TM97X0rKhg+y5eWYLa09NiPrlQxwUguIUxICqWUrBA9B/fdDD0e68JhLCMz+r2XX4JKkGbFV6R1Vjsd+tgQk3IbJCECaH+q/F0UJlpMQfO9BduAo3+oaXJI0I7YqZS30IhqhRw9LR0B9hQeEvNkGTenmxZfUBPh1J9rWs6sJsVUZnhow3Fv3IF9mQuyz57o/kIUfdbHpt8CyZCnLkGCT7GQAYif29kITYquWx7o+qnJfW/cgX2wC0zpekMDm7Ep4Ov5zLaYlSYt4ZEObDsDOqFbEZn1NpR5OEQLRC2LxDV1p/+GxOSWhX5cU8NgXanYdrLNShXhjaJ6X4x57rhZVPssQApWOBsmyXHkUha7rzs77kdIXNe1F+5rcIl6Q6Jqeq9gq3TzpT8nhSVky7HojB+54P/rgp57T/uOIj7y9H/XJhi6AQcThthIz20aJrUIAekkX5OY8+rOuTIHiZYCgq1hhmdfFlQ+pOYvEqBD0TH1sXG7rSoGNEn/HTW27oJYw9UMi8AKLapDsV2V058exrGG0M3KP4a08cz5VG/ecCE8C51I7RoktQUYprzEh9xddU8gGUad4XEicLfwBUBd14sEu6lpskJ1Mz5d1f7WpkSqDZw5vYvX8UM82y2WqlAcWTLWdM6FsjONsglNQnPLm1TM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9EbSTmtxZYtHQOTrLRMioXtknNEYO1jI1vXoOT9D2ZQiLEdYY9uImlLGZRyBTRHgqLi6R2pC7DgiObIpp6BNDXd5R6CKgDgW3mnoXl2uNiE2lqhCTiX4kFB44VO1zhMdgfkIcLBwOFS8GbFjhZD79VDlnu4IzEFAzhJvzfF01VujsymxVXE4ntO99tp8Tpu8zBlHQFy6LAjw1qPH0k2JHfuAD+vw4gSDPDgCsxEQh3jXwkudQz33TkJSxc2JLQM4q+RYhg/5YJgHR2AuAuEYWTwaXIKY4ubEpiIZwuhi6nCvDSAeNkYgOkU+5Tj49jlV2vRfdaQV+bMjcJIInIjHPskGeV2OAAice/LkyezfbnMIHYGlIuBLkaX2jNu1FQK+FNkKPi+8VASc2EvtGbdrKwSc2FvB54WXioATe6k943ZthUCrLxpsZdTfVFgvFC6rPXwYjMBXosL3MZXe+wB+kPA/O0HAT0V2AmNdSSR17f/s8Ok0vhq1i2+R1Cs/46m+FGlLgN7X40RmvDefn7Gfu2hrwRnV7sRu2/F8NY6ffyg//IWn5qtzLFM8NEDAid0A1EQlBO79mEuSXxI+yfLHbRDwNfY26M0sK0/Nb9PxtbnT/h+7ZiLQvph77PYYZzWIzHwHlCWInZRk+R7ZDQJO7N3guIkWNo3d/9nZpKDLTkfAlyLTsdpaUt6aX0ViCcI3ijw0RMA9dkNwU9UiM19o7v2fnVTGn3eHgBN7d1gOahKp+YHN3v/ZUTprbQ8NEHBiNwA1VSnyslkc+j87vF730AABX2M3ANVURo/MzwXUXp3fUn7t1/+tuN+3QMA/BLUFeBOKQmqWG7UfDPIPQU0AcK7I/6920HLi6vWCAAAAAElFTkSuQmCC\n",
"text/latex": [
"$\\displaystyle \\frac{f \\left(2 p_{dc} + 10^{- \\frac{\\delta l}{10}} \\eta \\mu\\right)}{2}$"
],
"text/plain": [
" ⎛ -\\delta⋅l ⎞\n",
" ⎜ ────────── ⎟\n",
" ⎜ 10 ⎟\n",
"f⋅⎝2⋅p_{dc} + 10 ⋅\\eta⋅\\mu⎠\n",
"────────────────────────────────────\n",
" 2 "
]
},
"execution_count": 22,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"R = f * (mu*t*eta+2*p_dc) / 2\n",
"R"
]
},
{
"cell_type": "code",
"execution_count": 23,
"id": "6637fe0a",
"metadata": {},
"outputs": [],
"source": [
"E = (p_dc + p_opt * n * t * eta) / (2 * p_dc + n * t * eta)"
]
},
{
"cell_type": "code",
"execution_count": 24,
"id": "82a82472",
"metadata": {},
"outputs": [],
"source": [
"def plot_for_key(key, key_range, title='', show=True):\n",
" subs = pop_in_place(approx_values, key)\n",
" if subs.get('\\mu') is not None:\n",
" subs['n'] = subs['\\mu']\n",
" plot = sp.plotting.plot(R.evalf(subs=subs), E.evalf(subs=subs), (variables[key], *key_range), xlabel=f'${key}$', ylabel='', show=False, title=title or f'$R$ and $E$ vs. ${key}$')\n",
" plot[1].line_color = 'r'\n",
" if show:\n",
" plot.show()\n",
" return plot"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "bf4db181",
"metadata": {},
"outputs": [
{
"ename": "ValueError",
"evalue": "The same variable should be used in all univariate expressions being plotted.",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mValueError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-25-9cbfa17e5309>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mplot_for_key\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mr'\\mu'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;36m0.5\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;36m3\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m<ipython-input-24-2836792b187f>\u001b[0m in \u001b[0;36mplot_for_key\u001b[0;34m(key, key_range, title, show)\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0msubs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'\\mu'\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0msubs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'n'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msubs\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'\\mu'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mplot\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0msp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplotting\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mR\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mevalf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msubs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msubs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mE\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mevalf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0msubs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msubs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mvariables\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0mkey_range\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mxlabel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34mf'${key}$'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mylabel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m''\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mshow\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtitle\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtitle\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0;34mf'$R$ and $E$ vs. ${key}$'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mplot\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mline_color\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'r'\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mshow\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/lib/python3.9/site-packages/sympy/plotting/plot.py\u001b[0m in \u001b[0;36mplot\u001b[0;34m(show, *args, **kwargs)\u001b[0m\n\u001b[1;32m 1726\u001b[0m \u001b[0mfree\u001b[0m \u001b[0;34m|=\u001b[0m \u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfree_symbols\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1727\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfree\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1728\u001b[0;31m raise ValueError(\n\u001b[0m\u001b[1;32m 1729\u001b[0m \u001b[0;34m'The same variable should be used in all '\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1730\u001b[0m 'univariate expressions being plotted.')\n",
"\u001b[0;31mValueError\u001b[0m: The same variable should be used in all univariate expressions being plotted."
]
}
],
"source": [
"plot_for_key(r'\\mu', (0.5, 3))"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "a4d125cc",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAz0AAAIiCAYAAADin6aPAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAABWIAAAViAHE10CgAAB/TElEQVR4nO3dd1hVZ7r+8e+iSxUFQZQmYtfYO/aSHtM1xomp089MZuac30zmzJhMkjN9TmYmJ5NuzBhNTGJMT9TYFXvvqIA0QRQBpcP6/bEA2W40isAu3J/r4gLWu1j72YTIvnnf9byGaZqIiIiIiIi4Kw9HFyAiIiIiItKSFHpERERERMStKfSIiIiIiIhbU+gRERERERG3ptAjIiIiIiJuTaFHRERERETcmkKPiIiIiIi4NYUeERERERFxawo9IiIiIiLi1hR6RERERETErSn0iIiIiIiIW1PoERERERERt6bQIyIiIiIibk2hR0RErpthGE8bhmEahvGWo2txNYZh7Kn93k1zdC0iIu5KoUdEpIUYhtG79sXspW/lhmGkGobxumEYCY6u09Gu8H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l2rFg89teqWsT0C3H/JsXqGYfzeMIzvG4YRccnx9sCvaj89emlXN8MwfmoYRpphGBuuoSaFHhGRVqTubSIizcgwjHCgS+2nVwo9K7Fmbfyxbpi/2g1KPwHWYHUY+9gwjDSs7nC9sWYz5tLIC/pmMAdrtqM/kGIYxn6sP5z1BVKBl4EfX+3FLvk+PWEYxl1XOD3XNM27m1S1ZRHwZ2BU7edpXJy5aag38EvgJcMwTmItQQzA6rjni9UA4vFGvq49EHuNNSn0iIi0Is30iIg0r7rZixquMINhmmYZsLz20xlXe/HapXG3AH/AChtdgBisfX8mmab572sv+aoe9wQwBPgXkIPVhS4YK6wNA85e4yUHN/i4JzDmCm8+11l7HvBVg0MLL93YtdazwHPABqzfjwOBblgh6UWgX+2s13UxDKMjEA1UcUmjCxERaRlG4//ui4iIiIiIuAfN9IiIiIiIiFtT6BEREREREbem0CMiIiIiIm5NoUdERERERNyaQo+IiIiIiLg1hR4REREREXFrCj0iIiIiIuLWFHpERERERMStKfSIiIiIiIhbU+gRERERERG3ptAjIiKtwjCM1wzDeM3RdYiISNvjdR1fazZbFSIi4vZGjhxZ9+FjjqxDRERcitEcF9FMj4iIiIiIuDWFHhERERERcWsKPSIiIiIi4tYUekRERERExK0p9IiIiIiIiFtT6BEREREREbem0CMiIiIiIm5NoUdERERERNyaQo+IiIiIiLg1hR4REREREXFrCj0iIiIiIuLWFHpERERERMStKfSIiIiIiIhbU+gRERERERG3ptAjIiIiIiJuTaFHRERERETcmkKPiIiIiIi4NYUeERERERFxawo9IiIiIiLi1hR6RERERETaupIS+OYbR1fRYhR6RERERETaqtxc+O1vISYGbrwRMjMdXVGLUOgREREREWlrDhyARx+1ws6zz8KZM1BVBf/8p6MraxFeji5ARERERERagWnCypXw17/C11/bjw8ZAiNHtn5drUChR0RERETEnZWXw7vvwj/+ATt32o4ZBtx2G/z855CUZH3uhhR6RERERETcUX4+vPwyvPiide/OmDEXx9q1g7lz4ac/hR49HFVhq1HoERERERFxJ0eOwAsvwIIFUFp68XhuLkRGwo9+BN/9LoSFOazE1qbQIyIiIiLi6kwT1qyBv/0NPvvMfrx/f/jZz2DmTPDza/XyHE2hR0RERETEVVVUwJIlVtjZtct+/KabrLAzebLb3q9zNRR6RERERERczdmz8Oqr1uzOpZ3YfH1hzhzrfp2+fR1RndNR6BERERERcRUpKfD3v8P8+VBSYh2
"text/plain": [
"<Figure size 840x560 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<sympy.plotting.plot.Plot at 0x7fd53264ddf0>"
]
},
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot_for_key(r'l', (0.5, 10))"
]
},
{
"cell_type": "code",
"execution_count": 18,
"id": "35cb0bcc",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0IAAAIhCAYAAABjSQo0AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAABWIAAAViAHE10CgAAB3iklEQVR4nO3dd3wV153///dRF2oUCRBdgBrNgMGm9+7uuFISb+Ikm93YSTZlkzhe403sbJL9pq1380ucrJMFbNxix47pGLBpNsbGGJCEQCB6kQBJqEv3/P4YtSskUB9J9/V8POYx954z99yPxEWat2bmjLHWCgAAAAB8iZ/bBQAAAABAWyMIAQAAAPA5BCEAAAAAPocgBAAAAMDnEIQAAAAA+ByCEAAAAACfQxACAAAA4HMIQgAAAAB8DkEIAAAAgM8hCAEAAADwOQQhAAAAAD6HIAQAAADA5xCEAAAAAPgcghAAAAAAn0MQAgAAAOBzCEIAAC/GmOXGGGuM+bPbtQAA0FoIQgDQAMaY5IpwUHspNsYcM8b80RgzxO063Xad71Ndy//ndr0AAN8V4HYBANBBjK1YF0naW6O9r6RBkr4k6X5jzBRr7WdtXFt7Uvl9KpT08Q22XdfKtQAAUC+CEA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/S849nw40umoAAKfGAQDQVMaYXZImSLrTWvu22/UAABqOI0IAADSBMcZPUuW9mJpyahwAwEUcEQIAAADgczgiBAAAAMDnEIQAAAAA+ByCEAAAAACfQxACAAAA4HN8JggZY543xjzvdh0AAAAA3BfQyuO3mynpJkyYUPnwUTfrAAAAAFAn05Zv5jNHhAAAAACgEkE
"text/plain": [
"<Figure size 840x560 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<sympy.plotting.plot.Plot at 0x7fd53209ceb0>"
]
},
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot_for_key(r'p_{dc}', (0, 1))"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "5cc66fa2",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAA0YAAAIiCAYAAADsNtjgAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAABWIAAAViAHE10CgAABe0UlEQVR4nO3dd3hUZdrH8e9D76iAvWEDBCkidgW7r31ddVfXVVxRBEVF7IqAvRdEBV3bWta69l6xgF3suKigKFjiUhRpCc/7x8kwCYSWdiaZ7+e6coXcc+bMnXCM8+M85z4hxogkSZIk5bM6aTcgSZIkSWkzGEmSJEnKewYjSZIkSXnPYCRJkiQp7xmMJEmSJOU9g5EkSZKkvGcwkiRJkpT3DEaSJEmS8p7BSJIkSVLeMxhJkiRJynsGI0mSJEl5z2AkSZIkKe8ZjCRJkiTlPYORJEmSpLxnMJKkPBdCGBpCiCGEO9LuRZKktBiMJKkMIYQOxWFh0Y+5IYSJIYR/hhA2TLvPtC3l51TWx8i0+5UkaUnqpd2AJOWozYs/zwHeL1FfC1gfOBo4OISwfYzxk2ruLZdkfk6zgQ+Wse2zVdyLJEnlZjCSpLJl3vC/GWPcteQDIYRd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3PD3LJJ7Xf1jkV1PA3YJIexFcvbv25L3eJIkLR+X0kmStPwywai8QyeOAP5DsvTvaeDPwCnAUSWWCGYGL+wPFJGM9b6JJIxtXXwz25KGkQxveIhkKd8O5exNkvKaS+kkSVpOIYSxwNbAfjHGJ6roNa4CjogxtqmK/UuSyuYZI0mSlkPxTVcz94Ja4aV0K6A78H4V7l+SVAaDkSRJyyHGuCD
"text/plain": [
"<Figure size 840x560 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<sympy.plotting.plot.Plot at 0x7fd5325d3c70>"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot_for_key(r'p_{opt}', (0, 1))"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "9c2bd9df",
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAzoAAAIhCAYAAACG189YAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAABWIAAAViAHE10CgAAB/IUlEQVR4nO3dd3gV553+//ejLoEkBBK9gwSSMMUGU0w1BgzINS5xh2yyyWaT/LLfJJuNvVnjTda72c2mbJxNNsVgxz1OXABTDKYZ40Y1khASRRTRBEJCvT2/P0btyBKoHGmkc+7Xdc01c545Z/SRfCzOrWfmM8Zai4iIiIiIiC8JcLsAERERERERb1PQERERERERn6OgIyIiIiIiPkdBR0REREREfI6CjoiIiIiI+BwFHRERERER8TkKOiIiIiIi4nMUdERERERExOco6IiIiIiIiM9R0BEREREREZ+joCMiIiIiIj5HQUdERERERHyOgo6IiIiIiPgcBR0REREREfE5CjoiIiIiIuJzFHRERKRNjDErjDHWGLPK7VpEREQaU9AREfEiY0xizYf/xkuZMeaYMeYPxphRbtfptqv8nJpafut2vSIi0v0EuV2AiIiPub5mXQrsbjA+CB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biw+WmZnJ//zP/1BcXMywYcNYsGABsbGxrSpo+vTpTY4fPHiQcePGtepYIiIiIiLSPbU36NSek5bZeIe1Ni8uLo7MzM/tatZLL73ESy+9VPc4PDycp556iu9973vtKvIrJ0/y85IS2L8fzp6F/v3bdTwRERE
"text/plain": [
"<Figure size 840x560 with 1 Axes>"
]
},
"metadata": {
"needs_background": "light"
},
"output_type": "display_data"
},
{
"data": {
"text/plain": [
"<sympy.plotting.plot.Plot at 0x7fd5325cac70>"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"plot_for_key(r'\\eta', (0, 1))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b0675f39",
"metadata": {},
"outputs": [],
"source": [
"h = lambda p: - (p * sp.log(p, 2) + (1 - p) * sp.log(1 - p, 2))\n",
"R_sec = R * (- h (E))"
]
}
],
"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.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
}