pyGSTi 0.9.12__cp310-cp310-win_amd64.whl → 0.9.13__cp310-cp310-win_amd64.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (225) hide show
  1. pyGSTi-0.9.13.dist-info/METADATA +197 -0
  2. {pyGSTi-0.9.12.dist-info → pyGSTi-0.9.13.dist-info}/RECORD +211 -220
  3. {pyGSTi-0.9.12.dist-info → pyGSTi-0.9.13.dist-info}/WHEEL +1 -1
  4. pygsti/_version.py +2 -2
  5. pygsti/algorithms/contract.py +1 -1
  6. pygsti/algorithms/core.py +62 -35
  7. pygsti/algorithms/fiducialpairreduction.py +95 -110
  8. pygsti/algorithms/fiducialselection.py +17 -8
  9. pygsti/algorithms/gaugeopt.py +2 -2
  10. pygsti/algorithms/germselection.py +87 -77
  11. pygsti/algorithms/mirroring.py +0 -388
  12. pygsti/algorithms/randomcircuit.py +165 -1333
  13. pygsti/algorithms/rbfit.py +0 -234
  14. pygsti/baseobjs/basis.py +94 -396
  15. pygsti/baseobjs/errorgenbasis.py +0 -132
  16. pygsti/baseobjs/errorgenspace.py +0 -10
  17. pygsti/baseobjs/label.py +52 -168
  18. pygsti/baseobjs/opcalc/fastopcalc.cp310-win_amd64.pyd +0 -0
  19. pygsti/baseobjs/opcalc/fastopcalc.pyx +2 -2
  20. pygsti/baseobjs/polynomial.py +13 -595
  21. pygsti/baseobjs/protectedarray.py +72 -132
  22. pygsti/baseobjs/statespace.py +1 -0
  23. pygsti/circuits/__init__.py +1 -1
  24. pygsti/circuits/circuit.py +753 -504
  25. pygsti/circuits/circuitconstruction.py +0 -4
  26. pygsti/circuits/circuitlist.py +47 -5
  27. pygsti/circuits/circuitparser/__init__.py +8 -8
  28. pygsti/circuits/circuitparser/fastcircuitparser.cp310-win_amd64.pyd +0 -0
  29. pygsti/circuits/circuitstructure.py +3 -3
  30. pygsti/circuits/cloudcircuitconstruction.py +27 -14
  31. pygsti/data/datacomparator.py +4 -9
  32. pygsti/data/dataset.py +51 -46
  33. pygsti/data/hypothesistest.py +0 -7
  34. pygsti/drivers/bootstrap.py +0 -49
  35. pygsti/drivers/longsequence.py +46 -10
  36. pygsti/evotypes/basereps_cython.cp310-win_amd64.pyd +0 -0
  37. pygsti/evotypes/chp/opreps.py +0 -61
  38. pygsti/evotypes/chp/statereps.py +0 -32
  39. pygsti/evotypes/densitymx/effectcreps.cpp +9 -10
  40. pygsti/evotypes/densitymx/effectreps.cp310-win_amd64.pyd +0 -0
  41. pygsti/evotypes/densitymx/effectreps.pyx +1 -1
  42. pygsti/evotypes/densitymx/opreps.cp310-win_amd64.pyd +0 -0
  43. pygsti/evotypes/densitymx/opreps.pyx +2 -2
  44. pygsti/evotypes/densitymx/statereps.cp310-win_amd64.pyd +0 -0
  45. pygsti/evotypes/densitymx/statereps.pyx +1 -1
  46. pygsti/evotypes/densitymx_slow/effectreps.py +7 -23
  47. pygsti/evotypes/densitymx_slow/opreps.py +16 -23
  48. pygsti/evotypes/densitymx_slow/statereps.py +10 -3
  49. pygsti/evotypes/evotype.py +39 -2
  50. pygsti/evotypes/stabilizer/effectreps.cp310-win_amd64.pyd +0 -0
  51. pygsti/evotypes/stabilizer/effectreps.pyx +0 -4
  52. pygsti/evotypes/stabilizer/opreps.cp310-win_amd64.pyd +0 -0
  53. pygsti/evotypes/stabilizer/opreps.pyx +0 -4
  54. pygsti/evotypes/stabilizer/statereps.cp310-win_amd64.pyd +0 -0
  55. pygsti/evotypes/stabilizer/statereps.pyx +1 -5
  56. pygsti/evotypes/stabilizer/termreps.cp310-win_amd64.pyd +0 -0
  57. pygsti/evotypes/stabilizer/termreps.pyx +0 -7
  58. pygsti/evotypes/stabilizer_slow/effectreps.py +0 -22
  59. pygsti/evotypes/stabilizer_slow/opreps.py +0 -4
  60. pygsti/evotypes/stabilizer_slow/statereps.py +0 -4
  61. pygsti/evotypes/statevec/effectreps.cp310-win_amd64.pyd +0 -0
  62. pygsti/evotypes/statevec/effectreps.pyx +1 -1
  63. pygsti/evotypes/statevec/opreps.cp310-win_amd64.pyd +0 -0
  64. pygsti/evotypes/statevec/opreps.pyx +2 -2
  65. pygsti/evotypes/statevec/statereps.cp310-win_amd64.pyd +0 -0
  66. pygsti/evotypes/statevec/statereps.pyx +1 -1
  67. pygsti/evotypes/statevec/termreps.cp310-win_amd64.pyd +0 -0
  68. pygsti/evotypes/statevec/termreps.pyx +0 -7
  69. pygsti/evotypes/statevec_slow/effectreps.py +0 -3
  70. pygsti/evotypes/statevec_slow/opreps.py +0 -5
  71. pygsti/extras/__init__.py +0 -1
  72. pygsti/extras/drift/signal.py +1 -1
  73. pygsti/extras/drift/stabilityanalyzer.py +3 -1
  74. pygsti/extras/interpygate/__init__.py +12 -0
  75. pygsti/extras/interpygate/core.py +0 -36
  76. pygsti/extras/interpygate/process_tomography.py +44 -10
  77. pygsti/extras/rpe/rpeconstruction.py +0 -2
  78. pygsti/forwardsims/__init__.py +1 -0
  79. pygsti/forwardsims/forwardsim.py +50 -93
  80. pygsti/forwardsims/mapforwardsim.py +78 -20
  81. pygsti/forwardsims/mapforwardsim_calc_densitymx.cp310-win_amd64.pyd +0 -0
  82. pygsti/forwardsims/mapforwardsim_calc_densitymx.pyx +65 -66
  83. pygsti/forwardsims/mapforwardsim_calc_generic.py +91 -13
  84. pygsti/forwardsims/matrixforwardsim.py +72 -17
  85. pygsti/forwardsims/termforwardsim.py +9 -111
  86. pygsti/forwardsims/termforwardsim_calc_stabilizer.cp310-win_amd64.pyd +0 -0
  87. pygsti/forwardsims/termforwardsim_calc_statevec.cp310-win_amd64.pyd +0 -0
  88. pygsti/forwardsims/termforwardsim_calc_statevec.pyx +0 -651
  89. pygsti/forwardsims/torchfwdsim.py +265 -0
  90. pygsti/forwardsims/weakforwardsim.py +2 -2
  91. pygsti/io/__init__.py +1 -2
  92. pygsti/io/mongodb.py +0 -2
  93. pygsti/io/stdinput.py +6 -22
  94. pygsti/layouts/copalayout.py +10 -12
  95. pygsti/layouts/distlayout.py +0 -40
  96. pygsti/layouts/maplayout.py +103 -25
  97. pygsti/layouts/matrixlayout.py +99 -60
  98. pygsti/layouts/prefixtable.py +1534 -52
  99. pygsti/layouts/termlayout.py +1 -1
  100. pygsti/modelmembers/instruments/instrument.py +3 -3
  101. pygsti/modelmembers/instruments/tpinstrument.py +2 -2
  102. pygsti/modelmembers/modelmember.py +0 -17
  103. pygsti/modelmembers/operations/__init__.py +3 -4
  104. pygsti/modelmembers/operations/affineshiftop.py +206 -0
  105. pygsti/modelmembers/operations/composederrorgen.py +1 -1
  106. pygsti/modelmembers/operations/composedop.py +1 -24
  107. pygsti/modelmembers/operations/denseop.py +5 -5
  108. pygsti/modelmembers/operations/eigpdenseop.py +2 -2
  109. pygsti/modelmembers/operations/embeddederrorgen.py +1 -1
  110. pygsti/modelmembers/operations/embeddedop.py +0 -1
  111. pygsti/modelmembers/operations/experrorgenop.py +5 -2
  112. pygsti/modelmembers/operations/fullarbitraryop.py +1 -0
  113. pygsti/modelmembers/operations/fullcptpop.py +2 -2
  114. pygsti/modelmembers/operations/fulltpop.py +28 -6
  115. pygsti/modelmembers/operations/fullunitaryop.py +5 -4
  116. pygsti/modelmembers/operations/lindbladcoefficients.py +93 -78
  117. pygsti/modelmembers/operations/lindbladerrorgen.py +268 -441
  118. pygsti/modelmembers/operations/linearop.py +7 -27
  119. pygsti/modelmembers/operations/opfactory.py +1 -1
  120. pygsti/modelmembers/operations/repeatedop.py +1 -24
  121. pygsti/modelmembers/operations/staticstdop.py +1 -1
  122. pygsti/modelmembers/povms/__init__.py +3 -3
  123. pygsti/modelmembers/povms/basepovm.py +7 -36
  124. pygsti/modelmembers/povms/complementeffect.py +4 -9
  125. pygsti/modelmembers/povms/composedeffect.py +0 -320
  126. pygsti/modelmembers/povms/computationaleffect.py +1 -1
  127. pygsti/modelmembers/povms/computationalpovm.py +3 -1
  128. pygsti/modelmembers/povms/effect.py +3 -5
  129. pygsti/modelmembers/povms/marginalizedpovm.py +3 -81
  130. pygsti/modelmembers/povms/tppovm.py +74 -2
  131. pygsti/modelmembers/states/__init__.py +2 -5
  132. pygsti/modelmembers/states/composedstate.py +0 -317
  133. pygsti/modelmembers/states/computationalstate.py +3 -3
  134. pygsti/modelmembers/states/cptpstate.py +4 -4
  135. pygsti/modelmembers/states/densestate.py +10 -8
  136. pygsti/modelmembers/states/fullpurestate.py +0 -24
  137. pygsti/modelmembers/states/purestate.py +1 -1
  138. pygsti/modelmembers/states/state.py +5 -6
  139. pygsti/modelmembers/states/tpstate.py +28 -10
  140. pygsti/modelmembers/term.py +3 -6
  141. pygsti/modelmembers/torchable.py +50 -0
  142. pygsti/modelpacks/_modelpack.py +1 -1
  143. pygsti/modelpacks/smq1Q_ZN.py +3 -1
  144. pygsti/modelpacks/smq2Q_XXYYII.py +2 -1
  145. pygsti/modelpacks/smq2Q_XY.py +3 -3
  146. pygsti/modelpacks/smq2Q_XYI.py +2 -2
  147. pygsti/modelpacks/smq2Q_XYICNOT.py +3 -3
  148. pygsti/modelpacks/smq2Q_XYICPHASE.py +3 -3
  149. pygsti/modelpacks/smq2Q_XYXX.py +1 -1
  150. pygsti/modelpacks/smq2Q_XYZICNOT.py +3 -3
  151. pygsti/modelpacks/smq2Q_XYZZ.py +1 -1
  152. pygsti/modelpacks/stdtarget.py +0 -121
  153. pygsti/models/cloudnoisemodel.py +1 -2
  154. pygsti/models/explicitcalc.py +3 -3
  155. pygsti/models/explicitmodel.py +3 -13
  156. pygsti/models/fogistore.py +5 -3
  157. pygsti/models/localnoisemodel.py +1 -2
  158. pygsti/models/memberdict.py +0 -12
  159. pygsti/models/model.py +801 -68
  160. pygsti/models/modelconstruction.py +4 -4
  161. pygsti/models/modelnoise.py +2 -2
  162. pygsti/models/modelparaminterposer.py +1 -1
  163. pygsti/models/oplessmodel.py +1 -1
  164. pygsti/models/qutrit.py +15 -14
  165. pygsti/objectivefns/objectivefns.py +75 -140
  166. pygsti/objectivefns/wildcardbudget.py +2 -7
  167. pygsti/optimize/__init__.py +1 -0
  168. pygsti/optimize/arraysinterface.py +28 -0
  169. pygsti/optimize/customcg.py +0 -12
  170. pygsti/optimize/customlm.py +129 -323
  171. pygsti/optimize/customsolve.py +2 -2
  172. pygsti/optimize/optimize.py +0 -84
  173. pygsti/optimize/simplerlm.py +841 -0
  174. pygsti/optimize/wildcardopt.py +19 -598
  175. pygsti/protocols/confidenceregionfactory.py +28 -14
  176. pygsti/protocols/estimate.py +31 -14
  177. pygsti/protocols/gst.py +238 -142
  178. pygsti/protocols/modeltest.py +19 -12
  179. pygsti/protocols/protocol.py +9 -37
  180. pygsti/protocols/rb.py +450 -79
  181. pygsti/protocols/treenode.py +8 -2
  182. pygsti/protocols/vb.py +108 -206
  183. pygsti/protocols/vbdataframe.py +1 -1
  184. pygsti/report/factory.py +0 -15
  185. pygsti/report/fogidiagram.py +1 -17
  186. pygsti/report/modelfunction.py +12 -3
  187. pygsti/report/mpl_colormaps.py +1 -1
  188. pygsti/report/plothelpers.py +11 -3
  189. pygsti/report/report.py +16 -0
  190. pygsti/report/reportables.py +41 -37
  191. pygsti/report/templates/offline/pygsti_dashboard.css +6 -0
  192. pygsti/report/templates/offline/pygsti_dashboard.js +12 -0
  193. pygsti/report/workspace.py +2 -14
  194. pygsti/report/workspaceplots.py +328 -505
  195. pygsti/tools/basistools.py +9 -36
  196. pygsti/tools/edesigntools.py +124 -96
  197. pygsti/tools/fastcalc.cp310-win_amd64.pyd +0 -0
  198. pygsti/tools/fastcalc.pyx +35 -81
  199. pygsti/tools/internalgates.py +151 -15
  200. pygsti/tools/jamiolkowski.py +5 -5
  201. pygsti/tools/lindbladtools.py +19 -11
  202. pygsti/tools/listtools.py +0 -114
  203. pygsti/tools/matrixmod2.py +1 -1
  204. pygsti/tools/matrixtools.py +173 -339
  205. pygsti/tools/nameddict.py +1 -1
  206. pygsti/tools/optools.py +154 -88
  207. pygsti/tools/pdftools.py +0 -25
  208. pygsti/tools/rbtheory.py +3 -320
  209. pygsti/tools/slicetools.py +64 -12
  210. pyGSTi-0.9.12.dist-info/METADATA +0 -157
  211. pygsti/algorithms/directx.py +0 -711
  212. pygsti/evotypes/qibo/__init__.py +0 -33
  213. pygsti/evotypes/qibo/effectreps.py +0 -78
  214. pygsti/evotypes/qibo/opreps.py +0 -376
  215. pygsti/evotypes/qibo/povmreps.py +0 -98
  216. pygsti/evotypes/qibo/statereps.py +0 -174
  217. pygsti/extras/rb/__init__.py +0 -13
  218. pygsti/extras/rb/benchmarker.py +0 -957
  219. pygsti/extras/rb/dataset.py +0 -378
  220. pygsti/extras/rb/io.py +0 -814
  221. pygsti/extras/rb/simulate.py +0 -1020
  222. pygsti/io/legacyio.py +0 -385
  223. pygsti/modelmembers/povms/denseeffect.py +0 -142
  224. {pyGSTi-0.9.12.dist-info → pyGSTi-0.9.13.dist-info}/LICENSE +0 -0
  225. {pyGSTi-0.9.12.dist-info → pyGSTi-0.9.13.dist-info}/top_level.txt +0 -0
@@ -27,6 +27,7 @@ from pygsti.circuits.circuitlist import CircuitList as _CircuitList
27
27
  from pygsti.objectivefns.objectivefns import PoissonPicDeltaLogLFunction as _PoissonPicDeltaLogLFunction
28
28
  from pygsti.objectivefns.objectivefns import Chi2Function as _Chi2Function
29
29
  from pygsti.objectivefns.objectivefns import FreqWeightedChi2Function as _FreqWeightedChi2Function
30
+ from pygsti.models.explicitmodel import ExplicitOpModel as _ExplicitOpModel
30
31
 
31
32
 
32
33
  # NON-MARKOVIAN ERROR BARS
@@ -482,9 +483,15 @@ class ConfidenceRegionFactory(_NicelySerializable):
482
483
  label = projection_type
483
484
 
484
485
  model = self.parent.models[self.model_lbl]
485
- nongauge_space, gauge_space = model.compute_nongauge_and_gauge_spaces()
486
- self.nNonGaugeParams = nongauge_space.shape[1]
487
- self.nGaugeParams = model.num_params - self.nNonGaugeParams
486
+
487
+ if projection_type != 'none':
488
+ nongauge_space, gauge_space = model.compute_nongauge_and_gauge_spaces()
489
+ self.nNonGaugeParams = nongauge_space.shape[1]
490
+ self.nGaugeParams = model.num_params - self.nNonGaugeParams
491
+ else:
492
+ # no projection means we take the entire space as non-gauge
493
+ self.nNonGaugeParams = model.num_params
494
+ self.nGaugeParams = 0
488
495
 
489
496
  #Project Hessian onto non-gauge space
490
497
  if projection_type == 'none':
@@ -691,13 +698,13 @@ class ConfidenceRegionFactory(_NicelySerializable):
691
698
  sub_crf.project_hessian('none')
692
699
  crfv = sub_crf.view(level)
693
700
 
694
- operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).flatten()
701
+ operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).ravel()
695
702
  for gl in model.operations])
696
703
  return _np.sqrt(_np.sum(operationCIs**2))
697
704
 
698
705
  #Run Minimization Algorithm
699
706
  startM = _np.zeros((self.nNonGaugeParams, self.nGaugeParams), 'd')
700
- x0 = startM.flatten()
707
+ x0 = startM.ravel()
701
708
  print_obj_func = _opt.create_objfn_printer(_objective_func)
702
709
  minSol = _opt.minimize(_objective_func, x0,
703
710
  method=method, maxiter=maxiter,
@@ -727,7 +734,7 @@ class ConfidenceRegionFactory(_NicelySerializable):
727
734
  self.circuit_list_lbl, projected_hessian, 0.0)
728
735
  sub_crf.project_hessian('none')
729
736
  crfv = sub_crf.view(level)
730
- operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).flatten()
737
+ operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).ravel()
731
738
  for gl in model.operations])
732
739
  op_intrinsic_err = _np.sqrt(_np.mean(operationCIs**2))
733
740
 
@@ -738,7 +745,7 @@ class ConfidenceRegionFactory(_NicelySerializable):
738
745
  self.circuit_list_lbl, projected_hessian, 0.0)
739
746
  sub_crf.project_hessian('none')
740
747
  crfv = sub_crf.view(level)
741
- spamCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(sl).flatten()
748
+ spamCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(sl).ravel()
742
749
  for sl in _itertools.chain(iter(model.preps),
743
750
  iter(model.povms))])
744
751
  spam_intrinsic_err = _np.sqrt(_np.mean(spamCIs**2))
@@ -755,9 +762,9 @@ class ConfidenceRegionFactory(_NicelySerializable):
755
762
  sub_crf.project_hessian('none')
756
763
  crfv = sub_crf.view(level)
757
764
 
758
- operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).flatten()
765
+ operationCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(gl).ravel()
759
766
  for gl in model.operations])
760
- spamCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(sl).flatten()
767
+ spamCIs = _np.concatenate([crfv.retrieve_profile_likelihood_confidence_intervals(sl).ravel()
761
768
  for sl in _itertools.chain(iter(model.preps),
762
769
  iter(model.povms))])
763
770
  op_err = _np.sqrt(_np.mean(operationCIs**2))
@@ -1068,11 +1075,18 @@ class ConfidenceRegionFactoryView(object):
1068
1075
  else:
1069
1076
  # copy objects because we add eps to them below
1070
1077
  typ, lbl = dependency
1071
- if typ == "gate": modelObj = mdl.operations[lbl]
1072
- elif typ == "prep": modelObj = mdl.preps[lbl]
1073
- elif typ == "povm": modelObj = mdl.povms[lbl]
1074
- elif typ == "instrument": modelObj = mdl.instruments[lbl]
1075
- else: raise ValueError("Invalid dependency type: %s" % typ)
1078
+ if isinstance(mdl, _ExplicitOpModel):
1079
+ if typ == "gate": modelObj = mdl.operations[lbl]
1080
+ elif typ == "prep": modelObj = mdl.preps[lbl]
1081
+ elif typ == "povm": modelObj = mdl.povms[lbl]
1082
+ elif typ == "instrument": modelObj = mdl.instruments[lbl]
1083
+ else: raise ValueError("Invalid dependency type: %s" % typ)
1084
+ else:
1085
+ if typ == "gate": modelObj = mdl.operation_blks['gates'][lbl]
1086
+ elif typ == "prep": modelObj = mdl.prep_blks['layers'][lbl]
1087
+ elif typ == "povm": modelObj = mdl.povm_blks['layers'][lbl]
1088
+ elif typ == "instrument": modelObj = mdl.instrument_blks['layers'][lbl]
1089
+ else: raise ValueError("Invalid dependency type: %s" % typ)
1076
1090
  all_gpindices.extend(modelObj.gpindices_as_array())
1077
1091
 
1078
1092
  vec0 = mdl.to_vector()
@@ -87,7 +87,6 @@ class Estimate(_MongoSerializable):
87
87
 
88
88
  @classmethod
89
89
  def _create_obj_from_doc_and_mongodb(cls, doc, mongodb, quick_load=False):
90
- #def from_mongodb(cls, mongodb_collection, doc_id, ):
91
90
  ret = cls.__new__(cls)
92
91
  _MongoSerializable.__init__(ret, doc.get('_id', None))
93
92
  ret.__dict__.update(_io.read_auxtree_from_mongodb_doc(mongodb, doc, 'auxfile_types', quick_load=quick_load))
@@ -277,7 +276,10 @@ class Estimate(_MongoSerializable):
277
276
  Model
278
277
  """
279
278
  goparams_list = [goparams] if hasattr(goparams, 'keys') else goparams
280
- return goparams_list[0].get('model', self.models['final iteration estimate'])
279
+ if goparams_list:
280
+ return goparams_list[0].get('model', self.models['final iteration estimate'])
281
+ else:
282
+ return None
281
283
 
282
284
  def add_gaugeoptimized(self, goparams, model=None, label=None, comm=None, verbosity=None):
283
285
  """
@@ -331,8 +333,14 @@ class Estimate(_MongoSerializable):
331
333
  label = "go%d" % i; i += 1
332
334
  if (label not in self._gaugeopt_suite.gaugeopt_argument_dicts) and \
333
335
  (label not in self.models): break
334
-
335
- goparams_list = [goparams] if hasattr(goparams, 'keys') else goparams
336
+ if hasattr(goparams, 'keys'):
337
+ goparams_list = [goparams]
338
+ elif goparams is None:
339
+ goparams_list = []
340
+ #since this will be empty much of the code/iteration below will
341
+ #be skipped.
342
+ else:
343
+ goparams_list = goparams
336
344
  ordered_goparams = []
337
345
  last_gs = None
338
346
 
@@ -350,11 +358,14 @@ class Estimate(_MongoSerializable):
350
358
  printer = _VerbosityPrinter.create_printer(max_vb, printer_comm)
351
359
  printer.log("-- Adding Gauge Optimized (%s) --" % label)
352
360
 
353
- for i, gop in enumerate(goparams_list):
354
-
355
- if model is not None:
356
- last_gs = model # just use user-supplied result
357
- else:
361
+ if model is not None:
362
+ last_gs = model # just use user-supplied result
363
+ #sort the parameters by name for consistency
364
+ for gop in goparams_list:
365
+ ordered_goparams.append(_collections.OrderedDict(
366
+ [(k, gop[k]) for k in sorted(list(gop.keys()))]))
367
+ else:
368
+ for i, gop in enumerate(goparams_list):
358
369
  from ..algorithms import gaugeopt_to_target as _gaugeopt_to_target
359
370
  default_model = default_target_model = False
360
371
  gop = gop.copy() # so we don't change the caller's dict
@@ -398,14 +409,20 @@ class Estimate(_MongoSerializable):
398
409
  if default_model: del gop['model']
399
410
  if default_target_model: del gop['target_model']
400
411
 
401
- #sort the parameters by name for consistency
402
- ordered_goparams.append(_collections.OrderedDict(
403
- [(k, gop[k]) for k in sorted(list(gop.keys()))]))
412
+ #sort the parameters by name for consistency
413
+ ordered_goparams.append(_collections.OrderedDict(
414
+ [(k, gop[k]) for k in sorted(list(gop.keys()))]))
404
415
 
405
416
  assert(last_gs is not None)
406
417
  self.models[label] = last_gs
407
- self._gaugeopt_suite.gaugeopt_argument_dicts[label] = ordered_goparams \
408
- if len(goparams_list) > 1 else ordered_goparams[0]
418
+
419
+ if goparams_list: #only do this if goparams_list wasn't empty to begin with.
420
+ #which would be the case except for the special case where the label is 'none'.
421
+ self._gaugeopt_suite.gaugeopt_argument_dicts[label] = ordered_goparams \
422
+ if len(goparams_list) > 1 else ordered_goparams[0]
423
+ else:
424
+ self._gaugeopt_suite.gaugeopt_argument_dicts[label] = None
425
+
409
426
 
410
427
  def add_confidence_region_factory(self,
411
428
  model_label='final iteration estimate',