-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests failing against Qiskit main due to change in delay behavior #1509
Fix tests failing against Qiskit main due to change in delay behavior #1509
Conversation
A long-standing bug in qpy leads to the units of delay instructions being overwritten to `dt`. See: Qiskit/qiskit#10662 Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests. `Delay.__eq__` does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change: Qiskit/qiskit#13486 Comparing circuits with delays now includes the delay units in the determination of equality. `Delay.__eq__` itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit. Here the tests are given a backend with a `dt` value so that the experiments will generate circuits with delays in `dt` and so still have delays with the same `dt` after the qpy roundtrip.
I opened Qiskit/qiskit#13812 for the delay comparison bug. It looks like there is some other unrelated bug with fake backends to address as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there is some other unrelated bug with fake backends to address as well.
Are you referring to the bug that's solved in #1509 ?
…qiskit-community#1509) A long-standing bug in qpy leads to the units of delay instructions being overwritten to `dt`. See: Qiskit/qiskit#10662 Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests. `Delay.__eq__` does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change: Qiskit/qiskit#13486 Comparing circuits with delays now includes the delay units in the determination of equality. `Delay.__eq__` itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit. Here the tests are given a backend with a `dt` value so that the experiments will generate circuits with delays in `dt` and so still have delays with the same `dt` after the qpy roundtrip.
…#1509) A long-standing bug in qpy leads to the units of delay instructions being overwritten to `dt`. See: Qiskit/qiskit#10662 Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests. `Delay.__eq__` does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change: Qiskit/qiskit#13486 Comparing circuits with delays now includes the delay units in the determination of equality. `Delay.__eq__` itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit. Here the tests are given a backend with a `dt` value so that the experiments will generate circuits with delays in `dt` and so still have delays with the same `dt` after the qpy roundtrip. (cherry picked from commit ad2341d)
…#1509) A long-standing bug in qpy leads to the units of delay instructions being overwritten to `dt`. See: Qiskit/qiskit#10662 Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests. `Delay.__eq__` does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change: Qiskit/qiskit#13486 Comparing circuits with delays now includes the delay units in the determination of equality. `Delay.__eq__` itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit. Here the tests are given a backend with a `dt` value so that the experiments will generate circuits with delays in `dt` and so still have delays with the same `dt` after the qpy roundtrip. (cherry picked from commit ad2341d)
… (backport #1509) (#1520) A long-standing bug in qpy leads to the units of delay instructions being overwritten to `dt`. See: Qiskit/qiskit#10662 Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests. `Delay.__eq__` does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change: Qiskit/qiskit#13486 Comparing circuits with delays now includes the delay units in the determination of equality. `Delay.__eq__` itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit. Here the tests are given a backend with a `dt` value so that the experiments will generate circuits with delays in `dt` and so still have delays with the same `dt` after the qpy roundtrip.<hr>This is an automatic backport of pull request #1509 done by [Mergify](https://mergify.com). Co-authored-by: Will Shanks <willshanks@us.ibm.com>
A long-standing bug in qpy leads to the units of delay instructions being overwritten to
dt
. See:Qiskit/qiskit#10662
Some experiments test that their circuits are round-trip serializable through qpy (perhaps not as necessary as it once was as the room for sticking arbitrary Python into circuits is reduced with the move to Rust). The T1 and Tphi circuits have delays and so were affected by the qpy bug. However, there is a second bug related to delays which canceled this bug out for those tests.
Delay.__eq__
does not check that the units are the same for the two delay instructions, so the loss of the original unit did not matter for the tests. Following this change:Qiskit/qiskit#13486
Comparing circuits with delays now includes the delay units in the determination of equality.
Delay.__eq__
itself still does not consider the unit but some part of adding the delay to a circuit converts it into a Rust object that does check the unit.Here the tests are given a backend with a
dt
value so that the experiments will generate circuits with delays indt
and so still have delays with the samedt
after the qpy roundtrip.