(Created on August 03, 2017)
import pickle
with open('results.pkl', 'rb') as infile:
results = pickle.load(infile)
estimates = results.estimates
default = estimates['default']
gatesets = default.gatesets
ds = results.dataset
gs = gatesets['go0']
gs_final = gatesets['final iteration estimate']
gs_target = gatesets['target']
#Ls = [results.gatestring_structs['final'].Ls]
Ls = results.gatestring_structs['final'].Ls
cri = None
from pygsti.report import Workspace
ws = Workspace()
ws.init_notebook_mode(connected=False, autodisplay=True)
The aggregate log-likelihood as a function of GST iterations''')
ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL,
eff_ds, switchBd.objective, 'L')
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-3-da3877e2bc83> in <module>() 1 ----> 2 ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, 3 eff_ds, switchBd.objective, 'L') NameError: name 'gs_finalAllL' is not defined
Each point displays the goodness of fit for a single gate sequence.''')
colorScatterPlot = ws.ColorBoxPlot(
switchBd.objective, gs_final, eff_ds, gsL,
linlg_pcntle=float(linlogPercentile) / 100,
minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?
colorScatterPlot.set_render_options(click_to_display=True)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-4-cae4ff6034fa> in <module>() 1 2 colorScatterPlot = ws.ColorBoxPlot( ----> 3 switchBd.objective, gs_final, eff_ds, gsL, 4 linlg_pcntle=float(linlogPercentile) / 100, 5 minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page? NameError: name 'switchBd' is not defined
This table presents, for each of the gates, three different measures of distance or discrepancy from the GST estimate to the ideal target operation. See text for more detail.''')
ws.GatesVsTargetTable(gs_final, gs_target, cri)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-5-10bfa932eee8> in <module>() 1 ----> 2 ws.GatesVsTargetTable(gs_final, gs_target, cri) <string> in factoryfn(gateset, targetGateset, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in __init__(self, ws, gateset, targetGateset, confidenceRegionInfo) 477 """ 478 super(GatesVsTargetTable,self).__init__(ws, self._create, gateset, --> 479 targetGateset, confidenceRegionInfo) 480 481 def _create(self, gateset, targetGateset, confidenceRegionInfo): /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in __init__(self, ws, fn, *args) 1521 self.initargs = args 1522 self.tables,self.switchboards,self.sbSwitchIndices,self.switchpos_map = \ -> 1523 self.ws.switchedCompute(self.tablefn, *self.initargs) 1524 self.options = { 'click_to_display': False } 1525 /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in switchedCompute(self, fn, *args) 610 key="NA"; result = v; break 611 else: --> 612 key, result = self.smartCache.cached_compute(fn, argVals) 613 614 if key not in storedKeys or key == 'INEFFECTIVE': /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in _create(self, gateset, targetGateset, confidenceRegionInfo) 486 formatters = (None,'Conversion','Conversion','Conversion') # ,'Conversion' 487 --> 488 infidelities = [_reportables.process_infidelity(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 489 jt_diffs = [_reportables.jt_diff(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 490 dnorms = [_reportables.half_diamond_norm(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in <listcomp>(.0) 486 formatters = (None,'Conversion','Conversion','Conversion') # ,'Conversion' 487 --> 488 infidelities = [_reportables.process_infidelity(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 489 jt_diffs = [_reportables.jt_diff(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 490 dnorms = [_reportables.half_diamond_norm(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cacher(*args, **kwargs) 312 @_functools.wraps(obj) 313 def cacher(*args, **kwargs): --> 314 k, v = cache.cached_compute(obj, args, kwargs) 315 return v 316 return cacher /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in compute_quantity(gatesetA, gatesetB, gateLabel, confidenceRegionInfo) 749 B = gatesetB.gates[gateLabel] 750 if confidenceRegionInfo is None: # No Error bars --> 751 return ReportableQty(fnOfGates(A, B, mxBasis)) 752 753 # make sure the gateset we're given is the one used to generate the confidence region /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in process_infidelity(A, B, mxBasis) 769 @gates_quantity() # This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo) 770 def process_infidelity(A, B, mxBasis): --> 771 return 1 - _tools.process_fidelity(A, B, mxBasis) 772 773 @gates_quantity() # This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py in process_fidelity(A, B, mxBasis) 343 if mxBasis is None: 344 mxBasis = _basis.Basis('gm', int(round(_np.sqrt(A.shape[0])))) --> 345 JA = _jam.jamiolkowski_iso(A, mxBasis) 346 JB = _jam.jamiolkowski_iso(B, mxBasis) 347 return fidelity(JA,JB) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/jamiolkowski.py in jamiolkowski_iso(gateMx, gateMxBasis, choiMxBasis) 85 gateMxBasis, choiMxBasis = _basis.build_basis_pair(gateMx, gateMxBasis, choiMxBasis) 86 gateMx = _np.asarray(gateMx) ---> 87 gateMxInStdBasis = _basis.change_basis(gateMx, gateMxBasis, gateMxBasis.std_equivalent()) 88 89 #expand gate matrix so it acts on entire space of dmDim x dmDim density matrices /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py in change_basis(mx, from_basis, to_basis, dimOrBlockDims, resize) 430 isMx = len(mx.shape) == 2 and mx.shape[0] == mx.shape[1] 431 if isMx: --> 432 ret = _np.dot(toMx, _np.dot(mx, fromMx)) 433 else: # isVec 434 ret = _np.dot(toMx, mx) ValueError: shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)
Metrics indicating how well the estimated gate set can be trusted -- i.e., how well it fits the data.
Comparison between the computed and expected maximum $\log(\mathcal{L})$ for different values of $L$.
$N_S$ and $N_p$ are the number of gate strings and parameters, respectively.
The quantity $2\Delta\log(\mathcal{L})$ measures the goodness of fit of the GST model (small is better) and is expected to lie within $[k-\sqrt{2k},k+\sqrt{2k}]$ where $k = N_s-N_p$.
$N_\sigma = (2\Delta\log(\mathcal{L})-k)/\sqrt{2k}$ is the number of standard deviations from the mean (a $p$-value can be straightforwardly derived from $N_\sigma$).
The rating from 1 to 5 stars gives a very crude indication of goodness of fit.
ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL,
eff_ds, switchBd.objective, 'L')
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-6-da3877e2bc83> in <module>() 1 ----> 2 ws.FitComparisonBarPlot(Ls, gs_finalAllL, switchBd.gsAllL, 3 eff_ds, switchBd.objective, 'L') NameError: name 'gs_finalAllL' is not defined
colorScatterPlot = ws.ColorBoxPlot(
switchBd.objective, gs_final, eff_ds, gsL,
linlg_pcntle=float(linlogPercentile) / 100,
minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page?
colorScatterPlot.set_render_options(click_to_display=True)
#switchBd.view(maxLView,"v6")
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-7-5c265eeb2d3d> in <module>() 1 2 colorScatterPlot = ws.ColorBoxPlot( ----> 3 switchBd.objective, gs_final, eff_ds, gsL, 4 linlg_pcntle=float(linlogPercentile) / 100, 5 minProbClipForWeighting=switchBd.mpc, scatter=True) #TODO: L-switchboard on summary page? NameError: name 'switchBd' is not defined
Each pixel represents a single experiment (gate sequence), and its color indicates whether GST was able to fit the corresponding frequency well. Shades of white/gray are typical. Red squares represent statistically significant evidence for model violation (non-Markovianity), and should appear with probability at most linlg_pcntle if the data really are Markovian. Square blocks of pixels correspond to base sequences (arranged vertically by germ and horizontally by length); each pixel within a block corresponds to a specific choice of pre- and post-fiducial sequences. See text for further details.
ws.ColorBoxPlot("scaling", switchBd.gs_finalFinal, eff_ds, switchBd.gs_finalIter,
submatrices=switchBd.scaledSubMxsDict)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-8-434a18b3c4f2> in <module>() 1 ----> 2 ws.ColorBoxPlot("scaling", switchBd.gs_finalFinal, eff_ds, switchBd.gs_finalIter, 3 submatrices=switchBd.scaledSubMxsDict) NameError: name 'switchBd' is not defined
Each pixel represents a single experiment (gate sequence), and its color indicates the amount of scaling that was applied to the original data counts when computing the log-likelihood or $\chi^2$ for this estimate.
Values of 1.0 indicate all of the original data was used, whereas numbers between 0 and 1 indicate that the data counts for the experiement were artificially decreased (usually to improve the fit).
Quantities which are gauge-invariant are the most reliable means of assessing the quality of the gates, as these do not depend on any unphysical gauge degrees of freedom
The spectrum (Eigenvalues column) of each estimated gate. The second column displays these eigenvalues over the complex disc.
ws.GateEigenvalueTable(gs_final, gs_target, cri, display=('evals','log-evals'))
Gate | Eigenvalues | Real log(eval) | Imag log(eval) |
---|---|---|---|
Gi | $ \begin{pmatrix} 0.899225e^{i0.002\pi} \\ 0.899225e^{-i0.002\pi} \\ 0.902577 \\ 1 \end{pmatrix} $ | $ \begin{pmatrix} -0.106222 \\ -0.106222 \\ -0.102501 \\ 0 \end{pmatrix} $ | $ \begin{pmatrix} 0.002074 \\ -0.002074 \\ 0 \\ 0 \end{pmatrix} $ π |
Gx | $ \begin{pmatrix} 0.901995e^{i0.501\pi} \\ 0.901995e^{-i0.501\pi} \\ 1 \\ 0.912432 \end{pmatrix} $ | $ \begin{pmatrix} -0.103146 \\ -0.103146 \\ 0 \\ -0.091642 \end{pmatrix} $ | $ \begin{pmatrix} 0.500663 \\ -0.500663 \\ 0 \\ 0 \end{pmatrix} $ π |
Gy | $ \begin{pmatrix} 1 \\ 0.898011 \\ 0.897092e^{i0.500\pi} \\ 0.897092e^{-i0.500\pi} \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ -0.107573 \\ -0.108596 \\ -0.108596 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ 0 \\ 0.50005 \\ -0.50005 \end{pmatrix} $ π |
<pygsti.report.workspacetables.GateEigenvalueTable at 0x7f13b6c9bb38>
Compares the eigenvalues of the data-derived Gram matrix with those of a Gram matrix computed using the target gates.
ws.GramMatrixBarPlot(ds, gs_target, 10)#, strs)
<pygsti.report.workspaceplots.GramMatrixBarPlot at 0x7f13b6b8c9b0>
The raw estimated gate set, and then some useful derived quantities. These quanties are gauge-dependent
, meaning they will depend on unphysical gauge degrees of freedom that are a necessary byproduct of estimating an entire gate set at once (akin to a freedom of reference frame). After finding a best-estimate based on the (physical) data, GST optimizes within the space of all (unphysical) gauge degrees of freedom using the parameters in Table
# Choose G.O. params
# goSwitchBoard2
A list of the parameters used when performing the gauge optimization that produced the final GST results found in subsequent tables and figures.
ws.GaugeOptParamsTable(switchBd.goparams)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-12-2f015ad838f8> in <module>() 1 ----> 2 ws.GaugeOptParamsTable(switchBd.goparams) 3 NameError: name 'switchBd' is not defined
ws.SpamTable(switchBd.gsTargetAndFinal,
['Target','Estimated'],
cri, includeHSVec=False)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-13-cbd7b88b0b35> in <module>() 1 ----> 2 ws.SpamTable(switchBd.gsTargetAndFinal, 3 ['Target','Estimated'], 4 cri, includeHSVec=False) 5 NameError: name 'switchBd' is not defined
Computed by taking the dot products of vectors in bestGatesetSpamTable. The symbol $E_C$, when it appears, refers to the complement
effect given by subtracting each of the other effects from the identity.
ws.SpamParametersTable(gs_final, cri)
E0 | EC | |
---|---|---|
ρ0 | -0.000009 | 1.000009 |
<pygsti.report.workspacetables.SpamParametersTable at 0x7f13b6bb16a0>
A rotation axis and angle are extracted from each gate by considering the projection of its logarithm onto a the Pauli Hamiltonian projectors. The direction and magnitude (up to a conventional constant) give the axis and angle respectively.
ws.GateDecompTable(gs_final, gs_target, cri)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-15-c216ce4f0a71> in <module>() 1 ----> 2 ws.GateDecompTable(gs_final, gs_target, cri) 3 <string> in factoryfn(gateset, targetGateset, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in __init__(self, ws, gateset, targetGateset, confidenceRegionInfo) 781 """ 782 super(GateDecompTable,self).__init__(ws, self._create, gateset, --> 783 targetGateset, confidenceRegionInfo) 784 785 /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in __init__(self, ws, fn, *args) 1521 self.initargs = args 1522 self.tables,self.switchboards,self.sbSwitchIndices,self.switchpos_map = \ -> 1523 self.ws.switchedCompute(self.tablefn, *self.initargs) 1524 self.options = { 'click_to_display': False } 1525 /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in switchedCompute(self, fn, *args) 610 key="NA"; result = v; break 611 else: --> 612 key, result = self.smartCache.cached_compute(fn, argVals) 613 614 if key not in storedKeys or key == 'INEFFECTIVE': /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in _create(self, gateset, targetGateset, confidenceRegionInfo) 804 805 hamProjs, hamGens = _tools.std_errgen_projections( --> 806 logG, "hamiltonian", basisNm, basisNm, return_generators=True) 807 norm = _np.linalg.norm(hamProjs) 808 axes[gl] = hamProjs / norm if (norm > 1e-15) else hamProjs /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py in std_errgen_projections(errgen, projection_type, projection_basis, mxBasis, return_generators) 866 """ 867 --> 868 errgen_std = change_basis(errgen, mxBasis, "std") 869 d2 = errgen.shape[0] 870 d = int(_np.sqrt(d2)) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py in change_basis(mx, from_basis, to_basis, dimOrBlockDims, resize) 407 408 if from_basis.dim.gateDim != to_basis.dim.gateDim: --> 409 raise ValueError('Automatic basis expanding/contracting temporarily disabled') 410 #or \ 411 # resize is not None: ValueError: Automatic basis expanding/contracting temporarily disabled
The spectrum of each estimated gate pre-multiplied by the inverse of it's ideal (target) counterpart. The second column displays these eigenvalues over the complex disc.
ws.GateEigenvalueTable(gs_final, gs_target, cri, display=('rel','log-rel'))
Gate | Rel. Evals | Real log(rel. eval) | Imag log(rel. eval) |
---|---|---|---|
Gi | $ \begin{pmatrix} 0.899225e^{i0.002\pi} \\ 0.899225e^{-i0.002\pi} \\ 0.902577 \\ 1 \end{pmatrix} $ | $ \begin{pmatrix} -0.106222 \\ -0.106222 \\ -0.102501 \\ 0 \end{pmatrix} $ | $ \begin{pmatrix} 0.002074 \\ -0.002074 \\ 0 \\ 0 \end{pmatrix} $ π |
Gx | $ \begin{pmatrix} 1 \\ 0.898077 \\ 0.905064 \\ 0.913306 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ -0.107499 \\ -0.09975 \\ -0.090685 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} $ π |
Gy | $ \begin{pmatrix} 1 \\ 0.903568 \\ 0.891716 \\ 0.896951 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ -0.101404 \\ -0.114608 \\ -0.108755 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ 0 \\ 0 \\ 0 \end{pmatrix} $ π |
<pygsti.report.workspacetables.GateEigenvalueTable at 0x7f13b6b471d0>
This table presents, for each of the gates, three different measures of distance or discrepancy from the GST estimate to the ideal target operation. See text for more detail.
ws.GatesVsTargetTable(gs_final, gs_target, cri)
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-17-94a678e298cf> in <module>() 1 ----> 2 ws.GatesVsTargetTable(gs_final, gs_target, cri) 3 <string> in factoryfn(gateset, targetGateset, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in __init__(self, ws, gateset, targetGateset, confidenceRegionInfo) 477 """ 478 super(GatesVsTargetTable,self).__init__(ws, self._create, gateset, --> 479 targetGateset, confidenceRegionInfo) 480 481 def _create(self, gateset, targetGateset, confidenceRegionInfo): /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in __init__(self, ws, fn, *args) 1521 self.initargs = args 1522 self.tables,self.switchboards,self.sbSwitchIndices,self.switchpos_map = \ -> 1523 self.ws.switchedCompute(self.tablefn, *self.initargs) 1524 self.options = { 'click_to_display': False } 1525 /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in switchedCompute(self, fn, *args) 610 key="NA"; result = v; break 611 else: --> 612 key, result = self.smartCache.cached_compute(fn, argVals) 613 614 if key not in storedKeys or key == 'INEFFECTIVE': /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in _create(self, gateset, targetGateset, confidenceRegionInfo) 486 formatters = (None,'Conversion','Conversion','Conversion') # ,'Conversion' 487 --> 488 infidelities = [_reportables.process_infidelity(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 489 jt_diffs = [_reportables.jt_diff(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 490 dnorms = [_reportables.half_diamond_norm(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in <listcomp>(.0) 486 formatters = (None,'Conversion','Conversion','Conversion') # ,'Conversion' 487 --> 488 infidelities = [_reportables.process_infidelity(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 489 jt_diffs = [_reportables.jt_diff(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] 490 dnorms = [_reportables.half_diamond_norm(gateset, targetGateset, gl, confidenceRegionInfo) for gl in gateLabels] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cacher(*args, **kwargs) 312 @_functools.wraps(obj) 313 def cacher(*args, **kwargs): --> 314 k, v = cache.cached_compute(obj, args, kwargs) 315 return v 316 return cacher /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in compute_quantity(gatesetA, gatesetB, gateLabel, confidenceRegionInfo) 749 B = gatesetB.gates[gateLabel] 750 if confidenceRegionInfo is None: # No Error bars --> 751 return ReportableQty(fnOfGates(A, B, mxBasis)) 752 753 # make sure the gateset we're given is the one used to generate the confidence region /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in process_infidelity(A, B, mxBasis) 769 @gates_quantity() # This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo) 770 def process_infidelity(A, B, mxBasis): --> 771 return 1 - _tools.process_fidelity(A, B, mxBasis) 772 773 @gates_quantity() # This function changes arguments to (gatesetA, gatesetB, gateLabel, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py in process_fidelity(A, B, mxBasis) 343 if mxBasis is None: 344 mxBasis = _basis.Basis('gm', int(round(_np.sqrt(A.shape[0])))) --> 345 JA = _jam.jamiolkowski_iso(A, mxBasis) 346 JB = _jam.jamiolkowski_iso(B, mxBasis) 347 return fidelity(JA,JB) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/jamiolkowski.py in jamiolkowski_iso(gateMx, gateMxBasis, choiMxBasis) 85 gateMxBasis, choiMxBasis = _basis.build_basis_pair(gateMx, gateMxBasis, choiMxBasis) 86 gateMx = _np.asarray(gateMx) ---> 87 gateMxInStdBasis = _basis.change_basis(gateMx, gateMxBasis, gateMxBasis.std_equivalent()) 88 89 #expand gate matrix so it acts on entire space of dmDim x dmDim density matrices /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/basis.py in change_basis(mx, from_basis, to_basis, dimOrBlockDims, resize) 430 isMx = len(mx.shape) == 2 and mx.shape[0] == mx.shape[1] 431 if isMx: --> 432 ret = _np.dot(toMx, _np.dot(mx, fromMx)) 433 else: # isVec 434 ret = _np.dot(toMx, mx) ValueError: shapes (4,4) and (0,0) not aligned: 4 (dim 1) != 0 (dim 0)
This table presents, for each state preparation and POVM effect, two different measures of distance or discrepancy from the GST estimate to the ideal target operation. See text for more detail.
ws.SpamVsTargetTable(gs_final, gs_target, cri)
Matrix is singular and may not have a square root.
--------------------------------------------------------------------------- AssertionError Traceback (most recent call last) <ipython-input-18-2c9b60b5fda5> in <module>() 1 ----> 2 ws.SpamVsTargetTable(gs_final, gs_target, cri) 3 <string> in factoryfn(gateset, targetGateset, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in __init__(self, ws, gateset, targetGateset, confidenceRegionInfo) 522 """ 523 super(SpamVsTargetTable,self).__init__(ws, self._create, gateset, --> 524 targetGateset, confidenceRegionInfo) 525 526 def _create(self, gateset, targetGateset, confidenceRegionInfo): /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in __init__(self, ws, fn, *args) 1521 self.initargs = args 1522 self.tables,self.switchboards,self.sbSwitchIndices,self.switchpos_map = \ -> 1523 self.ws.switchedCompute(self.tablefn, *self.initargs) 1524 self.options = { 'click_to_display': False } 1525 /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspace.py in switchedCompute(self, fn, *args) 610 key="NA"; result = v; break 611 else: --> 612 key, result = self.smartCache.cached_compute(fn, argVals) 613 614 if key not in storedKeys or key == 'INEFFECTIVE': /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in _create(self, gateset, targetGateset, confidenceRegionInfo) 537 prepInfidelities = [_reportables.vec_infidelity(gateset, targetGateset, l, 538 'prep', confidenceRegionInfo) --> 539 for l in prepLabels] 540 prepTraceDists = [_reportables.vec_tr_diff(gateset, targetGateset, l, 541 'prep', confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/workspacetables.py in <listcomp>(.0) 537 prepInfidelities = [_reportables.vec_infidelity(gateset, targetGateset, l, 538 'prep', confidenceRegionInfo) --> 539 for l in prepLabels] 540 prepTraceDists = [_reportables.vec_tr_diff(gateset, targetGateset, l, 541 'prep', confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cacher(*args, **kwargs) 312 @_functools.wraps(obj) 313 def cacher(*args, **kwargs): --> 314 k, v = cache.cached_compute(obj, args, kwargs) 315 return v 316 return cacher /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/smartcache.py in cached_compute(self, fn, argVals, kwargs) 177 self.typesigs[name_key] = typesig 178 with _timed_block('call', times): --> 179 self.cache[key] = fn(*argVals, **kwargs) 180 self.misses[key] += 1 181 hashtime = times['hash'] /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in compute_quantity(gatesetA, gatesetB, label, typ, confidenceRegionInfo) 855 856 if confidenceRegionInfo is None: # No Error bars --> 857 return ReportableQty(fnOfVectors(A, B, mxBasis)) 858 859 # make sure the gateset we're given is the one used to generate the confidence region /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/report/reportables.py in vec_infidelity(A, B, mxBasis) 885 rhoMx1 = _tools.vec_to_stdmx(A, mxBasis) 886 rhoMx2 = _tools.vec_to_stdmx(B, mxBasis) --> 887 return 1 - _tools.fidelity(rhoMx1, rhoMx2) 888 889 @vectors_quantity() # This function changes arguments to (gatsetA, gatesetB, label, typ, confidenceRegionInfo) /home/lsaldyt-local/projects/snl/pyGSTi/packages/pygsti/tools/gatetools.py in fidelity(A, B) 62 63 sqrtA = _hack_sqrtm(A) #_spl.sqrtm(A) ---> 64 assert( _np.linalg.norm( _np.dot(sqrtA,sqrtA) - A ) < 1e-8 ) #test the scipy sqrtm function 65 F = (_mt.trace( _hack_sqrtm( _np.dot( sqrtA, _np.dot(B, sqrtA) ) ) ).real)**2 # Tr( sqrt{ sqrt(A) * B * sqrt(A) } )^2 66 return F AssertionError:
Compares the ideal (generally unitary) logic gates (second column, also in targetGatesetTable) with those estimated by GST (third column). Each gate is represented as a $d^2\times d^2$ superoperator that acts by matrix multiplication on vectors in $\mathcal{B}(\mathcal{H})$. Matrices are displayed using a heat map that ranges between 1.0 (red) and -1.0 (blue). Note that it is impossible to discern even order-1%% deviations from the ideal using this color scale, and one should rely on other analysis for more a precise comparison.
ws.GatesTable(switchBd.gsTargetAndFinal,
['Target','Estimated'], "boxes", cri)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-19-36c3f316c909> in <module>() 1 ----> 2 ws.GatesTable(switchBd.gsTargetAndFinal, 3 ['Target','Estimated'], "boxes", cri) NameError: name 'switchBd' is not defined
This report contains information for more than one data set. This page shows comparisons between different data sets.
Each gate sequence is assigned a p-value based on how consistent that sequence's counts are between the two selected data sets. The line shows what would be expected for perfectly consistent data.
ws.DatasetComparisonPlot(dscmp_switchBd.dscmp)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-20-1a6bd038ebbb> in <module>() 1 ----> 2 ws.DatasetComparisonPlot(dscmp_switchBd.dscmp) 3 NameError: name 'dscmp_switchBd' is not defined
In a similar fashion to other color box plots, this plot shows two times the log-likelihood-ratio for each gate sequence corresponding to how consistent that sequences' counts are between the two selected data sets. The likelihood ratio is between a models that supposes there is either one or two separate probability distributions from which the data counts are drawn.
ws.ColorBoxPlot('dscmp', dscmp_switchBd.dscmp_gs_final,
None, None, dscomparator=dscmp_switchBd.dscmp)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-21-db3165bbd365> in <module>() 1 ----> 2 ws.ColorBoxPlot('dscmp', dscmp_switchBd.dscmp_gs_final, 3 None, None, dscomparator=dscmp_switchBd.dscmp) NameError: name 'dscmp_switchBd' is not defined
Information pertaining to the target gate set and data set.
The ideal input state ($\rho_0$) and `plus' POVM effect $E_0$ for the device on which we report. SPAM gates are given here as $d\times d$ matrices.
ws.SpamTable(gs_target, None, includeHSVec=False)
Operator | Matrix | Eigenvals |
---|---|---|
ρ0 | $ \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} $ | $ \begin{pmatrix} 1 \\ 0 \end{pmatrix} $ |
E0 | $ \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} $ | $ \begin{pmatrix} 0 \\ 1 \end{pmatrix} $ |
<pygsti.report.workspacetables.SpamTable at 0x7f13b6b56208>
A list of the preparation and measurement fiducial
gate sequences. See discussion in text.
ws.GatestringTable(strs,["Prep.","Measure"], commonTitle="Fiducials")
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-23-857890282a45> in <module>() 1 ----> 2 ws.GatestringTable(strs,["Prep.","Measure"], commonTitle="Fiducials") 3 NameError: name 'strs' is not defined
A list of the germ
gate sequences. See discussion in text.
ws.GatestringTable(germs, "Germ", nCols=2)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-24-e67eb0fe9596> in <module>() 1 ----> 2 ws.GatestringTable(germs, "Germ", nCols=2) 3 NameError: name 'germs' is not defined
See discussion in text.
ws.DataSetOverviewTable(ds)
Quantity | Value |
---|---|
Number of strings | 817 |
Gate labels | Gx, Gy, Gi |
SPAM labels | minus, plus |
Counts per string | 1000 |
<pygsti.report.workspacetables.DataSetOverviewTable at 0x7f13b6b56be0>
The ideal (generally unitary) logic gates. Each has a name starting with G
, and is represented as a $d^2\times d^2$ superoperator that acts by matrix multiplication on vectors in $\mathcal{B}(\mathcal{H})$. Matrices are displayed using a heat map that ranges between 1.0 (red) and -1.0 (blue).
ws.GatesTable(gs_target, display_as="boxes")
Gate | Superoperator (Gell-Mann basis) |
---|---|
Gi | |
Gx | |
Gy |
<pygsti.report.workspacetables.GatesTable at 0x7f13b6b4b828>
This section contains a raw dump of system information and various pyGSTi parameters. It's purpose is to stamp this report with parameters indicating how exactly GST was run to create it, as well as to record the software environment in within which the report creation was run. Note that if the core GST computation was done on a machine different from the one that created this report, the software information contained here will be of less value.
These parameters and related metadata describe how the GST computation was performed which led to this report.
ws.MetadataTable(gs_final, switchBd.params)
--------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-27-198a7eb73f66> in <module>() 1 ----> 2 ws.MetadataTable(gs_final, switchBd.params) 3 NameError: name 'switchBd' is not defined
Note that this describes the software environment of the machine used to generate this report, and not necessarily the machine used to perform the core GST gate set estimation.
ws.SoftwareEnvTable()
Quantity | Value |
---|---|
pyGSTi version | 0.9.3 |
numpy | 1.11.2 |
scipy | 0.18.1 |
matplotlib | 1.5.3 |
pyparsing | 2.1.10 |
cvxopt | 1.1.8 |
cvxpy | 0.4.6 |
nose | 1.3.7 |
PIL | 3.4.2 |
psutil | 4.3.1 |
Python version | 3.5.2 |
Python type | CPython |
Python compiler | GCC 4.8.5 20150623 (Red Hat 4.8.5-4) |
Python build | ('default', 'Oct 20 2016 13:11:26') |
Python branch | |
Python revision | |
Platform summary | Linux-3.10.0-327.36.1.el7.x86_64-x86_64-with-redhat-7.2-Maipo |
System | Linux |
Sys Release | 3.10.0-327.36.1.el7.x86_64 |
Sys Version | #1 SMP Wed Aug 17 03:02:37 EDT 2016 |
Machine | x86_64 |
Processor | x86_64 |
<pygsti.report.workspacetables.SoftwareEnvTable at 0x7f13b6b6bb70>