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.
Files changed (221) hide show
  1. pyGSTi-0.9.13.dist-info/METADATA +185 -0
  2. {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/RECORD +207 -217
  3. {pyGSTi-0.9.12.1.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 +42 -28
  7. pygsti/algorithms/fiducialselection.py +17 -8
  8. pygsti/algorithms/gaugeopt.py +2 -2
  9. pygsti/algorithms/germselection.py +87 -77
  10. pygsti/algorithms/mirroring.py +0 -388
  11. pygsti/algorithms/randomcircuit.py +165 -1333
  12. pygsti/algorithms/rbfit.py +0 -234
  13. pygsti/baseobjs/basis.py +94 -396
  14. pygsti/baseobjs/errorgenbasis.py +0 -132
  15. pygsti/baseobjs/errorgenspace.py +0 -10
  16. pygsti/baseobjs/label.py +52 -168
  17. pygsti/baseobjs/opcalc/fastopcalc.cp38-win_amd64.pyd +0 -0
  18. pygsti/baseobjs/opcalc/fastopcalc.pyx +2 -2
  19. pygsti/baseobjs/polynomial.py +13 -595
  20. pygsti/baseobjs/statespace.py +1 -0
  21. pygsti/circuits/__init__.py +1 -1
  22. pygsti/circuits/circuit.py +682 -505
  23. pygsti/circuits/circuitconstruction.py +0 -4
  24. pygsti/circuits/circuitlist.py +47 -5
  25. pygsti/circuits/circuitparser/__init__.py +8 -8
  26. pygsti/circuits/circuitparser/fastcircuitparser.cp38-win_amd64.pyd +0 -0
  27. pygsti/circuits/circuitstructure.py +3 -3
  28. pygsti/circuits/cloudcircuitconstruction.py +1 -1
  29. pygsti/data/datacomparator.py +2 -7
  30. pygsti/data/dataset.py +46 -44
  31. pygsti/data/hypothesistest.py +0 -7
  32. pygsti/drivers/bootstrap.py +0 -49
  33. pygsti/drivers/longsequence.py +2 -1
  34. pygsti/evotypes/basereps_cython.cp38-win_amd64.pyd +0 -0
  35. pygsti/evotypes/chp/opreps.py +0 -61
  36. pygsti/evotypes/chp/statereps.py +0 -32
  37. pygsti/evotypes/densitymx/effectcreps.cpp +9 -10
  38. pygsti/evotypes/densitymx/effectreps.cp38-win_amd64.pyd +0 -0
  39. pygsti/evotypes/densitymx/effectreps.pyx +1 -1
  40. pygsti/evotypes/densitymx/opreps.cp38-win_amd64.pyd +0 -0
  41. pygsti/evotypes/densitymx/opreps.pyx +2 -2
  42. pygsti/evotypes/densitymx/statereps.cp38-win_amd64.pyd +0 -0
  43. pygsti/evotypes/densitymx/statereps.pyx +1 -1
  44. pygsti/evotypes/densitymx_slow/effectreps.py +7 -23
  45. pygsti/evotypes/densitymx_slow/opreps.py +16 -23
  46. pygsti/evotypes/densitymx_slow/statereps.py +10 -3
  47. pygsti/evotypes/evotype.py +39 -2
  48. pygsti/evotypes/stabilizer/effectreps.cp38-win_amd64.pyd +0 -0
  49. pygsti/evotypes/stabilizer/effectreps.pyx +0 -4
  50. pygsti/evotypes/stabilizer/opreps.cp38-win_amd64.pyd +0 -0
  51. pygsti/evotypes/stabilizer/opreps.pyx +0 -4
  52. pygsti/evotypes/stabilizer/statereps.cp38-win_amd64.pyd +0 -0
  53. pygsti/evotypes/stabilizer/statereps.pyx +1 -5
  54. pygsti/evotypes/stabilizer/termreps.cp38-win_amd64.pyd +0 -0
  55. pygsti/evotypes/stabilizer/termreps.pyx +0 -7
  56. pygsti/evotypes/stabilizer_slow/effectreps.py +0 -22
  57. pygsti/evotypes/stabilizer_slow/opreps.py +0 -4
  58. pygsti/evotypes/stabilizer_slow/statereps.py +0 -4
  59. pygsti/evotypes/statevec/effectreps.cp38-win_amd64.pyd +0 -0
  60. pygsti/evotypes/statevec/effectreps.pyx +1 -1
  61. pygsti/evotypes/statevec/opreps.cp38-win_amd64.pyd +0 -0
  62. pygsti/evotypes/statevec/opreps.pyx +2 -2
  63. pygsti/evotypes/statevec/statereps.cp38-win_amd64.pyd +0 -0
  64. pygsti/evotypes/statevec/statereps.pyx +1 -1
  65. pygsti/evotypes/statevec/termreps.cp38-win_amd64.pyd +0 -0
  66. pygsti/evotypes/statevec/termreps.pyx +0 -7
  67. pygsti/evotypes/statevec_slow/effectreps.py +0 -3
  68. pygsti/evotypes/statevec_slow/opreps.py +0 -5
  69. pygsti/extras/__init__.py +0 -1
  70. pygsti/extras/drift/stabilityanalyzer.py +3 -1
  71. pygsti/extras/interpygate/__init__.py +12 -0
  72. pygsti/extras/interpygate/core.py +0 -36
  73. pygsti/extras/interpygate/process_tomography.py +44 -10
  74. pygsti/extras/rpe/rpeconstruction.py +0 -2
  75. pygsti/forwardsims/__init__.py +1 -0
  76. pygsti/forwardsims/forwardsim.py +14 -55
  77. pygsti/forwardsims/mapforwardsim.py +69 -18
  78. pygsti/forwardsims/mapforwardsim_calc_densitymx.cp38-win_amd64.pyd +0 -0
  79. pygsti/forwardsims/mapforwardsim_calc_densitymx.pyx +65 -66
  80. pygsti/forwardsims/mapforwardsim_calc_generic.py +91 -13
  81. pygsti/forwardsims/matrixforwardsim.py +63 -15
  82. pygsti/forwardsims/termforwardsim.py +8 -110
  83. pygsti/forwardsims/termforwardsim_calc_stabilizer.cp38-win_amd64.pyd +0 -0
  84. pygsti/forwardsims/termforwardsim_calc_statevec.cp38-win_amd64.pyd +0 -0
  85. pygsti/forwardsims/termforwardsim_calc_statevec.pyx +0 -651
  86. pygsti/forwardsims/torchfwdsim.py +265 -0
  87. pygsti/forwardsims/weakforwardsim.py +2 -2
  88. pygsti/io/__init__.py +1 -2
  89. pygsti/io/mongodb.py +0 -2
  90. pygsti/io/stdinput.py +6 -22
  91. pygsti/layouts/copalayout.py +10 -12
  92. pygsti/layouts/distlayout.py +0 -40
  93. pygsti/layouts/maplayout.py +103 -25
  94. pygsti/layouts/matrixlayout.py +99 -60
  95. pygsti/layouts/prefixtable.py +1534 -52
  96. pygsti/layouts/termlayout.py +1 -1
  97. pygsti/modelmembers/instruments/instrument.py +3 -3
  98. pygsti/modelmembers/instruments/tpinstrument.py +2 -2
  99. pygsti/modelmembers/modelmember.py +0 -17
  100. pygsti/modelmembers/operations/__init__.py +2 -4
  101. pygsti/modelmembers/operations/affineshiftop.py +1 -0
  102. pygsti/modelmembers/operations/composederrorgen.py +1 -1
  103. pygsti/modelmembers/operations/composedop.py +1 -24
  104. pygsti/modelmembers/operations/denseop.py +5 -5
  105. pygsti/modelmembers/operations/eigpdenseop.py +2 -2
  106. pygsti/modelmembers/operations/embeddederrorgen.py +1 -1
  107. pygsti/modelmembers/operations/embeddedop.py +0 -1
  108. pygsti/modelmembers/operations/experrorgenop.py +2 -2
  109. pygsti/modelmembers/operations/fullarbitraryop.py +1 -0
  110. pygsti/modelmembers/operations/fullcptpop.py +2 -2
  111. pygsti/modelmembers/operations/fulltpop.py +28 -6
  112. pygsti/modelmembers/operations/fullunitaryop.py +5 -4
  113. pygsti/modelmembers/operations/lindbladcoefficients.py +93 -78
  114. pygsti/modelmembers/operations/lindbladerrorgen.py +268 -441
  115. pygsti/modelmembers/operations/linearop.py +7 -27
  116. pygsti/modelmembers/operations/opfactory.py +1 -1
  117. pygsti/modelmembers/operations/repeatedop.py +1 -24
  118. pygsti/modelmembers/operations/staticstdop.py +1 -1
  119. pygsti/modelmembers/povms/__init__.py +3 -3
  120. pygsti/modelmembers/povms/basepovm.py +7 -36
  121. pygsti/modelmembers/povms/complementeffect.py +4 -9
  122. pygsti/modelmembers/povms/composedeffect.py +0 -320
  123. pygsti/modelmembers/povms/computationaleffect.py +1 -1
  124. pygsti/modelmembers/povms/computationalpovm.py +3 -1
  125. pygsti/modelmembers/povms/effect.py +3 -5
  126. pygsti/modelmembers/povms/marginalizedpovm.py +0 -79
  127. pygsti/modelmembers/povms/tppovm.py +74 -2
  128. pygsti/modelmembers/states/__init__.py +2 -5
  129. pygsti/modelmembers/states/composedstate.py +0 -317
  130. pygsti/modelmembers/states/computationalstate.py +3 -3
  131. pygsti/modelmembers/states/cptpstate.py +4 -4
  132. pygsti/modelmembers/states/densestate.py +6 -4
  133. pygsti/modelmembers/states/fullpurestate.py +0 -24
  134. pygsti/modelmembers/states/purestate.py +1 -1
  135. pygsti/modelmembers/states/state.py +5 -6
  136. pygsti/modelmembers/states/tpstate.py +28 -10
  137. pygsti/modelmembers/term.py +3 -6
  138. pygsti/modelmembers/torchable.py +50 -0
  139. pygsti/modelpacks/_modelpack.py +1 -1
  140. pygsti/modelpacks/smq1Q_ZN.py +3 -1
  141. pygsti/modelpacks/smq2Q_XXYYII.py +2 -1
  142. pygsti/modelpacks/smq2Q_XY.py +3 -3
  143. pygsti/modelpacks/smq2Q_XYI.py +2 -2
  144. pygsti/modelpacks/smq2Q_XYICNOT.py +3 -3
  145. pygsti/modelpacks/smq2Q_XYICPHASE.py +3 -3
  146. pygsti/modelpacks/smq2Q_XYXX.py +1 -1
  147. pygsti/modelpacks/smq2Q_XYZICNOT.py +3 -3
  148. pygsti/modelpacks/smq2Q_XYZZ.py +1 -1
  149. pygsti/modelpacks/stdtarget.py +0 -121
  150. pygsti/models/cloudnoisemodel.py +1 -2
  151. pygsti/models/explicitcalc.py +3 -3
  152. pygsti/models/explicitmodel.py +3 -13
  153. pygsti/models/fogistore.py +5 -3
  154. pygsti/models/localnoisemodel.py +1 -2
  155. pygsti/models/memberdict.py +0 -12
  156. pygsti/models/model.py +800 -65
  157. pygsti/models/modelconstruction.py +4 -4
  158. pygsti/models/modelnoise.py +2 -2
  159. pygsti/models/modelparaminterposer.py +1 -1
  160. pygsti/models/oplessmodel.py +1 -1
  161. pygsti/models/qutrit.py +15 -14
  162. pygsti/objectivefns/objectivefns.py +73 -138
  163. pygsti/objectivefns/wildcardbudget.py +2 -7
  164. pygsti/optimize/__init__.py +1 -0
  165. pygsti/optimize/arraysinterface.py +28 -0
  166. pygsti/optimize/customcg.py +0 -12
  167. pygsti/optimize/customlm.py +129 -323
  168. pygsti/optimize/customsolve.py +2 -2
  169. pygsti/optimize/optimize.py +0 -84
  170. pygsti/optimize/simplerlm.py +841 -0
  171. pygsti/optimize/wildcardopt.py +19 -598
  172. pygsti/protocols/confidenceregionfactory.py +28 -14
  173. pygsti/protocols/estimate.py +31 -14
  174. pygsti/protocols/gst.py +142 -68
  175. pygsti/protocols/modeltest.py +6 -10
  176. pygsti/protocols/protocol.py +9 -37
  177. pygsti/protocols/rb.py +450 -79
  178. pygsti/protocols/treenode.py +8 -2
  179. pygsti/protocols/vb.py +108 -206
  180. pygsti/protocols/vbdataframe.py +1 -1
  181. pygsti/report/factory.py +0 -15
  182. pygsti/report/fogidiagram.py +1 -17
  183. pygsti/report/modelfunction.py +12 -3
  184. pygsti/report/mpl_colormaps.py +1 -1
  185. pygsti/report/plothelpers.py +8 -2
  186. pygsti/report/reportables.py +41 -37
  187. pygsti/report/templates/offline/pygsti_dashboard.css +6 -0
  188. pygsti/report/templates/offline/pygsti_dashboard.js +12 -0
  189. pygsti/report/workspace.py +2 -14
  190. pygsti/report/workspaceplots.py +326 -504
  191. pygsti/tools/basistools.py +9 -36
  192. pygsti/tools/edesigntools.py +124 -96
  193. pygsti/tools/fastcalc.cp38-win_amd64.pyd +0 -0
  194. pygsti/tools/fastcalc.pyx +35 -81
  195. pygsti/tools/internalgates.py +151 -15
  196. pygsti/tools/jamiolkowski.py +5 -5
  197. pygsti/tools/lindbladtools.py +19 -11
  198. pygsti/tools/listtools.py +0 -114
  199. pygsti/tools/matrixmod2.py +1 -1
  200. pygsti/tools/matrixtools.py +173 -339
  201. pygsti/tools/nameddict.py +1 -1
  202. pygsti/tools/optools.py +154 -88
  203. pygsti/tools/pdftools.py +0 -25
  204. pygsti/tools/rbtheory.py +3 -320
  205. pygsti/tools/slicetools.py +64 -12
  206. pyGSTi-0.9.12.1.dist-info/METADATA +0 -155
  207. pygsti/algorithms/directx.py +0 -711
  208. pygsti/evotypes/qibo/__init__.py +0 -33
  209. pygsti/evotypes/qibo/effectreps.py +0 -78
  210. pygsti/evotypes/qibo/opreps.py +0 -376
  211. pygsti/evotypes/qibo/povmreps.py +0 -98
  212. pygsti/evotypes/qibo/statereps.py +0 -174
  213. pygsti/extras/rb/__init__.py +0 -13
  214. pygsti/extras/rb/benchmarker.py +0 -957
  215. pygsti/extras/rb/dataset.py +0 -378
  216. pygsti/extras/rb/io.py +0 -814
  217. pygsti/extras/rb/simulate.py +0 -1020
  218. pygsti/io/legacyio.py +0 -385
  219. pygsti/modelmembers/povms/denseeffect.py +0 -142
  220. {pyGSTi-0.9.12.1.dist-info → pyGSTi-0.9.13.dist-info}/LICENSE +0 -0
  221. {pyGSTi-0.9.12.1.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