From 424be6ef14f5f598fa74a94de1beee01a929e7af Mon Sep 17 00:00:00 2001 From: Aleks Kissinger Date: Sun, 10 Nov 2024 21:19:38 +0000 Subject: [PATCH] experiments --- scratchpads/ak.ipynb | 136 +++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 90 deletions(-) diff --git a/scratchpads/ak.ipynb b/scratchpads/ak.ipynb index 28799f03..93293369 100644 --- a/scratchpads/ak.ipynb +++ b/scratchpads/ak.ipynb @@ -2,13 +2,14 @@ "cells": [ { "cell_type": "code", - "execution_count": 1, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "import sys, os, math\n", "import numpy as np\n", "sys.path.insert(0,os.path.expanduser('~/git/pyzx')) # git version\n", + "sys.path.insert(0,'/workspaces/pyzx')\n", "import pyzx as zx\n", "from pyzx import print_matrix\n", "from pyzx.basicrules import *\n", @@ -16,6 +17,7 @@ "from fractions import Fraction\n", "import random\n", "from pyzx.gflow import gflow\n", + "from pyzx.utils import vertex_is_zx\n", "# zx.settings.drawing_backend = 'matplotlib'\n", "\n", "Z = zx.VertexType.Z\n", @@ -27,7 +29,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -37,18 +39,32 @@ " for v in s:\n", " if v not in pt: pt[v] = set()\n", " pt[v].add(k)\n", - " return pt" + " return pt\n", + "def extend(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", + " return pe\n", + "def is_dag(p):\n", + " pt = transpose(p)\n", + " for k,s in p.items():\n", + " for v in s:\n", + " if k != v and k in pt and v in pt[k]:\n", + " return False\n", + " return True\n" ] }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 42, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", + "
\n", "" ], @@ -394,30 +410,30 @@ { "data": { "text/plain": [ - "Graph(274 vertices, 328 edges)" + "Graph(541 vertices, 657 edges)" ] }, - "execution_count": 3, + "execution_count": 42, "metadata": {}, "output_type": "execute_result" } ], "source": [ "random.seed(1337)\n", - "g = zx.generate.cliffordT(4, 200, p_t=0.2)\n", + "g = zx.generate.cliffordT(5, 400, p_t=0.2)\n", "zx.draw(g)\n", "g" ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 43, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "
\n", + "
\n", "" ], "text/plain": [ @@ -774,51 +790,25 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{4: 8, 5: 8, 6: 8, 7: 8, 8: 7, 9: 7, 10: 7, 11: 7, 12: 6, 13: 6, 14: 5, 15: 5, 16: 5, 18: 5, 17: 4, 21: 4, 27: 4, 40: 4, 19: 3, 20: 3, 22: 3, 23: 3, 24: 2, 26: 2, 28: 2, 39: 2, 25: 1, 29: 1, 30: 1, 31: 1, 32: 0, 33: 0, 34: 0}\n" + "{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" ] }, { "data": { "text/plain": [ - "{8: {5},\n", - " 9: {4, 5, 6},\n", - " 10: {5, 7},\n", - " 11: {4},\n", - " 12: {4, 7, 8, 9, 10},\n", - " 13: {5, 11},\n", - " 14: {4, 5, 7, 12, 13},\n", - " 15: {6, 7, 13},\n", - " 16: {8, 10, 11, 12, 13},\n", - " 18: {8, 12, 13},\n", - " 17: {6, 7, 8, 9, 10, 14},\n", - " 21: {4, 5, 6, 7, 11, 14, 15, 18},\n", - " 27: {7, 18},\n", - " 40: {4, 5, 7, 9, 12, 13, 15, 20},\n", - " 19: {5, 6, 7, 9, 11, 13, 14, 16, 17, 18},\n", - " 20: {40},\n", - " 22: {7, 8, 9, 10, 11, 12, 13, 15, 17, 18, 21},\n", - " 23: {5, 6, 8, 9, 10, 11, 15, 16, 40},\n", - " 24: {4, 6, 8, 9, 10, 13, 14, 16, 18, 21, 23},\n", - " 26: {6, 8, 9, 10, 14, 18, 19, 22},\n", - " 28: {6, 13, 18, 21, 22, 23, 40},\n", - " 39: {4, 7, 13, 16, 18, 19, 21, 22, 23, 25},\n", - " 25: {39},\n", - " 29: {4, 7, 9, 10, 11, 13, 15, 16, 17, 18, 21, 23, 24, 27},\n", - " 30: {4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 18, 19, 22, 23, 28},\n", - " 31: {5, 6, 12, 13, 16, 17, 21, 24, 26, 40},\n", - " 32: {5, 6, 7, 12, 13, 16, 17, 18, 21, 24, 26, 29, 40},\n", - " 33: {6, 13, 18, 21, 22, 23, 30, 40},\n", - " 34: {5, 9, 11, 14, 16, 17, 18, 21, 22, 23, 26, 29, 39, 40}}" + "False" ] }, - "execution_count": 8, + "execution_count": 50, "metadata": {}, "output_type": "execute_result" } @@ -826,65 +816,31 @@ "source": [ "o, p = gflow(g1, focus=True, reverse=True, pauli=True)\n", "print(o)\n", - "p" + "print(p)\n", + "ep = extend(g1, p)\n", + "print(ep)\n", + "is_dag(ep)" ] }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "{32: 8, 33: 8, 34: 8, 31: 8, 26: 7, 29: 7, 30: 7, 39: 7, 19: 6, 24: 6, 25: 6, 27: 6, 28: 6, 22: 5, 23: 5, 16: 4, 17: 4, 21: 4, 40: 4, 14: 3, 15: 3, 18: 3, 20: 3, 12: 2, 13: 2, 8: 1, 9: 1, 10: 1, 11: 1, 4: 0, 5: 0, 6: 0, 7: 0}\n" + "{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" ] - }, - { - "data": { - "text/plain": [ - "{32: {5, 6, 7, 12, 13, 16, 17, 18, 21, 24, 26, 29, 40},\n", - " 34: {5, 9, 11, 14, 16, 17, 18, 21, 22, 23, 26, 29, 39, 40},\n", - " 31: {5, 6, 12, 13, 16, 17, 21, 24, 26, 40},\n", - " 33: {6, 13, 18, 21, 22, 23, 30, 40},\n", - " 25: {39},\n", - " 26: {6, 8, 9, 10, 14, 18, 19, 22},\n", - " 30: {4, 5, 6, 7, 8, 10, 12, 13, 14, 15, 18, 19, 22, 23, 28},\n", - " 39: {4, 7, 13, 16, 18, 19, 21, 22, 23, 25},\n", - " 29: {4, 7, 9, 10, 11, 13, 15, 16, 17, 18, 21, 23, 24, 27},\n", - " 28: {6, 13, 18, 21, 22, 23, 40},\n", - " 24: {4, 6, 8, 9, 10, 13, 14, 16, 18, 21, 23},\n", - " 19: {5, 6, 7, 9, 11, 13, 14, 16, 17, 18},\n", - " 23: {5, 6, 8, 9, 10, 11, 15, 16, 40},\n", - " 22: {7, 8, 9, 10, 11, 12, 13, 15, 17, 18, 21},\n", - " 20: {40},\n", - " 17: {6, 7, 8, 9, 10, 14},\n", - " 21: {4, 5, 6, 7, 11, 14, 15, 18},\n", - " 40: {4, 5, 7, 9, 12, 13, 15, 20},\n", - " 27: {7, 18},\n", - " 14: {4, 5, 7, 12, 13},\n", - " 16: {8, 10, 11, 12, 13},\n", - " 18: {8, 12, 13},\n", - " 15: {6, 7, 13},\n", - " 12: {4, 7, 8, 9, 10},\n", - " 13: {5, 11},\n", - " 9: {4, 5, 6},\n", - " 11: {4},\n", - " 8: {5},\n", - " 10: {5, 7}}" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" } ], "source": [ "o,p = gflow(g1, focus=True, reverse=False, pauli=True)\n", "pt = transpose(p)\n", "print(o)\n", - "pt" + "print(pt)" ] }, { @@ -911,7 +867,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.12.0" + "version": "3.12.1" } }, "nbformat": 4,