This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Commit 7f5f3d5
committed
Fix statevector snapshot access in MPS tutorial
The statevector snapshot tutorial access done in the MPS tutorials was
relying on internal implementation details (inherited from marshmallow)
for how it was accessing the statevector for printing. This causes an
issue when qiskit 0.20.0 is used because there is no marshmallow anymore.
Instead of relying on the nested internal object attr access that was
used before this uses the supported data() method to return a dict of
snapshots and pull the statevector from there. This should be support
for all versions of qiskit-terra, not just <0.15.0 and is the documented
method for retrieving snapshots.
This is the last thing needed to unblock Qiskit/qiskit#998 and finally
relaese qiskit 0.20.0.1 parent 1115ef9 commit 7f5f3d5
1 file changed
Lines changed: 10 additions & 12 deletions
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
| 137 | + | |
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | | - | |
158 | 157 | | |
159 | 158 | | |
160 | | - | |
161 | | - | |
| 159 | + | |
162 | 160 | | |
163 | 161 | | |
164 | 162 | | |
| |||
174 | 172 | | |
175 | 173 | | |
176 | 174 | | |
177 | | - | |
| 175 | + | |
178 | 176 | | |
179 | 177 | | |
180 | 178 | | |
| |||
210 | 208 | | |
211 | 209 | | |
212 | 210 | | |
213 | | - | |
| 211 | + | |
214 | 212 | | |
215 | 213 | | |
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
219 | | - | |
220 | | - | |
| 217 | + | |
| 218 | + | |
221 | 219 | | |
222 | 220 | | |
223 | 221 | | |
| |||
258 | 256 | | |
259 | 257 | | |
260 | 258 | | |
261 | | - | |
262 | | - | |
| 259 | + | |
| 260 | + | |
263 | 261 | | |
264 | 262 | | |
265 | 263 | | |
| |||
311 | 309 | | |
312 | 310 | | |
313 | 311 | | |
314 | | - | |
| 312 | + | |
315 | 313 | | |
316 | 314 | | |
317 | 315 | | |
| |||
0 commit comments