Comments (37)
pip list
gives cvxopt (1.1.8)
and cvxpy (0.4.2)
from pygsti.
I should add there is nothing pathological about the data. A can compute the diamond norm through other means without a problem.
from pygsti.
Hi Marcus,
Thanks for pointing this out. I'll take a look at it soon. Are you using the most recent master branch version of pyGSTi?
Erik
On May 18, 2016, at 8:36 AM, Marcus P S <[email protected]mailto:[email protected]> wrote:
I should add there is nothing pathological about the data. A can compute the diamond norm through other means without a problem.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-220046220
from pygsti.
Using the most up-to-date version of master
, I am unable to reproduce @marcusps' bug. I copy/pasted the minimal example into a clean Jupyter notebook, and everything ran just fine (modulo some warnings regarding the new colormap).
from pygsti.
(This following are an email I sent to Marcus and his response. Apologies for the repetition; wanted to merge both emails into the github thread. My mistake for not writing here first!)
My email:
Hi Marcus,
Thanks for bringing this to our attention. We’ll try to get to the bottom of this asap. A few quick questions for you:
- Can you try directly computing the diamond norm using pygsti.gatetools.diamonddist function? You can just do something simple like:
pygsti.gatetools.diamonddist(pygsti.construction.std1Q_XY.gs_target['Gx'],pygsti.construction.std1Q_XY.gs_target['Gy’])
(If it works, you should get about 1.732; however, I wouldn’t be surprised if it fails with the same error message.)
- What version of cvxpy do you have installed? Just run in an ipython session:
import cvxpy
cvxpy.version
(I’m running 0.3.0, apparently.)
- Which branch of the pygsti repo are you using? I imagine it’s “master”, but I want to be sure. (Just run the command “git branch”.)
I just switched to the master branch and successfully run the diamonddist function, but I’m having some proxy issues so I haven’t pulled the latest version of the repo; will fix the proxy problem shortly and see if I can reproduce the error your seeing.
Sincerely,
Kenny
The response from Marcus:
Hi Kenny,
"1. Can you try directly computing the diamond norm using
pygsti.gatetools.diamonddist function? You can just do something simple
like:
pygsti.gatetools.diamonddist(pygsti.construction.std1Q_XY.gs_target['Gx'],pygsti.construction.std1Q_XY.gs_target['Gy’])
(If it works, you should get about 1.732; however, I wouldn’t be
surprised if it fails with the same error message.)
"
This fails in the same way as before.
"2. What version of cvxpy do you have installed? Just run in an ipython
session:
import cvxpy
cvxpy.version
(I’m running 0.3.0, apparently.)"
I am running 0.4.0, and tested with 0.3.6 and had the same behavior.
Testing with 0.3.0 also leads to the same error messages, so the culprit
is probably elsewhere.
I had cvxopt 1.1.8 installed, and tried 1.1.7, but nothing changed.
"3. Which branch of the pygsti repo are you using? I imagine it’s
“master”, but I want to be sure. (Just run the command “git branch”.)"
I am on the master branch.
"I just switched to the master branch and successfully run the
diamonddist function, but I’m having some proxy issues so I haven’t
pulled the latest version of the repo; will fix the proxy problem
shortly and see if I can reproduce the error your seeing.
Sincerely,
Kenny"
from pygsti.
It turns out the issue was cvxopt
.
When I tried testing cvxopt=1.1.7
earlier, I made a mistake, and was in fact still running cvxopt=1.1.8
. Once I fixed that, everything works with cvxopt=1.1.7
.
Figuring out what is the problem in cvxopt
will take more snooping.
To summarize, the version of cvxpy
doe snot seem to matter, but cvxopt=1.1.8
in my setup seems to be the culprit.
from pygsti.
Answering Erik's question, yeah, this was with pyGSTi @ master.
from pygsti.
@marcusps Could you indicate a recent commit in your git log? Independently of the cvxpy
issue, it appears that, as of 4b44f0a, the module std1Q_XY
is no longer being imported into the pygsti.construction
namespace.
I would like to try and figure out where that change was introduced, because it means that, as far as the development history is concerned, it should not have been possible for this code
pygsti.gatetools.diamonddist(pygsti.construction.std1Q_XY.gs_target['Gx'],pygsti.construction.std1Q_XY.gs_target['Gy’])
to execute in the first place... 😒
from pygsti.
I did not run that line as Kenny sent it.
I changed std1Q_XY
to std1Q_XYI
and fixed the typo with the quote — after all, the objective was to test the diamond norm distance, not anything else.
But, for completeness:
$ git log
commit 4b44f0a9f57902b598ee9aaf41fb5a555e2b7e05
Merge: 64680f3 7b6209c
Author: Kenny Rudinger <[email protected]>
Date: Thu May 5 18:01:23 2016 -0600
Merge branch 'master' of https://github.com/pyGSTio/pyGSTi
commit 64680f36b45e76be71c1515ef571517a1eaeabde
Author: Kenny Rudinger <[email protected]>
Date: Thu May 5 18:00:46 2016 -0600
Updated germs for std1Q_XY so they are now amplificationally complete.
from pygsti.
That feeling when you realize you weren't paying as close attention as you could have... 😳
I just noticed that you had the line
from pygsti.construction import std1Q_XYI
in your notebook. Then, I assume that your test of Kenny's
pygsti.gatetools.diamonddist(pygsti.construction.std1Q_XY.gs_target['Gx'],\
pygsti.construction.std1Q_XY.gs_target['Gy'])
looked more like
pygsti.gatetools.diamonddist(std1Q_XYI.gs_target['Gx'],std1Q_XYI.gs_target['Gy'])
which would, in fact, at least execute without throwing any kinds of errors as to whether the std1Q_XYI
module even existed. I had tried to run a variant of Kenny's code snippet, and got
import pygsti
pygsti.construction.std1Q_XYI.gs_target['Gx']
AttributeError Traceback (most recent call last)
<ipython-input-2-9c0557982708> in <module>()
-->1 pygsti.construction.std1Q_XYI.gs_target['Gx']
AttributeError: 'module' object has no attribute 'std1Q_XYI'
which is why I was confused as to why things ran on your machine, Marcus. But now I see that, via the import statement, you probably ran a slightly different snippet (after all, as you pointed out, we wanted to test the python.gatetools.diamondist
function).
So, Kenny, I am at a loss as to how you were able to get your code to run earlier, but no longer...😕
from pygsti.
I just tried running @marcusps' minimal example on Mac OS X 10.11.5 with Anaconda as my python distribution, and it didn't successfully execute for cvxopt=1.1.7
or cvxopt=1.1.8
. I also had to remove the mxBasis
kwarg to pygsti.do_long_sequence_gst
, as apparently it no longer exists.
For all of this I'm running python=3.5.1
, numpy=1.11.0
, scipy=0.17.1
, and cvxpy=0.4.2
.
For cvxopt=1.1.8
, I get
SolverError: Solver 'CVXOPT' failed. Try another solver.
For cvxopt=1.1.7
, I get
~/anaconda/lib/python3.5/site-packages/cvxopt/__init__.py in <module>()
240 return +reduce(base.ediv, args)
241
--> 242 base.normal, base.uniform = normal, uniform
243 base.setseed, base.getseed = setseed, getseed
244 base.mul, base.div = mul, div
NameError: name 'base' is not defined
This appears to be a problem with cvxopt, but it strikes me as strange that others aren't having any difficulty using 1.1.7.
I also tried running with python=2.7.11
, and once again for cvxopt=1.1.8
got
SolverError: Solver 'CVXOPT' failed. Try another solver.
However, when I ran with python=2.7.11
and cvxopt=1.1.7
, the pdf was generated (although table 8 only has dashes where the diamond-norm values are supposed to be).
from pygsti.
I may have identified the issue. In issue #11 I've documented that installing cvxopt
with anaconda was giving rise to a bunch of ImportError
s. I found that once I installed it with pip
that I not only got rid of the import errors, but I could run @marcusps's minimal example with cvxopt=1.1.8
both with python 2 on master
and python 3 on commit c34ba68 of develop
. Not only does it not raise SolverError
s, but it also populates the diamond-norm values in table 8 like it's supposed to.
Can you verify this works on your system as well? I'm guessing it will, since it appears you are also using anaconda.
from pygsti.
So I (think I) installed cvxpy
using pip
(at the very least, pip install cvxpy
ran and did something!). I was able to run @marcusps's minimal example on the master
branch using Python 2.7.
And indeed, Table 8 does show actual numbers (as opposed to dashes or something) for the diamond norm.
This probably confirms @jarthurgross' suspicion that the issue has to deal with the installer for cvxopt
.
from pygsti.
Can you run pip list
or conda list
and verify what version of cvxopt
you got to work? Hopefully it's 1.1.8
, since @marcusps already had success with 1.1.7
.
from pygsti.
Hm, this problem does not seem to have gone away. I am running into it again on the beta
branch, and I can't generate any reports because of it.
If I uninstall cvxopt 1.1.8, install cvxopt 1.1.7, and restart the kernel, everything works fine.
Here's the latest error msg:
#Generate a "general" report, tailored to 2-qubit data
#results.create_general_report_pdf(filename="myReport_randomReduction.pdf",verbosity=2)
results.create_brief_report_pdf(filename="myReport_randomReduction.pdf",verbosity=1)
*** Generating tables ***
---------------------------------------------------------------------------
SolverError Traceback (most recent call last)
<ipython-input-18-142cd7849245> in <module>()
1 #Generate a "general" report, tailored to 2-qubit data
2 #results.create_general_report_pdf(filename="myReport_randomReduction.pdf",verbosity=2)
----> 3 results.create_brief_report_pdf(filename="myReport_randomReduction.pdf",verbosity=1)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in create_brief_report_pdf(self, confidenceLevel, filename, title, datasetLabel, suffix, m, M, tips, verbosity, comm)
2106
2107 for key in tables_to_compute:
-> 2108 qtys[key] = self.tables.get(key, verbosity=printer - 1).render(
2109 'latex',longtables=self.options.long_tables, scratchDir=D,
2110 precision=self.options.precision,
/home/jovyan/work/pyGSTi/packages/pygsti/report/resultcache.py in get(self, key, confidence_level, verbosity)
77 printer.log("Generating %s: %s%s" % (self._typename, key, (" (w/%d%% CIs)" % round(level) if (level is not None) else "")))
78
---> 79 self._data[level][key] = computeFn(key, level, printer)
80 except ResultCache.NoCRDependenceError:
81 assert(level is not None)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in fn(key, confidenceLevel, vb)
535 gsTgt, gsBest = setup()
536 cri = self._get_confidence_region(confidenceLevel)
--> 537 return _generation.get_gates_vs_target_table(gsBest, gsTgt, cri)
538 fns['bestGatesetVsTargetTable'] = (fn, validate_essential)
539
/home/jovyan/work/pyGSTi/packages/pygsti/report/generation.py in get_gates_vs_target_table(gateset, targetGateset, confidenceRegionInfo)
344 qtys_to_compute = [ '%s %s' % (gl,qty) for qty in qtyNames for gl in gateLabels ]
345 qtys = _cr.compute_gateset_gateset_qtys(qtys_to_compute, gateset, targetGateset,
--> 346 confidenceRegionInfo)
347
348 table = _ReportTable(colHeadings, formatters)
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in compute_gateset_gateset_qtys(qtynames, gateset1, gateset2, confidenceRegionInfo)
755 try:
756 ret[key] = _getGateQuantity(half_diamond_norm, gateset1, gateLabel,
--> 757 eps, confidenceRegionInfo)
758 except ImportError: #if failed to import cvxpy (probably b/c it's not installed)
759 ret[key] = ReportableQty(_np.nan) # report NAN for diamond norms
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in _getGateQuantity(fnOfGate, gateset, gateLabel, eps, confidenceRegionInfo, verbosity)
77
78 if confidenceRegionInfo is None: # No Error bars
---> 79 return ReportableQty(fnOfGate(gateset.gates[gateLabel]))
80
81 # make sure the gateset we're given is the one used to generate the confidence region
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in half_diamond_norm(gate)
750
751 def half_diamond_norm(gate):
--> 752 return 0.5 * _tools.diamonddist(gate, gateset2.gates[gateLabel]) #Note: default 'gm' basis
753 #vary elements of gateset1 (assume gateset2 is fixed)
754
/home/jovyan/work/pyGSTi/packages/pygsti/tools/gatetools.py in diamonddist(A, B, mxBasis, dimOrStateSpaceDims)
250 prob = _cvxpy.Problem(objective, constraints)
251 # try:
--> 252 prob.solve(solver="CVXOPT")
253 # prob.solve(solver="ECOS")
254 # prob.solve(solver="SCS")#This always fails
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in solve(self, *args, **kwargs)
171 return func(self, *args, **kwargs)
172 else:
--> 173 return self._solve(*args, **kwargs)
174
175 @classmethod
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _solve(self, solver, ignore_dcp, warm_start, verbose, parallel, **kwargs)
301 results_dict = {s.STATUS: sym_data.presolve_status}
302
--> 303 self._update_problem_state(results_dict, sym_data, solver)
304 return self.value
305
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _update_problem_state(self, results_dict, sym_data, solver)
413 else:
414 raise SolverError(
--> 415 "Solver '%s' failed. Try another solver." % solver.name())
416 self._status = results_dict[s.STATUS]
417
SolverError: Solver 'CVXOPT' failed. Try another solver.
Here is the output of pip list
pip list
bokeh (0.11.1)
cloudpickle (0.1.1)
conda (4.1.11)
conda-env (2.5.0a0)
configobj (5.0.6)
CVXcanon (0.1.0)
cvxopt (1.1.8)
cvxpy (0.4.2)
cycler (0.9.0)
Cython (0.23.4)
decorator (4.0.6)
dill (0.2.5)
ecos (2.0.4)
fastcache (1.0.2)
future (0.15.2)
h5py (2.5.0)
ipykernel (4.2.2)
ipython (4.1.1)
ipython-genutils (0.1.0)
ipywidgets (4.1.1)
Jinja2 (2.8)
jsonschema (2.4.0)
jupyter-client (4.1.1)
jupyter-contrib-core (0.3.0)
jupyter-contrib-nbextensions (0.1.0)
jupyter-core (4.0.6)
jupyter-nbextensions-configurator (0.2.1)
llvmlite (0.8.0)
lxml (3.6.1)
MarkupSafe (0.23)
matplotlib (1.5.1)
mistune (0.7.1)
mpltools (0.2.0)
multiprocess (0.70.4)
nbconvert (4.1.0)
nbformat (4.0.1)
networkx (1.11)
nose (1.3.7)
notebook (4.1.0)
numba (0.23.1)
numpy (1.11.1)
pandas (0.17.1)
path.py (0.0.0)
patsy (0.4.0)
pexpect (3.3)
pickleshare (0.5)
Pillow (3.1.1)
pip (8.1.2)
psutil (4.3.0)
ptyprocess (0.5)
pycosat (0.6.1)
pycrypto (2.6.1)
Pygments (2.1)
pyparsing (2.0.3)
python-dateutil (2.4.2)
python-pptx (0.5.8)
pytz (2015.7)
PyYAML (3.11)
pyzmq (15.2.0)
requests (2.10.0)
ruamel-yaml (-VERSION)
scikit-image (0.11.3)
scikit-learn (0.17.1)
scipy (0.18.0)
scs (1.2.6)
seaborn (0.7.0)
setuptools (25.1.6)
simplegeneric (0.8.1)
six (1.10.0)
statsmodels (0.6.1)
sympy (0.7.6.1)
terminado (0.5)
toolz (0.8.0)
tornado (4.3)
traitlets (4.1.0)
wheel (0.29.0)
XlsxWriter (0.9.3)
Here is the output of conda list
conda list
# packages in environment at /opt/conda:
#
bokeh 0.11.1 py35_0
cloudpickle 0.1.1 py35_0
conda 4.1.11 py35_0
conda-env 2.5.2 py35_0
configobj 5.0.6 <pip>
CVXcanon 0.1.0 <pip>
cvxopt 1.1.8 py35_3
cvxpy 0.4.2 <pip>
cycler 0.9.0 py35_0
cython 0.23.4 py35_0
decorator 4.0.6 py35_0
dill 0.2.4 py35_0
dill 0.2.5 <pip>
ecos 2.0.4 <pip>
fastcache 1.0.2 py35_0
fontconfig 2.11.1 5
freetype 2.5.5 0
future 0.15.2 <pip>
h5py 2.5.0 np110py35_4
hdf5 1.8.15.1 2
ipykernel 4.2.2 py35_0
ipython 4.1.1 py35_0
ipython_genutils 0.1.0 py35_0
ipywidgets 4.1.1 py35_0
jbig 2.1 0
jinja2 2.8 py35_0
jpeg 8d 0
jsonschema 2.4.0 py35_0
jupyter-contrib-core 0.3.0 <pip>
jupyter-contrib-nbextensions 0.1.0 <pip>
jupyter-nbextensions-configurator 0.2.1 <pip>
jupyter_client 4.1.1 py35_0
jupyter_core 4.0.6 py35_0
libgfortran 3.0.0 1
libpng 1.6.17 0
libsodium 1.0.3 0
libtiff 4.0.6 1
libxml2 2.9.2 0
libxslt 1.1.28 0
llvmlite 0.8.0 py35_0
lxml 3.6.1 py35_0
markupsafe 0.23 py35_0
matplotlib 1.5.1 np110py35_0
mistune 0.7.1 py35_0
mkl 11.3.3 0
mpltools 0.2.0 <pip>
multiprocess 0.70.4 <pip>
nbconvert 4.1.0 py35_0
nbformat 4.0.1 py35_0
networkx 1.11 py35_0
nose 1.3.7 py35_1
notebook 4.1.0 py35_0
numba 0.23.1 np110py35_0
numpy 1.11.1 py35_0
openssl 1.0.2h 1
pandas 0.17.1 np110py35_0
path.py 8.1.2 py35_1
patsy 0.4.0 np110py35_0
pexpect 3.3 py35_0
pickleshare 0.5 py35_0
pillow 3.1.1 py35_0
pip 8.1.2 py35_0
psutil 4.3.0 <pip>
ptyprocess 0.5 py35_0
pycosat 0.6.1 py35_1
pycrypto 2.6.1 py35_0
pygments 2.1 py35_0
pyparsing 2.0.3 py35_0
pyqt 4.11.4 py35_1
python 3.5.2 0
python-dateutil 2.4.2 py35_0
python-pptx 0.5.8 <pip>
pytz 2015.7 py35_0
pyyaml 3.11 py35_4
pyzmq 15.2.0 py35_0
qt 4.8.7 1
readline 6.2 2
requests 2.10.0 py35_0
ruamel_yaml 0.11.14 py35_0
scikit-image 0.11.3 np110py35_0
scikit-learn 0.17.1 np111py35_2
scipy 0.18.0 np111py35_0
scs 1.2.6 <pip>
seaborn 0.7.0 py35_0
setuptools 25.1.6 py35_0
simplegeneric 0.8.1 py35_0
sip 4.16.9 py35_0
six 1.10.0 py35_0
sqlite 3.13.0 0
statsmodels 0.6.1 np110py35_0
sympy 0.7.6.1 py35_0
terminado 0.5 py35_1
tk 8.5.18 0
toolz 0.8.0 <pip>
tornado 4.3 py35_0
traitlets 4.1.0 py35_0
wheel 0.29.0 py35_0
XlsxWriter 0.9.3 <pip>
xz 5.2.2 0
yaml 0.1.6 0
zeromq 4.1.3 0
zlib 1.2.8 3
Here is the Dockerfile
needed to reproduct the docker image I run exactly (i.e., you can run it yourself and see the same errors).
Dockerfile
needed to reproduct the docker image I run exactly (i.e., you can run it yourself and see the same errors).FROM jupyter/scipy-notebook
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends libblas-dev liblapack-dev libatlas-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER jovyan
RUN mkdir ~/work/data
RUN mkdir /home/jovyan/.local/share
RUN mkdir /home/jovyan/.local/share/jupyter
RUN /bin/bash -c "pip install git+git://github.com/ipython-contrib/IPython-notebook-extensions.git@master"
# RUN /bin/bash -c "source activate python2; \
# conda install lxml cvxopt=1.1.7; \
# pip install python-pptx; \
# pip install cvxpy==0.4.0; \
# pip install git+https://github.com/tonysyu/mpltools.git@master"
RUN /bin/bash -c "conda install lxml pip nose numpy scipy cvxopt; \
pip install python-pptx; \
pip install cvxpy==0.4.2; \
pip install git+https://github.com/tonysyu/mpltools.git@master"
RUN git clone https://github.com/pyGSTio/pyGSTi.git
RUN cd pyGSTi; git checkout beta; python install_locally.py # latest
VOLUME ~/work/data
from pygsti.
BTW, I tried uninstalling cvxopt, then installing cvxopt 1.1.8 with pip and nothing changed.
Here is what happens when I rerun my minimal example.
Loading test.gst: 100%
--- LGST ---
('LGST: Singular values of I_tilde (truncating to first 4 of 6) = \n', array([ 4.24292665, 1.28978318, 1.27766611, 1.26047845, 0.04327326,
0.00943884]))
LGST DEBUG: Gi before trunc to first 4 row and cols =
4.2424 -0.0003 0 0.0001 0 -0.0002
-0.0080 1.2603 0.0250 0.0130 0.0133 0.0054
0.0093 0 1.2737 0.0283 0.0222 -0.0030
0.0009 0.0022 -0.0088 1.2488 0.0065 0.0026
-0.0152 -0.0272 -0.0364 -0.0028 -0.0108 -0.0085
0.0238 -0.0141 0.0056 -0.0185 0.0068 0.0010
LGST DEBUG: Gx before trunc to first 4 row and cols =
4.2429 -0.0024 -0.0019 -0.0006 -0.0003 -0.0002
0.0039 0.1846 0.5549 1.1184 -0.0046 -0.0064
-0.0015 -1.1658 0.5068 -0.0452 0.0040 0.0091
-0.0100 -0.4719 -1.0213 0.5725 -0.0118 -0.0135
0.0036 0.0063 -0.0137 -0.0004 -0.0511 -0.0004
-0.0049 0.0017 -0.0054 -0.0037 -0.0043 -0.0053
LGST DEBUG: Gy before trunc to first 4 row and cols =
4.2425 0.0015 0.0049 -0.0042 0 -0.0002
-0.0228 0.0238 0.7810 -0.9978 -0.0039 -0.0177
-0.0064 -1.0876 0.5489 0.4167 -0.0243 -0.0093
-0.0210 0.6884 0.7804 0.6769 -0.0095 0.0009
-0.0187 -0.0006 -0.0211 0.0163 0.0015 -0.0029
-0.0015 0.0005 0.0011 -0.0065 0.0165 0.0013
LGST: Singular values of target I_tilde (truncating to first 4 of 6) =
[ 4.24264069e+00 1.41421356e+00 1.41421356e+00 1.41421356e+00
6.40580052e-16 9.87043238e-17]
Resulting gate set:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Gauge Optimization to TP (L-BFGS-B) ---
17s 0.0000000384
The resulting TP penalty is: 3.84125e-08
The gauge matrix found (B^-1) is:
[[ 1.00000348e+00 1.62293418e-05 -9.40728239e-06 2.67577725e-05]
[ -1.59259939e-09 9.99999999e-01 -6.08699488e-10 4.94035495e-10]
[ -2.08253528e-09 -6.08699396e-10 9.99999999e-01 1.77772457e-09]
[ 4.08151522e-09 4.94035403e-10 1.77772457e-09 9.99999996e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Iterative MLGST: Iter 0 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 1 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 2 of 9 168 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 137.715 (168 data params - 31 model params = expected mean of 137; p-value = 0.466775)
2*Delta(log(L)) = 138.035
--- Iterative MLGST: Iter 3 of 9 441 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 455.296 (441 data params - 31 model params = expected mean of 410; p-value = 0.060555)
2*Delta(log(L)) = 456.791
--- Iterative MLGST: Iter 4 of 9 817 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 887.53 (817 data params - 31 model params = expected mean of 786; p-value = 0.00666638)
2*Delta(log(L)) = 891.698
--- Iterative MLGST: Iter 5 of 9 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1244.3 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.0644704)
2*Delta(log(L)) = 1249.09
--- Iterative MLGST: Iter 6 of 9 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1630.81 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0857275)
2*Delta(log(L)) = 1635.63
--- Iterative MLGST: Iter 7 of 9 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2043.59 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0467865)
2*Delta(log(L)) = 2049.52
--- Iterative MLGST: Iter 8 of 9 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2471.9 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0152387)
2*Delta(log(L)) = 2477.98
--- Iterative MLGST: Iter 9 of 9 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2813.09 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0740998)
2*Delta(log(L)) = 2819.46
--- Last Iteration: switching to ML objective ---
--- MLGST ---
Memory estimates: (2 spam labels,2737 gate strings, 43 gateset params, 4 gate dim)
Peristent: 0.0018353 GB
Intermediate: 0.0143765 GB
Limit: 10 GB
Least squares msg = Both actual and predicted relative reductions in the sum of squares
are at most 0.000001; flag =1
Maximum log(L) = 1409.24 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2818.48 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0645887)
2*Delta(log(L)) = 2818.48
*** Generating tables ***
Iter 00 of 16 : Generating table: targetSpamTable
Iter 01 of 16 : Generating table: targetGatesTable
Iter 02 of 16 : Generating table: datasetOverviewTable
Iter 03 of 16 : Generating table: bestGatesetSpamTable
Iter 04 of 16 : Generating table: bestGatesetSpamParametersTable
Iter 05 of 16 : Generating table: bestGatesetGatesTable
Iter 06 of 16 : Generating table: bestGatesetChoiTable
Iter 07 of 16 : Generating table: bestGatesetDecompTable
Iter 08 of 16 : Generating table: bestGatesetRotnAxisTable
Iter 09 of 16 : Generating table: bestGatesetClosestUnitaryTable
Iter 10 of 16 : Generating table: bestGatesetVsTargetTable
---------------------------------------------------------------------------
SolverError Traceback (most recent call last)
<ipython-input-2-0d711f946d69> in <module>()
41 'verbosity' : 3} )
42
---> 43 results_test.create_full_report_pdf(verbosity=3)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in create_full_report_pdf(self, confidenceLevel, filename, title, datasetLabel, suffix, debugAidsAppendix, gaugeOptAppendix, pixelPlotAppendix, whackamoleAppendix, m, M, tips, verbosity, comm)
1651 for i, key in enumerate(tables_to_compute):
1652 printer.show_progress(i, len(tables_to_compute) - 1, prefix='', end='')
-> 1653 qtys[key] = self.tables.get(key, verbosity=printer - 1).render(
1654 'latex',longtables=self.options.long_tables, scratchDir=D,
1655 precision=self.options.precision,
/home/jovyan/work/pyGSTi/packages/pygsti/report/resultcache.py in get(self, key, confidence_level, verbosity)
77 printer.log("Generating %s: %s%s" % (self._typename, key, (" (w/%d%% CIs)" % round(level) if (level is not None) else "")))
78
---> 79 self._data[level][key] = computeFn(key, level, printer)
80 except ResultCache.NoCRDependenceError:
81 assert(level is not None)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in fn(key, confidenceLevel, vb)
535 gsTgt, gsBest = setup()
536 cri = self._get_confidence_region(confidenceLevel)
--> 537 return _generation.get_gates_vs_target_table(gsBest, gsTgt, cri)
538 fns['bestGatesetVsTargetTable'] = (fn, validate_essential)
539
/home/jovyan/work/pyGSTi/packages/pygsti/report/generation.py in get_gates_vs_target_table(gateset, targetGateset, confidenceRegionInfo)
344 qtys_to_compute = [ '%s %s' % (gl,qty) for qty in qtyNames for gl in gateLabels ]
345 qtys = _cr.compute_gateset_gateset_qtys(qtys_to_compute, gateset, targetGateset,
--> 346 confidenceRegionInfo)
347
348 table = _ReportTable(colHeadings, formatters)
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in compute_gateset_gateset_qtys(qtynames, gateset1, gateset2, confidenceRegionInfo)
755 try:
756 ret[key] = _getGateQuantity(half_diamond_norm, gateset1, gateLabel,
--> 757 eps, confidenceRegionInfo)
758 except ImportError: #if failed to import cvxpy (probably b/c it's not installed)
759 ret[key] = ReportableQty(_np.nan) # report NAN for diamond norms
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in _getGateQuantity(fnOfGate, gateset, gateLabel, eps, confidenceRegionInfo, verbosity)
77
78 if confidenceRegionInfo is None: # No Error bars
---> 79 return ReportableQty(fnOfGate(gateset.gates[gateLabel]))
80
81 # make sure the gateset we're given is the one used to generate the confidence region
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in half_diamond_norm(gate)
750
751 def half_diamond_norm(gate):
--> 752 return 0.5 * _tools.diamonddist(gate, gateset2.gates[gateLabel]) #Note: default 'gm' basis
753 #vary elements of gateset1 (assume gateset2 is fixed)
754
/home/jovyan/work/pyGSTi/packages/pygsti/tools/gatetools.py in diamonddist(A, B, mxBasis, dimOrStateSpaceDims)
250 prob = _cvxpy.Problem(objective, constraints)
251 # try:
--> 252 prob.solve(solver="CVXOPT")
253 # prob.solve(solver="ECOS")
254 # prob.solve(solver="SCS")#This always fails
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in solve(self, *args, **kwargs)
171 return func(self, *args, **kwargs)
172 else:
--> 173 return self._solve(*args, **kwargs)
174
175 @classmethod
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _solve(self, solver, ignore_dcp, warm_start, verbose, parallel, **kwargs)
301 results_dict = {s.STATUS: sym_data.presolve_status}
302
--> 303 self._update_problem_state(results_dict, sym_data, solver)
304 return self.value
305
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _update_problem_state(self, results_dict, sym_data, solver)
413 else:
414 raise SolverError(
--> 415 "Solver '%s' failed. Try another solver." % solver.name())
416 self._status = results_dict[s.STATUS]
417
SolverError: Solver 'CVXOPT' failed. Try another solver.
from pygsti.
Hmm, well this is disappointing. Before we start down the road of further debugging, could you confirm for me that the uninstall of conda's cvxopt and the reinstall with pip worked correctly by running conda list
again?
Also, I am curious what your system details are. I thought you might have been using OSX since I had similar difficulties with OSX, but looking at your outputs now I'm wondering if you're running Linux instead.
I just ran the notebook I made with your minimal example using the latest commit on the beta branch (9f3919a) and it executed without errors and gave meaningful diamond-norm values, so I suspect it is not the case that a new bug got introduced since I last looked at this.
from pygsti.
I'm using a docker image that runs on top of Debian Linux. I am simply
installing dependencies on top of an existing docker image from the jupyter
developers. If you install docker you should be able to reproduce the bug
using the Docker file I provided.
I'll send you the output of pip list etc tomorrow, but there is not much to
the story: with 1.1.8 I get errors, with 1.1.7 I don't.
I don't think it is a new bug in the beta branch. It is exactly the same
behavior as before. Since OSX users don't see the bug with the minimal
example, I think it is a subtle issue with one of the various numerics
libraries in Linux, maybe even just with Debian. There are some other
Linux/docker only issues, like not being able to generate reports because
matplotlib wants a DISPLAY to be set.
On Mon, Aug 8, 2016, 6:34 PM Jonathan Gross [email protected]
wrote:
Hmm, well this is disappointing. Before we start down the road of further
debugging, could you confirm for me that the uninstall of conda's cvxopt
and the reinstall with pip worked correctly by running conda list again?Also, I am curious what your system details are. I thought you might have
been using OSX since I had similar difficulties with OSX, but looking at
your outputs now I'm wondering if your running Linux instead.I just ran the notebook I made with your minimal example using the latest
commit on the beta branch (9f3919a
9f3919a)
and it executed without errors and gave meaningful diamond-norm values, so
I suspect it is not the case that a new bug got introduced since I last
looked at this.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAOKcd0QHwb0edOhp8blw1F3sknJnFwgks5qd67xgaJpZM4IhVek
.
from pygsti.
I'm running Ubuntu 16.04 (4.4.0-31-generic), which should be very similar to Marcus' setup.
I installed cvxopt/cvxpy though the instructions here
(Entirely through pip/apt package manager)
Pip list outputs the following:
lsaldyt@----:~$ pip list | grep "cvx"
cvxopt (1.1.8)
cvxpy (0.4.2)
lsaldyt@----:~$ pip3 list | grep "cvx"
cvxopt (1.1.8)
cvxpy (0.4.2)
Python versions:
lsaldyt@----:~$ python --version
Python 2.7.12
lsaldyt@----:~$ python3 --version
Python 3.5.2
Running the minimal example (without mxBasis='pp'), does not throw SolverErrors, and yields these pdfs (on beta
):
python-2-7-12.pdf
python-3-5-2.pdf
I'm still working on using the exact same docker image, but I'm putting this here in case it is helpful to anyone
from pygsti.
To reiterate:
If I start with the docker image as is (cvxopt installed through conda), the minimal example fails.
$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.8 py35_3
cvxpy 0.4.2 <pip>
Minimal example fails with
Loading test.gst: 100%
--- LGST ---
('LGST: Singular values of I_tilde (truncating to first 4 of 6) = \n', array([ 4.24292665, 1.28978318, 1.27766611, 1.26047845, 0.04327326,
0.00943884]))
LGST DEBUG: Gi before trunc to first 4 row and cols =
4.2424 -0.0003 0 0.0001 0 -0.0002
-0.0080 1.2603 0.0250 0.0130 0.0133 0.0054
0.0093 0 1.2737 0.0283 0.0222 -0.0030
0.0009 0.0022 -0.0088 1.2488 0.0065 0.0026
-0.0152 -0.0272 -0.0364 -0.0028 -0.0108 -0.0085
0.0238 -0.0141 0.0056 -0.0185 0.0068 0.0010
LGST DEBUG: Gx before trunc to first 4 row and cols =
4.2429 -0.0024 -0.0019 -0.0006 -0.0003 -0.0002
0.0039 0.1846 0.5549 1.1184 -0.0046 -0.0064
-0.0015 -1.1658 0.5068 -0.0452 0.0040 0.0091
-0.0100 -0.4719 -1.0213 0.5725 -0.0118 -0.0135
0.0036 0.0063 -0.0137 -0.0004 -0.0511 -0.0004
-0.0049 0.0017 -0.0054 -0.0037 -0.0043 -0.0053
LGST DEBUG: Gy before trunc to first 4 row and cols =
4.2425 0.0015 0.0049 -0.0042 0 -0.0002
-0.0228 0.0238 0.7810 -0.9978 -0.0039 -0.0177
-0.0064 -1.0876 0.5489 0.4167 -0.0243 -0.0093
-0.0210 0.6884 0.7804 0.6769 -0.0095 0.0009
-0.0187 -0.0006 -0.0211 0.0163 0.0015 -0.0029
-0.0015 0.0005 0.0011 -0.0065 0.0165 0.0013
LGST: Singular values of target I_tilde (truncating to first 4 of 6) =
[ 4.24264069e+00 1.41421356e+00 1.41421356e+00 1.41421356e+00
6.40580052e-16 9.87043238e-17]
Resulting gate set:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Gauge Optimization to TP (L-BFGS-B) ---
6s 0.0000000384
The resulting TP penalty is: 3.84125e-08
The gauge matrix found (B^-1) is:
[[ 1.00000348e+00 1.62293418e-05 -9.40728239e-06 2.67577725e-05]
[ -1.59259939e-09 9.99999999e-01 -6.08699488e-10 4.94035495e-10]
[ -2.08253528e-09 -6.08699396e-10 9.99999999e-01 1.77772457e-09]
[ 4.08151522e-09 4.94035403e-10 1.77772457e-09 9.99999996e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Iterative MLGST: Iter 0 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 1 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 2 of 9 168 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 137.715 (168 data params - 31 model params = expected mean of 137; p-value = 0.466775)
2*Delta(log(L)) = 138.035
--- Iterative MLGST: Iter 3 of 9 441 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 455.296 (441 data params - 31 model params = expected mean of 410; p-value = 0.060555)
2*Delta(log(L)) = 456.791
--- Iterative MLGST: Iter 4 of 9 817 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 887.53 (817 data params - 31 model params = expected mean of 786; p-value = 0.00666638)
2*Delta(log(L)) = 891.698
--- Iterative MLGST: Iter 5 of 9 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1244.3 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.0644704)
2*Delta(log(L)) = 1249.09
--- Iterative MLGST: Iter 6 of 9 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1630.81 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0857275)
2*Delta(log(L)) = 1635.63
--- Iterative MLGST: Iter 7 of 9 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2043.59 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0467865)
2*Delta(log(L)) = 2049.52
--- Iterative MLGST: Iter 8 of 9 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2471.9 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0152387)
2*Delta(log(L)) = 2477.98
--- Iterative MLGST: Iter 9 of 9 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2813.09 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0740998)
2*Delta(log(L)) = 2819.46
--- Last Iteration: switching to ML objective ---
--- MLGST ---
Memory estimates: (2 spam labels,2737 gate strings, 43 gateset params, 4 gate dim)
Peristent: 0.0018353 GB
Intermediate: 0.0143765 GB
Limit: 10 GB
Least squares msg = Both actual and predicted relative reductions in the sum of squares
are at most 0.000001; flag =1
Maximum log(L) = 1409.24 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2818.48 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0645887)
2*Delta(log(L)) = 2818.48
*** Generating tables ***
Iter 00 of 16 : Generating table: targetSpamTable
Iter 01 of 16 : Generating table: targetGatesTable
Iter 02 of 16 : Generating table: datasetOverviewTable
Iter 03 of 16 : Generating table: bestGatesetSpamTable
Iter 04 of 16 : Generating table: bestGatesetSpamParametersTable
Iter 05 of 16 : Generating table: bestGatesetGatesTable
Iter 06 of 16 : Generating table: bestGatesetChoiTable
Iter 07 of 16 : Generating table: bestGatesetDecompTable
Iter 08 of 16 : Generating table: bestGatesetRotnAxisTable
Iter 09 of 16 : Generating table: bestGatesetClosestUnitaryTable
Iter 10 of 16 : Generating table: bestGatesetVsTargetTable
---------------------------------------------------------------------------
SolverError Traceback (most recent call last)
<ipython-input-1-0d711f946d69> in <module>()
41 'verbosity' : 3} )
42
---> 43 results_test.create_full_report_pdf(verbosity=3)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in create_full_report_pdf(self, confidenceLevel, filename, title, datasetLabel, suffix, debugAidsAppendix, gaugeOptAppendix, pixelPlotAppendix, whackamoleAppendix, m, M, tips, verbosity, comm)
1651 for i, key in enumerate(tables_to_compute):
1652 printer.show_progress(i, len(tables_to_compute) - 1, prefix='', end='')
-> 1653 qtys[key] = self.tables.get(key, verbosity=printer - 1).render(
1654 'latex',longtables=self.options.long_tables, scratchDir=D,
1655 precision=self.options.precision,
/home/jovyan/work/pyGSTi/packages/pygsti/report/resultcache.py in get(self, key, confidence_level, verbosity)
77 printer.log("Generating %s: %s%s" % (self._typename, key, (" (w/%d%% CIs)" % round(level) if (level is not None) else "")))
78
---> 79 self._data[level][key] = computeFn(key, level, printer)
80 except ResultCache.NoCRDependenceError:
81 assert(level is not None)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in fn(key, confidenceLevel, vb)
535 gsTgt, gsBest = setup()
536 cri = self._get_confidence_region(confidenceLevel)
--> 537 return _generation.get_gates_vs_target_table(gsBest, gsTgt, cri)
538 fns['bestGatesetVsTargetTable'] = (fn, validate_essential)
539
/home/jovyan/work/pyGSTi/packages/pygsti/report/generation.py in get_gates_vs_target_table(gateset, targetGateset, confidenceRegionInfo)
344 qtys_to_compute = [ '%s %s' % (gl,qty) for qty in qtyNames for gl in gateLabels ]
345 qtys = _cr.compute_gateset_gateset_qtys(qtys_to_compute, gateset, targetGateset,
--> 346 confidenceRegionInfo)
347
348 table = _ReportTable(colHeadings, formatters)
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in compute_gateset_gateset_qtys(qtynames, gateset1, gateset2, confidenceRegionInfo)
755 try:
756 ret[key] = _getGateQuantity(half_diamond_norm, gateset1, gateLabel,
--> 757 eps, confidenceRegionInfo)
758 except ImportError: #if failed to import cvxpy (probably b/c it's not installed)
759 ret[key] = ReportableQty(_np.nan) # report NAN for diamond norms
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in _getGateQuantity(fnOfGate, gateset, gateLabel, eps, confidenceRegionInfo, verbosity)
77
78 if confidenceRegionInfo is None: # No Error bars
---> 79 return ReportableQty(fnOfGate(gateset.gates[gateLabel]))
80
81 # make sure the gateset we're given is the one used to generate the confidence region
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in half_diamond_norm(gate)
750
751 def half_diamond_norm(gate):
--> 752 return 0.5 * _tools.diamonddist(gate, gateset2.gates[gateLabel]) #Note: default 'gm' basis
753 #vary elements of gateset1 (assume gateset2 is fixed)
754
/home/jovyan/work/pyGSTi/packages/pygsti/tools/gatetools.py in diamonddist(A, B, mxBasis, dimOrStateSpaceDims)
250 prob = _cvxpy.Problem(objective, constraints)
251 # try:
--> 252 prob.solve(solver="CVXOPT")
253 # prob.solve(solver="ECOS")
254 # prob.solve(solver="SCS")#This always fails
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in solve(self, *args, **kwargs)
171 return func(self, *args, **kwargs)
172 else:
--> 173 return self._solve(*args, **kwargs)
174
175 @classmethod
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _solve(self, solver, ignore_dcp, warm_start, verbose, parallel, **kwargs)
301 results_dict = {s.STATUS: sym_data.presolve_status}
302
--> 303 self._update_problem_state(results_dict, sym_data, solver)
304 return self.value
305
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _update_problem_state(self, results_dict, sym_data, solver)
413 else:
414 raise SolverError(
--> 415 "Solver '%s' failed. Try another solver." % solver.name())
416 self._status = results_dict[s.STATUS]
417
SolverError: Solver 'CVXOPT' failed. Try another solver.
If I run conda uninstall cvxopt
followed by conda install cvxopt=1.1.7
, the minimal example works.
conda uninstall cvxopt
followed by conda install cvxopt=1.1.7
, the minimal example works.$ pip list | grep cvx
cvxopt (1.1.7)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.7 py35_3
cvxpy 0.4.2 <pip>
Minimal example output is
Loading test.gst: 100%
--- LGST ---
('LGST: Singular values of I_tilde (truncating to first 4 of 6) = \n', array([ 4.24292665, 1.28978318, 1.27766611, 1.26047845, 0.04327326,
0.00943884]))
LGST DEBUG: Gi before trunc to first 4 row and cols =
4.2424 -0.0003 0 0.0001 0 -0.0002
-0.0080 1.2603 0.0250 0.0130 0.0133 0.0054
0.0093 0 1.2737 0.0283 0.0222 -0.0030
0.0009 0.0022 -0.0088 1.2488 0.0065 0.0026
-0.0152 -0.0272 -0.0364 -0.0028 -0.0108 -0.0085
0.0238 -0.0141 0.0056 -0.0185 0.0068 0.0010
LGST DEBUG: Gx before trunc to first 4 row and cols =
4.2429 -0.0024 -0.0019 -0.0006 -0.0003 -0.0002
0.0039 0.1846 0.5549 1.1184 -0.0046 -0.0064
-0.0015 -1.1658 0.5068 -0.0452 0.0040 0.0091
-0.0100 -0.4719 -1.0213 0.5725 -0.0118 -0.0135
0.0036 0.0063 -0.0137 -0.0004 -0.0511 -0.0004
-0.0049 0.0017 -0.0054 -0.0037 -0.0043 -0.0053
LGST DEBUG: Gy before trunc to first 4 row and cols =
4.2425 0.0015 0.0049 -0.0042 0 -0.0002
-0.0228 0.0238 0.7810 -0.9978 -0.0039 -0.0177
-0.0064 -1.0876 0.5489 0.4167 -0.0243 -0.0093
-0.0210 0.6884 0.7804 0.6769 -0.0095 0.0009
-0.0187 -0.0006 -0.0211 0.0163 0.0015 -0.0029
-0.0015 0.0005 0.0011 -0.0065 0.0165 0.0013
LGST: Singular values of target I_tilde (truncating to first 4 of 6) =
[ 4.24264069e+00 1.41421356e+00 1.41421356e+00 1.41421356e+00
6.40580052e-16 9.87043238e-17]
Resulting gate set:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Gauge Optimization to TP (L-BFGS-B) ---
6s 0.0000000384
The resulting TP penalty is: 3.84125e-08
The gauge matrix found (B^-1) is:
[[ 1.00000348e+00 1.62293418e-05 -9.40728239e-06 2.67577725e-05]
[ -1.59259939e-09 9.99999999e-01 -6.08699488e-10 4.94035495e-10]
[ -2.08253528e-09 -6.08699396e-10 9.99999999e-01 1.77772457e-09]
[ 4.08151522e-09 4.94035403e-10 1.77772457e-09 9.99999996e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Iterative MLGST: Iter 0 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 1 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 2 of 9 168 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 137.715 (168 data params - 31 model params = expected mean of 137; p-value = 0.466775)
2*Delta(log(L)) = 138.035
--- Iterative MLGST: Iter 3 of 9 441 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 455.296 (441 data params - 31 model params = expected mean of 410; p-value = 0.060555)
2*Delta(log(L)) = 456.791
--- Iterative MLGST: Iter 4 of 9 817 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 887.53 (817 data params - 31 model params = expected mean of 786; p-value = 0.00666638)
2*Delta(log(L)) = 891.698
--- Iterative MLGST: Iter 5 of 9 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1244.3 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.0644704)
2*Delta(log(L)) = 1249.09
--- Iterative MLGST: Iter 6 of 9 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1630.81 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0857275)
2*Delta(log(L)) = 1635.63
--- Iterative MLGST: Iter 7 of 9 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2043.59 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0467865)
2*Delta(log(L)) = 2049.52
--- Iterative MLGST: Iter 8 of 9 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2471.9 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0152387)
2*Delta(log(L)) = 2477.98
--- Iterative MLGST: Iter 9 of 9 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2813.09 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0740998)
2*Delta(log(L)) = 2819.46
--- Last Iteration: switching to ML objective ---
--- MLGST ---
Memory estimates: (2 spam labels,2737 gate strings, 43 gateset params, 4 gate dim)
Peristent: 0.0018353 GB
Intermediate: 0.0143765 GB
Limit: 10 GB
Least squares msg = Both actual and predicted relative reductions in the sum of squares
are at most 0.000001; flag =1
Maximum log(L) = 1409.24 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2818.48 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0645887)
2*Delta(log(L)) = 2818.48
*** Generating tables ***
Iter 00 of 16 : Generating table: targetSpamTable
Iter 01 of 16 : Generating table: targetGatesTable
Iter 02 of 16 : Generating table: datasetOverviewTable
Iter 03 of 16 : Generating table: bestGatesetSpamTable
Iter 04 of 16 : Generating table: bestGatesetSpamParametersTable
Iter 05 of 16 : Generating table: bestGatesetGatesTable
Iter 06 of 16 : Generating table: bestGatesetChoiTable
Iter 07 of 16 : Generating table: bestGatesetDecompTable
Iter 08 of 16 : Generating table: bestGatesetRotnAxisTable
Iter 09 of 16 : Generating table: bestGatesetClosestUnitaryTable
Iter 10 of 16 : Generating table: bestGatesetVsTargetTable
Iter 11 of 16 : Generating table: bestGatesetErrorGenTable
Iter 12 of 16 : Generating table: fiducialListTable
Iter 13 of 16 : Generating table: prepStrListTable
Iter 14 of 16 : Generating table: effectStrListTable
Iter 15 of 16 : Generating table: germListTable
Iter 16 of 16 : Generating table: progressTable
*** Generating plots ***
LogL plots (2):
Iter 0 of 1 : Generating figure: bestEstimateColorBoxPlot
Iter 1 of 1 : Generating figure: invertedBestEstimateColorBoxPlot
*** Merging into template file ***
Latex file(s) successfully generated. Attempting to compile with pdflatex...
Initial output PDF test.pdf successfully generated.
Final output PDF test.pdf successfully generated. Cleaning up .aux and .log files.
I should add that for this to work I also have to select the Agg
backend in matplotlib (otherwise I run into #1 ). i.e. the minimal example starts with:
import matplotlib
matplotlib.use('Agg')
If I run conda uninstall cvxopt
followed by pip install cvxopt
, the minimal example fails.
conda uninstall cvxopt
followed by pip install cvxopt
, the minimal example fails.$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.8 <pip>
cvxpy 0.4.2 <pip>
Here is the minimal example output:
Loading test.gst: 100%
--- LGST ---
('LGST: Singular values of I_tilde (truncating to first 4 of 6) = \n', array([ 4.24292665, 1.28978318, 1.27766611, 1.26047845, 0.04327326,
0.00943884]))
LGST DEBUG: Gi before trunc to first 4 row and cols =
4.2424 -0.0003 0 0.0001 0 -0.0002
-0.0080 1.2603 0.0250 0.0130 0.0133 0.0054
0.0093 0 1.2737 0.0283 0.0222 -0.0030
0.0009 0.0022 -0.0088 1.2488 0.0065 0.0026
-0.0152 -0.0272 -0.0364 -0.0028 -0.0108 -0.0085
0.0238 -0.0141 0.0056 -0.0185 0.0068 0.0010
LGST DEBUG: Gx before trunc to first 4 row and cols =
4.2429 -0.0024 -0.0019 -0.0006 -0.0003 -0.0002
0.0039 0.1846 0.5549 1.1184 -0.0046 -0.0064
-0.0015 -1.1658 0.5068 -0.0452 0.0040 0.0091
-0.0100 -0.4719 -1.0213 0.5725 -0.0118 -0.0135
0.0036 0.0063 -0.0137 -0.0004 -0.0511 -0.0004
-0.0049 0.0017 -0.0054 -0.0037 -0.0043 -0.0053
LGST DEBUG: Gy before trunc to first 4 row and cols =
4.2425 0.0015 0.0049 -0.0042 0 -0.0002
-0.0228 0.0238 0.7810 -0.9978 -0.0039 -0.0177
-0.0064 -1.0876 0.5489 0.4167 -0.0243 -0.0093
-0.0210 0.6884 0.7804 0.6769 -0.0095 0.0009
-0.0187 -0.0006 -0.0211 0.0163 0.0015 -0.0029
-0.0015 0.0005 0.0011 -0.0065 0.0165 0.0013
LGST: Singular values of target I_tilde (truncating to first 4 of 6) =
[ 4.24264069e+00 1.41421356e+00 1.41421356e+00 1.41421356e+00
6.40580052e-16 9.87043238e-17]
Resulting gate set:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Gauge Optimization to TP (L-BFGS-B) ---
5s 0.0000000384
The resulting TP penalty is: 3.84125e-08
The gauge matrix found (B^-1) is:
[[ 1.00000348e+00 1.62293418e-05 -9.40728239e-06 2.67577725e-05]
[ -1.59259939e-09 9.99999999e-01 -6.08699488e-10 4.94035495e-10]
[ -2.08253528e-09 -6.08699396e-10 9.99999999e-01 1.77772457e-09]
[ 4.08151522e-09 4.94035403e-10 1.77772457e-09 9.99999996e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Iterative MLGST: Iter 0 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 1 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
2*Delta(log(L)) = 57.3823
--- Iterative MLGST: Iter 2 of 9 168 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 137.715 (168 data params - 31 model params = expected mean of 137; p-value = 0.466775)
2*Delta(log(L)) = 138.035
--- Iterative MLGST: Iter 3 of 9 441 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 455.296 (441 data params - 31 model params = expected mean of 410; p-value = 0.060555)
2*Delta(log(L)) = 456.791
--- Iterative MLGST: Iter 4 of 9 817 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 887.53 (817 data params - 31 model params = expected mean of 786; p-value = 0.00666638)
2*Delta(log(L)) = 891.698
--- Iterative MLGST: Iter 5 of 9 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1244.3 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.0644704)
2*Delta(log(L)) = 1249.09
--- Iterative MLGST: Iter 6 of 9 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1630.81 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0857275)
2*Delta(log(L)) = 1635.63
--- Iterative MLGST: Iter 7 of 9 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2043.59 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0467865)
2*Delta(log(L)) = 2049.52
--- Iterative MLGST: Iter 8 of 9 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2471.9 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0152387)
2*Delta(log(L)) = 2477.98
--- Iterative MLGST: Iter 9 of 9 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2813.09 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0740998)
2*Delta(log(L)) = 2819.46
--- Last Iteration: switching to ML objective ---
--- MLGST ---
Memory estimates: (2 spam labels,2737 gate strings, 43 gateset params, 4 gate dim)
Peristent: 0.0018353 GB
Intermediate: 0.0143765 GB
Limit: 10 GB
Least squares msg = Both actual and predicted relative reductions in the sum of squares
are at most 0.000001; flag =1
Maximum log(L) = 1409.24 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2818.48 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0645887)
2*Delta(log(L)) = 2818.48
*** Generating tables ***
Iter 00 of 16 : Generating table: targetSpamTable
Iter 01 of 16 : Generating table: targetGatesTable
Iter 02 of 16 : Generating table: datasetOverviewTable
Iter 03 of 16 : Generating table: bestGatesetSpamTable
Iter 04 of 16 : Generating table: bestGatesetSpamParametersTable
Iter 05 of 16 : Generating table: bestGatesetGatesTable
Iter 06 of 16 : Generating table: bestGatesetChoiTable
Iter 07 of 16 : Generating table: bestGatesetDecompTable
Iter 08 of 16 : Generating table: bestGatesetRotnAxisTable
Iter 09 of 16 : Generating table: bestGatesetClosestUnitaryTable
Iter 10 of 16 : Generating table: bestGatesetVsTargetTable
---------------------------------------------------------------------------
SolverError Traceback (most recent call last)
<ipython-input-1-19104a2c597a> in <module>()
42 'verbosity' : 3} )
43
---> 44 results_test.create_full_report_pdf(verbosity=3)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in create_full_report_pdf(self, confidenceLevel, filename, title, datasetLabel, suffix, debugAidsAppendix, gaugeOptAppendix, pixelPlotAppendix, whackamoleAppendix, m, M, tips, verbosity, comm)
1651 for i, key in enumerate(tables_to_compute):
1652 printer.show_progress(i, len(tables_to_compute) - 1, prefix='', end='')
-> 1653 qtys[key] = self.tables.get(key, verbosity=printer - 1).render(
1654 'latex',longtables=self.options.long_tables, scratchDir=D,
1655 precision=self.options.precision,
/home/jovyan/work/pyGSTi/packages/pygsti/report/resultcache.py in get(self, key, confidence_level, verbosity)
77 printer.log("Generating %s: %s%s" % (self._typename, key, (" (w/%d%% CIs)" % round(level) if (level is not None) else "")))
78
---> 79 self._data[level][key] = computeFn(key, level, printer)
80 except ResultCache.NoCRDependenceError:
81 assert(level is not None)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in fn(key, confidenceLevel, vb)
535 gsTgt, gsBest = setup()
536 cri = self._get_confidence_region(confidenceLevel)
--> 537 return _generation.get_gates_vs_target_table(gsBest, gsTgt, cri)
538 fns['bestGatesetVsTargetTable'] = (fn, validate_essential)
539
/home/jovyan/work/pyGSTi/packages/pygsti/report/generation.py in get_gates_vs_target_table(gateset, targetGateset, confidenceRegionInfo)
344 qtys_to_compute = [ '%s %s' % (gl,qty) for qty in qtyNames for gl in gateLabels ]
345 qtys = _cr.compute_gateset_gateset_qtys(qtys_to_compute, gateset, targetGateset,
--> 346 confidenceRegionInfo)
347
348 table = _ReportTable(colHeadings, formatters)
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in compute_gateset_gateset_qtys(qtynames, gateset1, gateset2, confidenceRegionInfo)
755 try:
756 ret[key] = _getGateQuantity(half_diamond_norm, gateset1, gateLabel,
--> 757 eps, confidenceRegionInfo)
758 except ImportError: #if failed to import cvxpy (probably b/c it's not installed)
759 ret[key] = ReportableQty(_np.nan) # report NAN for diamond norms
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in _getGateQuantity(fnOfGate, gateset, gateLabel, eps, confidenceRegionInfo, verbosity)
77
78 if confidenceRegionInfo is None: # No Error bars
---> 79 return ReportableQty(fnOfGate(gateset.gates[gateLabel]))
80
81 # make sure the gateset we're given is the one used to generate the confidence region
/home/jovyan/work/pyGSTi/packages/pygsti/report/reportables.py in half_diamond_norm(gate)
750
751 def half_diamond_norm(gate):
--> 752 return 0.5 * _tools.diamonddist(gate, gateset2.gates[gateLabel]) #Note: default 'gm' basis
753 #vary elements of gateset1 (assume gateset2 is fixed)
754
/home/jovyan/work/pyGSTi/packages/pygsti/tools/gatetools.py in diamonddist(A, B, mxBasis, dimOrStateSpaceDims)
250 prob = _cvxpy.Problem(objective, constraints)
251 # try:
--> 252 prob.solve(solver="CVXOPT")
253 # prob.solve(solver="ECOS")
254 # prob.solve(solver="SCS")#This always fails
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in solve(self, *args, **kwargs)
171 return func(self, *args, **kwargs)
172 else:
--> 173 return self._solve(*args, **kwargs)
174
175 @classmethod
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _solve(self, solver, ignore_dcp, warm_start, verbose, parallel, **kwargs)
301 results_dict = {s.STATUS: sym_data.presolve_status}
302
--> 303 self._update_problem_state(results_dict, sym_data, solver)
304 return self.value
305
/opt/conda/lib/python3.5/site-packages/cvxpy/problems/problem.py in _update_problem_state(self, results_dict, sym_data, solver)
413 else:
414 raise SolverError(
--> 415 "Solver '%s' failed. Try another solver." % solver.name())
416 self._status = results_dict[s.STATUS]
417
SolverError: Solver 'CVXOPT' failed. Try another solver.
This is all run on "Debian GNU/Linux 8" (Linux 3.13.0-67-generic), simply because that is what the Jupyter docker image is based on. Also,
$ python --version
Python 3.5.2 :: Continuum Analytics, Inc.
$ pip --version
pip 8.1.2 frmo /opt/conda/lib/python3.5/site-packages (python 3.5)
$ conda --version
conda 4.1.11
from pygsti.
First, here is what I did to replicate your setup:
Here is your Dockerfile as I ran it (two mkdir commands have been commented out)
FROM jupyter/scipy-notebook
USER root
RUN apt-get update && \
apt-get install -y --no-install-recommends libblas-dev liblapack-dev libatlas-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER jovyan
RUN mkdir ~/work/data
#RUN mkdir /home/jovyan/.local/share # LSaldyt
#RUN mkdir /home/jovyan/.local/share/jupyter # LSaldyt
RUN /bin/bash -c "pip install git+git://github.com/ipython-contrib/IPython-notebook-extensions.git@master"
# RUN /bin/bash -c "source activate python2; \
# conda install lxml cvxopt=1.1.7; \
# pip install python-pptx; \
# pip install cvxpy==0.4.0; \
# pip install git+https://github.com/tonysyu/mpltools.git@master"
RUN /bin/bash -c "conda install lxml pip nose numpy scipy cvxopt; \
pip install python-pptx; \
pip install cvxpy==0.4.2; \
pip install git+https://github.com/tonysyu/mpltools.git@master"
RUN git clone https://github.com/pyGSTio/pyGSTi.git
RUN cd pyGSTi; git checkout beta; python install_locally.py # latest
VOLUME ~/work/data
(The two commands were commented out because, for me they produced: mkdir: cannot create directory: File exists
)
I copied this to its own directory, and then issued docker build .
- once I uncommented the two commands (RUN mkdir /home/jovyan/.local/share
and RUN mkdir /home/jovyan/.local/share/jupyter
), it ran fine, so I tagged it:
lucas:~/test$ docker tag 8d6b03e2b106 marcus
lucas:~/test$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
marcus latest 8d6b03e2b106 3 minutes ago 5.261 GB
jupyter/scipy-notebook latest 746a019f1c2a 24 hours ago 4.669 GB
hello-world latest c54a2cc56cbb 5 weeks ago 1.848 kB
lucas:~/test$
Once the build finished, I used:
lucas:~/test$ docker run -t -i marcus /bin/bash
jovyan:~/work$
The output of versions/package lists:
jovyan:~/work$ conda list | grep cvx
cvxopt 1.1.8 py35_blas_openblas_203 [blas_openblas] conda-forge
cvxpy 0.4.2 <pip>
jovyan:~/work$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
jovyan:~/work$ pip3 list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
jovyan:~/work$ python --version
Python 3.5.2 :: Continuum Analytics, Inc. # Anaconda python!
The kernel was the same as my ubuntu 16.04 install:
jovyan:~/work$ uname -r
4.4.0-31-generic
To verify that the minimal example fails:
Here is your minimal example exactly as I ran it:
(I ran this as a script, not as a notebook - if you'd like me to run it as a notebook, send me the correct docker command to start the image with (the same command that you use, preferably))
import matplotlib
matplotlib.use('Agg')
import time, pickle, os
import scipy as sp
import numpy as np
import pygsti
from pygsti.construction import std1Q_XYI
gs1Q = std1Q_XYI.gs_target
gs1Q_test = std1Q_XYI.gs_target
fiducials1Q = std1Q_XYI.fiducials
germs1Q = std1Q_XYI.germs
maxLengths1Q = [0,1,2,4,8,16,32,64,128,256]
listOfExperiments = pygsti.construction.make_lsgst_experiment_list(
gs1Q_test.gates.keys(),
fiducials1Q,
fiducials1Q,
germs1Q,
maxLengths1Q)
gs_datagen = gs1Q_test.depolarize(gate_noise=0.003, spam_noise=0.05)
ds = pygsti.construction.generate_fake_data(gs_datagen, listOfExperiments, nSamples=2000,
sampleError="binomial", seed=2015)
pygsti.io.write_dataset("test.gst", ds)
results_test = pygsti.do_long_sequence_gst("test.gst",
gs1Q_test,
fiducials1Q,
fiducials1Q,
germs1Q,
maxLengths1Q,
# mxBasis="pp", Argument no longer exists
gaugeOptRatio=1e-7,
advancedOptions ={ 'memoryLimitInBytes' : 10*(1024)**3,
'depolarizeLGST' : 0.2,
'verbosity' : 3} )
results_test.create_full_report_pdf(verbosity=3)
Results
With the above configuration, the script successfully outputs this:
[...]
*** Merging into template file ***
Latex file(s) successfully generated. Attempting to compile with pdflatex...
Initial output PDF test.pdf successfully generated.
Final output PDF test.pdf successfully generated. Cleaning up .aux and .log files.
I then found the ID of the container and copied the report:
lucas:~/test$ docker ps -l
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3a508ce34064 marcus "tini -- /bin/bash" 8 minutes ago Up 8 minutes 8888/tcp jovial_roentgen
docker cp 3a508ce34:/home/jovyan/work/test.pdf .
Resulting in a pdf report with proper diamond norm values:
I'm willing to try this with different settings if needed
Again, here were my settings:
jovyan:~/work$ conda list | grep cvx
cvxopt 1.1.8 py35_blas_openblas_203 [blas_openblas] conda-forge
cvxpy 0.4.2 <pip>
jovyan:~/work$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
jovyan:~/work$ pip3 list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
jovyan:~/work$ pip --version
pip 8.1.2 from /opt/conda/lib/python3.5/site-packages (python 3.5)
jovyan:~/work$ conda --version
conda 4.1.11
Cheers,
Lucas
from pygsti.
Notice that your versions of cvxopt
differ with mine (From the Dockerfile
setup):
Yours:
Before reinstalling cvxopt
$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.8 py35_3
cvxpy 0.4.2 <pip>
After:
$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.8 <pip>
cvxpy 0.4.2 <pip>
Mine:
jovyan@3a508ce34064:~/work$ conda list | grep cvx
cvxopt 1.1.8 py35_blas_openblas_203 [blas_openblas] conda-forge
cvxpy 0.4.2 <pip>
jovyan@3a508ce34064:~/work$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
And also notice that running something like pip install --upgrade cvxpy
potentially causes errors
Specifically:
(From the link)
To update CVXPY, first update NumPy and SciPy separately. Then run pip uninstall cvxpy; pip install cvxpy.
Simply running pip install --upgrade cvxpy can cause errors, especially if you’re using Anaconda.
Perhaps the same happens with cvxopt
?
from pygsti.
I tried uninstalling both the pip versions and conda versions of cvxopt/cvxpy
, leaving me with the following:
jovyan:~/work$ pip uninstall cvxopt; pip uninstall cvxpy; conda uninstall cvxopt; conda uninstall cvxpy
jovyan:~/work$ conda list | grep cvx # empty
jovyan:~/work$ pip list | grep cvx # empty
And, of course, running the example puts dashes in table 8:
test2.pdf
Reinstalling with pip only:
jovyan:~/work$ pip install cvxopt
[...] # Runs fine
jovyan:~/work$ pip install cvxpy
[...] # Also runs fine
jovyan:~/work$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.3)
jovyan:~/work$ conda list | grep cvx
cvxopt 1.1.8 <pip>
cvxpy 0.4.3 <pip>
Notice that the version output directly matches yours after you reinstalled cvxopt
Running the script again yields this (correct diamond norm values):
test3.pdf
And after pip uninstall cvxopt; conda install cvxopt
(My original setup):
jovyan:~/work$ conda list | grep cvx
cvxopt 1.1.8 py35_blas_openblas_203 [blas_openblas] conda-forge
cvxpy 0.4.3 <pip>
Note that my version is 1.1.8 py35_blas...
, while yours is only 1.1.8 py35
from pygsti.
It is rather strange that you get different behavior during the docker build of the Dockerfile. My understanding was that the Dockerfile would ensure identical reproduction, but you end up with a different kernel, get different behavior for the mkdir
commands, and get a different version of cvxopt installed even though you issue the same commands.
Here are the msgs I get when I run docker build --no-cache -t gst-jupyter .
docker build --no-cache -t gst-jupyter .
$ docker build --no-cache -t gst-jupyter .
Sending build context to Docker daemon 114.8 MB
Step 1 : FROM jupyter/scipy-notebook
---> f99b5ee75bed
Step 2 : MAINTAINER Marcus Silva "[email protected]"
---> Running in f218fc0fc540
---> 8953cb316cd3
Removing intermediate container f218fc0fc540
Step 3 : USER root
---> Running in d1f4ac1e47f1
---> 301e6157ffd4
Removing intermediate container d1f4ac1e47f1
Step 4 : RUN apt-get update && apt-get install -y --no-install-recommends libblas-dev liblapack-dev libatlas-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
---> Running in b00e79142957
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Get:2 http://security.debian.org jessie/updates/main amd64 Packages [384 kB]
Ign http://httpredir.debian.org jessie InRelease
Get:3 http://httpredir.debian.org jessie-updates InRelease [142 kB]
Get:4 http://httpredir.debian.org jessie Release.gpg [2,373 B]
Get:5 http://httpredir.debian.org jessie-updates/main amd64 Packages [17.6 kB]
Get:6 http://httpredir.debian.org jessie Release [148 kB]
Get:7 http://httpredir.debian.org jessie/main amd64 Packages [9,032 kB]
Fetched 9,789 kB in 22s (438 kB/s)
Reading package lists...
W: Size of file /var/lib/apt/lists/httpredir.debian.org_debian_dists_jessie_main_binary-amd64_Packages.gz is not what the server reported 9031837 9034031
Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
libblas-common libblas3 libgfortran3 liblapack3
Suggested packages:
liblapack-doc
The following NEW packages will be installed:
libatlas-dev libblas-common libblas-dev libblas3 libgfortran3 liblapack-dev
liblapack3
0 upgraded, 7 newly installed, 0 to remove and 65 not upgraded.
Need to get 4,398 kB of archives.
After this operation, 20.3 MB of additional disk space will be used.
Get:1 http://httpredir.debian.org/debian/ jessie/main libgfortran3 amd64 4.9.2-10 [255 kB]
Get:2 http://httpredir.debian.org/debian/ jessie/main libblas-common amd64 1.2.20110419-10 [8,496 B]
Get:3 http://httpredir.debian.org/debian/ jessie/main libblas3 amd64 1.2.20110419-10 [167 kB]
Get:4 http://httpredir.debian.org/debian/ jessie/main libblas-dev amd64 1.2.20110419-10 [163 kB]
Get:5 http://httpredir.debian.org/debian/ jessie/main liblapack3 amd64 3.5.0-4 [1,852 kB]
Get:6 http://httpredir.debian.org/debian/ jessie/main libatlas-dev all 3.10.2-7 [68.8 kB]
Get:7 http://httpredir.debian.org/debian/ jessie/main liblapack-dev amd64 3.5.0-4 [1,884 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 4,398 kB in 10s (401 kB/s)
Selecting previously unselected package libgfortran3:amd64.
(Reading database ... 78435 files and directories currently installed.)
Preparing to unpack .../libgfortran3_4.9.2-10_amd64.deb ...
Unpacking libgfortran3:amd64 (4.9.2-10) ...
Selecting previously unselected package libblas-common.
Preparing to unpack .../libblas-common_1.2.20110419-10_amd64.deb ...
Unpacking libblas-common (1.2.20110419-10) ...
Selecting previously unselected package libblas3.
Preparing to unpack .../libblas3_1.2.20110419-10_amd64.deb ...
Unpacking libblas3 (1.2.20110419-10) ...
Selecting previously unselected package libblas-dev.
Preparing to unpack .../libblas-dev_1.2.20110419-10_amd64.deb ...
Unpacking libblas-dev (1.2.20110419-10) ...
Selecting previously unselected package libatlas-dev.
Preparing to unpack .../libatlas-dev_3.10.2-7_all.deb ...
Unpacking libatlas-dev (3.10.2-7) ...
Selecting previously unselected package liblapack3.
Preparing to unpack .../liblapack3_3.5.0-4_amd64.deb ...
Unpacking liblapack3 (3.5.0-4) ...
Selecting previously unselected package liblapack-dev.
Preparing to unpack .../liblapack-dev_3.5.0-4_amd64.deb ...
Unpacking liblapack-dev (3.5.0-4) ...
Setting up libgfortran3:amd64 (4.9.2-10) ...
Setting up libblas-common (1.2.20110419-10) ...
Setting up libblas3 (1.2.20110419-10) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3 to provide /usr/lib/libblas.so.3 (libblas.so.3) in auto mode
Setting up libblas-dev (1.2.20110419-10) ...
update-alternatives: using /usr/lib/libblas/libblas.so to provide /usr/lib/libblas.so (libblas.so) in auto mode
Setting up libatlas-dev (3.10.2-7) ...
Setting up liblapack3 (3.5.0-4) ...
update-alternatives: using /usr/lib/lapack/liblapack.so.3 to provide /usr/lib/liblapack.so.3 (liblapack.so.3) in auto mode
Setting up liblapack-dev (3.5.0-4) ...
update-alternatives: using /usr/lib/lapack/liblapack.so to provide /usr/lib/liblapack.so (liblapack.so) in auto mode
Processing triggers for libc-bin (2.19-18+deb8u1) ...
---> ab31f541ee6e
Removing intermediate container b00e79142957
Step 5 : USER jovyan
---> Running in d7b2465083ce
---> b03982438f72
Removing intermediate container d7b2465083ce
Step 6 : RUN mkdir ~/work/data
---> Running in c948e64a58a2
---> 02e80cf200d9
Removing intermediate container c948e64a58a2
Step 7 : RUN mkdir /home/jovyan/.local/share
---> Running in 441b99568d72
---> 5f816bb908a9
Removing intermediate container 441b99568d72
Step 8 : RUN mkdir /home/jovyan/.local/share/jupyter
---> Running in 78b755d7ab12
---> 0738f45e530b
Removing intermediate container 78b755d7ab12
Step 9 : RUN /bin/bash -c "pip install git+git://github.com/ipython-contrib/IPython-notebook-extensions.git@master"
---> Running in 42ecc3ad5b5d
Collecting git+git://github.com/ipython-contrib/IPython-notebook-extensions.git@master
Cloning git://github.com/ipython-contrib/IPython-notebook-extensions.git (to master) to /tmp/pip-wmp8gg8c-build
Requirement already satisfied (use --upgrade to upgrade): ipython-genutils in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Collecting jupyter-contrib-core>=0.3 (from jupyter-contrib-nbextensions==0.1.0)
Downloading jupyter_contrib_core-0.3.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): jupyter-core in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Collecting jupyter-nbextensions-configurator (from jupyter-contrib-nbextensions==0.1.0)
Downloading jupyter_nbextensions_configurator-0.2.1-py2.py3-none-any.whl (547kB)
Requirement already satisfied (use --upgrade to upgrade): nbconvert in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Requirement already satisfied (use --upgrade to upgrade): notebook>=4.0 in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Collecting psutil>=2.2.1 (from jupyter-contrib-nbextensions==0.1.0)
Downloading psutil-4.3.0.tar.gz (316kB)
Requirement already satisfied (use --upgrade to upgrade): pyyaml in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Requirement already satisfied (use --upgrade to upgrade): tornado in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Requirement already satisfied (use --upgrade to upgrade): traitlets in /opt/conda/lib/python3.5/site-packages (from jupyter-contrib-nbextensions==0.1.0)
Requirement already satisfied (use --upgrade to upgrade): setuptools in /opt/conda/lib/python3.5/site-packages/setuptools-19.6.2-py3.5.egg (from jupyter-contrib-core>=0.3->jupyter-contrib-nbextensions==0.1.0)
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil: started
Running setup.py bdist_wheel for psutil: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/e9/8b/35/535f07b31ebe94e56901cee48e1291e18989b272d79de437db
Successfully built psutil
Installing collected packages: jupyter-contrib-core, jupyter-nbextensions-configurator, psutil, jupyter-contrib-nbextensions
Running setup.py install for jupyter-contrib-nbextensions: started
Running setup.py install for jupyter-contrib-nbextensions: finished with status 'done'
Successfully installed jupyter-contrib-core-0.3.0 jupyter-contrib-nbextensions-0.1.0 jupyter-nbextensions-configurator-0.2.1 psutil-4.3.0
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
---> 906e831b3bac
Removing intermediate container 42ecc3ad5b5d
Step 10 : RUN /bin/bash -c "conda install lxml pip nose numpy scipy cvxopt=1.1.7; pip install python-pptx; pip install cvxpy==0.4.2; pip install git+https://github.com/tonysyu/mpltools.git@master"
---> Running in 7d7183c7bf0d
Fetching package metadata: ....
Solving package specifications: .............................
Package plan for installation in environment /opt/conda:
The following packages will be downloaded:
package | build
---------------------------|-----------------
libgfortran-3.0.0 | 1 281 KB
mkl-11.3.3 | 0 122.1 MB
openssl-1.0.2h | 1 3.2 MB
sqlite-3.13.0 | 0 4.0 MB
xz-5.2.2 | 0 644 KB
zlib-1.2.8 | 3 101 KB
python-3.5.2 | 0 17.2 MB
conda-env-2.5.2 | py35_0 27 KB
cvxopt-1.1.7 | py35_0 4.0 MB
libxslt-1.1.28 | 0 1.1 MB
nose-1.3.7 | py35_1 195 KB
numpy-1.11.1 | py35_0 6.1 MB
pycosat-0.6.1 | py35_1 193 KB
pyyaml-3.11 | py35_4 326 KB
requests-2.10.0 | py35_0 651 KB
ruamel_yaml-0.11.14 | py35_0 377 KB
setuptools-25.1.6 | py35_0 478 KB
conda-4.1.11 | py35_0 204 KB
lxml-3.6.1 | py35_0 3.2 MB
pip-8.1.2 | py35_0 1.6 MB
scipy-0.18.0 | np111py35_0 30.5 MB
------------------------------------------------------------
Total: 196.2 MB
The following NEW packages will be INSTALLED:
cvxopt: 1.1.7-py35_0
libxslt: 1.1.28-0
lxml: 3.6.1-py35_0
nose: 1.3.7-py35_1
ruamel_yaml: 0.11.14-py35_0
The following packages will be UPDATED:
conda: 3.19.1-py35_0 --> 4.1.11-py35_0
conda-env: 2.4.5-py35_0 --> 2.5.2-py35_0
libgfortran: 1.0-0 --> 3.0.0-1
mkl: 11.3.1-0 --> 11.3.3-0
numpy: 1.10.4-py35_0 --> 1.11.1-py35_0
openssl: 1.0.2f-0 --> 1.0.2h-1
pip: 8.0.2-py35_0 --> 8.1.2-py35_0
pycosat: 0.6.1-py35_0 --> 0.6.1-py35_1
python: 3.5.1-0 --> 3.5.2-0
pyyaml: 3.11-py35_1 --> 3.11-py35_4
requests: 2.9.1-py35_0 --> 2.10.0-py35_0
scipy: 0.17.0-np110py35_1 --> 0.18.0-np111py35_0
setuptools: 19.6.2-py35_0 --> 25.1.6-py35_0
sqlite: 3.9.2-0 --> 3.13.0-0
xz: 5.0.5-1 --> 5.2.2-0
zlib: 1.2.8-0 --> 1.2.8-3
Proceed ([y]/n)?
Fetching packages ...
libgfortran-3. 100% |###############################| Time: 0:00:00 1.98 MB/s
mkl-11.3.3-0.t 100% |###############################| Time: 0:00:26 4.83 MB/s
openssl-1.0.2h 100% |###############################| Time: 0:00:01 2.28 MB/s
sqlite-3.13.0- 100% |###############################| Time: 0:00:01 3.79 MB/s
xz-5.2.2-0.tar 100% |###############################| Time: 0:00:00 1.96 MB/s
zlib-1.2.8-3.t 100% |###############################| Time: 0:00:00 852.25 kB/s
python-3.5.2-0 100% |###############################| Time: 0:00:03 5.46 MB/s
conda-env-2.5. 100% |###############################| Time: 0:00:00 886.67 kB/s
cvxopt-1.1.7-p 100% |###############################| Time: 0:00:02 1.51 MB/s
libxslt-1.1.28 100% |###############################| Time: 0:00:00 2.53 MB/s
nose-1.3.7-py3 100% |###############################| Time: 0:00:00 1.31 MB/s
numpy-1.11.1-p 100% |###############################| Time: 0:00:01 3.93 MB/s
pycosat-0.6.1- 100% |###############################| Time: 0:00:00 705.25 kB/s
pyyaml-3.11-py 100% |###############################| Time: 0:00:00 924.88 kB/s
requests-2.10. 100% |###############################| Time: 0:00:00 2.64 MB/s
ruamel_yaml-0. 100% |###############################| Time: 0:00:00 2.83 MB/s
setuptools-25. 100% |###############################| Time: 0:00:00 2.56 MB/s
conda-4.1.11-p 100% |###############################| Time: 0:00:00 2.03 MB/s
lxml-3.6.1-py3 100% |###############################| Time: 0:00:00 4.43 MB/s
pip-8.1.2-py35 100% |###############################| Time: 0:00:00 2.07 MB/s
scipy-0.18.0-n 100% |###############################| Time: 0:00:06 4.96 MB/s
Extracting packages ...
[ COMPLETE ]|##################################################| 100%
Unlinking packages ...
[ COMPLETE ]|##################################################| 100%
Linking packages ...
[ COMPLETE ]|##################################################| 100%
Collecting python-pptx
Downloading python-pptx-0.5.8.tar.gz (5.2MB)
Requirement already satisfied (use --upgrade to upgrade): lxml>=3.1.0 in /opt/conda/lib/python3.5/site-packages (from python-pptx)
Requirement already satisfied (use --upgrade to upgrade): Pillow>=2.6.1 in /opt/conda/lib/python3.5/site-packages (from python-pptx)
Collecting XlsxWriter>=0.5.7 (from python-pptx)
Downloading XlsxWriter-0.9.3-py2.py3-none-any.whl (136kB)
Building wheels for collected packages: python-pptx
Running setup.py bdist_wheel for python-pptx: started
Running setup.py bdist_wheel for python-pptx: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/98/1b/ec/8ef268155ddf4617d97f5a973cea3991425928b302c8a73307
Successfully built python-pptx
Installing collected packages: XlsxWriter, python-pptx
Successfully installed XlsxWriter-0.9.3 python-pptx-0.5.8
Collecting cvxpy==0.4.2
Downloading cvxpy-0.4.2.tar.gz (145kB)
Requirement already satisfied (use --upgrade to upgrade): cvxopt>=1.1.6 in /opt/conda/lib/python3.5/site-packages (from cvxpy==0.4.2)
Collecting ecos>=2 (from cvxpy==0.4.2)
Downloading ecos-2.0.4.tar.gz (113kB)
Collecting scs>=1.1.3 (from cvxpy==0.4.2)
Downloading scs-1.2.6.tar.gz (86kB)
Collecting multiprocess (from cvxpy==0.4.2)
Downloading multiprocess-0.70.4.tgz (1.1MB)
Requirement already satisfied (use --upgrade to upgrade): fastcache in /opt/conda/lib/python3.5/site-packages (from cvxpy==0.4.2)
Requirement already satisfied (use --upgrade to upgrade): six in /opt/conda/lib/python3.5/site-packages (from cvxpy==0.4.2)
Collecting toolz (from cvxpy==0.4.2)
Downloading toolz-0.8.0.tar.gz (40kB)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.9 in /opt/conda/lib/python3.5/site-packages (from cvxpy==0.4.2)
Requirement already satisfied (use --upgrade to upgrade): scipy>=0.15 in /opt/conda/lib/python3.5/site-packages (from cvxpy==0.4.2)
Collecting CVXcanon>=0.0.22 (from cvxpy==0.4.2)
Downloading CVXcanon-0.1.1.tar.gz (694kB)
Collecting dill>=0.2.5 (from multiprocess->cvxpy==0.4.2)
Downloading dill-0.2.5.tgz (60kB)
Building wheels for collected packages: cvxpy, ecos, scs, multiprocess, toolz, CVXcanon, dill
Running setup.py bdist_wheel for cvxpy: started
Running setup.py bdist_wheel for cvxpy: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/62/c9/b8/2fd663c7510898c79fa41f0863faf127365314066d2b07af28
Running setup.py bdist_wheel for ecos: started
Running setup.py bdist_wheel for ecos: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/c3/1d/fc/fb93c7c26e627779cfe8cd433bb8ed2cd628f19ad094f70517
Running setup.py bdist_wheel for scs: started
Running setup.py bdist_wheel for scs: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/7f/c7/28/11e2ac690bdb2919dd29523a811d5d8ec815f4d33689dbbe53
Running setup.py bdist_wheel for multiprocess: started
Running setup.py bdist_wheel for multiprocess: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/af/c7/00/537742db7f56f20ca57ee2db38aa7471d7b050a7c8cd2db66b
Running setup.py bdist_wheel for toolz: started
Running setup.py bdist_wheel for toolz: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/b0/84/bf/7089262387e8ea60bdefb1fdb84d2ee99427f6d09c9c7ba37d
Running setup.py bdist_wheel for CVXcanon: started
Running setup.py bdist_wheel for CVXcanon: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/1b/f6/dd/14f66c64621bddd6b92a3cfc995fa2a21b134fcf4122402b30
Running setup.py bdist_wheel for dill: started
Running setup.py bdist_wheel for dill: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/4c/61/4b/fe80508bd8f3102b75998dfbc1202a0153838a460c29de4d54
Successfully built cvxpy ecos scs multiprocess toolz CVXcanon dill
Installing collected packages: ecos, scs, dill, multiprocess, toolz, CVXcanon, cvxpy
Found existing installation: dill 0.2.4
Uninstalling dill-0.2.4:
DEPRECATION: Uninstalling a distutils installed project (dill) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Successfully uninstalled dill-0.2.4
Successfully installed CVXcanon-0.1.1 cvxpy-0.4.2 dill-0.2.5 ecos-2.0.4 multiprocess-0.70.4 scs-1.2.6 toolz-0.8.0
Collecting git+https://github.com/tonysyu/mpltools.git@master
Cloning https://github.com/tonysyu/mpltools.git (to master) to /tmp/pip-qznt32dh-build
Requirement already satisfied (use --upgrade to upgrade): matplotlib>=1.0 in /opt/conda/lib/python3.5/site-packages (from mpltools==0.2.0)
Collecting configobj>=4.4.0 (from mpltools==0.2.0)
Downloading configobj-5.0.6.tar.gz
Collecting future>=0.12.4 (from mpltools==0.2.0)
Downloading future-0.15.2.tar.gz (1.6MB)
Requirement already satisfied (use --upgrade to upgrade): numpy>=1.6 in /opt/conda/lib/python3.5/site-packages (from matplotlib>=1.0->mpltools==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /opt/conda/lib/python3.5/site-packages (from matplotlib>=1.0->mpltools==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): pytz in /opt/conda/lib/python3.5/site-packages (from matplotlib>=1.0->mpltools==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): cycler in /opt/conda/lib/python3.5/site-packages (from matplotlib>=1.0->mpltools==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): pyparsing!=2.0.4,>=1.5.6 in /opt/conda/lib/python3.5/site-packages (from matplotlib>=1.0->mpltools==0.2.0)
Requirement already satisfied (use --upgrade to upgrade): six in /opt/conda/lib/python3.5/site-packages (from configobj>=4.4.0->mpltools==0.2.0)
Building wheels for collected packages: configobj, future
Running setup.py bdist_wheel for configobj: started
Running setup.py bdist_wheel for configobj: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/87/76/48/1564f8466fbd36402af5ac4972ffb56a6ef7f143892ef57fe5
Running setup.py bdist_wheel for future: started
Running setup.py bdist_wheel for future: finished with status 'done'
Stored in directory: /home/jovyan/.cache/pip/wheels/11/c5/d2/ad287de27d0f0d646f119dcffb921f4e63df128f28ab0a1bda
Successfully built configobj future
Installing collected packages: configobj, future, mpltools
Running setup.py install for mpltools: started
Running setup.py install for mpltools: finished with status 'done'
Successfully installed configobj-5.0.6 future-0.15.2 mpltools-0.2.0
---> ffbe3947a817
Removing intermediate container 7d7183c7bf0d
Step 11 : RUN git clone https://github.com/pyGSTio/pyGSTi.git
---> Running in 19b1f3465a9a
Cloning into 'pyGSTi'...
---> 288a244a4619
Removing intermediate container 19b1f3465a9a
Step 12 : RUN cd pyGSTi; git checkout beta; python install_locally.py # latest
---> Running in b308a2101cd5
Switched to a new branch 'beta'
Branch beta set up to track remote branch beta from origin.
Adding path: /home/jovyan/work/pyGSTi/packages
Wrote to /home/jovyan/.local/lib/python3.5/site-packages/GST.pth
GST package installed successfully!
---> 11141c3e1b93
Removing intermediate container b308a2101cd5
Step 13 : VOLUME ~/work/data
---> Running in c5084facc6ac
---> 14914cbb8c3a
Removing intermediate container c5084facc6ac
Successfully built 14914cbb8c3a
Looking at the discrepancies between my env and yours, I have the impression the kernel may be less important than the blas_openblas
version of cvxopt
.
I am starting to suspect the build of jupyter/scipy-notebook
because mine if 5 months old, and there have been quite a few changes since then. I thought docker would pull those changes automatically, but apparently not.
I am pulling jupyter/scipy-notebook
now and will see if that solves the problem.
from pygsti.
I agree that the differing version of cvxopt
is probably the issue.
So, after trying the latest docker image, I would also try:
- uninstall of both
cvxopt/cvxpy
, followed by a reinstall withpip
- uninstall of both
cvxopt/cvxpy
, followed by a reinstall withconda
- uninstall of
cvxopt
, followed by an install withconda
of theblas_openblas
version ofcvxopt
from pygsti.
Hm. Now report creating fails for a different reason, so it is unclear if this problem is gone with the new base docker image from jupyter/scipy-notebook
. I get what seems to be a variation of #1
I get this unpickling error, which I suppose I will have to file as a separate issue.
Loading test.gst: 100%
--- LGST ---
('LGST: Singular values of I_tilde (truncating to first 4 of 6) = \n', array([ 4.24288868, 1.2882661 , 1.27876723, 1.26105617, 0.0423613 ,
0.01134863]))
LGST DEBUG: Gi before trunc to first 4 row and cols =
4.2424 -0.0003 0.0001 0 -0.0002 -0.0001
0.0014 1.2631 -0.0144 -0.0279 0.0173 0.0183
-0.0173 -0.0096 1.2694 0.0299 -0.0251 0.0064
0.0041 0.0067 -0.0082 1.2501 -0.0037 -0.0037
-0.0174 -0.0279 0.0234 0.0139 -0.0113 -0.0122
0.0502 0.0034 -0.0095 0.0301 0.0084 0.0075
LGST DEBUG: Gx before trunc to first 4 row and cols =
4.2426 -0.0005 0.0022 0.0021 -0.0002 -0.0001
0.0056 0.0937 -0.6008 -1.1176 0.0004 -0.0007
-0.0109 1.0748 0.6017 -0.2320 0.0050 0.0024
0.0215 0.6584 -0.9271 0.5686 0.0056 0.0127
-0.0154 0.0013 0.0018 -0.0067 -0.0399 0.0007
-0.0057 -0.0017 -0.0079 -0.0104 0.0160 0.0163
LGST DEBUG: Gy before trunc to first 4 row and cols =
4.2428 0.0055 -0.0053 0.0036 0.0003 0
-0.0252 0.0092 -0.8557 0.9292 -0.0036 -0.0174
-0.0241 1.0640 0.5417 0.4468 0.0038 0.0042
-0.0042 -0.7083 0.7542 0.7148 -0.0063 -0.0116
-0.0001 0.0033 0.0056 0.0056 0.0167 0.0002
-0.0183 -0.0197 0.0232 -0.0024 -0.0030 0.0086
LGST: Singular values of target I_tilde (truncating to first 4 of 6) =
[ 4.24264069e+00 1.41421356e+00 1.41421356e+00 1.41421356e+00
3.68243912e-16 1.43359508e-16]
Resulting gate set:
rho0 = 0.7071 -0.0062 -0.0011 0.7113
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0
0.0065 0.9827 -0.0077 -0.0109
-0.0036 0.0125 0.9965 -0.0004
-0.0030 0.0079 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0092 0.9893 0.0143 0
0.0044 0.0274 0.0048 -1.0000
-0.0042 -0.0047 0.9863 0
Gy =
1.0000 0 0 -0.0001
0.0086 0.0204 -0.0057 0.9971
-0.0100 0.0168 0.9874 0.0139
0.0071 -0.9894 0.0265 -0.0104
--- Gauge Optimization to TP (L-BFGS-B) ---
5s 0.0000000290
The resulting TP penalty is: 2.90444e-08
The gauge matrix found (B^-1) is:
[[ 1.00000712e+00 -5.83035132e-05 9.75118005e-06 2.50879315e-05]
[ -2.50712692e-09 9.99999998e-01 -9.64135375e-10 4.11841848e-09]
[ -2.17013155e-09 -9.64135660e-10 9.99999999e-01 5.87846758e-10]
[ 3.07746137e-09 4.11841848e-09 5.87846758e-10 9.99999992e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0062 -0.0011 0.7113
E0 = 0.6990 -0.0011 0.0135 -0.6483
Gi =
0.9999 0 0 0
0.0065 0.9827 -0.0077 -0.0109
-0.0036 0.0125 0.9965 -0.0004
-0.0030 0.0079 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0092 0.9893 0.0143 0
0.0044 0.0274 0.0048 -1.0000
-0.0042 -0.0047 0.9863 0
Gy =
1.0000 0 0 0
0.0086 0.0204 -0.0057 0.9971
-0.0100 0.0168 0.9874 0.0139
0.0071 -0.9894 0.0265 -0.0104
--- Iterative MLGST: Iter 0 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.6606 (92 data params - 31 model params = expected mean of 61; p-value = 0.597683)
2*Delta(log(L)) = 57.8971
--- Iterative MLGST: Iter 1 of 9 92 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 57.6606 (92 data params - 31 model params = expected mean of 61; p-value = 0.597683)
2*Delta(log(L)) = 57.8979
--- Iterative MLGST: Iter 2 of 9 168 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 148.066 (168 data params - 31 model params = expected mean of 137; p-value = 0.244671)
2*Delta(log(L)) = 148.335
--- Iterative MLGST: Iter 3 of 9 441 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 459.588 (441 data params - 31 model params = expected mean of 410; p-value = 0.0455652)
2*Delta(log(L)) = 461.164
--- Iterative MLGST: Iter 4 of 9 817 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 908.38 (817 data params - 31 model params = expected mean of 786; p-value = 0.00155739)
2*Delta(log(L)) = 912.743
--- Iterative MLGST: Iter 5 of 9 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1259.13 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.0350377)
2*Delta(log(L)) = 1263.95
--- Iterative MLGST: Iter 6 of 9 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 1646.23 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0510594)
2*Delta(log(L)) = 1651.11
--- Iterative MLGST: Iter 7 of 9 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2053.9 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0331478)
2*Delta(log(L)) = 2059.88
--- Iterative MLGST: Iter 8 of 9 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2480.74 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0110673)
2*Delta(log(L)) = 2486.85
--- Iterative MLGST: Iter 9 of 9 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Sum of Chi^2 = 2821.41 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0598427)
2*Delta(log(L)) = 2827.84
--- Last Iteration: switching to ML objective ---
--- MLGST ---
Memory estimates: (2 spam labels,2737 gate strings, 43 gateset params, 4 gate dim)
Peristent: 0.0018353 GB
Intermediate: 0.0143765 GB
Limit: 10 GB
Least squares msg = Both actual and predicted relative reductions in the sum of squares
are at most 0.000001; flag =1
Maximum log(L) = 1413.42 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2826.84 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0517893)
2*Delta(log(L)) = 2826.84
*** Generating tables ***
Iter 00 of 16 : Generating table: targetSpamTable
Iter 01 of 16 : Generating table: targetGatesTable
Iter 02 of 16 : Generating table: datasetOverviewTable
Iter 03 of 16 : Generating table: bestGatesetSpamTable
Iter 04 of 16 : Generating table: bestGatesetSpamParametersTable
Iter 05 of 16 : Generating table: bestGatesetGatesTable
Iter 06 of 16 : Generating table: bestGatesetChoiTable
Iter 07 of 16 : Generating table: bestGatesetDecompTable
Iter 08 of 16 : Generating table: bestGatesetRotnAxisTable
Iter 09 of 16 : Generating table: bestGatesetClosestUnitaryTable
Iter 10 of 16 : Generating table: bestGatesetVsTargetTable
Iter 11 of 16 : Generating table: bestGatesetErrorGenTable
Iter 12 of 16 : Generating table: fiducialListTable
Iter 13 of 16 : Generating table: prepStrListTable
Iter 14 of 16 : Generating table: effectStrListTable
Iter 15 of 16 : Generating table: germListTable
Iter 16 of 16 : Generating table: progressTable
*** Generating plots ***
LogL plots (2):
Iter 0 of 1 : Generating figure: bestEstimateColorBoxPlot
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/home/jovyan/work/pyGSTi/packages/pygsti/report/figure.py in save_to(self, filename)
34 try:
---> 35 axes = _pickle.loads(self.pickledAxes)
36 #this creates a new (current) figure in matplotlib
/opt/conda/lib/python3.5/site-packages/matplotlib/figure.py in __setstate__(self, state)
1435 num = max(allnums) + 1 if allnums else 1
-> 1436 mgr = plt._backend_mod.new_figure_manager_given_figure(num, self)
1437
AttributeError: module 'ipykernel.pylab.backend_inline' has no attribute 'new_figure_manager_given_figure'
During handling of the above exception, another exception occurred:
ValueError Traceback (most recent call last)
<ipython-input-1-3c866a2108a4> in <module>()
42 'verbosity' : 3} )
43
---> 44 results_test.create_full_report_pdf(verbosity=3)
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in create_full_report_pdf(self, confidenceLevel, filename, title, datasetLabel, suffix, debugAidsAppendix, gaugeOptAppendix, pixelPlotAppendix, whackamoleAppendix, m, M, tips, verbosity, comm)
1725 printer.show_progress(0, 1, prefix='', end='')
1726 fig = set_fig_qtys("bestEstimateColorBoxPlot",
-> 1727 "best%sBoxes.pdf" % plotFnName, printer - 1)
1728 maxX = fig.get_extra_info()['nUsedXs']
1729 maxY = fig.get_extra_info()['nUsedYs']
/home/jovyan/work/pyGSTi/packages/pygsti/report/results.py in set_fig_qtys(figkey, figFilenm, v, W, H)
1702 def set_fig_qtys(figkey, figFilenm, v, W=None,H=None):
1703 fig = self.figures.get(figkey, verbosity=v)
-> 1704 fig.save_to(_os.path.join(report_dir, D, figFilenm))
1705 qtys[figkey] = incgr(figFilenm,W,H)
1706 qtys['tt_' + figkey] = tooltiptex(".figures['%s']" % figkey)
/home/jovyan/work/pyGSTi/packages/pygsti/report/figure.py in save_to(self, filename)
45 "'%matplotlib inline') within an iPython " +
46 "notebook, so if you used either of these " +
---> 47 "please remove it and all should be well.")
48 _plt.savefig(filename, bbox_extra_artists=(axes,),
49 bbox_inches='tight') #need extra artists otherwise
ValueError: ReportFigure unpickling error! This could be caused by using matplotlib or pylab magic functions ('%pylab inline' or '%matplotlib inline') within an iPython notebook, so if you used either of these please remove it and all should be well.
Any suggestion of how I can test this cvxopt
issue without having to deal with thus unpickling error?
from pygsti.
Try running the minimal example as a script (or running it in ipython, removing %pylab inline
or %matplotlib inline
if they are present.)
from pygsti.
I am not using magic functions, and I have tried without and without matplotlib.use('Agg') after importing
matplotlib`.
from pygsti.
As a script (outside jupyter), I need to add matplotlib.use('Agg')
(since the Qt dependency is missing, since it was remove recently from the jupyter docker image), but aside from that everything works.
In summary, if I update the base docker image, I get
$ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.2)
$ conda list | grep cvx
cvxopt 1.1.8 py35_blas_openblas_203 [blas_openblas] conda-forge
cvxpy 0.4.2 <pip>
$ uname -r
3.13.0-67-generic
To find out why 1.1.8
now works, we'd probably have to hunt through what changes in jupyter/scipy-notebook
over the last 5 months. Which does not strike me as interesting.
from pygsti.
I ran it as a script and it works fine.
The problems seems to be the fact that when matplotlib is imported within Jupyter, there is a hook that enables inline plotting by default (it does not happen in a config file, but rather in scipy-notebook/mplimporthook.py). This hook is baggage from the base docker image jupyter/scipy-notebook
.
My suggestion is that, invariably, Jupyter users will want inline plots anyway (they will want to look at data in other ways, not just within pyGSTi reports). Instead of forcing users to disable inlining, it may be better to find a way within pyGSTi to not require inlining to be turned off — by explicitly choosing a backend such as Agg within pyGSTi, or checking if inlining is enabled during report generating and then disabling temporarily, etc.
But this is a separate issue from the diamond norm issue.
The diamond norm issue seems to be due to cvxopt=1.1.8
requiring some particular version of openblas or something like that.
from pygsti.
I too had to use matplotlib.use('Agg')
when running the example as a script (for the same reason)
Since it looks like the latest version of cvxopt
works once your docker install is updated, is this issue ready to be closed?
(You can always re-open this if the problem persists)
As for the pickling issues with matplotlib, you're welcome to open a different issue. (Problems with pickling seem to be documented in report/figure.py
- so I wouldn't be surprised if there's some incompatibility there)
from pygsti.
Yeah, I think we can chalk it up to an issue with the base docker image and close this up.
from pygsti.
This bug seems to be alive and kicking in the latest beta branch, and running outside docker. Dependencies were install with either conda
or pip
, and they are all there.
This is what I get running the minimal example originally submitted.
msilva@stampede $ python test.py
/home/msilva/anaconda3/envs/pygsti2/lib/python2.7/site-packages/matplotlib/font_manager.py:273: UserWarning: Matplotlib is building the font cache using fc-list. This may take a moment.
warnings.warn('Matplotlib is building the font cache using fc-list. This may take a moment.')
/home/msilva/Repos/pyGSTi/packages/pygsti/drivers/longsequence.py:184: UserWarning: 'verbosity' as an advanced option is deprecated. Please use the 'verbosity' argument directly.
" Please use the 'verbosity' argument directly.")
Cache file not found or is tool old -- one willbe created after loading is completed
Writing cache file (to speed future loads): test.gst.cache
--- LGST ---
Singular values of I_tilde (truncating to first 4 of 6) =
4.24292665181
1.28978318159
1.27766610627
1.26047845124
0.0432732610367
0.00943883576857
Singular values of target I_tilde (truncating to first 4 of 6) =
4.24264068712
1.41421356237
1.41421356237
1.41421356237
6.40580052139e-16
9.87043237807e-17
Resulting gate set:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Gauge Optimization to TP (L-BFGS-B) ---
17s 0.0000000384
The resulting TP penalty is: 3.84125e-08
The gauge matrix found (B^-1) is:
[[ 1.00000348e+00 1.62293418e-05 -9.40728239e-06 2.67577725e-05]
[ -1.59259939e-09 9.99999999e-01 -6.08699488e-10 4.94035495e-10]
[ -2.08253528e-09 -6.08699396e-10 9.99999999e-01 1.77772457e-09]
[ 4.08151522e-09 4.94035403e-10 1.77772457e-09 9.99999996e-01]]
The gauge-corrected gates are:
rho0 = 0.7071 -0.0043 -0.0011 0.7131
E0 = 0.6990 -0.0010 0.0135 -0.6484
Gi =
0.9999 0 0 0.0001
0.0037 0.9831 -0.0074 -0.0026
-0.0037 0.0129 0.9965 -0.0003
0.0016 -0.0060 0.0292 0.9852
Gx =
1.0000 0 0 0
0.0020 0.9895 -0.0074 0
0.0037 0.0103 0.0045 -1.0001
-0.0018 -0.0127 0.9859 0
Gy =
0.9999 0 0 0
0.0080 0.0162 -0.0160 0.9976
0.0071 0.0384 0.9875 -0.0113
0.0083 -0.9887 0.0211 -0.0187
--- Iterative MLGST: Iter 01 of 10 92 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.91 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 101
wrtLen = 43
nSubtreesPerProc = 1
=> 0.00 GB
DB Detail: dprobs cache = 0.00GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 21044.1, mu=0
--- Outer Iter 1: norm_f = 20889.6, mu=4.19022e+06
--- Outer Iter 2: norm_f = 20435.3, mu=1.39674e+06
--- Outer Iter 3: norm_f = 19167.5, mu=465580
--- Outer Iter 4: norm_f = 17179.2, mu=423869
--- Outer Iter 5: norm_f = 13633.2, mu=141290
--- Outer Iter 6: norm_f = 7260.59, mu=47096.6
--- Outer Iter 7: norm_f = 3575.5, mu=43592.3
--- Outer Iter 8: norm_f = 1465.14, mu=35171.1
--- Outer Iter 9: norm_f = 691.16, mu=15249.1
--- Outer Iter 10: norm_f = 238.343, mu=5083.03
--- Outer Iter 11: norm_f = 71.2217, mu=1694.34
--- Outer Iter 12: norm_f = 57.451, mu=564.781
--- Outer Iter 13: norm_f = 57.1195, mu=188.26
--- Outer Iter 14: norm_f = 57.1171, mu=62.7535
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
Completed in 0.5s
2*Delta(log(L)) = 57.3824
Iteration 1 took 0.5s
--- Iterative MLGST: Iter 02 of 10 92 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.85 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 101
wrtLen = 43
nSubtreesPerProc = 1
=> 0.00 GB
DB Detail: dprobs cache = 0.00GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 57.1171, mu=0
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 57.1171 (92 data params - 31 model params = expected mean of 61; p-value = 0.617361)
Completed in 0.1s
2*Delta(log(L)) = 57.3824
Iteration 2 took 0.1s
--- Iterative MLGST: Iter 03 of 10 168 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.85 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 184
wrtLen = 43
nSubtreesPerProc = 1
=> 0.00 GB
DB Detail: dprobs cache = 0.00GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 208.279, mu=0
--- Outer Iter 1: norm_f = 137.989, mu=509.393
--- Outer Iter 2: norm_f = 137.715, mu=169.798
--- Outer Iter 3: norm_f = 137.715, mu=56.5992
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 137.715 (168 data params - 31 model params = expected mean of 137; p-value = 0.466775)
Completed in 0.2s
2*Delta(log(L)) = 138.035
Iteration 3 took 0.2s
--- Iterative MLGST: Iter 04 of 10 441 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.85 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 485
wrtLen = 43
nSubtreesPerProc = 1
=> 0.00 GB
DB Detail: dprobs cache = 0.00GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 553.53, mu=0
--- Outer Iter 1: norm_f = 455.388, mu=1317.47
--- Outer Iter 2: norm_f = 455.296, mu=439.155
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 455.296 (441 data params - 31 model params = expected mean of 410; p-value = 0.0605547)
Completed in 0.3s
2*Delta(log(L)) = 456.791
Iteration 4 took 0.4s
--- Iterative MLGST: Iter 05 of 10 817 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.79 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 898
wrtLen = 43
nSubtreesPerProc = 1
=> 0.00 GB
DB Detail: dprobs cache = 0.00GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 954.721, mu=0
--- Outer Iter 1: norm_f = 887.554, mu=2589.39
--- Outer Iter 2: norm_f = 887.53, mu=863.132
Least squares message = Relative change in |x| is at most 1e-06
Sum of Chi^2 = 887.53 (817 data params - 31 model params = expected mean of 786; p-value = 0.00666638)
Completed in 0.6s
2*Delta(log(L)) = 891.694
Iteration 5 took 0.7s
--- Iterative MLGST: Iter 06 of 10 1201 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.73 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 1321
wrtLen = 43
nSubtreesPerProc = 1
=> 0.01 GB
DB Detail: dprobs cache = 0.01GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 1325.17, mu=0
--- Outer Iter 1: norm_f = 1244.34, mu=7941.43
--- Outer Iter 2: norm_f = 1244.3, mu=2647.14
Least squares message = Relative change in |x| is at most 1e-06
Sum of Chi^2 = 1244.3 (1201 data params - 31 model params = expected mean of 1170; p-value = 0.064471)
Completed in 0.7s
2*Delta(log(L)) = 1249.08
Iteration 6 took 0.8s
--- Iterative MLGST: Iter 07 of 10 1585 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.70 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 1743
wrtLen = 43
nSubtreesPerProc = 1
=> 0.01 GB
DB Detail: dprobs cache = 0.01GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 1715.52, mu=0
--- Outer Iter 1: norm_f = 1630.85, mu=23887.7
--- Outer Iter 2: norm_f = 1630.81, mu=7962.58
Least squares message = Relative change in |x| is at most 1e-06
Sum of Chi^2 = 1630.81 (1585 data params - 31 model params = expected mean of 1554; p-value = 0.0857283)
Completed in 1.1s
2*Delta(log(L)) = 1635.64
Iteration 7 took 1.3s
--- Iterative MLGST: Iter 08 of 10 1969 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.67 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 2165
wrtLen = 43
nSubtreesPerProc = 1
=> 0.01 GB
DB Detail: dprobs cache = 0.01GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 2146.88, mu=0
--- Outer Iter 1: norm_f = 2043.65, mu=75537
--- Outer Iter 2: norm_f = 2043.59, mu=25179
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 2043.59 (1969 data params - 31 model params = expected mean of 1938; p-value = 0.0467865)
Completed in 1.6s
2*Delta(log(L)) = 2049.51
Iteration 8 took 1.8s
--- Iterative MLGST: Iter 09 of 10 2353 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.68 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 2588
wrtLen = 43
nSubtreesPerProc = 1
=> 0.01 GB
DB Detail: dprobs cache = 0.01GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 2515.12, mu=0
--- Outer Iter 1: norm_f = 2471.93, mu=226127
--- Outer Iter 2: norm_f = 2471.9, mu=75375.6
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 2471.9 (2353 data params - 31 model params = expected mean of 2322; p-value = 0.0152387)
Completed in 1.8s
2*Delta(log(L)) = 2477.98
Iteration 9 took 2.0s
--- Iterative MLGST: Iter 10 of 10 2737 gate strings ---:
--- Minimum Chi^2 GST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.68 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 3010
wrtLen = 43
nSubtreesPerProc = 1
=> 0.02 GB
DB Detail: dprobs cache = 0.02GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 2839.15, mu=0
--- Outer Iter 1: norm_f = 2813.11, mu=614812
--- Outer Iter 2: norm_f = 2813.09, mu=204937
Least squares message = Both actual and predicted relative reductions in the sum of squares are at most 1e-06
Sum of Chi^2 = 2813.09 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0740982)
Completed in 2.6s
2*Delta(log(L)) = 2819.46
Iteration 10 took 3.1s
Switching to ML objective (last iteration)
--- MLGST ---
Created evaluation tree with 1 subtrees. Will divide 1 procs into 1 (subtree-processing) groups of ~1 procs each, to distribute over 43 params (taken as 1 param groups of ~43 params).
Memlimit = 8.67 GB
Memory estimate (ng=1, np=1, Ng=1):
subcalls = [u'bulk_fill_probs', u'bulk_fill_dprobs']
cacheSize = 3010
wrtLen = 43
nSubtreesPerProc = 1
=> 0.02 GB
DB Detail: dprobs cache = 0.02GB
DB Detail: probs cache = 0.00GB
--- Outer Iter 0: norm_f = 1409.73, mu=0
--- Outer Iter 1: norm_f = 1409.25, mu=304064
--- Outer Iter 2: norm_f = 1409.24, mu=101355
Least squares message = Relative change in |x| is at most 1e-06
Maximum log(L) = 1409.24 below upper bound of -8.65222e+06
2*Delta(log(L)) = 2818.48 (2737 data params - 31 model params = expected mean of 2706; p-value = 0.0645887)
Completed in 2.8s
2*Delta(log(L)) = 2818.48
Final MLGST took 2.8s
Iterative MLGST Total Time: 13.5s
*** Generating tables ***
Iter 01 of 17 : Generating table: targetSpamTable [0.0s]
Iter 02 of 17 : Generating table: targetGatesTable [0.0s]
Iter 03 of 17 : Generating table: datasetOverviewTable [0.0s]
Iter 04 of 17 : Generating table: bestGatesetSpamTable [0.0s]
Iter 05 of 17 : Generating table: bestGatesetSpamParametersTable [0.0s]
Iter 06 of 17 : Generating table: bestGatesetGatesTable [0.0s]
Iter 07 of 17 : Generating table: bestGatesetChoiTable [0.0s]
Iter 08 of 17 : Generating table: bestGatesetDecompTable [0.0s]
Iter 09 of 17 : Generating table: bestGatesetRotnAxisTable [0.0s]
Iter 10 of 17 : Generating table: bestGatesetClosestUnitaryTable [9.8s]
Iter 11 of 17 : Generating table: bestGatesetVsTargetTableTraceback (most recent call last):
File "test.py", line 44, in <module>
results_test.create_full_report_pdf(verbosity=3)
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/results.py", line 1690, in create_full_report_pdf
qtys[key] = self.tables.get(key, verbosity=printer - 1).render(
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/resultcache.py", line 84, in get
self._data[level][key] = computeFn(key, level, printer)
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/results.py", line 540, in fn
return _generation.get_gates_vs_target_table(gsBest, gsTgt, cri)
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/generation.py", line 346, in get_gates_vs_target_table
confidenceRegionInfo)
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/reportables.py", line 757, in compute_gateset_gateset_qtys
eps, confidenceRegionInfo)
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/reportables.py", line 79, in _getGateQuantity
return ReportableQty(fnOfGate(gateset.gates[gateLabel]))
File "/home/msilva/Repos/pyGSTi/packages/pygsti/report/reportables.py", line 752, in half_diamond_norm
return 0.5 * _tools.diamonddist(gate, gateset2.gates[gateLabel]) #Note: default 'gm' basis
File "/home/msilva/Repos/pyGSTi/packages/pygsti/tools/gatetools.py", line 252, in diamonddist
prob.solve(solver="CVXOPT")
File "/home/msilva/anaconda3/envs/pygsti2/lib/python2.7/site-packages/cvxpy/problems/problem.py", line 210, in solve
return self._solve(*args, **kwargs)
File "/home/msilva/anaconda3/envs/pygsti2/lib/python2.7/site-packages/cvxpy/problems/problem.py", line 336, in _solve
self._update_problem_state(results_dict, sym_data, solver)
File "/home/msilva/anaconda3/envs/pygsti2/lib/python2.7/site-packages/cvxpy/problems/problem.py", line 448, in _update_problem_state
"Solver '%s' failed. Try another solver." % solver.name())
cvxpy.error.SolverError: Solver 'CVXOPT' failed. Try another solver.
msilva@stampede $ pip list | grep cvx
cvxopt (1.1.8)
cvxpy (0.4.6)
msilva@stampede $ conda list | grep cvx
cvxopt 1.1.8 <pip>
cvxpy 0.4.6 <pip>
msilva@stampede $ uname -r
3.13.0-96-generic
from pygsti.
I'd say that it seems like cvxopt
only works properly with openblas
installed. If that is the case, it would be good to list cvxopt
with openblas
support as a dependency for diamond norm computation.
Checking np.__config__.show()
I get
lapack_opt_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/msilva/anaconda3/envs/pygsti2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/msilva/anaconda3/envs/pygsti2/include']
blas_opt_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/msilva/anaconda3/envs/pygsti2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/msilva/anaconda3/envs/pygsti2/include']
openblas_lapack_info:
NOT AVAILABLE
lapack_mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/msilva/anaconda3/envs/pygsti2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/msilva/anaconda3/envs/pygsti2/include']
blas_mkl_info:
libraries = ['mkl_intel_lp64', 'mkl_intel_thread', 'mkl_core', 'iomp5', 'pthread']
library_dirs = ['/home/msilva/anaconda3/envs/pygsti2/lib']
define_macros = [('SCIPY_MKL_H', None), ('HAVE_CBLAS', None)]
include_dirs = ['/home/msilva/anaconda3/envs/pygsti2/include']
from pygsti.
After more digging, it is clear that:
- OpenBLAS needs to be installed
- a special version of cvxopt with OpenBLAS support needs to be installed
Running
conda install cvxopt
does not give that version (at least on several systems I have use, ranging from different Linux distributions, all the way to Windows). Instead, to get this to work I had to run
conda install --channel https://conda.anaconda.org/conda-forge cvxopt
and similarly, to get cvxpy
without resorting to pip
I had to run
conda install --channel https://conda.anaconda.org/cvxgrp cvxpy
That seems to have fixed the issue.
In order to avoid this problem it would be helpful to have a much more explicitly stated set of dependencies for the installation of pyGSTi
from pygsti.
Thanks for all the debugging work. It's still not clear to me that this isn't a case of the conda installation of cvxopt being messed up. Here's what (I think) is an accurate summary of this issue:
- Whenever cvxopt has given the "Try another solver" error, it's been when python was using cvxopt installed via conda, at least in the past. (I think @marcusps has tried uninstalling with conda and reinstalling using pip as well - which may indicate that the conda install corrupts something so that even after installing with pip things don't work.)
- When using pip to freshly install cvxopt we don't see this problem. At least I never have, and I've installed pyGSTi on about 10 machines now, including OSX macbooks, Fedora and Ubuntu linux laptops, and RHEL 6 & 7 clusters.
- @marcusps's last post looks like it describes a way of fixing the conda install of cvxopt, so that conda can be used with a little tweaking.
The overall takeaway seem to be that, for someone installing pyGSTi from scratch, its best to just use pip to install all the required packages and avoid conda, and if you still get the above error try using @marcusps's conda fix (previous post).
The comments about needing a special version of OpenBLAS are interesting to me - and perhaps in some cases that's the issue. But I've installed pyGSTi on many machines (just using pip) and never had to worry about which version of BLAS was used.
from pygsti.
I'm closing this issue as I haven't seen or heard anyone having an issue with weird CVXOPT failures for over a year. I think this supports the explanation that it is/was a CVXOPT versioning or install issue, where some installs of CVXOPT would fail to solve problems where most others had no issue. Anyone should feel free to reopen this or start a new issue if this problem resurfaces.
from pygsti.
Related Issues (20)
- Cannot compute product of editable circuit
- Nondeterministic Unit Test Failures HOT 5
- Re-evaluating Skipped Unit Tests HOT 3
- OpenQASM returned by convert_to_openqasm includes opaque gates. HOT 8
- Gauge transformations on SPAM HOT 2
- Faster unit tests/notebooks HOT 9
- Unexpected file in test_packages HOT 2
- ProtocolResults Incompletely Loads From Directory
- Target & True Models Should Be Static HOT 5
- Idea: Switch macOS tests to run against beta branch HOT 4
- Pygsti is incompatible with scipy 1.12 HOT 1
- Fiducial selection for prep fiducials generates wrong qubit labels HOT 7
- Avoid unintended calls to ``ComplementPOVMEffect.to_vector()``
- Use ``@`` for matrix-matrix and matrix-vector multiplications HOT 3
- Docstring for QuditProcessorSpec has mistake for "availability"
- Distinction between correlation error generators and active error generators in HTML reports
- Performance improvement for 2-qubit GST HOT 1
- How to characterize crosstalk errors with PyGsti?
- TypeError when performing gauge optimization with respect to fidelity or trace distance
- RB edesigns' `truncate_to_available_data` fails to truncate auxiliary information
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygsti.