From a2775a2fec311485ec482e2a9c48eeb7b0922c80 Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Tue, 12 Nov 2024 12:43:58 +0000 Subject: [PATCH] ... --- scratchpads/ak.ipynb | 125 ++++++++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 43 deletions(-) diff --git a/scratchpads/ak.ipynb b/scratchpads/ak.ipynb index 93293369..259ff3dd 100644 --- a/scratchpads/ak.ipynb +++ b/scratchpads/ak.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 28, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -18,6 +18,8 @@ "import random\n", "from pyzx.gflow import gflow\n", "from pyzx.utils import vertex_is_zx\n", + "from pyzx.graph.base import BaseGraph\n", + "from pyzx import VertexType, EdgeType\n", "# zx.settings.drawing_backend = 'matplotlib'\n", "\n", "Z = zx.VertexType.Z\n", @@ -29,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -40,12 +42,15 @@ " if v not in pt: pt[v] = set()\n", " pt[v].add(k)\n", " return pt\n", - "def extend(g, p):\n", + "def extend(g, s):\n", + " s1 = s.copy()\n", + " for v in s:\n", + " s1 |= {v for v in g.neighbors(v) if vertex_is_zx(g.type(v))}\n", + " return s1\n", + "def extend_dict(g, p):\n", " pe = dict()\n", " for k,s in p.items():\n", - " pe[k] = s.copy()\n", - " for v in s:\n", - " pe[k] |= {v for v in g.neighbors(v) if vertex_is_zx(g.type(v))}\n", + " pe[k] = extend(g, s)\n", " return pe\n", "def is_dag(p):\n", " pt = transpose(p)\n", @@ -53,18 +58,32 @@ " for v in s:\n", " if k != v and k in pt and v in pt[k]:\n", " return False\n", - " return True\n" + " return True\n", + "\n", + "def is_clifford(p):\n", + " return p in (0, 1, Fraction(1, 2), Fraction(3,2))\n", + "\n", + "def gadgetize(g: BaseGraph):\n", + " for v in list(g.vertices()):\n", + " p = g.phase(v)\n", + " if not is_clifford(p) and g.vertex_degree(v) > 1:\n", + " x = g.add_vertex(VertexType.Z, -1, g.row(v))\n", + " y = g.add_vertex(VertexType.Z, -2, g.row(v))\n", + " g.add_edge((x, y), EdgeType.HADAMARD)\n", + " g.add_edge((v, x), EdgeType.HADAMARD)\n", + " g.set_phase(y, p)\n", + " g.set_phase(v, 0)\n" ] }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", + "
\n", "" ], @@ -410,30 +429,30 @@ { "data": { "text/plain": [ - "Graph(541 vertices, 657 edges)" + "Graph(94 vertices, 113 edges)" ] }, - "execution_count": 42, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "random.seed(1337)\n", - "g = zx.generate.cliffordT(5, 400, p_t=0.2)\n", + "random.seed(1330)\n", + "g = zx.generate.cliffordT(3, 60, p_t=0.2)\n", "zx.draw(g)\n", "g" ] }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", + "
\n", "" ], "text/plain": [ @@ -780,6 +799,7 @@ "source": [ "g1 = g.copy()\n", "zx.full_reduce(g1)\n", + "gadgetize(g1)\n", "g1.normalize()\n", "g1 = g1.copy()\n", "zx.to_rg(g1)\n", @@ -790,57 +810,76 @@ }, { "cell_type": "code", - "execution_count": 50, + "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{5: 14, 6: 14, 7: 14, 8: 14, 13: 14, 9: 13, 10: 13, 11: 13, 58: 13, 12: 12, 15: 12, 17: 12, 18: 12, 57: 12, 59: 12, 14: 11, 16: 11, 19: 11, 20: 10, 21: 10, 22: 10, 23: 9, 24: 9, 25: 9, 27: 9, 26: 8, 28: 8, 29: 8, 30: 8, 31: 7, 40: 7, 62: 7, 32: 6, 33: 6, 34: 5, 35: 5, 36: 5, 37: 4, 38: 3, 39: 2, 41: 2, 42: 2, 44: 2, 60: 2, 61: 2, 43: 1, 45: 1, 46: 1, 47: 1, 48: 1, 51: 1, 63: 1, 49: 0, 50: 0}\n", - "{9: {8, 6}, 10: {8, 5, 6}, 11: {6}, 58: {8, 12, 5, 6}, 12: {58}, 15: {8, 10, 58}, 17: {5, 6, 8, 13, 58}, 18: {10, 58, 6, 7}, 57: {5, 6, 7, 10, 13, 14}, 59: {6, 8, 10, 16, 58}, 14: {57}, 16: {59}, 19: {10, 11, 58, 15}, 20: {19, 7}, 21: {6, 7, 9, 11, 13, 15, 17, 19, 58}, 22: {7, 9, 11, 17, 18, 19, 57, 59}, 23: {7, 11, 13, 17, 18, 20, 58, 59}, 24: {5, 15, 17, 19, 20, 21, 57, 59}, 25: {7, 8, 9, 15, 17, 18, 20, 22, 57, 59}, 27: {5, 9, 10, 17, 18, 19, 21, 22, 57, 58}, 26: {5, 6, 7, 13, 17, 18, 20, 21, 23, 58}, 28: {5, 9, 10, 11, 15, 19, 21, 22, 23, 25, 58, 57}, 29: {5, 6, 7, 8, 9, 18, 23}, 30: {6, 9, 10, 11, 13, 15, 18, 20, 21, 22, 24}, 31: {6, 7, 8, 9, 13, 17, 18, 21, 23, 24, 57, 58, 28, 29}, 40: {58, 6, 7, 8, 59, 11, 13, 21, 26, 27, 29}, 62: {6, 8, 10, 13, 15, 17, 18, 19, 23, 59, 28}, 32: {5, 7, 8, 10, 13, 17, 18, 20, 21, 22, 24, 25, 62}, 33: {58, 6, 7, 9, 10, 15, 17, 21, 22, 24, 26, 59, 28, 29, 62, 31}, 34: {32, 5, 8, 9, 17, 20, 21, 23, 24, 62, 26, 28, 29, 30, 31}, 35: {33, 5, 6, 13, 18, 19, 20, 23, 24, 25, 58, 57, 62, 31}, 36: {32, 7, 59, 10, 11, 13, 18, 20, 24, 57, 27, 62, 31}, 37: {34, 5, 6, 7, 11, 18, 19, 20, 62, 22, 23, 24, 57, 26, 59, 28, 30}, 38: {6, 7, 8, 9, 13, 20, 21, 22, 23, 24, 25, 28, 30, 34, 36, 37, 57, 58, 62}, 39: {5, 6, 7, 9, 10, 17, 18, 19, 24, 25, 26, 28, 32, 34, 35, 36, 38, 57, 58}, 41: {6, 7, 9, 11, 13, 15, 17, 19, 24, 26, 27, 28, 30, 31, 32, 33, 34, 38, 40, 58}, 42: {33, 36, 5, 6, 7, 38, 10, 13, 17, 18, 20, 24, 62, 27, 28, 29, 30, 31}, 44: {33, 35, 38, 40, 59, 10, 13, 15, 17, 19, 20, 57, 26, 27, 30}, 60: {9, 11, 13, 15, 19, 22, 23, 25, 26, 27, 32, 33, 36, 38, 40, 47, 57, 58, 62}, 61: {36, 5, 38, 11, 43, 17, 18, 19, 20, 25, 26, 59, 31}, 43: {61}, 45: {32, 33, 5, 6, 7, 40, 9, 41, 19, 20, 21, 22, 23, 57, 26, 27, 61, 31}, 46: {35, 8, 9, 10, 11, 42, 13, 15, 17, 22, 24, 27, 28, 62, 31}, 47: {60}, 48: {6, 7, 8, 17, 19, 22, 24, 27, 28, 29, 30, 33, 37, 38, 39, 40, 57, 61, 62}, 51: {6, 7, 8, 9, 10, 11, 19, 20, 23, 24, 25, 27, 28, 29, 32, 33, 35, 36, 37, 38, 39, 40, 57, 58, 59, 61}, 63: {6, 7, 8, 9, 11, 13, 15, 17, 23, 24, 25, 26, 28, 29, 30, 32, 36, 37, 39, 50, 58, 61}, 49: {6, 7, 8, 9, 15, 17, 18, 19, 20, 21, 23, 30, 32, 35, 36, 37, 38, 39, 40, 41, 46, 57, 59}, 50: {63}}\n", - "{9: {6, 8, 9, 11}, 10: {5, 6, 8, 9, 10, 11, 13}, 11: {11, 6}, 58: {5, 6, 8, 9, 10, 11, 12, 13, 58}, 15: {5, 8, 9, 10, 11, 12, 13, 15, 58}, 17: {5, 6, 7, 8, 9, 10, 11, 12, 13, 17, 58}, 18: {5, 6, 7, 9, 10, 11, 12, 13, 15, 18, 58}, 57: {5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 57}, 59: {5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 58, 59}, 19: {5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 19, 21, 25, 26, 27, 29, 58}, 20: {7, 9, 13, 15, 18, 19, 20}, 21: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24, 25, 26, 27, 29, 58}, 22: {5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 29, 57, 59}, 23: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 58, 59}, 24: {5, 7, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 57, 59}, 25: {5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 57, 59}, 27: {5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 57, 58}, 26: {5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 58}, 28: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 57, 58}, 29: {5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29}, 30: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 29, 30}, 31: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 57, 58, 62}, 40: {5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 40, 41, 42, 44, 58, 59, 62}, 62: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 59, 62}, 32: {5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 62}, 33: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 41, 42, 44, 58, 59, 62}, 34: {5, 7, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 40, 41, 42, 44, 62}, 35: {5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 41, 42, 44, 57, 58, 62}, 36: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 40, 41, 42, 44, 57, 59, 62}, 37: {5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 57, 59, 62}, 38: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 48, 51, 57, 58, 62}, 39: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 48, 51, 57, 58, 62}, 41: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 48, 51, 58, 62}, 42: {5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 48, 51, 62}, 44: {5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 48, 51, 57, 59, 62}, 60: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 44, 47, 48, 51, 57, 58, 60, 62}, 61: {5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 48, 51, 59, 61}, 45: {5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 39, 40, 41, 42, 43, 44, 45, 48, 51, 57, 61, 62}, 46: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 44, 46, 62}, 48: {6, 7, 8, 9, 11, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 48, 51, 57, 61, 62}, 51: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 48, 51, 57, 58, 59, 61, 62}, 63: {5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 48, 50, 51, 58, 61, 62, 63}}\n" + "17 <- {16} + {17, 3}\n", + "19 <- {18} + {19, 4}\n", + "15 <- {3, 4, 6, 7, 17, 19} + {5, 8, 9, 10, 15, 16, 18}\n", + "21 <- {19, 4, 20, 6} + {3, 5, 9, 18, 21}\n", + "25 <- {24, 19, 4} + {9, 18, 25}\n", + "23 <- {4, 5, 19, 21, 22} + {3, 6, 8, 9, 18, 20, 23}\n", + "27 <- {3, 5, 6, 17, 21, 26} + {8, 9, 10, 16, 20, 27}\n" ] - }, - { - "data": { - "text/plain": [ - "False" - ] - }, - "execution_count": 50, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ "o, p = gflow(g1, focus=True, reverse=True, pauli=True)\n", - "print(o)\n", - "print(p)\n", - "ep = extend(g1, p)\n", - "print(ep)\n", - "is_dag(ep)" + "vs = [v for v in g1.vertices() if not is_clifford(g1.phase(v))]\n", + "list.sort(vs, key=lambda v: o[v], reverse=True)\n", + "for v in vs: print(f\"{v} <- {p[v]} + {extend(g1, p[v]).difference(p[v])}\")" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{48: 14, 49: 14, 51: 14, 44: 14, 45: 14, 41: 13, 46: 13, 60: 13, 63: 13, 39: 12, 40: 12, 42: 12, 47: 12, 50: 12, 61: 12, 35: 11, 38: 11, 43: 11, 33: 10, 36: 10, 37: 10, 27: 9, 34: 9, 26: 8, 30: 8, 31: 8, 32: 8, 24: 7, 29: 7, 62: 7, 28: 6, 21: 5, 23: 5, 25: 5, 20: 4, 22: 4, 9: 3, 17: 3, 18: 3, 19: 3, 57: 3, 59: 3, 7: 2, 11: 2, 13: 2, 14: 2, 15: 2, 16: 2, 10: 1, 58: 1, 5: 0, 6: 0, 8: 0, 12: 0}\n", - "{49: {6, 7, 8, 9, 15, 17, 18, 19, 20, 21, 23, 30, 32, 35, 36, 37, 38, 39, 40, 41, 46, 57, 59}, 45: {32, 33, 5, 6, 7, 40, 41, 9, 19, 20, 21, 22, 23, 57, 26, 27, 61, 31}, 47: {60}, 50: {63}, 48: {6, 7, 8, 17, 19, 22, 24, 27, 28, 29, 30, 33, 37, 38, 39, 40, 57, 61, 62}, 51: {6, 7, 8, 9, 10, 11, 19, 20, 23, 24, 25, 27, 28, 29, 32, 33, 35, 36, 37, 38, 39, 40, 57, 58, 59, 61}, 63: {6, 7, 8, 9, 11, 13, 15, 17, 23, 24, 25, 26, 28, 29, 30, 32, 36, 37, 39, 50, 58, 61}, 41: {6, 7, 9, 11, 13, 15, 17, 19, 24, 26, 27, 28, 30, 31, 32, 33, 34, 38, 40, 58}, 44: {33, 35, 38, 40, 59, 10, 13, 15, 17, 19, 20, 57, 26, 27, 30}, 60: {9, 11, 13, 15, 19, 22, 23, 25, 26, 27, 32, 33, 36, 38, 40, 47, 57, 58, 62}, 46: {35, 8, 9, 42, 11, 10, 13, 15, 17, 22, 24, 27, 28, 62, 31}, 43: {61}, 39: {5, 6, 7, 9, 10, 17, 18, 19, 24, 25, 26, 28, 32, 34, 35, 36, 38, 57, 58}, 42: {33, 36, 5, 38, 7, 6, 10, 13, 17, 18, 20, 24, 62, 27, 28, 29, 30, 31}, 61: {36, 5, 38, 43, 11, 17, 18, 19, 20, 25, 26, 59, 31}, 35: {33, 5, 6, 13, 18, 19, 20, 23, 24, 25, 58, 57, 62, 31}, 38: {6, 7, 8, 9, 13, 20, 21, 22, 23, 24, 25, 28, 30, 34, 36, 37, 57, 58, 62}, 36: {32, 7, 59, 10, 11, 13, 18, 20, 24, 57, 27, 62, 31}, 40: {58, 6, 7, 27, 8, 11, 13, 21, 26, 59, 29}, 37: {34, 5, 6, 7, 11, 18, 19, 23, 20, 22, 30, 24, 57, 26, 59, 28, 62}, 33: {58, 6, 7, 9, 10, 15, 17, 21, 22, 24, 26, 59, 28, 29, 62, 31}, 34: {32, 5, 8, 9, 17, 20, 21, 23, 24, 62, 26, 28, 29, 30, 31}, 32: {5, 7, 8, 10, 13, 17, 18, 20, 21, 22, 24, 25, 62}, 30: {6, 9, 10, 11, 13, 15, 18, 20, 21, 22, 24}, 31: {6, 7, 8, 9, 13, 17, 18, 21, 23, 24, 57, 58, 28, 29}, 62: {6, 8, 10, 13, 15, 17, 18, 19, 23, 59, 28}, 24: {5, 15, 17, 19, 20, 21, 57, 59}, 26: {5, 6, 7, 13, 17, 18, 20, 21, 23, 58}, 27: {5, 9, 10, 17, 18, 19, 21, 22, 57, 58}, 28: {5, 9, 10, 11, 15, 19, 21, 22, 23, 25, 58, 57}, 29: {5, 6, 7, 8, 9, 18, 23}, 23: {7, 11, 13, 17, 18, 20, 58, 59}, 25: {7, 8, 9, 15, 17, 18, 20, 22, 57, 59}, 21: {6, 7, 9, 11, 13, 15, 17, 19, 58}, 22: {7, 9, 11, 17, 18, 19, 57, 59}, 20: {19, 7}, 14: {57}, 16: {59}, 18: {10, 58, 6, 7}, 57: {5, 6, 7, 10, 13, 14}, 19: {10, 11, 58, 15}, 17: {5, 6, 8, 13, 58}, 59: {6, 8, 10, 16, 58}, 15: {8, 10, 58}, 12: {58}, 58: {8, 12, 5, 6}, 10: {8, 5, 6}, 9: {8, 6}, 11: {6}}\n" + "{9: 4, 10: 4, 11: 4, 8: 3, 15: 3, 23: 3, 25: 3, 27: 3, 3: 2, 5: 2, 7: 2, 17: 2, 21: 2, 22: 2, 24: 2, 26: 2, 4: 1, 6: 1, 16: 1, 19: 1, 20: 1, 18: 0}\n" ] + }, + { + "data": { + "text/plain": [ + "{11: {3, 4, 5, 8, 15, 17, 19, 21, 23},\n", + " 7: {15},\n", + " 22: {23},\n", + " 24: {25},\n", + " 26: {27},\n", + " 27: {3, 5, 6, 17, 21, 26},\n", + " 10: {3, 5, 6, 17, 21},\n", + " 15: {3, 4, 6, 7, 17, 19},\n", + " 8: {4, 5, 19, 21},\n", + " 23: {4, 5, 19, 21, 22},\n", + " 16: {17},\n", + " 20: {21},\n", + " 25: {4, 19, 24},\n", + " 5: {4, 6, 19},\n", + " 9: {4, 19},\n", + " 21: {4, 6, 19, 20},\n", + " 17: {16},\n", + " 18: {19},\n", + " 19: {18}}" + ] + }, + "execution_count": 6, + "metadata": {}, + "output_type": "execute_result" } ], "source": [ "o,p = gflow(g1, focus=True, reverse=False, pauli=True)\n", "pt = transpose(p)\n", "print(o)\n", - "print(pt)" + "pt" ] }, {