Created
December 24, 2019 06:14
-
-
Save IvanIsCoding/9254c3b34f837e0b233e148939da833a to your computer and use it in GitHub Desktop.
Superdense Coding, Quantum Teleportation's cousin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 46, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# Superdense Coding\n", | |
"%matplotlib inline\n", | |
"from qiskit import *" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 47, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQwAAACoCAYAAAAVdtDfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAOmklEQVR4nO3dbVRUZQIH8D8zvGkQiQQoKDkCCqOwiNam5suWCp46uUVwzHU3pUCE40v7ofygrMdzaDOXaTu+sB1zPWdraQXxZU9au5aMGrZh+EooKSCOIoKIRQgozH4gqRGRR7x3nhnu//cpn7le/p7gz3Of+8wdF6vVagURkQCd7ABE5DxYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJcZQcgchanT5/u9Zj169cjIyPjnseMHj1aqUh2xxkGkYI2bNggO4KqWBhEJIyFQUTCWBhECsrPz5cdQVUsDCISxsIgUlBCQoLsCKpiYRCRMO7DcBLLPpLzdd+dJ+frkmPiDINIQenp6bIjqIqFQaSg3nZ5OjsWBpGCpkyZIjuCqlgYRAqqq6uTHUFVLAwiEsbCIFJQZGSk7AiqYmEQKWj79u2yI6iKhUGkoF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IVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRMJYGEQkjIVBRML+Dw6izFGbBbcxAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 337.12x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 47, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Step 0: Prepare the Bell State\n", | |
"bell_circuit = QuantumCircuit(2, 2)\n", | |
"bell_circuit.h(0)\n", | |
"bell_circuit.cx(0, 1)\n", | |
"bell_circuit.barrier()\n", | |
"bell_circuit.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 48, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAALIAAACoCAYAAABEx7SVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAInElEQVR4nO3dXUiU2x4G8MePRoM87TxiWaKlZTlTirmL0Mqk3UEjKMqSisAUcvtBVjf7dKESgp0+aCIq5EARnAshbcpzEXRoo6ZNF0p1MJkSxLKxMO0DtlFG6rnw5N5Z7Uad1+X7X8/vchzzEZ4W633f5fx9hoaGhkBkcr6qAxB5A4tMIrDIJAKLTCKwyCQCi0wisMgkAotMIrDIJAKLTCKwyCQCi0wisMgkAotMIrDIJAKLTCKwyCQCi0wisMgkgr/qADQxDx8+/O57zp49i8LCwj99z5IlS7wVSQmuyBo4d+6c6giGY5FJBBaZRGCRNVBdXa06guFYZBKBRdZARkaG6giGY5FJBBaZRGCRNVBQUKA6guF8+Gmc5ubJkz1P8MkeTXlr165VHcFwLLI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wgODobVakVra6vqOJPiX1f/g/Ynz/DLzzsxPTBAdRyv0H5FnjVrFqKiouByuXDz5s0vvv7o0SMFqYzzrLsXrW2PsfrHZWJKDPCuBQDg6NGjyMzMRHp6OjZv3ozo6Gi8ePECTqcTVqsVV69eVR3Ra169+Q3BPwSZ/r7xaNpvLT65ceMGTpw4gaamJrx//x6hoaFYuXIlDhw4gDVr1qiO51WDg4Omf5I3GotMIsj6b0naYpFJBBaZRGCRSQQWmURgkUkEFplEYJFJBBaZRGCRSQQWmURgkUkEFplEYJFJBBaZRGCRSQQWmURgkUkEFplEYJFJBBaZRGCRSQQWmURgkUkEFplEYJFJBBaZRPgfCEKwRCD4EZQAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 216.72x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 48, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Step 1: Prepare Alice circuits depending on b0b1\n", | |
"\n", | |
"# Case 00: the circuit has no gates\n", | |
"alice_00 = QuantumCircuit(2, 2)\n", | |
"alice_00.barrier()\n", | |
"alice_00.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 49, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAN8AAACoCAYAAABg3jtVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAALUUlEQVR4nO3db0zTdx4H8Hdb/t7JbXKN00l0Q0FptUSZy8JUNJseGm+aWeHQeBHJwVXM1C132x4Ic9zVyQg1Rh25BwvJ/SEHtco90GznTiqIyUHY/MOxNXEg6zQO5lyOBPFsew+cXRQ36tYfnx/9vl8Pf/yg71DefL/9/v4ZQqFQCEQ07ozSAY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ABSUlJgNpvR29sr8vqcdsaWSKedyi+43LhxA0NDQ3jiiSeko5BilB/5vvrqK6SmpsJisaC7u1s6zrj489H3cenyFbz62yIkJyVKx1GW8iPf5MmTkZ6ejp6eHpw8eXLU1z/55BOBVNq5cm0Q3b4+LH5qPosnjKudAPbu3YvCwkKsWrUKa9euxaxZs/DFF1+gvb0dFosFR48elY4YNddv/Bepj6bwuJ4OKD/tvOu9997D22+/jY6ODty8eRNTpkzB008/jZ07d2LJkiXS8aIqGAzyjBYdYPmIhPDfH5EQlo9ICMtHJITlIxLC8hEJYfmIhLB8REJYPiIhLB+REJaPSAjLRySE5SMSwvIRCWH5iISwfERCWD4iISwfkRCWj0gIy0ckhOUjEsLyEQlh+YiEsHxEQlg+IiEsH5EQlo9ICMtHJOT/T7kM4Wvy+jYAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 276.92x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 49, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Case 01: the circuit has the X gate\n", | |
"alice_01 = QuantumCircuit(2, 2)\n", | |
"alice_01.x(0)\n", | |
"alice_01.barrier()\n", | |
"alice_01.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 50, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAN8AAACoCAYAAABg3jtVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAALGklEQVR4nO3df2zTdR7H8Vdb9ithp+4aBFlANxishS5Q8TzAwU7RQshpYLIMQwIsGVdK+HW5KBe33cKlHpOjhigu5sAld7ld1q78yGV3eBBWftQ/INMLLNMmy2AWCA6R5JbMoW3vD2QejHN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NaH/k+/LLL5GXlwebzYbOzk7pOaPizwc/QPelK3j1V5XIyc6SnqMt7Y98jzzyCAoKCtDV1YVjx44N+/qnn34qsEqdK9euozNyEQufnM3whPFqJ4A33ngDFRUVWLp0KV588UUUFhbi888/Rzgchs1mw8GDB6UnpsyNm/9B3sO5fFzPALQ/7bzj6NGjePPNN3H27Fl89dVXmDBhAp566ils3boVzzzzjPS8lIrH43xGiwEwPiIh/PVHJITxEQlhfERCGB+REMZHJITxEQlhfERCGB+REMZHJITxEQlhfERCGB+REMZHJITxEQlhfERCGB+REMZHJITxEQlhfERCGB+REMZHJITxEQlhfERCGB+REMZHJITxEQlhfERC/gvzhvWtSshHpwAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 276.92x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 50, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Case 10: the circuit has the Z gate\n", | |
"alice_10 = QuantumCircuit(2, 2)\n", | |
"alice_10.z(0)\n", | |
"alice_10.barrier()\n", | |
"alice_10.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 51, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAQwAAACoCAYAAAAVdtDfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAMjElEQVR4nO3df2yUdYLH8c/M9OcdnEuvQZAGtEChM9IGunoev3uuWginRgo9NFyA5uBKifwwe6uXLZVlr67IdQxRbDYLS7K79rYtRcyGOz08OoA1OQh6C71qE1KsgwSLPzbXpFSZmfsD7Qaq2y/wPP12+rxfif9Mp/TzR33zzDPPPPgSiURCAGDAb3sAgORBMAAYIxgAjBEMAMYI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t/SX3/sLPTj/HttTMMxx0vM6Bw8e1JIlSzR27Filp6dr0qRJevzxx3X69Gnb01zx8cVL+p/2s/L7+VXA4Pgt+dqVK1f0xBNP6NFHH9Xp06f12GOPaePGjZo5c6b279+v8+fP257oirdaTykjPU1zvn+37SlIArwk+VpFRYXq6uq0YcMGhcNhpaT88Zq2aDSq2267TaNHj3blZz/9/M9d+XMBUz/70Vqj53Glp6Rjx46prq5OJSUl2rVr14ATgDk5OZaWAcMLRxiSli5dqubmZr333nsqLCy0PWdIfHzxknbta9YP5hTpB3OLbM9BkiAYkkaPHq3s7Gx1dnZa+fm8JIFtpi9JPH/S84svvlBPT4/uvPNO21OAYc/zRxiff/65srKyFAwG1dbWZnvOkPjVgTd19sOP9aN/XKHMjHTbc5BEPH+EMWbMGOXm5qq9vV2HDx8e8PUPPvjAwir3fHzxkto6zmnu92cQC9ww3iWR9Nxzz6msrEyLFi3SI488osmTJ+uTTz5Ra2urgsGgDhw4YHuiYz774v+U9b3RXHeBm+L5lyTfeOONN/TCCy/oxIkTunz5ssaOHat7771XmzZt0rx582zPc1Q8HufKTtwUggHAGH/NADBGMAAYIxgAjBEMAMYIBgBjBAOAMYIBwBjBAGCMYAAwRjAAGCMYAIwRDADGCAYAYwQDgDGCAcAYwQBgjGAAMEYwABgjGACMEQwAxggGAGMEA4AxggHAGMEAYIxgADBGMAAYIxgAjP0/hvBf1QFAHlQAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 337.12x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 51, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Case 11: the circuit has the X gate and then Z gate\n", | |
"alice_11 = QuantumCircuit(2, 2)\n", | |
"alice_11.x(0)\n", | |
"alice_11.z(0)\n", | |
"alice_11.barrier()\n", | |
"alice_11.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 52, | |
"metadata": {}, | |
"outputs": [ |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iGSI5UxEJEMsZyIiGWI5ExHJEMuZiEiGWM5ERDLEciYikiGWMxGRDLGciYhkiOVMRCRDLGciIhliORMRyRDLmYhIhljOREQyxHImIpIhljMRkQyxnImIZIjlTEQkQyxnIiIZYjkTEckQy5mISIZYzkREMsRyJiKSIZYzEZEMsZyJiGSI5UxEJEP/D1Dg+xmaujjYAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 457.52x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 52, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# Step 2: Apply the inverted entanglement circuit, and then measure\n", | |
"invert_circuit = QuantumCircuit(2, 2)\n", | |
"invert_circuit.cx(0, 1)\n", | |
"invert_circuit.h(0)\n", | |
"invert_circuit.barrier()\n", | |
"invert_circuit.measure([0, 1], [1, 0]) # Qiskit measures are always reversed, b1b0 not b0b1\n", | |
"invert_circuit.draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 53, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAngAAACoCAYAAABzNpM8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAeK0lEQVR4nO3de1xUdd4H8M/McFWQVBRC0ERAYRQvYBoqeFlN21LXSNPW3UoXRX092tp9K2v1Yc1UWrdMe9Jsy/VRgbJn1xskoKkV5A0JxTughLfQJQVxZp4/ZiVHYGaAM/M758zn/XrxeuHhzOGjfmfmM+cyozGZTCYQERERkWpoRQcgIiIiImmx4BERERGpDAseERERkcqw4BERERGpDAseERERkcqw4BERERGpDAseERERkcqw4BERERGpDAseERERkcqw4BERERGpDAseERERkcqw4BERERGpDAseERERkcqw4BERERGpDAse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lWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhlWPCIiIiIVIYFj4iIiEhl/h+NyOoClJBFvgAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 818.72x204.68 with 1 Axes>" | |
] | |
}, | |
"execution_count": 53, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# When merged, the whole circuit looks like\n", | |
"(bell_circuit + alice_11 + invert_circuit).draw(output=\"mpl\")" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 54, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# Now we simulate each outcome, to do so we create an auxiliary function that runs it\n", | |
"def simulate_circuit(prep, encoding, decoding):\n", | |
" \"\"\"Returns the counts of the circuit that is combination of the three circuits\"\"\"\n", | |
" circuit = prep + encoding + decoding\n", | |
" simulator = Aer.get_backend(\"qasm_simulator\")\n", | |
" job = execute(circuit, simulator, shots = 2**16)\n", | |
" result = job.result()\n", | |
" count = result.get_counts()\n", | |
" return count" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 55, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAE6CAYAAAB00gm8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZWElEQVR4nO3dfbRddX3n8fdXIiIrQUyoITeXFEOoThMV9FgBL0+jEYEWeeiALDRNKTCJlYi0XZUZpYZWnGWVQp0ySmqFoJ1BUEFtgIwOMQjh4k06qa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x360 with 1 Axes>" | |
] | |
}, | |
"execution_count": 55, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# For 00\n", | |
"count_00 = simulate_circuit(bell_circuit, alice_00, invert_circuit)\n", | |
"visualization.plot_histogram(count_00)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 56, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAE6CAYAAAB00gm8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZPUlEQVR4nO3df7RdZX3n8ffXRERWgpBQQm4uEUMYmUmkIIcp4OXXSESggwgOyKBpSoFJqERk2lWZChqmYBcKhXFKkbQKQadDQQW1ATJa4qUQgjfpREEniRWQhMuNKcH4AxLA7/xxTtLjzf3xnOT+OMl5v9Y665797Gc/57v/uOuz9q9nR2YiSZIG94bRLkCSpN2FoSlJUiFDU5KkQoamJEmFDE1JkgoZmpIkFRo72gWMpgMOOCAPOeSQ0S5DktREVqxYsTEzf6uvdS0dmocccghdXV2jXYYkqYlExLP9rfP0rCRJhQxNSZIKGZqSJBUyNCVJKmRoSpJUyNCUJKmQoSlJUiFDU5KkQoamJEmFDE1JkgoZmpIkFTI0JUkqZGhKklTI0JQkqZChKUlSIUNTkqRChqYkSYUMTUmSChmakiQVMjQlSSpkaEqSVMjQlCSpkKEp7YEuuugiDjzwQGbOnNnn+sxk/vz5TJ8+nSOOOIKVK1duX3fnnXdy2GGHcdhhh3HnnXdub1+xYgXveMc7mD59OvPnzyczh30/pGZjaEp7oDlz5vDggw/2u/6BBx5g7dq1rF27lttvv5158+YB8OKLL7JgwQKWL1/OE088wYIFC9i0aRMA8+bNY+HChdu3G2h8aU9laEp7oBNPPJEJEy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HQi8IyBKe3I07NSi4iIA4EPR8SVVE/LvhYR3cA9wFcz85e14HwBmD+KpUpNy9OzUouIiDuAGcA3gBeBCcBRwOHAOuAzmblk1AqUdgOGptQCakeQP6f6rtnOurZ24FjgEuCtwAWZuXLUCpWanNc0pdbw74Cnga3bGrLqucy8B/hdqqH6n0apPmm3YGhKreHHVK9j/kVEHBYRv/G/n5lbgTuB00ejOGl3YWhKLSAzXwb+FHgzsAiYHREHR8Q4gIjYBzgJeHL0qpSan9c0pRYSETOBq4GzgF8Cy4CfAqcC3cDFmfn90atQam6GptSCao+fnAmcDbxC9Qjznsz8f6NamNTkDE2pxUXEG+pnBJLUP0NTkqRC3ggkSVIhQ1OSpEKGpiRJhQxNSZIKGZqSJBUyNCVJKmRoSpJU6P8DE6upiSgo+UYAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 504x360 with 1 Axes>" | |
] | |
}, | |
"execution_count": 56, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# For 01\n", | |
"count_01 = simulate_circuit(bell_circuit, alice_01, invert_circuit)\n", | |
"visualization.plot_histogram(count_01)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 57, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAE6CAYAAAB00gm8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZZElEQVR4nO3de7SddX3n8ffXxEhZCUKChpwcKIYwMpOIgJsp4OE2GhHooIILZLQxojCJlYiMncosReMUnEWFgXHKAKkVgkyHincbINUhhEI44SRtFHWS1AKacDgxJRovkED8zh97J253zuW3k3PZZL9fa+119vN7fs9vf59/zmc9t98TmYkkSRray8a6AEmSXioMTUmS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iujfXr2BuDOiFgFPEz17tgO4BaAiFgCkJlza/1vAT4UETcCtwJvBOYBF5eOKamYly2kIYxqaGbm3RExBfg4MA14HDgnM5+qdTmiof8TEXEO8N+pPkLyNLAwM7/cxJiSCtSu90saRGTmWNcgSdJLgnPPSpJUyNCUJKmQoSlJUiFDU2pzERH1fyUNzBuBJP2OXeGZ/nOQ9tB20+hJqoqIlwFvA14FHAhsAh7MzM1jWpjUwjzSlNpQREwCPg+cCfwG2Agk8DzwIHBnZv6/iAiPOKXf8khTak8LgddSnQjksYg4BqhQnXXrLcDrIuL9mfnTsSxSajUeaUptKCIeAr6amTc0tI+jGpyfB36UmW8di/qkVuXds1KbiYjxVKebvCAiXlVrGxcRL8vMnZm5guoczp0R8fqxrFVqNYam1GYy80XgDqovef9oREytheVv6rqtB47El1JLv8PTs1Kbqd01+zLgfcC1VO9t+DJwN/Bj4FjgD4F/k5knjlWdUisyNKU2FhEHU33d3n8AjgN+QfUO2seAz2Rm99hVJ7UeQ1NqIxFxEPCL+sdIakeeBwATgdnArwxLqX+GptRGIuJWYFXt81RmbuunzyGZudVnNKU9GZpSm4iIi4G7gG3As8DfAfcD3wU2ZeZzETER+CLwicz83pgVK7UoQ1NqExGxGNgJXAecD7wXOApYBywFvkN1woObMnPCWNUptTJDU2oDtWcz/zNwUGZ+rK59FnAp8E6q1zUPBu7IzPePSaFSizM0pTYREYcAU2tzyk4AXmi4Iegi4K+BEzLzH8eqTqmVOfes1CYycyuwtfZ9B+y+czYycydwEPC8gSkNzNCU2ljDLECTgE+OVS3SS4GnZyUBEBEvBxqn05NUx9CUJKmQE7ZLklTI0JQkqZChKUlSIUNTkqRChqYkSYUMTUmSCv1/NPXoMPczUOEAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 504x360 with 1 Axes>" | |
] | |
}, | |
"execution_count": 57, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# For 10\n", | |
"count_10 = simulate_circuit(bell_circuit, alice_10, invert_circuit)\n", | |
"visualization.plot_histogram(count_10)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 58, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAE6CAYAAAB00gm8AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAZLklEQVR4nO3dfbSdZXnn8e9lYkBWEjFBQ04OFEOozkqkoNsp4OFtNCLYIoJLZGljisAkVCIydZQZRWMFZ1FgYGypklohyFgqKqgNkGqJoRBOPImNok6StogmhBNTgtGaF4zX/LF34nZzXu6d7HPOTs73s9ZeZz/3fT/3vp4/4JfnPTITSZI0uBeMdAGSJB0oDE1JkgoZmpIkFTI0JUkqZGhKklTI0JQkqdDYkS5gJB1xxBF5zDHHjHQZkqQ2smrVqi2Z+dK++kZ1aB5zzDH09PSMdBmSpDYSEU/21+fhWUmSChmakiQVMjQlSSpkaEqSVMjQlCSpkKEpSVIhQ1OSpEKGpiRJhQxNSZIKGZqSJBUyNCVJKmRoSpJUyNCUJKmQoSlJUiFDU5KkQoamJEmFDE1JkgoZmpIkFTI0JUkqZGhKklTI0JQkqZChKUlSIUNTOghdfPHFvOxlL2PWrFl99mcmCxYsYMaMGRx//PGsXr16b98dd9zBcccdx3HHHccdd9yxt33VqlW86lWvYsaMGSxYsIDMHPLtkNqNoSkdhObOncsDDzzQb//999/P+vXrWb9+Pbfddhvz588H4JlnnmHhwoV0d3ezcuVKFi5cyNatWwGYP38+ixYt2rveQPNLBytDUzoInXbaaUyaNKnf/vvuu485c+YQEZx00kk8++yzbNq0iQcffJDZs2czadIkXvKSlzB79mweeOABNm3axLZt2zjppJOICObMmcO99947jFsktQdDUxqFNm7cyFFHHbV3ubOzk40bNw7Y3tn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A7wJP1Q7Zvgj4W+B/ZubjI1as1KYMTWmUiIhFwG7geuB84N3AscBaYAnwTeAVwC2ZOW6k6pTamaEpjQIRMRb478DEzPxQXftM4FLgbcChwOHAHZn5nhEpVGpzhqY0SkTES4Apmfn/ImIc8Fz9BUERcSHwBeDVmfnPI1Wn1M685UQaJTJzK7C19n0XQES8gOo/nncDE4EdBqbUP0NTGsUy89d1ixOAj45ULdKBwMOzkoDq68KA3Q1BKqmOoSlJUiHfciJJUiFDU5KkQoamJEmFDE1JkgoZmpIkFTI0JUkq9P8BdD/GJbR0/vwAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 504x360 with 1 Axes>" | |
] | |
}, | |
"execution_count": 58, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# For 11\n", | |
"count_11 = simulate_circuit(bell_circuit, alice_11, invert_circuit)\n", | |
"visualization.plot_histogram(count_11)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 45, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"{'qiskit-terra': '0.11.0',\n", | |
" 'qiskit-aer': '0.3.4',\n", | |
" 'qiskit-ignis': '0.2.0',\n", | |
" 'qiskit-ibmq-provider': '0.4.4',\n", | |
" 'qiskit-aqua': '0.6.1',\n", | |
" 'qiskit': '0.14.0'}" | |
] | |
}, | |
"execution_count": 45, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"# The results match our predictions!\n", | |
"# For purposes of reproducibility, the Qiskit version is\n", | |
"qiskit.__qiskit_version__" | |
] | |
} | |
], | |
"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.7.5" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment