-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pyGSTi fails to generate plots without X #1
Comments
A simple work around is to add import matplotlib
matplotlib.use('Agg') at the top of the notebook and restart the kernel. I am not sure how this interacts with inline plots, though. |
In light of proper RB protocol needing to keep data from duplicate gate sequences separate, a new argument 'collisionAction' has been added to the constructor of DataSet (and MultiDataSet) objects. By default it is set to "aggregate" which causes the add-data functions of DataSet to add the supplied data to an existing gate sequence, which has been the only behavior thus far. Now, by setting 'collisionAction' to "keepseparate" the DataSet's add-data methods will append a "#<number>" gate label to the end of existing gate sequences (starting with <number> == "1" and going up) and thereby store the data separately. To access the data, one may query the gate string + "#1", for example, or use the new 'get_row' and 'set_row' methods which take the optional integer argument "occurance" which defaults to 0. Machinery to track and preserve the collisionAction of DataSets within a MultiDataSet has also been added, though it may not be needed much since MultiDataSets store *static* DataSets. Thus, it only comes into play when you make a non-static copy of one of the data sets stored within a MultiDataSet. This update also adds 'collisionAction' arguments to io's load_dataset and load_multidataset, as well as to generate_fake_data. Furthermore, the RB functionality has been updated to make proper use of collisionAction, so that do_randomized_benchmarking expects a DataSet with collisionAction == "keepseparate" (or with no duplicated clifford sequences). The tutorial notebook has been updated to generate a fake data set accordingly.
Just to follow up, I think we've addressed this issue in a somewhat roundabout way in that as of pyGSTi version 0.9.4 we don't use matplotlib (nor X) to generate report plots by default. There is still, however the option of generating PDF-format reports which still use matplotlib, and if one does this in a notebook the workaround suggested by Marcus above is the best and only thing I know to skirt the issue of Matplotlib's "inline" backend" not being able to write PDFs. So in summary:
to the beginning of your notebook should fix the problem. |
See error messages in the attached (as PNG and zipped Jupyter notebook). This happens in the
00 Quick and easy GST.ipynb
file included with pyGSTi.It seems to indicate that using the default configuration, matplotlib will try to use the QtAgg backend to plot, but then it can't plot because there is no DISPLAY variable set (X is not running).
This error can be reproduced by using a docker image built from BBN-Q/pygsti-docker (so it runs on Ubuntu 14.04, and all python library dependencies are explicitly listed there).
00 Quick and easy GST MPS.ipynb.zip
The text was updated successfully, but these errors were encountered: