added numerical values
This commit is contained in:
parent
66a32b08b3
commit
86dec59642
|
@ -306,6 +306,143 @@
|
||||||
"product_table_indices = [[get_matrix_index(C_L, m) for m in row] for row in product_table]\n",
|
"product_table_indices = [[get_matrix_index(C_L, m) for m in row] for row in product_table]\n",
|
||||||
"product_table_indices"
|
"product_table_indices"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "markdown",
|
||||||
|
"metadata": {},
|
||||||
|
"source": [
|
||||||
|
"Also necessary to convert a graph state into a naive state are the numpy array versions of $C_L$:"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 9,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": [
|
||||||
|
"import numpy as np"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 10,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"text/plain": [
|
||||||
|
"[array([[ 0.70710678+0.j, 0.70710678+0.j],\n",
|
||||||
|
" [ 0.70710678+0.j, -0.70710678+0.j]]), array([[1.+0.j, 0.+0.j],\n",
|
||||||
|
" [0.+0.j, 0.+1.j]]), array([[1.+0.j, 0.+0.j],\n",
|
||||||
|
" [0.+0.j, 1.+0.j]]), array([[0.70710678+0.j , 0.70710678+0.j ],\n",
|
||||||
|
" [0. +0.70710678j, 0. -0.70710678j]]), array([[0.70710678+0.j , 0. +0.70710678j],\n",
|
||||||
|
" [0.70710678+0.j , 0. -0.70710678j]]), array([[ 1.+0.j, 0.+0.j],\n",
|
||||||
|
" [ 0.+0.j, -1.+0.j]]), array([[0.70710678+0.j , 0. +0.70710678j],\n",
|
||||||
|
" [0. +0.70710678j, 0.70710678+0.j ]]), array([[ 0.70710678+0.j, -0.70710678+0.j],\n",
|
||||||
|
" [ 0.70710678+0.j, 0.70710678+0.j]]), array([[1.+0.j, 0.+0.j],\n",
|
||||||
|
" [0.+0.j, 0.-1.j]]), array([[ 0.70710678+0.j , -0.70710678+0.j ],\n",
|
||||||
|
" [ 0. +0.70710678j, 0. +0.70710678j]]), array([[0.70710678+0.j , 0. -0.70710678j],\n",
|
||||||
|
" [0.70710678+0.j , 0. +0.70710678j]]), array([[ 0.70710678+0.j , 0. -0.70710678j],\n",
|
||||||
|
" [ 0. +0.70710678j, -0.70710678+0.j ]]), array([[0.5+0.5j, 0.5-0.5j],\n",
|
||||||
|
" [0.5-0.5j, 0.5+0.5j]]), array([[ 0.70710678+0.j, 0.70710678+0.j],\n",
|
||||||
|
" [-0.70710678+0.j, 0.70710678+0.j]]), array([[0.+0.j, 1.+0.j],\n",
|
||||||
|
" [1.+0.j, 0.+0.j]]), array([[0.70710678+0.j , 0.70710678+0.j ],\n",
|
||||||
|
" [0. -0.70710678j, 0. +0.70710678j]]), array([[0.+0.j, 1.+0.j],\n",
|
||||||
|
" [0.+1.j, 0.+0.j]]), array([[ 0.5-0.5j, 0.5+0.5j],\n",
|
||||||
|
" [-0.5+0.5j, 0.5+0.5j]]), array([[0.+0.j, 0.+1.j],\n",
|
||||||
|
" [1.+0.j, 0.+0.j]]), array([[ 0.70710678+0.j , 0. +0.70710678j],\n",
|
||||||
|
" [ 0. -0.70710678j, -0.70710678+0.j ]]), array([[ 0.5-0.5j, -0.5+0.5j],\n",
|
||||||
|
" [-0.5+0.5j, -0.5+0.5j]]), array([[ 0.+0.j, -1.+0.j],\n",
|
||||||
|
" [ 1.+0.j, 0.+0.j]]), array([[ 0.70710678+0.j , -0.70710678+0.j ],\n",
|
||||||
|
" [ 0. -0.70710678j, 0. -0.70710678j]]), array([[ 0.5-0.5j, -0.5-0.5j],\n",
|
||||||
|
" [-0.5+0.5j, -0.5-0.5j]])]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 10,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"[np.array(c.tolist()).astype(np.cdouble) for c in C_L]"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 11,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAEYAAAAzCAYAAAAqwX72AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAC50lEQVRoBe2bi00jMRCGs4gCEHQQOuBRwYUOgA6AEhAVIOiAuwpOdx0EKkDQAXQAooPw/+CRlsVje3czUmxsydmsH+OZb8deO6M0k8lkA/lbWiwWb98KCyxomsZrP019Ql508g3ATH5Cht3zju1kMV/DB9MBIDStfPZZXP4nbP5iOyz+sF3AlE+gp4XrKe0xD69cuxdct5GvQPo5pe8qtIH+O9DjH/Iu9E5aO6NgIPQBAi8h8D+NdIvVA650wZWF4/T8A5VfkfeQp8jJKTiVIPwUkjYECqU64oR0w/tVTdQT+QiZa8bfvnoGwUDYEfKjR+g9ymbuqXiq8y+KgZnBRLpiN8k8ZX2RSQWT6A2bRVKBUSoY1InR4h1tBuJF6q6x3TjH7yEwKfZspTTKsU3odS1e4bNLvIn7GpPkpvIdhPfxSr6FfC+L3jqqYPi6g3IU6FNMysz2MRwfY+/2tmhJHWJT6RbjTD1jicewvsgUA8NtNHeN3cQn+eieareuiPsgGBj+G1a+YkodirVu7h/j/kTKSryqa0zLWHrHBYDIlNrH/S9AW8oi1xpn6V+hMz2e66F4Pc941Pse+l+HBoyCcdPlPCRkVeugO480g1JwKg2SWEinCkZ5kBVMBaMQUIqrx1QwCgGluHpMBaMQUIqrx1QwCgGlOHokkH44Y+zge6+glfS1vEIvk2BgEAwG5QFscNDKEghlQz+zYGBwjeEBkgcx5EFBK0swgGIaDAyCsTRsCbJNg4E5g5kBru8He/5WzMT6wSlLMG7tixktv0vH2nnrswQDS8Ro8Y62ceJFfHEMTrmCSTF4VDAwVzDiFT5A4k2jgoFZguE2whHxTRcpGxUMzBKMg2IaDMwZjGkwMFswmE6mwcDgWYkuiz3D4KCVc3nLi1kwMAqGZyVLy8bIdouwSTAw26k0BmhK3wpGoVTBVDAKAaW4eowCRt5K0+5RvrXtVrqWUdy1G1bJkaL+kQswun9km78DNA5P/ouKOwEAAAAASUVORK5CYII=\n",
|
||||||
|
"text/latex": [
|
||||||
|
"$\\displaystyle \\left[\\begin{matrix}0 & -1\\\\1 & 0\\end{matrix}\\right]$"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
"⎡0 -1⎤\n",
|
||||||
|
"⎢ ⎥\n",
|
||||||
|
"⎣1 0 ⎦"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 11,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"X = M([[0, 1], [1, 0]])\n",
|
||||||
|
"Z = M([[1, 0], [0, -1]])\n",
|
||||||
|
"XZ = X*Z\n",
|
||||||
|
"XZ"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 12,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAABIAAAAOCAYAAAAi2ky3AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABD0lEQVQoFZWTgW3CMBBFCWKAiBFggwIbMEJZod0AZoANYAVGIBtUZQMYoXSD8F6KUYIdQk/68vnf+Z99tntlWfawEdje8M14AG/GUjAGTiAPcfxKZB8IR2wNdOaBx8/BHljQYsYbQgbvRG3hBf4S5vURfgkaQn2IuQuyLLNi3QomObzH7jSFXHCm4m9L9mOBZNoAgUUy8tdQm31siTdodxQZx/FWPNIqCrYQSSFyvYAdu9m0rIvoSIjdeL0FIp9R9hOiIYTIh7n/FXHNXQiRd+bjugjcSJjYZZUQyTZ3hshjcxX/6RIxPrhVtLkFvv0JNsTxv73U8Ixk/407StkRoUkIUKj6TsynwId6Br6zrytJ1JPO4orZMQAAAABJRU5ErkJggg==\n",
|
||||||
|
"text/latex": [
|
||||||
|
"$\\displaystyle 21$"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
"21"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 12,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"get_matrix_index(C_L, XZ)"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": 13,
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [
|
||||||
|
{
|
||||||
|
"data": {
|
||||||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAABMAAAAOCAYAAADNGCeJAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABXUlEQVQ4EY2TgU3DMBBFbcQAVdkg3aDQCcgIZYUyQsUEqGwAK5QNmhXIBk0nKGWD8J/lX7lpkDjp63zf539nJxf7vg8xxiqEsBawB+FbWGuvhShNuZscH+VnwkZ5nXMQ2iJqkCD0Qm0OL/sSlua0ngh7ocr7YQvpBHtxJ1DEK8V7x/biKLwjxjjE6kJQMUXgXXUHZxF7ccucN7nRohE6bf7IjxlXwWqBtxyaz9W3Enka7uZ4jtd+q0e34B+piZ7S2ZXpMELlF57mJHdRnnG36Zrlhte814e6ejPxD3931Zm6etfBRkLPhYCrF9R56a6PF2IS4vPzTqUQsa839nbmurOYhPjEs1JIXAVyD3x1rzOVnDtrkpgO8OALCXmknEwBX5F3ZNSGdi+ipfuoBdX4IalcGhXnSmL+kqkoo8PMfkIo5ooH4VFcixjzRmdjRkUqJ8uHXxQw5NhCeEWI4BcltMR1yw4E5wAAAABJRU5ErkJggg==\n",
|
||||||
|
"text/latex": [
|
||||||
|
"$\\displaystyle 20$"
|
||||||
|
],
|
||||||
|
"text/plain": [
|
||||||
|
"20"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"execution_count": 13,
|
||||||
|
"metadata": {},
|
||||||
|
"output_type": "execute_result"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"source": [
|
||||||
|
"get_matrix_index(C_L, H * Z * X)"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user