decompose.ipynb
280 lines
| 53.9 KiB
| text/plain
|
TextLexer
Brian E. Granger
|
r4634 | { | |
"nbformat": 2, | |||
Brian E. Granger
|
r4637 | "metadata": { | |
"name": "decompose" | |||
}, | |||
Brian E. Granger
|
r4634 | "worksheets": [ | |
{ | |||
"cells": [ | |||
{ | |||
"source": "<h1>Gate Decomposition</h1>", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [], | |||
"collapsed": true, | |||
"prompt_number": 1, | |||
"input": "%load_ext sympyprinting" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [], | |||
"collapsed": true, | |||
"prompt_number": 2, | |||
"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" | |||
}, | |||
{ | |||
"source": "<h2>Example 1</h2>", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"source": "Create a symbolic controlled-Y gate", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$C_{1}{\\left(Y_{0}\\right)}$$", | |||
"prompt_number": 3, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAADcAAAAYCAYAAABeIWWlAAAABHNCSVQICAgIfAhkiAAAAxZJREFU\nWIXt2EuoVlUUwPHfvb6KW3aLwgd1UySvNAgfGYJpBQ5CwhCCBmrq4KKENXBQ0WMWESIRohMRH1yp\nIKJEMGgQQoWIID2wBBU1xAi0p2mhlYO1Pzz33PP6PrMG+YfDx9l7PfZjrbX3+fgfMxVr8S4+w0d4\nC5PRhR0Y34Hdtfgaf6fnFNYVyC3BX0nmN2zvwNcwRuAFnMbTuCfTdxf2YhsOt2GzF0/l2naJgS+q\n0PsA6zGqoO9ZdLcxBn3YhxOYViIzMw1qY0ObYzGIW3LtTyQ7O0v0VohdLuMRvNlwDEZiP45jQo3s\n91jc0O42TC9ovwE/4xx6cn3zsaGB7a1iB2t5Tazk0gayn4pQq2M6dlf0b00+l2TapuAdsdh13CbS\n48YqoRn4E4c0i+MnG8jA23ison+BmNye9N6L9zVbuBavYmWVwEvJyUAbRusYiTMi58roFoXrIiaK\nxZjSpp+lIp1K+VBMblabhquYiy8ayL2RfB8SudYu9+OSijD+QYRlZewmpjZ0usyVcKtikZjciw3t\n5rk56U/KNmZz6yR+woUaQ3eoie8M45PNOmam3yYLUcSv+A53Zxuzk9srKk9fjaE1hp8tfaK65Rmt\nWcWbLxbhy4K+CXgOq5PfiSU2zuGmMgdz8Lu4mZSxKj0tevCyOISPFsgPqM+5UTiv/LjYhYczYywq\nHKNFQZpd5ejR5OgZQ3OvH69jYYneAsWTW5jsdVX4nCfy5fmCvn5RC0ak9y5xebgvJ3dvsnFnhR/E\n7NfjE3FR3iF2Z3KFTtnkbhVVbFJB3zKxC2fTwE7iY0Pz5nF8k9P7HMtzbYtxLO+gKB8OpOef4Ecx\ngX5xV80ymJ4qbhc7n+WC4XfUaeIoG0JbN+oO2SwuyJ1wXOxqlh4Rqi26xVGyJa/8b0xuUFwMHupA\n96A4erKMw7eZ9zU4IsL1mlCWcy1miVAf04Htw658T84Qx0VrU/rwlfLj4aroEh+z74nceEX59elB\nxRWxjtli91dgEx7I9G1SUeiqSnRT8n8znMcvJbJj8EeHfop0r8beda7zX3AZgzubCkf7gz4AAAAA\nSUVORK5CYII=\n", | |||
"text": "C \u239bY \u239e\n 1\u239d 0\u23a0" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 3, | |||
"input": "CY10 = CGate(1, Y(0)); CY10\n" | |||
}, | |||
{ | |||
"source": "Decompose it into elementary gates and plot it", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$S_{0} CNOT_{1,0} S_{0} Z_{0}$$", | |||
"prompt_number": 4, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAIgAAAAcCAYAAAC6TfcHAAAABHNCSVQICAgIfAhkiAAABglJREFU\naIHtmn+slmMYxz9v5zjntJLTcaIiTURpxPphNVFMdljlN/1hTNootBSlmjIRE6ZVSGTTVKsIbf04\n8zNkRs2vP9CEqCX9GFEn6fjjez/e+zzv/fx4n/d5S/V+t7Oz576u+7qv+3vfz31f1/W8UEIJCVEO\n3A3MBxYCy4BhQAtgeQJ7/YApwErgXeA94FGgJdAaWGTpDgbWAL8CjUbPjxHAFiPfB3wGVPt0WgJj\nje9zgaVm/GEOvT+MrR+AVca/v03bx6bfGmCHaesbc975Ig3eK8j6+Q+wEXgLzWEl8IuRjUrqZHPj\nzCSgmdV+P/CNcTwuWqPJrgduBNpYsv7ACuBD4FlH34VowX4DKh3yY4FNQEeHbLCRDafpHNoA3wKv\nW+1DgU+BdpZeJbDXtNuoQeR3cIxZKNLi/VK0MaaSy1tfYA+wBMgkdXQx8HyAbDNwW0w7A9BurUeL\n6cI9aDdf62svQ4RMMPKbHH1PBJ50tF8GbAW6BYx5trE5wjwvMLZs9DM60xz9l1MAuSFIi/engdsd\n7Z3Ry7YWqMrbO4Pj0JE9MEC+Cjg1hp1TgJ3AG8AxIXpd0W4/3tfeAxiPFm4f8JGj73XAlb62/sBf\nwPUR/m0BvkMbd55DPhFtkDqHbH6E7SRIi3fQ9ejnvBbNdwNNT/G8cQUiZmSAfFIMG2XA+2jCUZOq\nRPGDH6PJ3vMLjU/dfTozaLqxeqBYYnEMH9cAB9Ap09shXw3sB1o5ZLfEsJ8v0uAdFKvc4GurQi/Y\nduCMRN5ZqEXENADTgQsIPwFcGIUm64or/KgArnK0z7fGvSjA3iu+51VG75IY4242urUOWT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voTbLEhrdij5P16GU\nry2qYDYktHe4oT1wK0qFz0Q8bkNBeE/0660VqB6RJlfF4D3UZqE/esmgL477CrRzuKGCbGbgYRfZ\no74j+oRQb8nT5KoYvB+ta3lIcDWH/jtOKkgag5QQjCp0umw/1I6U8P9EhuSxXQkllFBCCSWUUEIJ\nwL9xjqSsQYpqzQAAAABJRU5ErkJggg==\n", | |||
"text": "S \u22c5CNOT \u22c5S \u22c5Z \n 0 1,0 0 0" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 4, | |||
"input": "CY10.decompose()\n" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"prompt_number": 5, | |||
"text": "<sympy.physics.quantum.circuitplot.CircuitPlot object at 0x2c85f10>" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAQ8AAACOCAYAAAAvtI33AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACT5JREFUeJzt3EtIVH8YxvH32DCjleCFLhhoGBRBEGFEEFmLSMzSLLu4\nkGhTUFItui2sIIqiFkEUFaUuwqg2brqH1SK6/BehdLEL2t0wKmy6p/b+d5HlqPN69MyM3w/M5pwz\nP57feeNpjoM6qhoUkUQBgDA4qqpehwAQfeK8DgAgOlEeAEwoDwAmlAcAE8oDgAnlAcCE8gBgQnkA\nMKE8AJhQHgBMKA8AJpQHABPKA4AJ5QHAhPIAYEJ5ADChPACYUB4ATCgPACaUBwATygOACeUBwITy\nAGBCeQAwoTwAmFAeAEwoDwAmlAcAE8oDgAnlAcCE8gBgQnkAMKE8AJhQHogqz58/l0ePHomqeh1l\nwKM8EBWamppk8uTJMn78eMnKypLRo0fLnTt3vI41oDlKhSMKZGVlSV1dnbS3t/8+lpycLE1NTRIf\nH+9hsoGLTx6IeE+fPpX6+voOxSEi0t7eLhcvXvQoFUJ+8nAcp7+zAIgivlA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KamSkJCguzbt0+mTp3qdUSTjRs3\nSk5OjpSWlsqBAwdk0KBB3b7n4MGDcurUKbl582Y/JHRHtM+Pv+fhwZq9EWt/EyKUlpYWKSwslKFD\nh8qOHTtk4sSJv8/9mfv58+eyZ88euXz5spw/f17GjBnjVeRuxdrsYvaxBdEtKSlJLly4IFOnTpW5\nc+fKtGnT5NixY3Lp0iURETlx4oTk5+dLVlaW+P1+uXHjRkQXRyzik4cHa/ZGrP3v1RNtbW1y5swZ\nOX36tLx9+1ZqampkwYIFkpeXJ0uXLpXBgwd7HbFHYm12lIcHa/ZGrP0DHEhibXY8tgAwiblvWxzH\ncXW95ORkV9dzg1t7jMS9xbpYml1MPbYA6D88tgAwoTwAmFAeAEwoDwAmlAcAE8oDgAnlAcCE8gBg\nQnkAMKE8AJhQHgBMKA8AJpQHABPKA4AJ5QHAhPIAYEJ5ADChPACYUB4ATCgPACaUBwATygOACeUB\nwITyAGBCeQAwoTwAmFAeAEwoDwAmlAcAE8oDgAnlAcCE8gBgQnkAMKE8AJj8DwAon3puf4mgAAAA\nAElFTkSuQmCC\n" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 5, | |||
"input": "circuit_plot(CY10.decompose(), nqubits=2)" | |||
}, | |||
{ | |||
"source": "<h2>Example 2</h2>", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"source": "Create a controlled-Z gate", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$C_{0}{\\left(Z_{1}\\right)}$$", | |||
"prompt_number": 6, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAADkAAAAYCAYAAABA6FUWAAAABHNCSVQICAgIfAhkiAAAA1JJREFU\nWIXt2FuIVWUUwPHfNOMMXZjR0pp5qLBoxqgH04rIQEnoMkQQXYToYsJkRBFEpBURBYm9GdRDPiQy\nUEQvRZQihD50E8EuUEZBWg9O9wtZmW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VORK5CYII=\n", | |||
"text": "C \u239bZ \u239e\n 0\u239d 1\u23a0" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 6, | |||
"input": "CZ01 = CGate(0, Z(1)); CZ01\n" | |||
}, | |||
{ | |||
"source": "Decompose and plot it", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$H_{1} CNOT_{0,1} H_{1}$$", | |||
"prompt_number": 7, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAHwAAAAcCAYAAACj6tvkAAAABHNCSVQICAgIfAhkiAAABWZJREFU\naIHtmmtsFUUUx39FoAg+QKiSqtxGULCAqEAk1mINPj6IGJGEDxBBER/1kWAkBmPUqISYGKL4qApG\nHsHY+Pogii2oBVFRa1KxKPVF1EggJGAVCeDzw3/W7t07s7u3dy80dH9f5t45s2dm58ycOWfuhZQU\n4A1gG/Av8CfQAiw1sgzwPvCLkf8GfAbclof+Y4GZwNPARqABaAKmGfllwHxf+yeBzcBfwN/AORad\na4H9Zkx7gcWWNiOA54BXgGXA20A9MNoxzllG30GgGXgH+NrU/QqsN2P/HPgH+CbknTtLsW3xPxOM\nkicc8gVGPr0TetvQoGuA3qa+D/AY8DiwD7go8Nwg4AvT57MO3bPRBJUE6nsAdeb54GKZghbKdRZ9\nDcD9vjFCxyK43dL3u45xFUqxbJHFfKPkCoe8Ae22AXnoXAgcAu50yI9BK/R3oFdAdg0wA9hq5Mdb\nnr8LGBuoK0GLay1aVDYeRbuj3Fc3EHmCIC+geRkeqB+CFlUxKIYtcliDjNPPIuuFdmFLHvpq0aBn\nRrRbCLxlqV8MnAbcYfTUWtqsRIvGzxLk8gaF9DnJ6HzAVzcX+wR/C+y01I8F5oX0UQhJ2yKHHugc\n/NAhvxBN0JKY+kYit9kUo+0c7BPn7bYTgT+ALwPyEmBVoO5hM86rI/rMmHav+epmoXnwU27a2Xb+\nSGB8RD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Q\n/ceLYs5XqO6k7oT7oBTLzx6yI+/uQCnZ0Tpojm9Af5zwKOZ8pbboAtx0pAeQcvioRpckKd2EpOKk\nlJSUlJSUlG7Mf20dXidP7IWnAAAAAElFTkSuQmCC\n", | |||
"text": "H \u22c5CNOT \u22c5H \n 1 0,1 1" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 7, | |||
"input": "CZ01.decompose()\n" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"prompt_number": 8, | |||
"text": "<sympy.physics.quantum.circuitplot.CircuitPlot object at 0x472d550>" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAANcAAACOCAYAAACi/J2KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAB1NJREFUeJzt3U1IVG0bwPHrTI9Zk2VZk5CLKKiRXGiUC5nyYxOVVAiR\nUqsKDMYWtYn2LSJpq7XKoXbZIoJSNDQsozADN9GmNFtUQwb2oVbOXM/qid7XGdPJyzNz5v8DN97N\n6Tre/p07ncpR1c8islIALChHVdXtIQAv8rk9AOBVxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAj\nxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAjxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAjxAUY\n8URcBQUF4jiO2VtBQYHbt+hpXt0/T/xb8Y7jiOVtWF8/23l1//5Z9N8RC05V5fHjxxKJRGR0dFSm\npqYkPz9fKioq5OTJk7J+/Xq3R8xKnjgWZitVlUgkImVlZXLixAkpLi6Ws2fPSl9fnxw/flxevXol\nwWBQjh07Ji9fvnR73OyjHjDbbdTV1WlxcbE6jqM5OTlaVlamjY2Nqqo6MjKiNTU1WlRUpI7j6KpV\nq7S8vFxbWlrmfH23TE9Pa2Njo5aWlur9+/c1Ho//Wvt93k+fPumlS5c0EAhoT0+PG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iGtr6/X9+/f/8/a7/PG\n43Ht7u7WDRs2aGtr62KPOSde3T/+smQaXD9VU1NTcu7cOblx44bs3btXTp06Jdu2bZPCwkIZGRmR\nu3fvSmtrq8RiMWlubpYDBw64PXJCXt0/4kqD6/+t8fFxuX79urS1tcnbt2/l48ePUlRUJBUVFRIO\nh6W6ujrpt7vTgVf3j7jS4PoLjXkX9/rJePYbGoDbPPPaQstjTyb8wDXTeXH/PBFXJh2BMJNX949j\nIWCEuAAjxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAjxAUYIS7ACHEBRogLMEJcgBHiAowQF2CE\nuAAjxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAjxAUYIS7ACHEBRogLMEJcgBHiAowQF2CEuAAj\nxAUYIS7ACHEBRogLMEJcgBHi8pBYLCZdXV0iIvL69WuXpwFxecS7d+9k69atcvjwYRERKSkpkfPn\nz7s8VXZzVFXdHgJ/7+DBg9LR0SHT09O/3uf3+6Wrq0tCoZCLk2Uvnrk84v/DEhGZnJyU9vZ2lyZC\n0mcux3EWexbAU/5JtsBpMbM0NTXJtWvXZGpq6tf7/H6/PH/+XILBoIuTZS+OhR5x+fJlqa2tldzc\nXMnLy5P8/HyJRCKE5SK+oeEx0WhUotGoBINBycnJcXucrEZcgBGOhYAR4gKMEBdghLgAI8QFGCEu\nwAhxAUaICzBCXIAR4gKMEBdghLgAI8QFGCEuwAhxAUaICzBCXIAR4gKMEBdghLgAI8QFGCEuwAhx\nAUaICzBCXIAR4gKMEBdghLgAI8QFGCEuwAhxAUaICzBCXIAR4gKMEBdghLgAI8QFGCEuwAhxAUaI\nCzBCXIAR4gKM/Avn+MC2/OP35gAAAABJRU5ErkJggg==\n" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 8, | |||
"input": "circuit_plot(CZ01.decompose(), nqubits=2)" | |||
}, | |||
{ | |||
"source": "<h2>Example 3</h2>", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"source": "Create a SWAP gate", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$SWAP_{1,0}$$", | |||
"prompt_number": 9, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAE8AAAAcCAYAAAAgLuLfAAAABHNCSVQICAgIfAhkiAAABDdJREFU\naIHt2HuIV1UQB/CP7ur63DRre/0RuET2QHpQ0sO0skhJwhJKoiiVIAiDpDAqwYwsih5Y9KSo7EVG\nUVErbiXawyikCI0okvKPyNI0rVxbsz/m/Ni71/v7/W4+SnS/cDnnzJwzM2fuuTNzLj3YI2jEDCzA\nS3gd0zAQ76AdHdiOTizH4LR2Fr5PvO34HFdmZF+FtYm3GXeWsOc1TK3B74NF+DbJ3YDFaMMyfIe3\ncGIJXbuE/knRreidod+Mr4Uz4e5k6JMFMloT79UqOk7FxxhUwp6Lk6zZJeZemOZen6P3wePYgnNK\nyKmL3lXoz+JH3IG/M/R54nS1p/Ha1G4pkNGU2r5VdFyUns11bByI21P/0DpzYXRq23P0vzA32TW9\nhJy6KHLeAWJTr1RZ8yXeTf11NWTPSO2wAt7x+EmX82vhNjyQ+mWcNwbrsaqANyC1h5WQUxdFzjtT\nHPGjqqxZhtWpv77KnHH4BpsUO+9aPFLCvmPE5/+M+BTrOW8gTsaHaX4eo1K7oITuncJBIgF04F5d\nzizCGcLIhzK0JhEv+won/5xbMwkTStryNoan/joR9GvhvGTPTQW8BnyVbBpcwN9tuFFXJq1kxIcx\nJDdvhB2dNxsTU/8z8SJ6pXET5pe04XIRoypYhT/qrJmb7Dk9Rz9CVAsLRVja4xiBOViKrcmohbk5\nLbo7rxVvZPiLEn9oGs/E0SV0N+MTXTEK3kuyam1+KbaJ7P9oep5O+xhXQu8ewXH4QWSsfhl6o+7O\nezPNreCFxG8VQXpOSX0PYnKO9mKSVc35/UTW/7Skjl1GPmHMqjJvJZ4XxvfK0DuxMfUni8J4ZYb/\nS2qH4QbcV8KmEzBFlBNtmee0xK+WNEaJsLCkhI7dgsZMfxDG4q4qc5uxAn/m6OtEAJ6Nswt4MF4U\n1xvVRi/h4DEiuGcxUySwas47K7VL6ujog8dEDVsvARHha5KoHI4U+8z7wHhxkloLBLSIuizvHOIz\n6dBV12VxnTity1UvyLOYJpJVES5VfHOooF3Y31xD/lRRcHcKp9RDg0hUh6TxdDxVNPEeUZstxLEZ\n+nCx+ZlVFLQlBY0FvCliw6MLeHlcIOJqQxX+uUnWvAJeM34X2b0MtijnvEvwUWbcIk7dgPzE53Cg\nOF2LxYlqExfyfOrP4gmcX4U3JsmthZPES6uURct1fxH98b4IAdvxWxqPTM8yrEm8TfhAlDm1UNZ5\nt9jxptUpCvH9FmWdd7+43WSxSfqxUCYO7c9Ybcdr3gDpWtrjvNpYIeJcBS2iIljz/5izd6Dosx2J\nw3O0QeLXXCVBXIGXK8xqmW1fxQTxF3uscMwQfJF483GZ7gluqzhl14gb0inilrThP7F2L8NQUWRX\nnoMzvAZcXWNtU55QVJvty/i1Bm+b2v7o2M227FOYKK5fPdgJ7G9fYQ960IMe/Cv8A97G6Y4Q7MLo\nAAAAAElFTkSuQmCC\n", | |||
"text": "SWAP \n 1,0" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 9, | |||
"input": "SWAP10 = SWAP(1, 0); SWAP10\n" | |||
}, | |||
{ | |||
"source": "Decompose and plot it", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"latex": "$$CNOT_{1,0} CNOT_{0,1} CNOT_{1,0}$$", | |||
"prompt_number": 10, | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAOQAAAAcCAYAAABxlhP5AAAABHNCSVQICAgIfAhkiAAABThJREFU\neJztm3uIVUUcxz93t01ta0PD2h7uZqQGWWRgSvZ+K0QEYUQPemCREj0kkLTAiEoIAwuWipDNsqRa\ngghCxY0sLXAVC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yssO2/Nqm5uQdzHyh+ztKeVP1zI6UnyagWXahr4UP5A/rj9iaAfvDWQ2LlPvWmX13yRL17xawaGv\nV5Fjq4KrtIH3IE8vlJmGhATzEvLdCLyd0og2ZMv4ToetSfNuofKP3nZk1vwUWXCnsQwR7aYMP4DL\nyBbtBeTpizK3IM8ymtSzVj79t0nTtVatYHToVaaosVXBTOApYLM6dmqjJjt85wFfMvRA7w4kdnfR\nRfKifQxwPxKarNZPB/J84LiEPAuQ9cFWJOQYQEKXTcgjVkn4iLYZWbeYefY5/OpVK9/+Y/mk6VqN\nVjC69CpT5NgKBh/RdgE3GOdzgL9HrEWHHrX030fXeif32PJ5ciJE+pFZsUwz8ONBasvBIPT+jySp\n2sYb0s124FjjvBV56iMUQu//SJKqbbwhh7gU2QQAeTPhEsN2Jem7bPVGVv9NrSLZeI8t+xWTeqaE\nPJExH3nvrjwZ7UHE6gF+QwTrRd5OOAM4F9nFW0llqFHPpPXf1ipN11CIY6tGWq1Pi2FrQragTRqR\nd/lCJan/tlZpuoZCIWMrtMG2N8V2DMPfabPfiQuNpP7bWqXpGgpxbBXMIuKa2peoVXVEvWogtGgh\nD1Gr6oh6RSKRSCQSiUQikUikcP4DcImNVwb6bzMAAAAASUVORK5CYII=\n", | |||
"text": "CNOT \u22c5CNOT \u22c5CNOT \n 1,0 0,1 1,0" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 10, | |||
"input": "SWAP10.decompose()" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "pyout", | |||
"prompt_number": 11, | |||
"text": "<sympy.physics.quantum.circuitplot.CircuitPlot object at 0x7f082c973650>" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAANcAAACOCAYAAACi/J2KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACrlJREFUeJzt3WtoU/cfx/FP/k5MU7v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H\nJSJSW1srb7zxhiQlJUlBQYFUVVUJAKmqqpJ169ZJYmKivPnmm1JfX2/0qPQvLpdLPv30U3n22Wfl\n5ZdfluLiYjl+/LgAkIqKCpkzZ46MGDFC1qxZIzdv3jR63H4i8j2XNxcvXkRxcTFaW1tx9OhR5OTk\nYPz48Vi2bBnGjRtn9Hjkh9vtxpEjR1BZWQmHw4G6ujrk5uYiJycHeXl5sFgsRo/oVdTERRRqEfc9\nF9GTgnERKWFcREoYF5ESxkWkhHERKWFcREoYF5ESxkWkhHERKWFcREoYF5ESxkWkhHERKWFcREoY\nF5ESxkWkhHERKWFcREoYF5ESxkWkhHERKWFcREoYF5ESxkWkhHERKWFcREoYF5ESxkWkhHERKWFc\nREoYF5ESxkWkhHERKWFcREoYF5ESxkWk5P8CkGbXih06iwAAAABJRU5ErkJggg==\n" | |||
} | |||
], | |||
"collapsed": false, | |||
"prompt_number": 11, | |||
"input": "circuit_plot(SWAP10.decompose(), nqubits=2)" | |||
}, | |||
{ | |||
"source": "<h2>All together now</h2>", | |||
"cell_type": "markdown" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [], | |||
"collapsed": true, | |||
"prompt_number": 12, | |||
"input": "gates = [CGate(1,Y(0)), CGate(0,Z(1)), SWAP(1, 0)]" | |||
}, | |||
{ | |||
"cell_type": "code", | |||
"language": "python", | |||
"outputs": [ | |||
{ | |||
"output_type": "display_data", | |||
"latex": "$$C_{1}{\\left(Y_{0}\\right)} = S_{0} CNOT_{1,0} S_{0} Z_{0}$$", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAANMAAAAcCAYAAAD7uYq4AAAABHNCSVQICAgIfAhkiAAACC9JREFU\neJztnHmsFdUdxz/3vecTRBFxATdcoKLGBdkios81ihaJNkYMSwXXilurNZRaUvcF16jEJRU1bKZo\nLJpWxC5UBRVcUIu7glqraIN1xYr4/ON7JnfeuXNmzp177sWW+SSTx51z5jfnfucsv9/vzAUKCgoa\nwi7AecAcY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XNlz0cblGjQw\nF5vv+oFDg4tQJ4syZ6PQxu/XKLb60HG/NLL0Cql9d6RVM7A38JSp1x3YmfKAmVOFzcR4Zok5QvAJ\nWgr7UjmYppsjjS3QrB1nNZXv+O2K0sz1JnqTGDQbpuHbdqhe8xVUrnAurs4on2UOXxahWCs0WXqF\n1H4Vnhm6Kmw25I3rO1CAl4flVGZnuiAxIppQav13Oe9RL3zaXlAmpF710D7TZiMG03S0KXlgjmuf\nQ2nhOD3omPk6C7lES3O1rn74tL2gTEi96qF9w55nVnA5ALkx9guFPrxK+bc9kX8aTQK9UCZpmxx2\nG0Fa29c3XH1kIHKhIKxe9dC+rs+zhBIH9yN/cjLu14H2Jzljl8UgtLqNQz8vGBwrm4re0/qhktb2\n9YWsPjIf+L35d0i96qF93Z9nT+tIe9kxz8qUdm0t9hrJ/0o760VaH2lBnTNOSL3qof36/jwLfqA0\nAaes60YUFPw/cDz6T1AKCgpqpNE/mykoKCgoKCgoKCgoKChYB3wPhhtkbtASAMcAAAAASUVORK5C\nYII=\n", | |||
"text": "C \u239bY \u239e = S \u22c5CNOT \u22c5S \u22c5Z \n 1\u239d 0\u23a0 0 1,0 0 0" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"latex": "$$C_{0}{\\left(Z_{1}\\right)} = H_{1} CNOT_{0,1} H_{1}$$", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAMkAAAAcCAYAAADLNZuZAAAABHNCSVQICAgIfAhkiAAAB21JREFU\neJztm2lsFVUUgD9oKauVKiAlIpsWiIQgAgGqoYCIVgOissQINkRERSUaUASFoGFJwIBIIqLSYJWm\n1kQSgYqVRRZZlBJwQ0VRQRDc6goqiz/Onb73pndm7rw3U0qYL3k/3pz7zl3OnXvPOfc+iIiISIkc\n4BGgFNgKvAOsANoBdYDlQMsA6hkHnFGfP4DdwNvqs049rwQyA6graEYhY3Mcaech9b27ks8GPiDW\nv31In+onUZcfe/QDNgHfq3pf0ui7Azio5CeBvcBltjINgAnASm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kD4X+c/E0SR1nw3c+nM+4DZ3LkduNe9A/rAV9li56nfKVPilDpIu9Noq6yNZl2TI\nInEnOgX8GIDes4Vbf84nnOZOJrK7lBL+WEW2iDgnGYDsKGedVGOSiIgwqIvcmth/thsSEVGbcTro\njIiIiIiIiIiIiIiIOK/4H2GZIPTJUTibAAAAAElFTkSuQmCC\n", | |||
"text": "C \u239bZ \u239e = H \u22c5CNOT \u22c5H \n 0\u239d 1\u23a0 1 0,1 1" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"latex": "$$SWAP_{1,0} = CNOT_{1,0} CNOT_{0,1} CNOT_{1,0}$$", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAUYAAAAcCAYAAAAdtRbVAAAABHNCSVQICAgIfAhkiAAACMVJREFU\neJztnHmQFcUdxz8rl4AuIIpGTUApSwIJ5RlNPDDe4lVGq6KFQSJRS0Qtg0mMWmoOQjzKRBBFQUnE\nI5Say4QjELMCGhS0vNDyKPEIKsGNihesmM0f3568mZ6emX67D/cd/al6Ne919/Txnd909/y650Eg\nEAgEvOkOXADcCfwO+CMwHugLzAcWAxuBdmATsBzY2px7CfCaiWsHngTGxvIeB/zbxH0I/MKjPn8A\nzsyJ7wEsBF42+b4HLAIWAEuBV4C/AHt6lFUt9AZOB6YDS1D7WoBTTPwRwA9i6aeh67AJ+AwY6chz\nPvAx0uhd4HpHmmHALcC9wCxgHjAX+GpGPc8w+W0EViLNn6d0HRabuj8O/Bd4MafNnaEW9Apa1Z5W\n/6c36kQuB7aIhf8YeAF1lABXm0rOcuQx1MTdn1HG14B/Alt51OdbJq8rPNIeZ9JeaIX3AG4FNgCH\neuTT1eyPtJ4JHAL0NOFbAtcBv0aDyoHWedsCTyENZmTkPQ4NNE1W+BbAzeZ82/BPQEY/ljQL0bXp\nGQuLjHqio+y/Z9SrM9SKXkGr2tIqwb1INBdvAt8z3yehSt7oSDfcxD2Qkc9kYJBHXfoCz5q8bvJI\nH3XWIxxxXzRxd3vk05VMBtr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sdslfYAv4E/f3Ia79LLwiP\n0j62VWhXRS921xuj0V+lHYLE6Y/+OBO0T/JUkotFbWgUORu9ubMvenvnvc+ltvVH0L888tpv65Wn\nbSNQjm01ul2lGIA2iEef+BaEbsB3c8517e8KlEfQv+PY7bf1ytO2EeiobTntKmuzZL3ybk7cZ+Tr\nsbHCdWlEgv4dx26/rVeeto1AR22r0e2qkOPRRtJA1xD0L4+glz9Bq07QaLPnaiPoXx5BL3+CVoFA\nIBAIBAKBQCAQCAQCgUDgc+V/qk2ZfX6S+9YAAAAASUVORK5CYII=\n", | |||
"text": "SWAP = CNOT \u22c5CNOT \u22c5CNOT \n 1,0 1,0 0,1 1,0" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAAJ8AAACOCAYAAAAvkdreAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAABEJJREFUeJzt3b1LI1sAhvF3khvBxIuaQm1sbQSxEPETsRMEsRELC8FG\nrNMIFnaCNlYWVhbRyk7/A238rASxEwvFlEYiGNDZQtx7ZW8W767ua2aeH0yTxMOZ8DBnnIFMEIZh\nUdLfAv6wIAzD0D0JxFPCPQHEF/HBhvhgQ3ywIT7YEB9siA82xAcb4oMN8cGG+GBDfLAhPtgQH2yI\nDzbEBxvigw3xwYb4YEN8sCE+2BAfbIgPNsQHG+KDDfHBhvhgQ3ywIT7YEB9siA82xAcb4oNN7OIr\nFos6OzvT/f29eyqxF5v4wjDUwsKCmpub1d/fr+bmZi0uLopfBfaJzW8yb21taXZ2VqVS6ftrmUxG\nGxsbmpiYMM4svmITX09Pjw4PD394fWBgQPv7+4YZoWJ8QRD86bkgZiqe84VhGKlteXlZtbW1b/Yx\nnU5rdXXVPre4brFZdh8fHzU6OqqDgwOVSiVlMhkNDAxoZ2dHNTU17unFUmzik16O5icnJ+ru7tbx\n8bG6urrcU4q1WMX3KggCxXC3v5zYXOfD10N8sCE+2BAfbIgPNsQHG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NXV1SHA\n3W6Xuq7z/PwMT1euYv5pvG3bjMfjNE2T1WqV0WiU4XCY6XSaXq+I7+CPU8xd7/V6ubu7y8nJSZLk\n/Pzc8GBfnnxVVX33LCrMn68++G1P4/2ONxwOc3t7m8lkkqZpMp/P0+/36fGKVMTO13Vd6rrOYDA4\nPGr3O+B2u81sNqNHLFIR8SXJZrPJ6enppx2vbdu8vr7m7OwMnKxcxcSnn8dXPWGMTxjjE8b4hDE+\nYYxPGOMTxviEMT5hjE8Y4xPG+IQxPmGMTxjjE8b4hDE+YYxPGOMTxviEMT5hjE8Y4xPG+IQxPmGM\nTxjjE8b4hDE+YYxPGOMTxviEMT5hjE8Y4xPG+IQxPmGMTxjjE8b4hDE+YYxPmH8MEtVxVFn5TgAA\nAABJRU5ErkJggg==\n" | |||
}, | |||
{ | |||
"output_type": "display_data", | |||
"png": "iVBORw0KGgoAAAANSUhEUgAAANcAAACOCAYAAACi/J2KAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACrlJREFUeJzt3WtoU/cfx/FP/k5MU7vWSy/O0VRBWpFN6xyuQ113YVOq\niAW10wdjTqwGFccQV+cFtj1xbGysUyulF8WiVkUporW2VqZu0LKtm63VTevMdJuxrdisNkrS7/+B\nIHZNosn6zTHJ5wV5knMOfH/++iYnF9AkIl0A4kBEA8okImL0EESR6H9GD0AUqRgXkRLGRaSEcREp\nYVxEShgXkRLGRaSEcREpYVxEShgXkRLGRaSEcREpYVxEShgXkRLGRaSEcREpYVxEShgXkRLGRaSE\ncREpYVxEShgXkRLGRaSEcREpYVxEShgXkRLGRaSEcREpecroAei/ExF89913KC8vh91uh8vlQnx8\nPLKysvDee+8hKSnJ6BGjEl+5wpiIoLy8HJMmTcKSJUuQkZGB999/H99++y3effddXL58Genp6Vi8\neDEuXLhg9LjRRygsud1uWbZsmUycOFFqa2ult7f3wbGHt7Wzs1O2bNkiiYmJcvLkSSNGjVr8/7nC\nkIhg1apVaGlpQVVVF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_number": 16, | |||
"input": "for g in gates:\n dg = g.decompose()\n display(Eq(g, dg))\n circuit_plot(g, nqubits=2)\n circuit_plot(dg, nqubits=2) " | |||
} | |||
] | |||
} | |||
] | |||
} |