Commit ff15ce4
* Fix qpy serialization of substitution of type `ParameterExpression` (#13890)
* 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>
(cherry picked from commit a6fa6f8)
# Conflicts:
# test/qpy_compat/test_qpy.py
* Update test_qpy.py
* Update test/qpy_compat/test_qpy.py
---------
Co-authored-by: John Lapeyre <jlapeyre@users.noreply.github.com>
Co-authored-by: Elena Peña Tapia <57907331+ElePT@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
1 parent 06ac96e commit ff15ce4
3 files changed
Lines changed: 89 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 | | |
| |||
516 | 526 | | |
517 | 527 | | |
518 | 528 | | |
| 529 | + | |
| 530 | + | |
519 | 531 | | |
520 | 532 | | |
521 | 533 | | |
522 | 534 | | |
| 535 | + | |
523 | 536 | | |
524 | 537 | | |
525 | 538 | | |
| |||
534 | 547 | | |
535 | 548 | | |
536 | 549 | | |
| 550 | + | |
537 | 551 | | |
538 | 552 | | |
539 | 553 | | |
| |||
| 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 | |
|---|---|---|---|
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
823 | 846 | | |
824 | 847 | | |
| 848 | + | |
825 | 849 | | |
826 | 850 | | |
827 | 851 | | |
| |||
871 | 895 | | |
872 | 896 | | |
873 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
874 | 904 | | |
875 | 905 | | |
876 | 906 | | |
| |||
968 | 998 | | |
969 | 999 | | |
970 | 1000 | | |
| 1001 | + | |
| 1002 | + | |
971 | 1003 | | |
972 | 1004 | | |
973 | 1005 | | |
| |||
0 commit comments