pyGSTi 0.9.12__cp39-cp39-win32.whl → 0.9.13__cp39-cp39-win32.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.cp39-win32.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.cp39-win32.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.cp39-win32.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.cp39-win32.pyd +0 -0
  41. pygsti/evotypes/densitymx/effectreps.pyx +1 -1
  42. pygsti/evotypes/densitymx/opreps.cp39-win32.pyd +0 -0
  43. pygsti/evotypes/densitymx/opreps.pyx +2 -2
  44. pygsti/evotypes/densitymx/statereps.cp39-win32.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.cp39-win32.pyd +0 -0
  51. pygsti/evotypes/stabilizer/effectreps.pyx +0 -4
  52. pygsti/evotypes/stabilizer/opreps.cp39-win32.pyd +0 -0
  53. pygsti/evotypes/stabilizer/opreps.pyx +0 -4
  54. pygsti/evotypes/stabilizer/statereps.cp39-win32.pyd +0 -0
  55. pygsti/evotypes/stabilizer/statereps.pyx +1 -5
  56. pygsti/evotypes/stabilizer/termreps.cp39-win32.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.cp39-win32.pyd +0 -0
  62. pygsti/evotypes/statevec/effectreps.pyx +1 -1
  63. pygsti/evotypes/statevec/opreps.cp39-win32.pyd +0 -0
  64. pygsti/evotypes/statevec/opreps.pyx +2 -2
  65. pygsti/evotypes/statevec/statereps.cp39-win32.pyd +0 -0
  66. pygsti/evotypes/statevec/statereps.pyx +1 -1
  67. pygsti/evotypes/statevec/termreps.cp39-win32.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.cp39-win32.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.cp39-win32.pyd +0 -0
  87. pygsti/forwardsims/termforwardsim_calc_statevec.cp39-win32.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.cp39-win32.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
@@ -1,174 +0,0 @@
1
- """
2
- State representations for "qibo" evolution type.
3
- """
4
- #***************************************************************************************************
5
- # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
6
- # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights
7
- # in this software.
8
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
9
- # in compliance with the License. You may obtain a copy of the License at
10
- # http://www.apache.org/licenses/LICENSE-2.0 or in the LICENSE file in the root pyGSTi directory.
11
- #***************************************************************************************************
12
-
13
- import numpy as _np
14
- import functools as _functools
15
-
16
- from .. import basereps as _basereps
17
- from . import _get_densitymx_mode, _get_minimal_space
18
- from pygsti.baseobjs.statespace import StateSpace as _StateSpace
19
- from pygsti.baseobjs.basis import Basis as _Basis
20
- from pygsti.tools import internalgates as _itgs
21
- from pygsti.tools import basistools as _bt
22
- from pygsti.tools import optools as _ot
23
-
24
- try:
25
- from ...tools import fastcalc as _fastcalc
26
- except ImportError:
27
- _fastcalc = None
28
-
29
- try:
30
- import qibo as _qibo
31
- except ImportError:
32
- _qibo = None
33
-
34
-
35
- class StateRep(_basereps.StateRep):
36
- def __init__(self, qibo_circuit, qibo_state, state_space):
37
- self.qibo_circuit = qibo_circuit
38
- self.qibo_state = qibo_state
39
- self.state_space = _StateSpace.cast(state_space)
40
- assert(self.qibo_circuit is None or self.state_space.num_qubits == self.qibo_circuit.nqubits), \
41
- 'Number-of-qubits mismatch between state space and circuit for "qubit" evotype'
42
-
43
- @property
44
- def num_qubits(self):
45
- return self.state_space.num_qubits
46
-
47
- def copy(self):
48
- return StateRep(self.qibo_circuit, self.qibo_state, self.state_space)
49
-
50
- def actionable_staterep(self):
51
- # return a state rep that can be acted on by op reps or mapped to
52
- # a probability/amplitude by POVM effect reps.
53
- return self # for most classes, the rep itself is actionable
54
-
55
-
56
- class StateRepDensePure(StateRep):
57
- def __init__(self, purevec, state_space, basis):
58
- state_space = _StateSpace.cast(state_space)
59
- qibo_circuit = _qibo.models.Circuit(state_space.num_qubits, density_matrix=_get_densitymx_mode())
60
- self.basis = basis
61
- super(StateRepDensePure, self).__init__(qibo_circuit, purevec, state_space)
62
-
63
- @property
64
- def base(self):
65
- return self.qibo_state
66
-
67
- def base_has_changed(self):
68
- pass
69
-
70
- def to_dense(self, on_space):
71
- if on_space == 'Hilbert' or (on_space == 'minimal' and _get_minimal_space() == 'Hilbert'):
72
- return self.base
73
- elif on_space == 'HilbertSchmidt' or (on_space == 'minimal' and _get_minimal_space() == 'HilbertSchmidt'):
74
- return _bt.change_basis(_ot.state_to_dmvec(self.base), 'std', self.basis)
75
- else:
76
- raise ValueError("Invalid `on_space` argument: %s" % str(on_space))
77
-
78
-
79
- class StateRepDense(StateRep):
80
- def __init__(self, data, state_space, basis):
81
- assert(_get_densitymx_mode() is True), "Must set pygsti.evotypes.qibo.densitymx_mode=True to use dense states!"
82
- state_space = _StateSpace.cast(state_space)
83
- qibo_circuit = _qibo.models.Circuit(state_space.num_qubits, density_matrix=True)
84
- self.basis = basis
85
- self.std_basis = _Basis.cast('std', state_space.dim) # the basis the qibo expects
86
- self.data = data
87
- self.udim = state_space.udim
88
- qibo_state = _bt.change_basis(data, basis, self.std_basis).reshape((self.udim, self.udim))
89
- super(StateRepDense, self).__init__(qibo_circuit, qibo_state, state_space)
90
-
91
- @property
92
- def base(self):
93
- return self.data # state in self.basis (not self.std_basis)
94
-
95
- def base_has_changed(self):
96
- self.qibo_state = _bt.change_basis(self.data, self.basis, self.std_basis).reshape((self.udim, self.udim))
97
-
98
- def to_dense(self, on_space):
99
- if not (on_space == 'HilbertSchmidt' or (on_space == 'minimal' and _get_minimal_space() == 'HilbertSchmidt')):
100
- raise ValueError("'densitymx' evotype cannot produce Hilbert-space ops!")
101
- return self.data
102
-
103
-
104
- class StateRepComputational(StateRep):
105
- def __init__(self, zvals, basis, state_space):
106
- assert all([nm in ('pp', 'PP') for nm in basis.name.split('*')]), \
107
- "Only Pauli basis is allowed for 'chp' evotype"
108
-
109
- #Convert zvals to dense vec:
110
- factor_dim = 2
111
- v0 = _np.array((1, 0), complex) # '0' qubit state as complex state vec
112
- v1 = _np.array((0, 1), complex) # '1' qubit state as complex state vec
113
- v = (v0, v1)
114
-
115
- if _fastcalc is None: # do it the slow way using numpy
116
- vec = _functools.reduce(_np.kron, [v[i] for i in zvals])
117
- else:
118
- typ = complex
119
- fast_kron_array = _np.ascontiguousarray(
120
- _np.empty((len(zvals), factor_dim), typ))
121
- fast_kron_factordims = _np.ascontiguousarray(_np.array([factor_dim] * len(zvals), _np.int64))
122
- for i, zi in enumerate(zvals):
123
- fast_kron_array[i, :] = v[zi]
124
- vec = _np.ascontiguousarray(_np.empty(factor_dim**len(zvals), typ))
125
- _fastcalc.fast_kron_complex(vec, fast_kron_array, fast_kron_factordims)
126
-
127
- self.zvals = zvals
128
- self.basis = basis
129
-
130
- if _qibo is None: raise ValueError("qibo is not installed! Must `pip install qibo` to use the 'qibo' evotype")
131
- state_space = _StateSpace.cast(state_space)
132
- qibo_circuit = _qibo.models.Circuit(state_space.num_qubits, density_matrix=_get_densitymx_mode())
133
- super(StateRepComputational, self).__init__(qibo_circuit, vec, state_space)
134
-
135
-
136
- class StateRepComposed(StateRep):
137
- def __init__(self, state_rep, op_rep, state_space):
138
- self.state_rep = state_rep
139
- self.op_rep = op_rep
140
- super(StateRepComposed, self).__init__(None, None, state_space) # this state rep is *not* actionable
141
-
142
- def reps_have_changed(self):
143
- pass # not needed -- don't actually hold ops
144
-
145
- def actionable_staterep(self):
146
- state_rep = self.state_rep.actionable_staterep()
147
- return self.op_rep.acton(state_rep)
148
-
149
- @property
150
- def basis(self):
151
- # (all qibo state reps need to have a .basis property)
152
- return self.state_rep.basis
153
-
154
- #REMOVE
155
- # def chp_ops(self, seed_or_state=None):
156
- # return self.state_rep.chp_ops(seed_or_state=seed_or_state) \
157
- # + self.op_rep.chp_ops(seed_or_state=seed_or_state)
158
-
159
- # TODO: Untested, only support computational and composed for now
160
- #class StateRepTensorProduct(StateRep):
161
- # def __init__(self, factor_state_reps, state_space):
162
- # self.factor_reps = factor_state_reps
163
- # super(StateRepTensorProduct, self).__init__([], state_space)
164
- # self.reps_have_changed()
165
- #
166
- # def reps_have_changed(self):
167
- # chp_ops = []
168
- # current_iqubit = 0
169
- # for factor in self.factor_reps:
170
- # local_to_tp_index = {str(iloc): str(itp) for iloc, itp in
171
- # enumerate(range(current_iqubit, current_iqubit + factor.num_qubits))}
172
- # chp_ops.extend([_update_chp_op(op, local_to_tp_index) for op in self.chp_ops])
173
- # current_iqubit += factor.num_qubits
174
- # self.chp_ops = chp_ops
@@ -1,13 +0,0 @@
1
- """ Randomized Benchmarking Sub-package """
2
- #***************************************************************************************************
3
- # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
4
- # Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights
5
- # in this software.
6
- # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
7
- # in compliance with the License. You may obtain a copy of the License at
8
- # http://www.apache.org/licenses/LICENSE-2.0 or in the LICENSE file in the root pyGSTi directory.
9
- #***************************************************************************************************
10
-
11
- from . import dataset
12
- from . import simulate
13
- from .benchmarker import Benchmarker