2019-10-16 15:19:47 +00:00
|
|
|
{
|
|
|
|
"cells": [
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 1,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"import matplotlib.pyplot as plt\n",
|
2019-11-01 18:07:45 +00:00
|
|
|
"from itertools import product\n",
|
2019-11-20 18:23:52 +00:00
|
|
|
"from collections import defaultdict\n",
|
2019-11-01 18:07:45 +00:00
|
|
|
"\n",
|
2019-11-20 18:23:52 +00:00
|
|
|
"from pyqcs import CZ, GenericGate, State, H\n",
|
|
|
|
"from pyqcs.graph.util import C_L"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 2,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"%matplotlib inline"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 3,
|
|
|
|
"metadata": {},
|
2019-11-20 18:23:52 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"(0.5000000000000001+0j)*|0b0> + (0.5000000000000001+0j)*|0b1> + (0.5000000000000001+0j)*|0b10> + (0.5000000000000001+0j)*|0b11>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 3,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
2019-11-01 18:07:45 +00:00
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"plus_state_state_2 = (H(0) | H(1)) * State.new_zero_state(2)\n",
|
|
|
|
"plus_state_state_2"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 4,
|
|
|
|
"metadata": {},
|
2019-11-20 18:23:52 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"(0.5000000000000001+0j)*|0b0> + (0.5000000000000001+0j)*|0b1> + (0.5000000000000001+0j)*|0b10> + (-0.5000000000000001-0j)*|0b11>"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 4,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
2019-11-01 18:07:45 +00:00
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"plus_state_state_2_cz = CZ(0, 1) * plus_state_state_2\n",
|
|
|
|
"plus_state_state_2_cz"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 5,
|
|
|
|
"metadata": {},
|
2019-11-20 18:23:52 +00:00
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"circuits = [GenericGate(0, C_L[c0]) | GenericGate(1, C_L[c1]) for c0,c1 in product(range(24), range(24))]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 6,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"resulting_states = [c * s for c,s in product(circuits, (plus_state_state_2, plus_state_state_2_cz))]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 7,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"def get_equivalent_states(s, resulting_states):\n",
|
|
|
|
" for i,test in enumerate(resulting_states):\n",
|
|
|
|
" if(test == s):\n",
|
|
|
|
" yield i\n",
|
|
|
|
" \n",
|
|
|
|
"equivalent_states = [list(get_equivalent_states(s, resulting_states)) for s in resulting_states]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 8,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"equivalent_state_counts = [len(e) - 1 for e in equivalent_states]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 9,
|
|
|
|
"metadata": {},
|
2019-11-01 18:07:45 +00:00
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2019-11-20 18:23:52 +00:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD4CAYAAAANbUbJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAM+UlEQVR4nO3db4xlZX3A8e+vjGCLRna7k81WobM0hGTfFMiEQjSGiuKCRjQhDRuja4vZppVEW5NmKS/avsP+sX+SRtwW6qZBqlUoG9RSuiUxTZptZ1uKC7jdBde6ZGGH2qppX9TVX1/cZ9brdIeZuffMzD37+36SyZx7zpk5z8MzfJk5984QmYkk6fz2Ixs9AEnS2jP2klSAsZekAoy9JBVg7CWpgKn1vNiWLVtyZmZmPS8pSb13+PDhlzNzepzPsa6xn5mZYW5ubj0vKUm9FxFfH/dzeBtHkgow9pJUgLGXpAKMvSQVYOwlqQBjL0kFGHtJKsDYS1IBxl6SCljX36Adx8zeLwBw4p53LHlswbnOWXzeSs4Z53qOae2uN4ljGud6jmkyr9f1mJY6tl78zl6SCjD2klSAsZekAoy9JBVg7CWpAGMvSQUYe0kqwNhLUgHGXpIKMPaSVICxl6QCjL0kFWDsJakAYy9J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Ea4PPARzLz28PHcvCf5d689jUi3gmczszDGz2WDk0x+LH6E5l5NfDfDG4PnNXDddrE4I8Sbgd+ArgY2Lmhg1oDfVuX5UTE3cAZ4IG1+Px9iH1v/yxDRLyKQegfyMyH2u6XImJbO74NON3292GebwTeFREnGPyV07cAfwhcEhELv6A3PO6zc2rHXwf8x3o
|
2019-11-01 18:07:45 +00:00
|
|
|
"text/plain": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"<Figure size 432x288 with 1 Axes>"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
2019-11-20 18:23:52 +00:00
|
|
|
"metadata": {
|
|
|
|
"needs_background": "light"
|
|
|
|
},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"plt.bar(range(len(resulting_states)), equivalent_state_counts)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 10,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"clusters = set((tuple(sorted(v)) for v in equivalent_states))"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 11,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"{15, 23}"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 11,
|
2019-11-01 18:07:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"set(equivalent_state_counts)"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2019-11-20 18:23:52 +00:00
|
|
|
"execution_count": 12,
|
2019-11-01 18:07:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"1152"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
2019-11-20 18:23:52 +00:00
|
|
|
"execution_count": 12,
|
2019-11-01 18:07:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"len(equivalent_states)"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
2019-11-20 18:23:52 +00:00
|
|
|
"execution_count": 13,
|
2019-11-01 18:07:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
2019-11-20 18:23:52 +00:00
|
|
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAXsAAAD4CAYAAAANbUbJAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAM+UlEQVR4nO3db4xlZX3A8e+vjGCLRna7k81WobM0hGTfFMiEQjSGiuKCRjQhDRuja4vZppVEW5NmKS/avsP+sX+SRtwW6qZBqlUoG9RSuiUxTZptZ1uKC7jdBde6ZGGH2qppX9TVX1/cZ9brdIeZuffMzD37+36SyZx7zpk5z8MzfJk5984QmYkk6fz2Ixs9AEnS2jP2klSAsZekAoy9JBVg7CWpgKn1vNiWLVtyZmZmPS8pSb13+PDhlzNzepzPsa6xn5mZYW5ubj0vKUm9FxFfH/dzeBtHkgow9pJUgLGXpAKMvSQVYOwlqQBjL0kFGHtJKsDY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7dxFr5wF5xs+3qj/Vh8NXAI2JqZp9qhF4Gtbbsv8/wD4NeA77fHPw78V2aeaY+Hx312Tu34t9r5k2Q7MA/8Wbs19acRcTE9XqfMfAH4XeDfgVMM/rkfpt/rtGC16zLx67XILzD4CQU6nlMfYt9rEfEa4PPARzLz28PHcvCf5d689jUi3gmczszDGz2WDk0x+LH6E5l5NfDfDG4PnNXDddrE4I8Sbgd+ArgY2Lmhg1oDfVuX5UTE3cAZ4IG1+Px9iH1v/yxDRLyKQegfyMyH2u6XImJbO74NON3292GebwTeFREnGPyV07cAfwhcEhELv6A3PO6zc2rHXwf8x3o
|
2019-11-01 18:07:45 +00:00
|
|
|
"text/plain": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"<Figure size 432x288 with 1 Axes>"
|
2019-11-01 18:07:45 +00:00
|
|
|
]
|
|
|
|
},
|
2019-11-20 18:23:52 +00:00
|
|
|
"metadata": {
|
|
|
|
"needs_background": "light"
|
|
|
|
},
|
|
|
|
"output_type": "display_data"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"resulting_states_after_cz = [CZ(0, 1) * s for s in resulting_states]\n",
|
|
|
|
"equivalent_states_after_cz = [list(get_equivalent_states(s, resulting_states_after_cz)) for s in resulting_states_after_cz]\n",
|
|
|
|
"equivalent_state_counts_after_cz = [len(e) - 1 for e in equivalent_states_after_cz]\n",
|
|
|
|
"\n",
|
|
|
|
"plt.bar(range(len(resulting_states)), equivalent_state_counts_after_cz)\n",
|
|
|
|
"plt.show()"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 14,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"{15, 23}"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 14,
|
2019-11-01 18:07:45 +00:00
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
2019-11-20 18:23:52 +00:00
|
|
|
"clusters_after_cz = set((tuple(sorted(v)) for v in equivalent_states))\n",
|
|
|
|
"set(equivalent_state_counts_after_cz)"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 15,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [
|
|
|
|
{
|
|
|
|
"data": {
|
|
|
|
"text/plain": [
|
|
|
|
"True"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"execution_count": 15,
|
|
|
|
"metadata": {},
|
|
|
|
"output_type": "execute_result"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"source": [
|
|
|
|
"clusters == clusters_after_cz"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": 16,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"resulting_states_after_cz_C_L = [c*s for c,s in product(circuits, resulting_states)]"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"cell_type": "code",
|
|
|
|
"execution_count": null,
|
|
|
|
"metadata": {},
|
|
|
|
"outputs": [],
|
|
|
|
"source": [
|
|
|
|
"equivalent_states_after_cz_C_L = [list(get_equivalent_states(s, resulting_states_after_cz_C_L)) for s in resulting_states_after_cz_C_L]\n",
|
|
|
|
"equivalent_state_counts_after_cz_C_L = [len(e) - 1 for e in equivalent_states_after_cz_C_L]\n",
|
|
|
|
"\n",
|
|
|
|
"plt.bar(range(len(resulting_states_after_cz_C_L)), equivalent_state_counts_after_cz_C_L)\n",
|
|
|
|
"plt.show()"
|
2019-10-16 15:19:47 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"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.3"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"nbformat": 4,
|
|
|
|
"nbformat_minor": 2
|
|
|
|
}
|