You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add leakage subpackage to the API docs. Update README.md to emphasize the distinction between building notebooks and building the web docs. Change a comment in gaugeopt.py following decision to close GitHub issue #820.
Copy file name to clipboardExpand all lines: README.md
+44-48Lines changed: 44 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@
8
8
9
9
pyGSTi
10
10
------
11
-
**pyGSTi** is an open-source software for *modeling and characterizing noisy quantum information processors*
11
+
**pyGSTi** is open-source software for *modeling and characterizing noisy quantum information processors*
12
12
(QIPs), i.e., systems of one or more qubits. It is licensed under the Apache License, Version 2.0.
13
13
Copyright information can be found in ``NOTICE``, and the license itself in ``LICENSE``.
14
14
@@ -17,9 +17,9 @@ There are three main objects in pyGSTi:
17
17
-`Model`: a description of a QIP's gate and SPAM operations (a noise model).
18
18
-`DataSet`: a dictionary-like container holding experimental data.
19
19
20
-
You can do various things by with these objects:
20
+
You can do various things with these objects:
21
21
22
-
-**Circuit simulation**: compute a the outcome probabilities of a `Circuit` using a `Model`.
22
+
-**Circuit simulation**: compute the outcome probabilities of a `Circuit` using a `Model`.
23
23
-**Data simulation**: simulate experimental data (a `DataSet`) using a `Model`.
24
24
-**Model testing**: Test whether a given `Model` fits the data in a `DataSet`.
25
25
-**Model estimation**: Estimate a `Model` from a `DataSet` (e.g. using GST).
@@ -32,10 +32,10 @@ In particular, there are a number of characterization protocols currently implem
32
32
quality of a QIP in an average sense. PyGSTi implements standard "Clifford" RB
33
33
as well as the more scalable "Direct" RB methods.
34
34
-**Robust Phase Estimation (RPE)** is a method designed for quickly learning
35
-
a few noise parameters of a QIP that particularly useful for tuning up qubits.
35
+
a few noise parameters of a QIP that are particularly useful for tuning up qubits.
36
36
37
37
PyGSTi is designed with a modular structure so as to be highly customizable
38
-
and easily integrated to new or existing python software. It runs using
38
+
and easily integrated with new or existing python software. It runs using
39
39
python 3.10 or higher. To facilitate integration with software for running
40
40
cloud-QIP experiments, pyGSTi `Circuit` objects can be converted to IBM's
41
41
**OpenQASM** and Rigetti Quantum Computing's **Quil** circuit description languages.
@@ -51,10 +51,7 @@ To install pyGSTi and only its required dependencies run:
51
51
52
52
``pip install pygsti[complete]``
53
53
54
-
The disadvantage to these approaches is that the numerous tutorials
55
-
included in the package will then be buried within your Python's
56
-
`site_packages` directory, which you'll likely want to access later on.
57
-
**Alternatively**, you can **locally install** pyGSTi using the following commands:
54
+
**Alternatively**, you can install pyGSTi from source using the following commands:
58
55
59
56
~~~
60
57
cd <install_directory>
@@ -63,17 +60,10 @@ cd pyGSTi
63
60
pip install -e .[complete]
64
61
~~~
65
62
66
-
As above, you can leave off the `.[complete]` if you only went the minimal
67
-
set of dependencies installed. You could also replace the `git clone ...`
68
-
command with `unzip pygsti-0.9.x.zip` where the latter file is a downloaded
69
-
pyGSTi source archive. Any of the above installations *should* build
70
-
the set of optional Cython extension modules if a working C/C++ compiler
71
-
and the `Cython` package are present. If, however, compilation fails or
72
-
you later decided to add Cython support, you can rebuild the extension
73
-
modules (without reinstalling) if you've followed the local installation
74
-
approach above using the command:
63
+
Any of the above installations *should* build the set of optional Cython extension modules if a working C/C++ compiler and the `Cython` package are present.
75
64
76
-
`python setup.py build_ext --inplace`
65
+
If you installed from source then you have the option of (re)building Cython extensions at any time.
66
+
You can do that by running `python setup.py build_ext --inplace`.
77
67
78
68
Finally, [Jupyter notebook](http://jupyter.org/) is highly recommended as
79
69
it is generally convenient and the format of the included tutorials and
@@ -82,14 +72,14 @@ it can be installed separately.
82
72
83
73
Getting Started
84
74
---------------
85
-
Here's a couple of simple examples to get you started.
75
+
Here are a couple of simple examples to get you started.
86
76
87
77
#### Circuit simulation
88
78
To compute the outcome probabilities of a circuit, you just need to create
89
79
a `Circuit` object (describing your circuit) and a `Model` object containing
90
80
the operations contained in your circuit. Here we use a "stock" single-qubit `Model`
91
-
containing *Idle*, *X(π/2)*, and *Y(π/2)* gates labelled `Gi`, `Gx`,
92
-
and `Gy`, respectively:
81
+
containing an unlabeled *Idle* gate along with *X(π/2)* and *Y(π/2)* gates
82
+
labelled `Gxpi2`and `Gypi2`, respectively:
93
83
~~~
94
84
import pygsti
95
85
from pygsti.modelpacks import smq1Q_XYI
@@ -106,20 +96,20 @@ hardware designed to implement a (small) system of quantum bits (qubits).
106
96
Here's the basic idea:
107
97
108
98
1. you tell pyGSTi what gates you'd ideally like to perform
109
-
2. pyGSTi tells you what circuits it want's data for
99
+
2. pyGSTi tells you what circuits it wants data for
110
100
3. you perform the requested experiments and place the resulting
111
-
data (outcome counts) into a text file that looks something like:
101
+
data (outcome counts) into a text file that looks something like this:
112
102
113
103
```
114
104
## Columns = 0 count, 1 count
115
105
{} 0 100 # the empty sequence (just prep then measure)
116
-
Gx 10 90 # prep, do a X(pi/2) gate, then measure
117
-
GxGy 40 60 # prep, do a X(pi/2) gate followed by a Y(pi/2), then measure
106
+
Gx 10 90 # prep, do an X(pi/2) gate, then measure
107
+
GxGy 40 60 # prep, do an X(pi/2) gate followed by a Y(pi/2), then measure
118
108
Gx^4 20 80 # etc...
119
109
```
120
110
121
-
4. pyGSTi takes the data file and outputs a "report" - currently a
122
-
HTML web page.
111
+
4. pyGSTi takes the data file and outputs a "report" - currently
112
+
an HTML web page.
123
113
124
114
In code, running GST looks something like this:
125
115
~~~
@@ -154,35 +144,27 @@ report.write_html("myReport", auto_open=True, verbosity=1) # Can also write out
154
144
155
145
Documentation
156
146
-------------
157
-
There are numerous tutorials (meant to be pedagogical) and examples (meant to be demonstrate
158
-
how to do some particular thing) in the `pyGSTi/docs` directory. These are stored as MyST Markdown
147
+
There are numerous tutorials and examples in the `pyGSTi/docs` directory. These are stored as MyST Markdown
159
148
for version control convenience, but can be converted to Jupyter notebooks as needed using Jupytext.
160
149
161
-
#### Viewing the documentation *online*
150
+
### Viewing the documentation *online*
162
151
The recommended way to view the documentation is on [ReadTheDocs](https://pygsti.readthedocs.io/en/latest/),
163
152
although the raw Markdown files can also be looked at on [GitHub](https://github.com/sandialabs/pyGSTi/blob/master/docs/markdown/intro.md).
164
153
165
154
The site renders the source MyST Markdown without executing notebook cells, so you won't see outputs (plots, tables) inline.
166
-
Each rendered page offers two ways to run the notebook yourself:
155
+
You can download the notebooks or run them on the cloud with buttons in the upper-right of the given page.
167
156
168
-
- **Rocket icon → Binder or Colab:** launches a fully-provisioned notebook environment in your browser with no local install.
169
-
- **Cloud/download icon → "Download this page" dropdown:** grab the `.ipynb` (or the `.md` source) and run it in your own Jupyter setup.
157
+
- **Download icon → ipynb, md, or pdf.** If you just click the `.ipynb` or `.md` options then the source will open as raw text in a new tab.
158
+
If you want to save those files you need to **right click the desired format and select `Save Link As ...`**, then enter the file name with the appropriate extension.
159
+
Here's a screenshot of what that can look like.
170
160
171
-
#### Building the documentation *locally*
172
-
The docs are built using [Jupyter Book v1](https://jupyterbook.org). Note: v2 is a separate product (MyST Engine + Node.js)
173
-
that doesn't support our autodoc-based API reference yet, so we pin `jupyter-book<2`.
To install the build dependencies along with pyGSTi:
176
-
``pip install -e .[docs]``
177
-
178
-
then build:
179
-
``jb build docs``
163
+
- **Rocket icon → Binder or Colab:** launches a fully-provisioned notebook environment in your browser with no local install. Right now this is clunky and not recommended.
180
164
181
-
Then open `docs/_build/html/index.html` in a web browser to look through the documentation.
182
-
183
-
#### Running notebooks *locally*
184
-
It can also be convenient to build and run the tutorials locally. We can do this using Jupytext
185
-
for conversion and then start a Jupyter notebook or JupyterLab server to run the notebooks.
165
+
### Running notebooks *locally*
166
+
It can be convenient to just build and run the tutorials locally.
167
+
We can do this using Jupytext for conversion and then start a Jupyter notebook or JupyterLab server to run the notebooks.
186
168
Assuming you've followed the *local installation* directions above:
187
169
188
170
* Change to the docs directory, by running:
@@ -199,7 +181,21 @@ where you can start the first `markdown/intro.ipynb` notebook. Note that the ke
199
181
command to execute a cell within the Jupyter notebook is ``Shift+Enter``, not
200
182
just ``Enter``.
201
183
202
-
#### Contributing notebook changes
184
+
### Building the web documentation *locally*
185
+
The web docs are built using [Jupyter Book v1](https://jupyterbook.org). Note: v2 is a separate product that doesn't support our autodoc-based API reference yet, so we pin `jupyter-book<2`.
186
+
187
+
**WARNING.** Building the web docs takes a LONG TIME, because they include a very large **API Reference**.
188
+
If you only want to read or work with the tutorials and examples, don't do a full build — just convert and [run the notebooks directly](#running-notebooks-locally).
189
+
190
+
To install the build dependencies along with pyGSTi:
191
+
``pip install -e .[docs]``
192
+
193
+
then build:
194
+
``jb build docs``
195
+
196
+
Then open `docs/_build/html/index.html` in a web browser to look through the documentation.
197
+
198
+
### Contributing notebook changes
203
199
**Only the `docs/markdown/*.md` files are version-controlled.** The paired `.ipynb` files — generated next to
204
200
each `.md` under `docs/markdown/` — are gitignored build artifacts. The canonical source is the `.md` file, and
0 commit comments