🐛 shortestSWAPsBetween returns one SWAP too many#1395
Conversation
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
shortestSWAPsBetween inserts one SWAP too manyshortestSWAPsBetween returns one SWAP too many
📝 WalkthroughSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings. WalkthroughThe path-reconstruction loop in Architecture::shortestSWAPsBetween now initializes Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (4)📚 Learning: 2025-10-07T15:30:42.946ZApplied to files:
📚 Learning: 2025-12-02T07:37:46.860ZApplied to files:
📚 Learning: 2025-12-08T23:44:39.930ZApplied to files:
📚 Learning: 2025-12-17T11:32:45.843ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
(cherry picked from commit 853eb22)
Description
#1301 introduced the
shortestSWAPsBetweenmethod to theArchitectureclass. Unfortunately, there is a bug: It returns one SWAP too many. Semantically, this is still correct but unnecessary since the qubits are already adjacent. In other words, the last SWAP swaps already adjacent qubits.Checklist: