pyGSTi#

Note

You are reading the documentation for pyGSTi version 0.10.post1.dev1. Use the version selector to switch between tagged releases and the latest development build.

Welcome! This page is a top-level introduction to pyGSTi. It and the rest of this documentation describe and demonstrate how you can use the pygsti package to accomplish various tasks related to quantum characterization. We’ll start with a brief general introduction and then move on to specifics.

Quickstart#

Install from PyPI (see Installation for conda, optional dependencies, and building from source). You can get our latest official release with the following shell command.

pip install pygsti

To get the latest version of our develop branch (which is the basis of these web docs), have pip pull from the pyGSTi git repo instead.

pip install git+https://github.com/sandialabs/pyGSTi.git@develop

Then build a model and compute circuit outcome probabilities:

import pygsti
from pygsti.modelpacks import smq1Q_XYI

model = smq1Q_XYI.target_model()                    # ideal 1-qubit model
circuit = pygsti.circuits.Circuit([('Gxpi2', 0)])   # a single X(π/2) gate
model.probabilities(circuit)                        # ~ {('0',): 0.5, ('1',): 0.5}

Ready to do more? See Getting Started below for guided tours of pyGSTi’s protocols and objects.

Tip

Running these notebooks. This site renders the source MyST Markdown without executing cells, so you won’t see outputs (plots, tables) inline. To run a notebook yourself: use the rocket icon at the top right of any page to launch it in Binder or Colab, or use the download dropdown (cloud icon) to grab the .ipynb and run it in your own Jupyter environment.

What does pyGSTi do?#

PyGSTi is a Python framework for modeling and analyzing collections of qubits, more affectionately called quantum information processors (QIPs). We use “QIP” generously to include systems of just 1 or 2 qubits in addition to larger systems. Initially pyGSTi was developed to perform a single type of data analysis called gate set tomography (GST), from where pyGSTi derives it’s name. While GST is still a central capability of the package, pyGSTi is capable of modeling QIP behavior and analyzing QIP data much more generally.

For example, some things you might use pyGSTi for are:

  • constructing and manipulating quantum circuits.

  • constructing a model for a QIP.

  • computing the outcome probabilities of a circuit predicted by a QIP model.

  • simulating observed data based on a QIP model.

  • testing how a particular QIP model agrees with real data taken.

  • running high-level quantum characterization protocols such as:

    • Gate set tomography (GST) on 1 or 2 qubits

    • Clifford randomized benchmarking (RB)

    • Direct randomized benchmarking (DRB)

    • Robust phase estimation (RPE)

    • Multi-qubit reduced-model tomography

  • performing “drift-detection” tests on multiple passes of ideally identical data.

  • computing the process fidelity or diamond distance between two gate matrices.

  • making sweet-looking figures that compare QIP models and data.

  • creating integrated reports which explain characterization results (especially GST).

Getting Started#

This documentation facilitates two basic approaches to getting started with pyGSTi.

The first approach is a top-down approach that shows how to use pyGSTi as a stand-alone QCVV tool that runs protocols on data. An overview of what protocols pyGSTi can run and how to invoke them is given in the pyGSTi protocols overview tutorial.

The second is a bottom-up approach that starts by introducing the main components of pyGSTi and how they work together, and then explains what you can do with them. If you like this approach or are ambivalent, you should read through these two tutorials to get a high-level overview of what pyGSTi can do:

(These pages link to further tutorials covering more advanced functionality that you are free to explore as desired.)

If you have a particular problem you need solved and you want to know what 5 lines of Python code will get it done for you, then you should visit the FAQ with its links to associated example tutorials. If your question isn’t answered there, you should email us at pygsti@sandia.gov or add an issue to the pyGSTi github page.