Skip to content

Refactor CouplingMap.make_symmetric() to use rustworkx's make_symmetric()#16574

Closed
HedroPedro wants to merge 0 commit into
Qiskit:mainfrom
HedroPedro:main
Closed

Refactor CouplingMap.make_symmetric() to use rustworkx's make_symmetric()#16574
HedroPedro wants to merge 0 commit into
Qiskit:mainfrom
HedroPedro:main

Conversation

@HedroPedro

@HedroPedro HedroPedro commented Jul 12, 2026

Copy link
Copy Markdown

The minimum supported version of rustworkx is now 0.15.0, so the compatibility workaround is no longer needed. This PR replaces the Python implementation of CouplingMap.make_symmetric() with the native PyDiGraph.make_symmetric() implementation and removes the obsolete TODO.

The previous implementation manually iterated over the graph edges and added missing reverse edges. PyDiGraph.make_symmetric() implements the same behavior natively in rustworkx, so this change removes duplicate logic while relying on the optimized implementation.

Both implementations achieves the same results.

Validation realized

  • tox
    The existing test suite passes without modification, indicating that the native implementation preserves the expected behavior.

AI/LLM disclosure

  • I didn't use LLM tooling, or only used it privately.
  • I used the following tool to help write this PR description: Chat GPT
  • I used the following tool to generate or modify code:

@HedroPedro
HedroPedro requested a review from a team as a code owner July 12, 2026 02:28
@HedroPedro
HedroPedro requested a review from jeevan0920 July 12, 2026 02:28
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jul 12, 2026
@qiskit-bot

Copy link
Copy Markdown
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

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

  • @Qiskit/terra-core

@CLAassistant

CLAassistant commented Jul 12, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Community PR PRs from contributors that are not 'members' of the Qiskit repo

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants