Commit a6fa6f8
Fix qpy serialization of substitution of type
* Fix qpy serialization of substitution of type ParameterExpression
When substitution history `ParameterExpression._qpy_replay` is serialized,
there was no branch for the case that the substituted value is of type
`ParameterExpression`.
This commit fixes this oversight.
* Fix deserializing qpy written by previous writing fix
* Added a branch for reading `ParameterExpression` in _qpy_replay
* Added a missing argument (version) in an existing call in code path that
was previously untested
* Remove a bit of useless code introduced in last commit
* run black
* Add tests
* Revert renaming extra_symbols to extra_expressions
Reverting this to minimize changes in order to make the PR safer to
backport.
* Revert cleaning up logic in _encode_replay_subs
This was a good change. But not necessary for the bug fix, which is
the main point of this PR.
* Add qpy compat test
* Bind parameter when checking for equality
* Run black after merge in browser
---------
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>ParameterExpression (#13890)1 parent 106864c commit a6fa6f8
3 files changed
Lines changed: 76 additions & 0 deletions
File tree
- qiskit/qpy/binary_io
- test
- python/qpy
- qpy_compat
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
234 | 236 | | |
235 | 237 | | |
236 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
237 | 246 | | |
238 | 247 | | |
239 | 248 | | |
| 249 | + | |
240 | 250 | | |
241 | 251 | | |
242 | 252 | | |
| |||
530 | 540 | | |
531 | 541 | | |
532 | 542 | | |
| 543 | + | |
| 544 | + | |
533 | 545 | | |
534 | 546 | | |
535 | 547 | | |
536 | 548 | | |
| 549 | + | |
537 | 550 | | |
538 | 551 | | |
539 | 552 | | |
| |||
548 | 561 | | |
549 | 562 | | |
550 | 563 | | |
| 564 | + | |
551 | 565 | | |
552 | 566 | | |
553 | 567 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
833 | 833 | | |
834 | 834 | | |
835 | 835 | | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
836 | 848 | | |
837 | 849 | | |
838 | 850 | | |
| |||
909 | 921 | | |
910 | 922 | | |
911 | 923 | | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
912 | 929 | | |
913 | 930 | | |
914 | 931 | | |
| |||
1020 | 1037 | | |
1021 | 1038 | | |
1022 | 1039 | | |
| 1040 | + | |
| 1041 | + | |
1023 | 1042 | | |
1024 | 1043 | | |
1025 | 1044 | | |
| |||
0 commit comments