From c8a865369094cfb310083ca8189f59b7a3d5e48a Mon Sep 17 00:00:00 2001 From: grace-harper Date: Mon, 2 Oct 2023 16:55:49 -0400 Subject: [PATCH] Remove work.ipynb --- work.ipynb | 132 ----------------------------------------------------- 1 file changed, 132 deletions(-) delete mode 100644 work.ipynb diff --git a/work.ipynb b/work.ipynb deleted file mode 100644 index e01dd534..00000000 --- a/work.ipynb +++ /dev/null @@ -1,132 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": {}, - "outputs": [], - "source": [ - "import qiskit_qec as qq \n", - "from typing import Dict, Tuple\n", - "import rustworkx as rx" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": {}, - "outputs": [], - "source": [ - "def make_test_graph() -> Tuple[rx.PyGraph, Dict[Tuple[int, Tuple[int]], int]]:\n", - " \"\"\"Make a basic decoding graph.\n", - "\n", - " 4 -- 0 -- 1 -- 2 -- 3 -- (4)\n", - " \"\"\"\n", - " graph = rx.PyGraph(multigraph=False)\n", - " idxmap = {}\n", - " for i, q in enumerate([[0, 1], [1, 2], [2, 3], [3, 4]]):\n", - " node = {\"time\": 0, \"qubits\": q, \"highlighted\": False}\n", - " graph.add_node(node)\n", - " idxmap[(0, tuple(q))] = i\n", - " node = {\"time\": 0, \"qubits\": [], \"highlighted\": False, \"is_boundary\": True}\n", - " graph.add_node(node)\n", - " idxmap[(0, tuple([]))] = 4\n", - " for dat in [[[0], 0, 4], [[1], 0, 1], [[2], 1, 2], [[3], 2, 3], [[4], 3, 4]]:\n", - " edge = {\"qubits\": dat[0], \"measurement_error\": False, \"weight\": 1, \"highlighted\": False}\n", - " graph.add_edge(dat[1], dat[2], edge)\n", - " return graph, idxmap\n" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": {}, - "outputs": [], - "source": [ - "\n", - "from qiskit_qec.decoders.pymatching_matcher import PyMatchingMatcher\n", - "\n", - "m = PyMatchingMatcher()\n", - "graph, idxmap = make_test_graph()\n", - "nngraph = m.preprocess(graph)\n", - " " - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "NodeView((0, 1, 2, 3, 4))" - ] - }, - "execution_count": 10, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "nngraph.nodes\n", - "nngraph.edges\n" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "dict" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "graph.edges()\n", - "type(graph.nodes()[1])" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3.10.6 ('qqec')", - "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.10.6" - }, - "orig_nbformat": 4, - "vscode": { - "interpreter": { - "hash": "b2fc4f2030b9a5415f1291c43d27029c7377775d8b1538a2d1c2897a28a0b142" - } - } - }, - "nbformat": 4, - "nbformat_minor": 2 -}