Skip to content

Use correct minimum rustworkx requirement version #14507

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

Closed
wants to merge 1 commit into from

Conversation

mtreinish
Copy link
Member

Summary

The rustworkx version we have previously had set as the minimum requirement is not correct. It was listed as 0.15.0 but we are using PyDiGraph.neighbors_undirected() since #14218 merged which was added in rustworkx 0.16.0. [1] This means the requirement is incorrect and if you try to run Qiskit with rustworkx 0.15.0 it will not work when this method is run. This commit corrects this issue and bumps the minimum supported rustworkx version in the requirements list to 0.16.0.

Details and comments

[1] https://www.rustworkx.org/release_notes.html#relnotes-0-16-0

The rustworkx version we have previously had set as the minimum
requirement is not correct. It was listed as 0.15.0 but we are using
`PyDiGraph.neighbors_undirected()` since Qiskit#14218 merged which was added
in rustworkx 0.16.0. [1] This means the requirement is incorrect and
if you try to run Qiskit with rustworkx 0.15.0 it will not work when
this method is run. This commit corrects this issue and bumps the
minimum supported rustworkx version in the requirements list to 0.16.0.

[1] https://www.rustworkx.org/release_notes.html#relnotes-0-16-0
@mtreinish mtreinish added this to the 2.1.0 milestone May 29, 2025
@mtreinish mtreinish requested a review from a team as a code owner May 29, 2025 21:16
@mtreinish mtreinish added the Changelog: API Change Include in the "Changed" section of the changelog label May 29, 2025
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@mtreinish
Copy link
Member Author

What is problematic here is that #14218 was backported to stable/2.0 and stable/1.4. So we should at least do the same, although we typically try to avoid raising minimum dependency versions in patch releases. We might want to instead look at rewriting the vf2 utils function to avoid using .neighbors_undirected() instead of backporting this PR (which is why I didn't tag this as stable backport potential).

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the only problem with Rustworkx 0.15, let's leave our requirement and that and put the workaround on all branches.

My new VF2 obsoletes that Python-space code anyway, and that should come in for the 2.2 cycle, so probably nicer not to bump the dependency for this alone. I didn't realise that that was a 0.16 method when I wrote it.

@mtreinish
Copy link
Member Author

mtreinish commented May 29, 2025

That was the only place I hit, but I didn't test beyond it. I can run the test suite with 0.15.0 installed to verify there is nothing else and do that instead. We do require rustworkx-core 0.16.0 but that's obviously different.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 15333752715

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+0.004%) to 87.841%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 91.98%
crates/qasm2/src/parse.rs 6 97.15%
Totals Coverage Status
Change from base Build 15333013138: 0.004%
Covered Lines: 79648
Relevant Lines: 90673

💛 - Coveralls

mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request May 30, 2025
In Qiskit#14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see Qiskit#14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and Qiskit#14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.
mtreinish added a commit to mtreinish/qiskit-core that referenced this pull request May 30, 2025
In Qiskit#14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see Qiskit#14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and Qiskit#14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.
@mtreinish
Copy link
Member Author

Closing this in favor of: #14513

@mtreinish mtreinish closed this May 30, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jun 4, 2025
* Avoid using rustworkx 0.16.0 methods in vf2_utils

In #14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see #14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and #14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors
mergify bot pushed a commit that referenced this pull request Jun 4, 2025
* Avoid using rustworkx 0.16.0 methods in vf2_utils

In #14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see #14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and #14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors

(cherry picked from commit 9aa1a29)
mergify bot pushed a commit that referenced this pull request Jun 4, 2025
* Avoid using rustworkx 0.16.0 methods in vf2_utils

In #14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see #14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and #14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors

(cherry picked from commit 9aa1a29)
github-merge-queue bot pushed a commit that referenced this pull request Jun 12, 2025
…14533)

* Avoid using rustworkx 0.16.0 methods in vf2_utils (#14513)

* Avoid using rustworkx 0.16.0 methods in vf2_utils

In #14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see #14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and #14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors

(cherry picked from commit 9aa1a29)

* Add release note

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
github-merge-queue bot pushed a commit that referenced this pull request Jun 12, 2025
…14534)

* Avoid using rustworkx 0.16.0 methods in vf2_utils (#14513)

* Avoid using rustworkx 0.16.0 methods in vf2_utils

In #14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see #14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and #14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors

(cherry picked from commit 9aa1a29)

* Add release note

---------

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
rahaman-quantum pushed a commit to rahaman-quantum/qiskit that referenced this pull request Jun 20, 2025
* Avoid using rustworkx 0.16.0 methods in vf2_utils

In Qiskit#14218 the vf2_utils module was updated to use the
`PyDiGraph.neighbors_undirected()` method which was added in 0.16.0.
However that PR neglected to bump the minimum required version of
rustworkx to 0.16.0 from 0.15.0 which is the current minim version
listed. While we could bump the minimum version (see Qiskit#14507) to
rustworkx 0.16.0 using this method isn't strictly necessary and Qiskit#14218
was backported to stable branches and backporting a version bump is not
desireable. This commit instead just updates the rustworkx usage to use
APIs in 0.15.0.

This PR will need to be backported to stable/1.4 and stable/2.0 to fix
compatibility with the listed rustworkx requirement. However, in the
backport a fix note will be needed to document that the release fixes
compatibility with the listed requirement.

* Correctly handle duplicates across successors and predecessors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants