{ "cells": [ { "cell_type": "markdown", "id": "39e84d80-670c-45f1-be88-0bd765523bfa", "metadata": { "tags": [] }, "source": [ "# Visualize Eka objects\n", "```{note}\n", "The widgets in this notebook are interactive!\n", "```\n", "\n", "This notebook demonstrates the functions of the `visualizer` module for creating stabilizer plots. More concretely, this notebook contains:\n", "* plotting the stabilizers of a `Block`\n", "* plotting the logical operators of a `Block`\n", "* plotting arbitrary pauli strings\n", "* plotting the pauli charges of a `Block`\n", "* plotting multiple `Block`s on a lattice" ] }, { "cell_type": "markdown", "id": "dd6ccbae", "metadata": {}, "source": [ "First, we import all necessary modules:" ] }, { "cell_type": "code", "execution_count": 1, "id": "dc9692a7", "metadata": {}, "outputs": [], "source": [ "import loom.visualizer as vis\n", "from loom.eka import Lattice, PauliOperator, Stabilizer, Block\n", "import plotly.io as pio\n", "\n", "pio.renderers.default = \"notebook\"" ] }, { "cell_type": "markdown", "id": "aba8c4ce-279a-4b42-bdcd-d1d94e5796d5", "metadata": {}, "source": [ "## Rotated surface code\n", "Let's create a 3x3 rotated surface code block on a square lattice. We make the square lattice a 5x5 lattice and place the rotated surface code block in the upper left corner.\n", "\n", "The (0,0) position is at the top left. The first coordinate is the x-axis with the positive x-axis going to the right. The second coordinate is the y-axis with the positive y-axis going to the bottom. " ] }, { "cell_type": "code", "execution_count": null, "id": "7d4d0e9a", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "