-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump PyO3 and rust-numpy to 0.23.x (#13577)
* Bump PyO3 and rust-numpy to 0.23.x This commit bumps the version of pyo3 and rust-numpy used by qiskit to the latest release 0.23. The largest change by volume of code is the deprecation of all the `*_bound()` methods. These are just warnings but they would be fatal to our CI so it needs to be updated. THe larger functional change that required updating the code is the change in the traits around converting to Python objects. This actually found a bug in the target where we were not returning a proper instruction type for standard gates. This also opens up the opportunity to update our hashbrown version to 0.15.x, but we can't do that until the next rustworkx-core release. * Fix cache pygates build * Fix cargo test * Fix impl of IntoPyObject for target's operation * Fix impl of IntoPyObject for equivalence library circuit * Remove commented out code * Fix commutation library conversion * Fix conversion of qasm3 py register type * Use into_py_any() * Use borrowed instead of cloning py bound for NormalOperation * Fix unitary synthesis failure In pyo3 0.23 the behavior of the default conversion for a `SmallVec<u8>` and similar arrays of u8 default to bytes objects when converted to python. This was documented as an api change in the release, however it was cauing the unitary synthesis test to fail because when we were evaluating whether the synthesis was in terms of the natural direction of the 2q gate on the backend it was evaluating `[0, 1] == b"\x00\x11"` which evaluates to `False` and the pass flipped the direction of the 2q gate. This was causing the test failure because all the 2q gates which were correctly directed were getting incorrectly flipped. This commit fixes this by manually creating a pylist so the comparisons work as expected. * Fix cargo fmt * Apply suggestions from code review Co-authored-by: Kevin Hartman <[email protected]> * Fix compilation error * Use into_py_any in missed spot * Fix lint * Fix cargo fmt * Remove overeager trait derives * Pull in latest pyo3 bugfix release * Fix error handling * Fix lifetime for _to_matrix() * Implement `IntoPyObject` for `&StandardGate` This makes it more ergonomic to use the blanket implementations of `IntoPyObject` on ad-hoc structures like `(&T1, &T2)` when one of the contained types is a `StandardGate`. * Implement `IntoPyObject` for all `&T` where `T: PyClass + Copy` --------- Co-authored-by: Kevin Hartman <[email protected]> Co-authored-by: Jake Lishman <[email protected]>
- Loading branch information
1 parent
d884a3c
commit 9ddb6e2
Showing
63 changed files
with
1,220 additions
and
1,072 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
9ddb6e2
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.
Hello,
I recently encountered a build issue with the latest version of the project, specifically when running cargo build. The build process fails in the current version but succeeds in the parent commit (d884a3c).
Upon investigation, I found that the issue is related to dependency conflicts. numpy 0.23 requires ndarray 0.16.1, which is incompatible with other dependencies in the project (ndarray 0.15.6). Despite my efforts, I have been unable to resolve this conflict.
I want to mention that I am not entirely certain if my understanding of the issue is correct, as I am still learning about rust. However, given that the previous version did not have this problem, I thought it might be worth bringing this to your attention.
I would greatly appreciate any insights or assistance you could provide to help resolve this issue.