pyGSTi 0.9.12.1__cp38-cp38-win_amd64.whl → 0.9.13__cp38-cp38-win_amd64.whl
Sign up to get free protection for your applications and to get access to all the features.
- pyGSTi-0.9.13.dist-info/METADATA +185 -0
- {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/RECORD +207 -217
- {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/WHEEL +1 -1
- pygsti/_version.py +2 -2
- pygsti/algorithms/contract.py +1 -1
- pygsti/algorithms/core.py +42 -28
- pygsti/algorithms/fiducialselection.py +17 -8
- pygsti/algorithms/gaugeopt.py +2 -2
- pygsti/algorithms/germselection.py +87 -77
- pygsti/algorithms/mirroring.py +0 -388
- pygsti/algorithms/randomcircuit.py +165 -1333
- pygsti/algorithms/rbfit.py +0 -234
- pygsti/baseobjs/basis.py +94 -396
- pygsti/baseobjs/errorgenbasis.py +0 -132
- pygsti/baseobjs/errorgenspace.py +0 -10
- pygsti/baseobjs/label.py +52 -168
- pygsti/baseobjs/opcalc/fastopcalc.cp38-win_amd64.pyd +0 -0
- pygsti/baseobjs/opcalc/fastopcalc.pyx +2 -2
- pygsti/baseobjs/polynomial.py +13 -595
- pygsti/baseobjs/statespace.py +1 -0
- pygsti/circuits/__init__.py +1 -1
- pygsti/circuits/circuit.py +682 -505
- pygsti/circuits/circuitconstruction.py +0 -4
- pygsti/circuits/circuitlist.py +47 -5
- pygsti/circuits/circuitparser/__init__.py +8 -8
- pygsti/circuits/circuitparser/fastcircuitparser.cp38-win_amd64.pyd +0 -0
- pygsti/circuits/circuitstructure.py +3 -3
- pygsti/circuits/cloudcircuitconstruction.py +1 -1
- pygsti/data/datacomparator.py +2 -7
- pygsti/data/dataset.py +46 -44
- pygsti/data/hypothesistest.py +0 -7
- pygsti/drivers/bootstrap.py +0 -49
- pygsti/drivers/longsequence.py +2 -1
- pygsti/evotypes/basereps_cython.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/chp/opreps.py +0 -61
- pygsti/evotypes/chp/statereps.py +0 -32
- pygsti/evotypes/densitymx/effectcreps.cpp +9 -10
- pygsti/evotypes/densitymx/effectreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/densitymx/effectreps.pyx +1 -1
- pygsti/evotypes/densitymx/opreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/densitymx/opreps.pyx +2 -2
- pygsti/evotypes/densitymx/statereps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/densitymx/statereps.pyx +1 -1
- pygsti/evotypes/densitymx_slow/effectreps.py +7 -23
- pygsti/evotypes/densitymx_slow/opreps.py +16 -23
- pygsti/evotypes/densitymx_slow/statereps.py +10 -3
- pygsti/evotypes/evotype.py +39 -2
- pygsti/evotypes/stabilizer/effectreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/stabilizer/effectreps.pyx +0 -4
- pygsti/evotypes/stabilizer/opreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/stabilizer/opreps.pyx +0 -4
- pygsti/evotypes/stabilizer/statereps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/stabilizer/statereps.pyx +1 -5
- pygsti/evotypes/stabilizer/termreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/stabilizer/termreps.pyx +0 -7
- pygsti/evotypes/stabilizer_slow/effectreps.py +0 -22
- pygsti/evotypes/stabilizer_slow/opreps.py +0 -4
- pygsti/evotypes/stabilizer_slow/statereps.py +0 -4
- pygsti/evotypes/statevec/effectreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/statevec/effectreps.pyx +1 -1
- pygsti/evotypes/statevec/opreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/statevec/opreps.pyx +2 -2
- pygsti/evotypes/statevec/statereps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/statevec/statereps.pyx +1 -1
- pygsti/evotypes/statevec/termreps.cp38-win_amd64.pyd +0 -0
- pygsti/evotypes/statevec/termreps.pyx +0 -7
- pygsti/evotypes/statevec_slow/effectreps.py +0 -3
- pygsti/evotypes/statevec_slow/opreps.py +0 -5
- pygsti/extras/__init__.py +0 -1
- pygsti/extras/drift/stabilityanalyzer.py +3 -1
- pygsti/extras/interpygate/__init__.py +12 -0
- pygsti/extras/interpygate/core.py +0 -36
- pygsti/extras/interpygate/process_tomography.py +44 -10
- pygsti/extras/rpe/rpeconstruction.py +0 -2
- pygsti/forwardsims/__init__.py +1 -0
- pygsti/forwardsims/forwardsim.py +14 -55
- pygsti/forwardsims/mapforwardsim.py +69 -18
- pygsti/forwardsims/mapforwardsim_calc_densitymx.cp38-win_amd64.pyd +0 -0
- pygsti/forwardsims/mapforwardsim_calc_densitymx.pyx +65 -66
- pygsti/forwardsims/mapforwardsim_calc_generic.py +91 -13
- pygsti/forwardsims/matrixforwardsim.py +63 -15
- pygsti/forwardsims/termforwardsim.py +8 -110
- pygsti/forwardsims/termforwardsim_calc_stabilizer.cp38-win_amd64.pyd +0 -0
- pygsti/forwardsims/termforwardsim_calc_statevec.cp38-win_amd64.pyd +0 -0
- pygsti/forwardsims/termforwardsim_calc_statevec.pyx +0 -651
- pygsti/forwardsims/torchfwdsim.py +265 -0
- pygsti/forwardsims/weakforwardsim.py +2 -2
- pygsti/io/__init__.py +1 -2
- pygsti/io/mongodb.py +0 -2
- pygsti/io/stdinput.py +6 -22
- pygsti/layouts/copalayout.py +10 -12
- pygsti/layouts/distlayout.py +0 -40
- pygsti/layouts/maplayout.py +103 -25
- pygsti/layouts/matrixlayout.py +99 -60
- pygsti/layouts/prefixtable.py +1534 -52
- pygsti/layouts/termlayout.py +1 -1
- pygsti/modelmembers/instruments/instrument.py +3 -3
- pygsti/modelmembers/instruments/tpinstrument.py +2 -2
- pygsti/modelmembers/modelmember.py +0 -17
- pygsti/modelmembers/operations/__init__.py +2 -4
- pygsti/modelmembers/operations/affineshiftop.py +1 -0
- pygsti/modelmembers/operations/composederrorgen.py +1 -1
- pygsti/modelmembers/operations/composedop.py +1 -24
- pygsti/modelmembers/operations/denseop.py +5 -5
- pygsti/modelmembers/operations/eigpdenseop.py +2 -2
- pygsti/modelmembers/operations/embeddederrorgen.py +1 -1
- pygsti/modelmembers/operations/embeddedop.py +0 -1
- pygsti/modelmembers/operations/experrorgenop.py +2 -2
- pygsti/modelmembers/operations/fullarbitraryop.py +1 -0
- pygsti/modelmembers/operations/fullcptpop.py +2 -2
- pygsti/modelmembers/operations/fulltpop.py +28 -6
- pygsti/modelmembers/operations/fullunitaryop.py +5 -4
- pygsti/modelmembers/operations/lindbladcoefficients.py +93 -78
- pygsti/modelmembers/operations/lindbladerrorgen.py +268 -441
- pygsti/modelmembers/operations/linearop.py +7 -27
- pygsti/modelmembers/operations/opfactory.py +1 -1
- pygsti/modelmembers/operations/repeatedop.py +1 -24
- pygsti/modelmembers/operations/staticstdop.py +1 -1
- pygsti/modelmembers/povms/__init__.py +3 -3
- pygsti/modelmembers/povms/basepovm.py +7 -36
- pygsti/modelmembers/povms/complementeffect.py +4 -9
- pygsti/modelmembers/povms/composedeffect.py +0 -320
- pygsti/modelmembers/povms/computationaleffect.py +1 -1
- pygsti/modelmembers/povms/computationalpovm.py +3 -1
- pygsti/modelmembers/povms/effect.py +3 -5
- pygsti/modelmembers/povms/marginalizedpovm.py +0 -79
- pygsti/modelmembers/povms/tppovm.py +74 -2
- pygsti/modelmembers/states/__init__.py +2 -5
- pygsti/modelmembers/states/composedstate.py +0 -317
- pygsti/modelmembers/states/computationalstate.py +3 -3
- pygsti/modelmembers/states/cptpstate.py +4 -4
- pygsti/modelmembers/states/densestate.py +6 -4
- pygsti/modelmembers/states/fullpurestate.py +0 -24
- pygsti/modelmembers/states/purestate.py +1 -1
- pygsti/modelmembers/states/state.py +5 -6
- pygsti/modelmembers/states/tpstate.py +28 -10
- pygsti/modelmembers/term.py +3 -6
- pygsti/modelmembers/torchable.py +50 -0
- pygsti/modelpacks/_modelpack.py +1 -1
- pygsti/modelpacks/smq1Q_ZN.py +3 -1
- pygsti/modelpacks/smq2Q_XXYYII.py +2 -1
- pygsti/modelpacks/smq2Q_XY.py +3 -3
- pygsti/modelpacks/smq2Q_XYI.py +2 -2
- pygsti/modelpacks/smq2Q_XYICNOT.py +3 -3
- pygsti/modelpacks/smq2Q_XYICPHASE.py +3 -3
- pygsti/modelpacks/smq2Q_XYXX.py +1 -1
- pygsti/modelpacks/smq2Q_XYZICNOT.py +3 -3
- pygsti/modelpacks/smq2Q_XYZZ.py +1 -1
- pygsti/modelpacks/stdtarget.py +0 -121
- pygsti/models/cloudnoisemodel.py +1 -2
- pygsti/models/explicitcalc.py +3 -3
- pygsti/models/explicitmodel.py +3 -13
- pygsti/models/fogistore.py +5 -3
- pygsti/models/localnoisemodel.py +1 -2
- pygsti/models/memberdict.py +0 -12
- pygsti/models/model.py +800 -65
- pygsti/models/modelconstruction.py +4 -4
- pygsti/models/modelnoise.py +2 -2
- pygsti/models/modelparaminterposer.py +1 -1
- pygsti/models/oplessmodel.py +1 -1
- pygsti/models/qutrit.py +15 -14
- pygsti/objectivefns/objectivefns.py +73 -138
- pygsti/objectivefns/wildcardbudget.py +2 -7
- pygsti/optimize/__init__.py +1 -0
- pygsti/optimize/arraysinterface.py +28 -0
- pygsti/optimize/customcg.py +0 -12
- pygsti/optimize/customlm.py +129 -323
- pygsti/optimize/customsolve.py +2 -2
- pygsti/optimize/optimize.py +0 -84
- pygsti/optimize/simplerlm.py +841 -0
- pygsti/optimize/wildcardopt.py +19 -598
- pygsti/protocols/confidenceregionfactory.py +28 -14
- pygsti/protocols/estimate.py +31 -14
- pygsti/protocols/gst.py +142 -68
- pygsti/protocols/modeltest.py +6 -10
- pygsti/protocols/protocol.py +9 -37
- pygsti/protocols/rb.py +450 -79
- pygsti/protocols/treenode.py +8 -2
- pygsti/protocols/vb.py +108 -206
- pygsti/protocols/vbdataframe.py +1 -1
- pygsti/report/factory.py +0 -15
- pygsti/report/fogidiagram.py +1 -17
- pygsti/report/modelfunction.py +12 -3
- pygsti/report/mpl_colormaps.py +1 -1
- pygsti/report/plothelpers.py +8 -2
- pygsti/report/reportables.py +41 -37
- pygsti/report/templates/offline/pygsti_dashboard.css +6 -0
- pygsti/report/templates/offline/pygsti_dashboard.js +12 -0
- pygsti/report/workspace.py +2 -14
- pygsti/report/workspaceplots.py +326 -504
- pygsti/tools/basistools.py +9 -36
- pygsti/tools/edesigntools.py +124 -96
- pygsti/tools/fastcalc.cp38-win_amd64.pyd +0 -0
- pygsti/tools/fastcalc.pyx +35 -81
- pygsti/tools/internalgates.py +151 -15
- pygsti/tools/jamiolkowski.py +5 -5
- pygsti/tools/lindbladtools.py +19 -11
- pygsti/tools/listtools.py +0 -114
- pygsti/tools/matrixmod2.py +1 -1
- pygsti/tools/matrixtools.py +173 -339
- pygsti/tools/nameddict.py +1 -1
- pygsti/tools/optools.py +154 -88
- pygsti/tools/pdftools.py +0 -25
- pygsti/tools/rbtheory.py +3 -320
- pygsti/tools/slicetools.py +64 -12
- pyGSTi-0.9.12.1.dist-info/METADATA +0 -155
- pygsti/algorithms/directx.py +0 -711
- pygsti/evotypes/qibo/__init__.py +0 -33
- pygsti/evotypes/qibo/effectreps.py +0 -78
- pygsti/evotypes/qibo/opreps.py +0 -376
- pygsti/evotypes/qibo/povmreps.py +0 -98
- pygsti/evotypes/qibo/statereps.py +0 -174
- pygsti/extras/rb/__init__.py +0 -13
- pygsti/extras/rb/benchmarker.py +0 -957
- pygsti/extras/rb/dataset.py +0 -378
- pygsti/extras/rb/io.py +0 -814
- pygsti/extras/rb/simulate.py +0 -1020
- pygsti/io/legacyio.py +0 -385
- pygsti/modelmembers/povms/denseeffect.py +0 -142
- {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/LICENSE +0 -0
- {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/top_level.txt +0 -0
pygsti/algorithms/rbfit.py
CHANGED
@@ -17,132 +17,6 @@ from pygsti.baseobjs.nicelyserializable import NicelySerializable as _NicelySeri
|
|
17
17
|
from pygsti.tools import rbtools as _rbt
|
18
18
|
|
19
19
|
|
20
|
-
# Obsolute function to be deleted.
|
21
|
-
# def std_practice_analysis(RBSdataset, seed=[0.8, 0.95], bootstrap_samples=200, asymptote='std', rtype='EI',
|
22
|
-
# datatype='auto'):
|
23
|
-
# """
|
24
|
-
# Implements a "standard practice" analysis of RB data. Fits the average success probabilities to the exponential
|
25
|
-
# decay A + Bp^m, using least-squares fitting, with (1) A fixed (as standard, to 1/2^n where n is the number of
|
26
|
-
# qubits the data is for), and (2) A, B and p all allowed to varying. Confidence intervals are also estimated using
|
27
|
-
# a standard non-parameteric boostrap.
|
28
|
-
|
29
|
-
# Parameters
|
30
|
-
# ----------
|
31
|
-
# RBSdataset : RBSummaryDataset
|
32
|
-
# An RBSUmmaryDataset containing the data to analyze
|
33
|
-
|
34
|
-
# seed : list, optional
|
35
|
-
# Seeds for the fit of B and p (A is seeded to the asymptote defined by `asympote`).
|
36
|
-
|
37
|
-
# bootstrap_samples : int, optional
|
38
|
-
# The number of samples in the bootstrap.
|
39
|
-
|
40
|
-
# asymptote : str or float, optional
|
41
|
-
# The A value for the fitting to A + Bp^m with A fixed. If a string must be 'std', in
|
42
|
-
# in which case A is fixed to 1/2^n.
|
43
|
-
|
44
|
-
# rtype : {'EI','AGI'}, optional
|
45
|
-
# The RB error rate rescaling convention. 'EI' results in RB error rates that are associated
|
46
|
-
# with the entanglement infidelity, which is the error probability with stochastic errors (and
|
47
|
-
# is equal to the diamond distance). 'AGI' results in RB error rates that are associated with
|
48
|
-
# average gate infidelity.
|
49
|
-
|
50
|
-
# Returns
|
51
|
-
# -------
|
52
|
-
# RBResults
|
53
|
-
# An object encapsulating the RB results (and data).
|
54
|
-
|
55
|
-
# """
|
56
|
-
# assert(datatype == 'raw' or datatype == 'adjusted' or datatype == 'auto'), "Unknown data type!"
|
57
|
-
|
58
|
-
# if datatype == 'auto':
|
59
|
-
# if RBSdataset.datatype == 'hamming_distance_counts':
|
60
|
-
# datatype = 'adjusted'
|
61
|
-
# else:
|
62
|
-
# datatype = 'raw'
|
63
|
-
|
64
|
-
# lengths = RBSdataset.lengths
|
65
|
-
# n = RBSdataset.num_qubits
|
66
|
-
|
67
|
-
# if isinstance(asymptote, str):
|
68
|
-
# assert(asymptote == 'std'), "If `asympotote` is a string it must be 'std'!"
|
69
|
-
# if datatype == 'raw':
|
70
|
-
# asymptote = 1 / 2**n
|
71
|
-
# elif datatype == 'adjusted':
|
72
|
-
# asymptote = 1 / 4**n
|
73
|
-
|
74
|
-
# if datatype == 'adjusted':
|
75
|
-
# ASPs = RBSdataset.adjusted_ASPs
|
76
|
-
# if datatype == 'raw':
|
77
|
-
# ASPs = RBSdataset.ASPs
|
78
|
-
|
79
|
-
# FF_results, FAF_results = std_least_squares_fit(lengths, ASPs, n, seed=seed, asymptote=asymptote,
|
80
|
-
# ftype='full+FA', rtype=rtype)
|
81
|
-
|
82
|
-
# parameters = ['A', 'B', 'p', 'r']
|
83
|
-
# bootstraps_FF = {}
|
84
|
-
# bootstraps_FAF = {}
|
85
|
-
|
86
|
-
# if bootstrap_samples > 0:
|
87
|
-
|
88
|
-
# bootstraps_FF = {p: [] for p in parameters}
|
89
|
-
# bootstraps_FAF = {p: [] for p in parameters}
|
90
|
-
# failcount_FF = 0
|
91
|
-
# failcount_FAF = 0
|
92
|
-
|
93
|
-
# # Add bootstrapped data, if neccessary.
|
94
|
-
# RBSdataset.add_bootstrapped_datasets(samples=bootstrap_samples)
|
95
|
-
|
96
|
-
# for i in range(bootstrap_samples):
|
97
|
-
|
98
|
-
# if datatype == 'adjusted':
|
99
|
-
# BS_ASPs = RBSdataset.bootstraps[i].adjusted_ASPs
|
100
|
-
# if datatype == 'raw':
|
101
|
-
# BS_ASPs = RBSdataset.bootstraps[i].ASPs
|
102
|
-
|
103
|
-
# BS_FF_results, BS_FAF_results = std_least_squares_fit(lengths, BS_ASPs, n, seed=seed,
|
104
|
-
# asymptote=asymptote, ftype='full+FA',
|
105
|
-
# rtype=rtype)
|
106
|
-
|
107
|
-
# if BS_FF_results['success']:
|
108
|
-
# for p in parameters:
|
109
|
-
# bootstraps_FF[p].append(BS_FF_results['estimates'][p])
|
110
|
-
# else:
|
111
|
-
# failcount_FF += 1
|
112
|
-
# if BS_FAF_results['success']:
|
113
|
-
# for p in parameters:
|
114
|
-
# bootstraps_FAF[p].append(BS_FAF_results['estimates'][p])
|
115
|
-
# else:
|
116
|
-
# failcount_FAF += 1
|
117
|
-
|
118
|
-
# failrate_FF = failcount_FF / bootstrap_samples
|
119
|
-
# failrate_FAF = failcount_FAF / bootstrap_samples
|
120
|
-
|
121
|
-
# std_FF = {p: _np.std(_np.array(bootstraps_FF[p])) for p in parameters}
|
122
|
-
# std_FAF = {p: _np.std(_np.array(bootstraps_FAF[p])) for p in parameters}
|
123
|
-
|
124
|
-
# else:
|
125
|
-
# bootstraps_FF = None
|
126
|
-
# std_FF = None
|
127
|
-
# failrate_FF = None
|
128
|
-
# bootstraps_FAF = None
|
129
|
-
# std_FAF = None
|
130
|
-
# failrate_FAF = None
|
131
|
-
|
132
|
-
# fits = {}
|
133
|
-
# fits['full'] = FitResults('LS', FF_results['seed'], rtype, FF_results['success'], FF_results['estimates'],
|
134
|
-
# FF_results['variable'], stds=std_FF, bootstraps=bootstraps_FF,
|
135
|
-
# bootstraps_failrate=failrate_FF)
|
136
|
-
|
137
|
-
# fits['A-fixed'] = FitResults('LS', FAF_results['seed'], rtype, FAF_results['success'],
|
138
|
-
# FAF_results['estimates'], FAF_results['variable'], stds=std_FAF,
|
139
|
-
# bootstraps=bootstraps_FAF, bootstraps_failrate=failrate_FAF)
|
140
|
-
|
141
|
-
# results = SimpleRBResults(RBSdataset, rtype, fits)
|
142
|
-
|
143
|
-
# return results
|
144
|
-
|
145
|
-
|
146
20
|
def std_least_squares_fit(lengths, asps, n, seed=None, asymptote=None, ftype='full', rtype='EI'):
|
147
21
|
"""
|
148
22
|
Implements a "standard" least-squares fit of RB data.
|
@@ -469,111 +343,3 @@ class FitResults(_NicelySerializable):
|
|
469
343
|
return cls(state['fit_type'], state['seed'], state['r_type'], state['success'],
|
470
344
|
state['estimates'], state['variable'], state['stds'],
|
471
345
|
state['bootstraps'], state['bootstraps_failrate'])
|
472
|
-
|
473
|
-
# Obsolute RB results class
|
474
|
-
# class SimpleRBResults(object):
|
475
|
-
# """
|
476
|
-
# An object to contain the results of an RB analysis.
|
477
|
-
|
478
|
-
# """
|
479
|
-
|
480
|
-
# def __init__(self, data, rtype, fits):
|
481
|
-
# """
|
482
|
-
# Initialize an RBResults object.
|
483
|
-
|
484
|
-
# Parameters
|
485
|
-
# ----------
|
486
|
-
# data : RBSummaryDataset
|
487
|
-
# The RB summary data that the analysis was performed for.
|
488
|
-
|
489
|
-
# rtype : {'IE','AGI'}
|
490
|
-
# The type of RB error rate, corresponding to different dimension-dependent
|
491
|
-
# re-scalings of (1-p), where p is the RB decay constant in A + B*p^m.
|
492
|
-
|
493
|
-
# fits : dict
|
494
|
-
# A dictionary containing FitResults objects, obtained from one or more
|
495
|
-
# fits of the data (e.g., a fit with all A, B and p as free parameters and
|
496
|
-
# a fit with A fixed to 1/2^n).
|
497
|
-
# """
|
498
|
-
# self.data = data
|
499
|
-
# self.rtype = rtype
|
500
|
-
# self.fits = fits
|
501
|
-
|
502
|
-
# def plot(self, fitkey=None, decay=True, success_probabilities=True, size=(8, 5), ylim=None, xlim=None,
|
503
|
-
# legend=True, title=None, figpath=None):
|
504
|
-
# """
|
505
|
-
# Plots RB data and, optionally, a fitted exponential decay.
|
506
|
-
|
507
|
-
# Parameters
|
508
|
-
# ----------
|
509
|
-
# fitkey : dict key, optional
|
510
|
-
# The key of the self.fits dictionary to plot the fit for. If None, will
|
511
|
-
# look for a 'full' key (the key for a full fit to A + Bp^m if the standard
|
512
|
-
# analysis functions are used) and plot this if possible. It otherwise checks
|
513
|
-
# that there is only one key in the dict and defaults to this. If there are
|
514
|
-
# multiple keys and none of them are 'full', `fitkey` must be specified when
|
515
|
-
# `decay` is True.
|
516
|
-
|
517
|
-
# decay : bool, optional
|
518
|
-
# Whether to plot a fit, or just the data.
|
519
|
-
|
520
|
-
# success_probabilities : bool, optional
|
521
|
-
# Whether to plot the success probabilities distribution, as a violin plot. (as well
|
522
|
-
# as the *average* success probabilities at each length).
|
523
|
-
|
524
|
-
# size : tuple, optional
|
525
|
-
# The figure size
|
526
|
-
|
527
|
-
# ylim, xlim : tuple, optional
|
528
|
-
# The x and y limits for the figure.
|
529
|
-
|
530
|
-
# legend : bool, optional
|
531
|
-
# Whether to show a legend.
|
532
|
-
|
533
|
-
# title : str, optional
|
534
|
-
# A title to put on the figure.
|
535
|
-
|
536
|
-
# figpath : str, optional
|
537
|
-
# If specified, the figure is saved with this filename.
|
538
|
-
# """
|
539
|
-
|
540
|
-
# # Future : change to a plotly plot.
|
541
|
-
# try: import matplotlib.pyplot as _plt
|
542
|
-
# except ImportError: raise ValueError("This function requires you to install matplotlib!")
|
543
|
-
|
544
|
-
# if decay and fitkey is None:
|
545
|
-
# allfitkeys = list(self.fits.keys())
|
546
|
-
# if 'full' in allfitkeys: fitkey = 'full'
|
547
|
-
# else:
|
548
|
-
# assert(len(allfitkeys) == 1), \
|
549
|
-
# "There are multiple fits and none have the key 'full'. Please specify the fit to plot!"
|
550
|
-
# fitkey = allfitkeys[0]
|
551
|
-
|
552
|
-
# _plt.figure(figsize=size)
|
553
|
-
# _plt.plot(self.data.lengths, self.data.ASPs, 'o', label='Average success probabilities')
|
554
|
-
|
555
|
-
# if decay:
|
556
|
-
# lengths = _np.linspace(0, max(self.data.lengths), 200)
|
557
|
-
# A = self.fits[fitkey].estimates['A']
|
558
|
-
# B = self.fits[fitkey].estimates['B']
|
559
|
-
# p = self.fits[fitkey].estimates['p']
|
560
|
-
# _plt.plot(lengths, A + B * p**lengths,
|
561
|
-
# label='Fit, r = {:.2} +/- {:.1}'.format(self.fits[fitkey].estimates['r'],
|
562
|
-
# self.fits[fitkey].stds['r']))
|
563
|
-
|
564
|
-
# if success_probabilities:
|
565
|
-
# _plt.violinplot(list(self.data.success_probabilities), self.data.lengths, points=10, widths=1.,
|
566
|
-
# showmeans=False, showextrema=False, showmedians=False) # , label='Success probabilities')
|
567
|
-
|
568
|
-
# if title is not None: _plt.title(title)
|
569
|
-
# _plt.ylabel("Success probability")
|
570
|
-
# _plt.xlabel("RB sequence length $(m)$")
|
571
|
-
# _plt.ylim(ylim)
|
572
|
-
# _plt.xlim(xlim)
|
573
|
-
|
574
|
-
# if legend: _plt.legend()
|
575
|
-
|
576
|
-
# if figpath is not None: _plt.savefig(figpath, dpi=1000)
|
577
|
-
# else: _plt.show()
|
578
|
-
|
579
|
-
# return
|