##// END OF EJS Templates
fix: changed keyword input field to type password
fix: changed keyword input field to type password

File last commit:

r4637:d919e2ec
r4695:68e011ca
Show More
teleportation.ipynb
167 lines | 31.8 KiB | text/plain | TextLexer
Brian E. Granger
Converting notebooks to JSON format.
r4634 {
"nbformat": 2,
Brian E. Granger
Implemented metadata for notebook format.
r4637 "metadata": {
"name": "teleportation"
},
Brian E. Granger
Converting notebooks to JSON format.
r4634 "worksheets": [
{
"cells": [
{
"source": "<h1>Teleportation</h1>",
"cell_type": "markdown"
},
{
"cell_type": "code",
"language": "python",
"outputs": [],
"collapsed": false,
"prompt_number": 5,
"input": "%load_ext sympyprinting"
},
{
"cell_type": "code",
"language": "python",
"outputs": [],
"collapsed": true,
"prompt_number": 6,
"input": "from sympy import sqrt, symbols, Rational\nfrom sympy import expand, Eq, Symbol, simplify, exp, sin\nfrom sympy.physics.quantum import *\nfrom sympy.physics.quantum.qubit import *\nfrom sympy.physics.quantum.gate import *\nfrom sympy.physics.quantum.grover import *\nfrom sympy.physics.quantum.qft import QFT, IQFT, Fourier\nfrom sympy.physics.quantum.circuitplot import circuit_plot"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$a {\\left|000\\right\\rangle } + b {\\left|001\\right\\rangle }$$",
"prompt_number": 7,
"png": "iVBORw0KGgoAAAANSUhEUgAAAHgAAAAVCAYAAACNDipWAAAABHNCSVQICAgIfAhkiAAAA4VJREFU\naIHt2V2IFlUYwPHf6ootWaxl0GJFhFFSN2ZFFxZbhLBQUV1UkgQRVJcF1UVRvBdFBdEXXZR60QcZ\nEUGFWN0FkRXR52YoSmz0YfRBBIpZZF2cMzCemVnnfXdOarz/mzPnmefMPB9nzpx5hiFDDkPWYumh\nNuIwojEe8we42F14L5GtwX1YgdU4HltrxnalN4MbsWUA+/vlHryIR/Eptifn/4t4wFF4E9vwQ3Ju\nRofx6CX9y7ArGgfHxhtemVmvh9G+LB+ctdhfsim1o0zXfo7iAiG5/8TjOno6ikcv6W/BM4nsCfyG\nhRn1zsFVbY0uMSI8Mf3wtOYnq5f0u/RzHjbhcbxk9gQPGo8KvdLxqnjTqxOdqSi/JJNewf39mQ7G\n8VqfY7YKSa6jVzrO5SfcavYEUxOPebMot2FlbHck8p2xncykV5YvO7iZc2IJluPdFrq5/GxLJR51\nCV6BB/AInsPl+KDhgifGdnci3xPbiUx6BS/j2gbbumKVsKyPYR02CktmXexy+dmWSjzSl/JqPI9z\n8R3Owid4p+GChaF7EnnRH8+kV7AXRzfY1hUXxXYEN8fjaWH3/FCim8vPtlTiUZ6Fpwov8juE5BLe\nPbs1L0/7Yrs/kS9I5F3rFYwJTuXkQuEzaX1Jtl39hiaXn22pxKOc4IeF3durJdlyHKc5wdMN8mIW\n7cqkV3CNsCzlYpHwyno7kS/D4hr9XH62pRKPYokewcV4y4EzYBJ/4sOGC34R28X4pSRfFNsfM+kV\nnCHsE+o4Gy8IvpWZj1PwWc2Ybbiu1D8/6pcn+MJ4300143P52ZZKPIoEn4kTVJ2exEf4A6fh6+R8\nYejJDtwRnhfb6Ux6hO++jzXzpfrv3XE8q1pQqON04b34TUk2JVSV6j61cvjZltp4FEv098KTurN0\nbkxIcFH+uq3mor8Lzk8l8kvxFTZn0iPs7l+vsalLduBb4fuz4AbhQdhYo5/Dz7YcNB6bcW88XiBU\nWX7GnTgptlQrN2uEZWZJ7E/gV6G8l0vvmJI9/dJPoWMUP8X7iTbMCEthQS8Z03U8Cu4WJtoVNeda\nxWNC2PY/JVRtlgo7xfeFCkmxdb+9ZuxNQtAewxu4peEeXeldLyxvg9BvJWslnsQGYdKnf21yx+MV\nfI6/hQTvFX56PFjSmUs8/ncMUqo8YplrqfJI5C+hoD9kyJAhQ4YcSv4FPQ4z7YmdV7kAAAAASUVO\nRK5CYII=\n",
"text": "a\u22c5\u2758000\u27e9 + b\u22c5\u2758001\u27e9"
}
],
"collapsed": false,
"prompt_number": 7,
"input": "a,b = symbols('a b', real=True)\nstate = Qubit('000')*a + Qubit('001')*b; state"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$CNOT_{1,2} H_{1}$$",
"prompt_number": 8,
"png": "iVBORw0KGgoAAAANSUhEUgAAAGQAAAAcCAYAAACXkxr4AAAABHNCSVQICAgIfAhkiAAABNhJREFU\naIHt2HmIV1UUB/DPjE1ZppYU2TatalFEmxW000ILIkUUWUELGrTQRhGlQdFKkW1iBSG2WBFaEpJZ\nNGWm7UZhm0UbbbRHWRQ1/XHuj9+bN+/9fm/G0bbfFx7v3XPOPfe8c+8959xLC/8qjMb5eAjPYQFm\nYSu0YSZGJtnN0IXl6MbLBfrG4u3E78Z7ODAn045jMAf3pGcBrsY6OdmupOdrPJXkvku0dzE/0T9K\ntEv69PfNsScW4tuMHc/j6MSfJPz2W+J/hGexbV8HGoSL8RnOwKgMb3M8jRnCuXlcgNeTAXuV6O/C\nUQX0rbEM0zEkQ+8QC+HdND5sgq+EU/K6f8f6GdoaeBInldizsrhd/O8uJfx38I3eC6oSOrEEH2K7\nEpldkwG3FfBmYe/En1nS/74C2ub4ACeX9Fk72TQntc/B+JzMmlgh7M/jMr0nb6CwDJ+X8DYWvni4\nP4rXwAvCMRs3kf1S71XehgfT9yv4BSNyMiNwS442Uqz+O5qMeY/4uS3SOINy/NpCuK6g76167pqB\nwgZpzFkl/AmJf24VZe259hXYA1OUz3gNy0V4yGJHsVqIsDMYp+Rk9sWiTHuYCCfrVjD6vfTeGfPw\nR46/f3ovLOj7isgvA4390jvvixoOSO8imxpiF/GDy/SeqCIcV0A7U90pQ/C9mLi2jMyN6oUAXChW\n0DUVxrw7yRaNTSTxPzC8gq6Bws3CplEl/OXCD1V82gOXJsUT+21a5IzBmfYtSechGdr9me92fJxk\nxlTQ/3KS3bKANwg/4tXq5g4IluJXsRjyz9PC3nn9UfxY6rzbShj3YK69fdJZS8TDREVSw1aJ/1UF\n3euLnFQWSndPum6qauwAYD2xI/P/XUMtf1xUVWF2G+2JP/FmhX6jC2ijxPbM4i2xSsZhU+yDxRl+\nrR7/oMKYZ4jdN6eEX4vlfY7VK4F9hA8XNeDTT5uWilq5GTZUHO9Pw6EF9GPFKrkc1+oZbnZKvCea\njLkWvhATN7RE5pGka8MmugYS16cxdy7hv46fRPXaZ0xNyjubyF2OjQrod4lKKY8O4cxPMTvHaxeV\nz8965p48rhO794ASfps4JVfZ3Z14oILcBEwWpfhlepfYxBHhB8UJe7gIZ40WW0Nb9hLJ6eIGCk5P\nTxHK4ihcKSb73gLenYl3eEnfC8Rh79QG+ndMOqY3kBkiHHyvevlchiPVz1jteAbTcjLrihuB+SU6\nDk82TV4ZWw4TP3+2OBnXMEaEmyNK+p2ARxvo7RSrZVIBryP1XaznIXILsRvfwA6NjBY/140Tm8jB\nwZpPyFQ8nmmfKw7CWYxPY05poKNb+a6uaouxuEFcgi0QpexkURHlcQTeV78sXCryQhHmKC4GiBxx\nngh7M9IzXdw9rV3SZ6IIB0tEOOsWYfEp5admqjmhU89rlqvwWvqehBdFqOoWVV8Xtkn8acIPvyf+\nO5ir51msL7b859FXJwzFJ6nfKrelz6fH/xnaxU49S1zvrJYBWyjHFHE1MlfktFWO1oTUcZAoMGqY\nKK55XhLxv1GV10I/0CZO+7NFJTlF/XTfIZL0Oal9unqhUnvmrg5bijL/fxkjc+0V4kKSmJTjxY3y\ncL2ru6zsqralBeGgcX+3ES3UcaZWTv1HoV8XgC200EILLbTwT8FfiZEmaAj2TA8AAAAASUVORK5C\nYII=\n",
"text": "CNOT \u22c5H \n 1,2 1"
}
],
"collapsed": false,
"prompt_number": 8,
"input": "entangle1_2 = CNOT(1,2)*HadamardGate(1); entangle1_2\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$\\frac{1}{2} \\sqrt{2} a {\\left|000\\right\\rangle } + \\frac{1}{2} \\sqrt{2} a {\\left|110\\right\\rangle } + \\frac{1}{2} \\sqrt{2} b {\\left|001\\right\\rangle } + \\frac{1}{2} \\sqrt{2} b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23bd\u23bd \n\u2572\u2571 2 \u22c5a\u22c5\u2758000\u27e9 \u2572\u2571 2 \u22c5a\u22c5\u2758110\u27e9 \u2572\u2571 2 \u22c5b\u22c5\u2758001\u27e9 \u2572\u2571 2 \u22c5b\u22c5\u2758111\u27e9\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n 2 2 2 2"
}
],
"collapsed": false,
"prompt_number": 9,
"input": "state = qapply(entangle1_2*state); state\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$H_{0} CNOT_{0,1}$$",
"prompt_number": 10,
"png": "iVBORw0KGgoAAAANSUhEUgAAAGQAAAAcCAYAAACXkxr4AAAABHNCSVQICAgIfAhkiAAABRFJREFU\naIHtmHtol1UYxz+bl5VmZnMm67JRijbJMI0km0XDgsKkDAomWeiKZgZWYhcoqcYKQmohq1bkpT8a\n3YgutrLaTMvSwK62LkgXQwnsZuLssv74npff+Z2d877vfvutHPt94cfL73me97mc5zzPed4DBQwI\nvAB8AXQDfwI7gBbDqwDeBnYb/m/ANmBJL/QfCSwAVgObgDagHbjc8OcAyy35h4GtwF/A38BUj84N\nwAHj08/AKo/MZOBR4BngceBVoBU4LeDnQqOvC9gOvAbsNLRfgI3G9w+Bf4AvY2LuM2Yaww8F+LcZ\n/hU56O1ECT4PGG7oRwAPAA8C+4FznPfGAh8Zm48EdF+NNlORQy8Gms37bjIvQYm8yqOvDbjT8hEy\nSbrBY/vNgF95wXJj+MIAvw3t1jG90NkAHAJuDPCHoGr7HRjm8C4FaoHPDH+U5/2bgOkOrQglfwNK\nug/3o0ovt2ilqJJcPIHW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cW+9AkY4+CIw19MCCv8ecjId3oknGcRRsPfJcH3QMBeY0/HwkBjaX2oVaDDrbBgrj4J9Dz\nlqHfMQodlouB+4Br/2sH/mfExd+ERn4Xc9F02Y2Gjdr+cMz3HTGY4Iu/iMz1jo1jUWuLfmUQvu3N\nFV151jfQ4Iu/G//1/2AZeg47VKMP6gIOE+S7CxVQQAEFFFCAF/8CvQspefa4L7cAAAAASUVORK5C\nYII=\n",
"text": "H \u22c5CNOT \n 0 0,1"
}
],
"collapsed": false,
"prompt_number": 10,
"input": "entangle0_1 = HadamardGate(0)*CNOT(0,1); entangle0_1\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"prompt_number": 11,
"text": "&lt;sympy.physics.quantum.circuitplot.CircuitPlot object at 0x3b9fb90&gt;"
},
{
"output_type": "display_data",
"png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAADFCAYAAABKK3dYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAADWdJREFUeJzt3HtM1fUfx/HXF8UBJQqK5WXctdRKXdk0wYOuTI3maG7Z\n/KOOW5k2N62xNZe1tTlnF7tKSflHlzWFtRpOm+YEFLx0NGM1Z+Qf3qZ2FK/jJsjn90ez6Y9zED5x\n+PI9PB/b9x8+nG/vbweffC9HHWOMEQB0UYzbAwDwJuIBwArxAGCFeACwQjwAWCEeAKwQDwBWiAcA\nK8QDgBXiAcAK8QBghXgAsEI8AFghHgCsEA8AVogHACvEA4AV4gHACvEAYIV4ALBCPABYIR4ArBAP\nAFaIBwArxAOAFeIBwArxAGCFeACw0t/tAdA9Ll68qJKSEp06dUqNjY0aPHiwpkyZoscff1wxMfyO\nQPfjp8rjDh8+rEWLFikrK0uVlZWKj4/XBx98oObmZhUWFuq+++7TunXrdPXqVbdHRZRxjDHG7SFg\np7i4WG+++aZWrFihRYsWKSUlRZLkOI6MMTLGaN++ffrwww/1+++/66efflJ6erq7QyNqEA+PKi4u\n1tq1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0NCg6dOnuzDdnREP9HptbW0qKCjQ5cuX\nde3aNUlSU1OT/H6/Ll686PJ09mpqanTlyhXl5eWFXC8vL5ck+Xy+Hpyq8/q7PQBwJ0ePHtXly5fb\nfb1///7asWOHFixY4MJU/93N+x07duzQwYMH260HAgE5jtNrzzzC3qaVxMbG1k1bKAUFBSY2NtbU\n19e3W2ttbTUJCQlm/Pjxd3zq4dYxhT3zMB76+C+i38MPP6yamhrduHHj368lJSXpzJkziouLc3Gy\nO3Mcp93XjDHas2ePJkyYoISEhHbrhw4dUmNjY6fPOtz488o9D3jCli1bNGnSJMXHx+uuu+5Samqq\ndu7c2evDEc6RI0dUV1en3NzckOtVVVWSeu/9Dol7HvCIESNGKBAI6MSJE2pqatKYMWNC/kb3ipv3\nO0I9opWk6upqSeq99ztEPOAxaWlpbo/QLSorK+U4TofxyM7O1vDhw3t4ss7jsgXoYc3NzaqoqFBm\nZqaGDRvWbr2mpkbBYFDTpk1zYbrOIx5ADzl58qR8Pp/Gjh2r8+fP6+TJk8rJydHnn38u6Z/7Oo89\n9pieeOIJOY6jsrIy5eXlae/evS5PHhr/GBAQYfxjQABwC+IBwArxAGCFR7VAD4jkZ1KSkpIitu+O\nEA8gwqL1mQSXLQCsEA8AVogHACvEA4AV4gHACvEAYIV4ALBCPABYIR4ArBAPAFaIBwArxAOAFeIB\nwArxAGCFeACwQjwAWCEeAKwQDwBWiAcAK8QDgBXiAcAK8QBghXgAsEI8AFghHgCsEA8AVogHACvE\nA4AV4gHACvEAYIV4ALBCPABYIR4ArBAPAFb+B5hQIBisk9TNAAAAAElFTkSuQmCC\n"
}
],
"collapsed": false,
"prompt_number": 11,
"input": "circuit_plot(entangle0_1*entangle1_2, nqubits=3)\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$\\frac{1}{2} a {\\left|000\\right\\rangle } + \\frac{1}{2} a {\\left|001\\right\\rangle } + \\frac{1}{2} a {\\left|110\\right\\rangle } + \\frac{1}{2} a {\\left|111\\right\\rangle } + \\frac{1}{2} b {\\left|010\\right\\rangle } - \\frac{1}{2} b {\\left|011\\right\\rangle } + \\frac{1}{2} b {\\left|100\\right\\rangle } - \\frac{1}{2} b {\\left|101\\right\\rangle }$$",
"prompt_number": 12,
"png": "iVBORw0KGgoAAAANSUhEUgAAAr4AAAAiCAYAAAC5vNpkAAAABHNCSVQICAgIfAhkiAAACOJJREFU\neJztnWmIJVcZhp/MTGaSOJqOy2jaiUwgkTERCVEDKontYIwL6GDEgD9UxAWD4oALQjA0bkh+KJI/\nUUQNisYNQUQCikhcokaDONH8cJ2JZhLiFpO4TNT2x1dF31tdde851ed8t+qe94Gmpqq/qq77zHvP\nPVX3VBUIIYQQQgghpjgL2LXonSgI+fZFvv2Rc1/kOz1y6odcp0dOO9gDXAb8Fjiw2F0pAvn2Rb79\nkXNf5Ds9cuqHXKenaKc7AmquAh4JnJt5X4Qh377Itz9y7ot8p0dO/ZDr9MhpIBsUeGSwQOTbF/n2\nR859ke/0yKkfcp2eIp2GnPEVQgghhBBi9KjjO80VwOmL3omCkG9/5NwX+fZBnvMgrz7Icx5avQ6p\n43u4ZdmTgPcBHwTeAJzdsW6qut8Ar4za6/Hi4bvmauCCluUl+YZ25zVdjmLrlPFNPHzPq1sG3+8E\nvl79XNry++20JTWl5XqeU/DxOq9ubF7b6JPfmu3mMrRubJ775rcmldd529u219xjQdYb8weBE8Cz\nq/mLgbuB8zLXvT9+17Mwdt81b8Vey1rH70vxDVud18xzFFqnjE+z3rE8le/QurH7PhV4c7V+2/t8\nvTGfuo0Ycq5zOYX8XkPrSstvTapcKr/TpPIaur0tXkPv33ZKY+rBNcAPgR9U87cD3wG+hInYyFT3\n02r+9h77vBP4b4/1miyD789jb6hHzPm7pfqGcEehdcr4bFL7LiXjDwPnAPcAvw6oT91GeOS6D55O\nIb1X5bed1LlUfo3UXrPm9zXAJ4GfADcBR2JWjmB94t8HMLFvatmXDeBpmerADgbWiWcv8IUe6zVZ\nBt9g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98jiM4CPNpZtUIicBSDf\nvsi3P3Lui3ynR079kOv0yKkQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEGJQ/B8AaEfHVo5PdAAA\nAABJRU5ErkJggg==\n",
"text": "a\u22c5\u2758000\u27e9 a\u22c5\u2758001\u27e9 a\u22c5\u2758110\u27e9 a\u22c5\u2758111\u27e9 b\u22c5\u2758010\u27e9 b\u22c5\u2758011\u27e9 b\u22c5\u2758100\u27e9 b\u22c5\u2758101\u27e9\n\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500 - \u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500 - \u2500\u2500\u2500\u2500\u2500\u2500\u2500\n 2 2 2 2 2 2 2 2"
}
],
"collapsed": false,
"prompt_number": 12,
"input": "state = qapply(entangle0_1*state); state\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [],
"collapsed": true,
"prompt_number": 13,
"input": "result = measure_partial(state, (0,1))\n"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$\\frac{a {\\left|110\\right\\rangle }}{\\sqrt{a^{2} + b^{2}} \\sqrt{\\frac{1}{4} \\lvert{\\frac{a}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2} + \\frac{1}{4} \\lvert{\\frac{b}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2}}} + \\frac{b {\\left|010\\right\\rangle }}{\\sqrt{a^{2} + b^{2}} \\sqrt{\\frac{1}{4} \\lvert{\\frac{a}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2} + \\frac{1}{4} \\lvert{\\frac{b}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2}}}$$",
"prompt_number": 14,
"text": "a\u22c5\u2758110\u27e9 \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \n \u2571 2 2 \n \u2571 \u2502 a \u2502 \u2502 b \u2502 \n \u2571 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \n \u2571 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \u2571 \u2502 \u2571 2 2 \u2502 \u2502 \u2571 2 2 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \u2571\n \u2571 2 2 \u2571 \u2502\u2572\u2571 a + b \u2502 \u2502\u2572\u2571 a + b \u2502 \u2571 2 2 \u2571 \n\u2572\u2571 a + b \u22c5 \u2571 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2572\u2571 a + b \u22c5 \u2571 \n \u2572\u2571 4 4 \u2572\u2571 \n\n b\u22c5\u2758010\u27e9 \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\n \u2571 2 2 \n \u2571 \u2502 a \u2502 \u2502 b \u2502 \n \u2571 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \n\u2571 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \n \u2502 \u2571 2 2 \u2502 \u2502 \u2571 2 2 \u2502 \n \u2502\u2572\u2571 a + b \u2502 \u2502\u2572\u2571 a + b \u2502 \n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \n 4 4"
}
],
"collapsed": false,
"prompt_number": 14,
"input": "state = (result[2][0]*2).expand(); state"
},
{
"cell_type": "code",
"language": "python",
"outputs": [
{
"output_type": "pyout",
"latex": "$$\\frac{a {\\left|010\\right\\rangle }}{\\sqrt{a^{2} + b^{2}} \\sqrt{\\frac{1}{4} \\lvert{\\frac{a}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2} + \\frac{1}{4} \\lvert{\\frac{b}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2}}} + \\frac{b {\\left|110\\right\\rangle }}{\\sqrt{a^{2} + b^{2}} \\sqrt{\\frac{1}{4} \\lvert{\\frac{a}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2} + \\frac{1}{4} \\lvert{\\frac{b}{\\sqrt{a^{2} + b^{2}}}}\\rvert^{2}}}$$",
"prompt_number": 15,
"text": "a\u22c5\u2758010\u27e9 \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \n \u2571 2 2 \n \u2571 \u2502 a \u2502 \u2502 b \u2502 \n \u2571 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \n \u2571 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \u2571 \u2502 \u2571 2 2 \u2502 \u2502 \u2571 2 2 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd \u2571\n \u2571 2 2 \u2571 \u2502\u2572\u2571 a + b \u2502 \u2502\u2572\u2571 a + b \u2502 \u2571 2 2 \u2571 \n\u2572\u2571 a + b \u22c5 \u2571 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2572\u2571 a + b \u22c5 \u2571 \n \u2572\u2571 4 4 \u2572\u2571 \n\n b\u22c5\u2758110\u27e9 \n\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\n \u2571 2 2 \n \u2571 \u2502 a \u2502 \u2502 b \u2502 \n \u2571 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \u2502\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2502 \n\u2571 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \u2502 \u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u23bd\u2502 \n \u2502 \u2571 2 2 \u2502 \u2502 \u2571 2 2 \u2502 \n \u2502\u2572\u2571 a + b \u2502 \u2502\u2572\u2571 a + b \u2502 \n \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 + \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \n 4 4"
}
],
"collapsed": false,
"prompt_number": 15,
"input": "state = qapply(XGate(2)*state); state\n"
}
]
}
]
}