{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Introduction to `Workspace` objects\n", "This tutorial briefly explains how pyGSTi visualizes data using `Workspace` objects. Understanding the basics covered here will help demystify the creation of plots and tables in other tutorials.\n", "\n", "PyGSTi prefers to use HTML-based figures (native HTML tables and [Plotly](https://plot.ly/python/) plots) over the perhaps more traditional LaTeX tables and [matplotlib](https://matplotlib.org) plots. There are several reasons for this:\n", "1. Interactivity - HTML allows plots and tables to be interactive; with LaTeX this is impossible and with matplotlib it's painful.\n", "2. HTML's ability to be integrated into web pages (making nicer reports than a many-page PDF) and into Jupyter notebooks.\n", "3. Portability - Plotly figures (HTML and JS) can be more robustly stored and transported (e.g. over the web) than matplotlib `Figure` objects, which are difficult even to pickle with Python.\n", "\n", "The creation of (HTML) figures, both tables and plots, is handled by the `pygsti.report.Workspace` factory object." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import pygsti\n", "ws = pygsti.report.Workspace()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Within an IPython notebook like this one, we can create figures in notebook cells by calling (once, usually at the beginning of the notebook):" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "
Gate | Superoperator (Pauli-Product basis) |
---|---|
Gi | \n",
" \n",
"\n",
" \n",
"\n",
"\n",
" |
Gx | \n",
" \n",
"\n",
" \n",
"\n",
"\n",
" |
Gy | \n",
" \n",
"\n",
" \n",
"\n",
"\n",
" |