Skip to content

fix circuit routing failure for directed device graph#7889

Merged
pavoljuhas merged 6 commits intoquantumlib:mainfrom
Vivek1106-04:fix/routing-mixed-edges
Mar 4, 2026
Merged

fix circuit routing failure for directed device graph#7889
pavoljuhas merged 6 commits intoquantumlib:mainfrom
Vivek1106-04:fix/routing-mixed-edges

Conversation

@Vivek1106-04
Copy link
Contributor

@Vivek1106-04 Vivek1106-04 commented Feb 11, 2026

Treat graph edges as undirected when placing routing SWAPs.
Also extend MappingManager methods dist_on_device and
shortest_path with an optional undirected flag.

Fixes #7885

@Vivek1106-04 Vivek1106-04 requested review from a team and vtomole as code owners February 11, 2026 04:18
@github-actions github-actions bot added the size: L 250< lines changed <1000 label Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.62%. Comparing base (8b8050e) to head (eb3199c).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7889   +/-   ##
=======================================
  Coverage   99.62%   99.62%           
=======================================
  Files        1106     1106           
  Lines       99421    99484   +63     
=======================================
+ Hits        99046    99109   +63     
  Misses        375      375           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Vivek1106-04
Copy link
Contributor Author

@pavoljuhas - The routing algorithm used directed distance calculations for undirected swap operations, causing the bug in first place

@Vivek1106-04
Copy link
Contributor Author

@pavoljuhas - Gentle reminder to review . Thank you

Instead of adding new MappingManager methods `dist_on_device_undirected`,
`shortest_path_undirected`, just add an extra `undirected` flag to
`dist_on_device`, `shortest_path`.
Also ensure the routed circuit has the same unitary and
verify the expected count of added gates.
@github-actions github-actions bot added size: M 50< lines changed <250 and removed size: L 250< lines changed <1000 labels Mar 4, 2026
Copy link
Collaborator

@pavoljuhas pavoljuhas left a comment

Choose a reason for hiding this comment

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

LGTM after pushing some clean ups - mainly replacing new
something_undirected methods with an optional undirected flag.

@Vivek1106-04
Copy link
Contributor Author

thanks for the review @pavoljuhas .

@pavoljuhas pavoljuhas added this pull request to the merge queue Mar 4, 2026
Merged via the queue into quantumlib:main with commit 4c28746 Mar 4, 2026
76 of 77 checks passed
@Vivek1106-04 Vivek1106-04 deleted the fix/routing-mixed-edges branch March 9, 2026 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected circuit routing failure for directed device graph

2 participants