Skip to content

Add distance_matrix to rustworkx-core#1439

Merged
IvanIsCoding merged 9 commits into
Qiskit:mainfrom
mtreinish:distance-matrix-core
Aug 13, 2025
Merged

Add distance_matrix to rustworkx-core#1439
IvanIsCoding merged 9 commits into
Qiskit:mainfrom
mtreinish:distance-matrix-core

Conversation

@mtreinish

Copy link
Copy Markdown
Member

This commit moves the distance matrix functionality to rustworkx. This is mostly a straightforward migration as the functionality was written in a generic way already. The only difference is how node holes were handled, the this opted to split the functions into 2, a verison that assumes the graph has compact indices and one that doesn't.

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.
This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.

Co-authored-by: Jake Lishman <jake@binhbar.com>
@mtreinish mtreinish changed the title [WIP] Add distance_matrix to rustworkx-core Add distance_matrix to rustworkx-core Jul 2, 2025
@mtreinish mtreinish changed the title Add distance_matrix to rustworkx-core [WIP] Add distance_matrix to rustworkx-core Jul 2, 2025
@mtreinish mtreinish changed the title [WIP] Add distance_matrix to rustworkx-core Add distance_matrix to rustworkx-core Jul 2, 2025
@mtreinish mtreinish removed the on hold label Jul 2, 2025
@coveralls

coveralls commented Jul 2, 2025

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 16924127179

Details

  • 75 of 75 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.003%) to 94.645%

Totals Coverage Status
Change from base Build 16923295558: 0.003%
Covered Lines: 17815
Relevant Lines: 18823

💛 - Coveralls

@IvanIsCoding IvanIsCoding modified the milestones: 0.17.0, 0.17.1 Jul 6, 2025
@mtreinish

Copy link
Copy Markdown
Member Author

@IvanIsCoding Since this is a new feature from a semver perspective I don't think we should include this in a 0.17.1 release. I'd either keep it for 0.17.0 (it is ready for review now) or defer it to 0.18.0.

@IvanIsCoding

Copy link
Copy Markdown
Collaborator

Let’s defer it to 0.18.0 then.

I tagged it as 0.17.1 because for rustworkx it would not be a change. But for rustworkx-core it is I guess

@IvanIsCoding IvanIsCoding modified the milestones: 0.17.1, 0.18.0 Jul 7, 2025
@IvanIsCoding

Copy link
Copy Markdown
Collaborator

I might merge #1491 and use this PR as an excuse to release 0.17.1. There was a problem releasing 0.17.0 with the identifiers.

@IvanIsCoding IvanIsCoding modified the milestones: 0.18.0, 0.17.1 Aug 13, 2025

@IvanIsCoding IvanIsCoding left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems straightforward. Maybe we should have merged it for 0.17.0, so I will use it to publish 0.17.1 as 0.17.0 only got published to crates.io

@IvanIsCoding IvanIsCoding enabled auto-merge August 13, 2025 00:24
@IvanIsCoding IvanIsCoding added this pull request to the merge queue Aug 13, 2025
Merged via the queue into Qiskit:main with commit 7318a80 Aug 13, 2025
62 of 66 checks passed
@IvanIsCoding

Copy link
Copy Markdown
Collaborator

@Mergifyio backport stable/0.17

@mergify

mergify Bot commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

backport stable/0.17

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Aug 13, 2025
* Add distance_matrix to rustworkx-core

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.

* Optimize the implementation of distance matrix

This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.

Co-authored-by: Jake Lishman <jake@binhbar.com>

* Deduplicate functions

* Add release note

* Remove stray debug print

* Remove invalid classifier and capitalize keywords

* Bump release version to 0.17.1

---------

Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: Ivan Carvalho <ivancarvalho@gatech.edu>
(cherry picked from commit 7318a80)
IvanIsCoding added a commit that referenced this pull request Aug 13, 2025
* Add distance_matrix to rustworkx-core

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.

* Optimize the implementation of distance matrix

This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.



* Deduplicate functions

* Add release note

* Remove stray debug print

* Remove invalid classifier and capitalize keywords

* Bump release version to 0.17.1

---------




(cherry picked from commit 7318a80)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: Ivan Carvalho <ivancarvalho@gatech.edu>
github-merge-queue Bot pushed a commit that referenced this pull request Sep 16, 2025
* Add distance_matrix to rustworkx-core (#1439) (#1493)

* Add distance_matrix to rustworkx-core

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.

* Optimize the implementation of distance matrix

This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.



* Deduplicate functions

* Add release note

* Remove stray debug print

* Remove invalid classifier and capitalize keywords

* Bump release version to 0.17.1

---------




(cherry picked from commit 7318a80)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: Ivan Carvalho <ivancarvalho@gatech.edu>

* Make workflow only trigger sdist steps

* Tweak license field

* Fix retworkx dist path

* Limit trigger to today

* Update timestamp condition in wheels.yml

* Update build conditions for wheels on specific date

* Revert to main status

* Use build for wheels.yml

* Fix newline

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
mergify Bot added a commit that referenced this pull request Sep 16, 2025
* Add distance_matrix to rustworkx-core (#1439) (#1493)

* Add distance_matrix to rustworkx-core

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.

* Optimize the implementation of distance matrix

This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.

* Deduplicate functions

* Add release note

* Remove stray debug print

* Remove invalid classifier and capitalize keywords

* Bump release version to 0.17.1

---------

(cherry picked from commit 7318a80)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: Ivan Carvalho <ivancarvalho@gatech.edu>

* Make workflow only trigger sdist steps

* Tweak license field

* Fix retworkx dist path

* Limit trigger to today

* Update timestamp condition in wheels.yml

* Update build conditions for wheels on specific date

* Revert to main status

* Use build for wheels.yml

* Fix newline

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
(cherry picked from commit 69af7ff)
IvanIsCoding added a commit that referenced this pull request Sep 16, 2025
* Add distance_matrix to rustworkx-core (#1439) (#1493)

* Add distance_matrix to rustworkx-core

This commit moves the distance matrix functionality to rustworkx. This
is mostly a straightforward migration as the functionality was written
in a generic way already. The only difference is how node holes were
handled, the this opted to split the functions into 2, a verison that
assumes the graph has compact indices and one that doesn't.

* Optimize the implementation of distance matrix

This commit performs some optimizations on the internals of the
distance_matrix() function. It avoids extra allocations and uses a
fixedbitset for tracking instead of hashsets.

* Deduplicate functions

* Add release note

* Remove stray debug print

* Remove invalid classifier and capitalize keywords

* Bump release version to 0.17.1

---------

(cherry picked from commit 7318a80)






* Make workflow only trigger sdist steps

* Tweak license field

* Fix retworkx dist path

* Limit trigger to today

* Update timestamp condition in wheels.yml

* Update build conditions for wheels on specific date

* Revert to main status

* Use build for wheels.yml

* Fix newline

---------




(cherry picked from commit 69af7ff)

Co-authored-by: Ivan Carvalho <8753214+IvanIsCoding@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Co-authored-by: Jake Lishman <jake@binhbar.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants