Skip to content

Conversation

@Shaobo-Zhou
Copy link
Contributor

@Shaobo-Zhou Shaobo-Zhou commented Sep 5, 2025

Description

Fixes instruction duration unit in estimated success probability calculation in src/mqt/predictor/reward.py, as the default unit is "dt" instead of "s": https://github.com/Qiskit/qiskit/blob/stable/2.1/qiskit/transpiler/target.py#L415-L430

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@codecov
Copy link

codecov bot commented Sep 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Shaobo-Zhou Shaobo-Zhou marked this pull request as ready for review September 5, 2025 16:09
@coderabbitai
Copy link

coderabbitai bot commented Nov 18, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Corrected instruction duration unit handling in success probability estimates for Qiskit 2.0.0+ devices, improving accuracy of idle-time decoherence calculations.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

For Qiskit >= 2.0.0, the estimated_success_probability function now multiplies the decay exponent for single-qubit delay instructions by the device dt (instruction-duration scaling) when computing idle-time decoherence. A changelog entry documenting the fix was added.

Changes

Cohort / File(s) Summary
Decoherence decay update
src/mqt/predictor/reward.py
estimated_success_probability retrieves device.dt for Qiskit >= 2.0.0 and multiplies the exponential decay exponent for single-qubit delay gates by this scaling factor when computing idle-time decoherence.
Changelog
CHANGELOG.md
Added Unreleased entry: "Fix instruction duration unit in estimated success probability calculation" (PR #445, Shaobo-Zhou).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify correct use and units of device.dt in src/mqt/predictor/reward.py.
  • Confirm Qiskit version check is correct and preserves behavior for older versions.
  • Ensure change applies only to single-qubit delay handling and doesn't affect other gate error calculations.

Poem

🐰 I tiptoe on the circuit's beat,
dt whispers time beneath my feet,
Decay now counts the proper pace,
Small hops of code, a steadier trace,
I munch a carrot, errors meet.

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive The description identifies the bug fix and includes a relevant code reference, but the checklist items are largely unchecked and the description lacks detail on testing, documentation updates, and migration needs. Provide more context about testing coverage, documentation updates, and whether this fix requires any migration guidance or breaking changes for users.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: fixing the instruction duration unit in the estimated success probability calculation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c0af637 and b9b5991.

📒 Files selected for processing (1)
  • CHANGELOG.md (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-14T14:37:38.047Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/yaqs PR: 212
File: CHANGELOG.md:12-15
Timestamp: 2025-10-14T14:37:38.047Z
Learning: In the munich-quantum-toolkit/yaqs project, changelog entries follow the template: "- $TITLE ([#$NUMBER]($URL)) ([**AUTHOR**](https://github.com/$AUTHOR))". Issue references should not be included in changelog entries; the PR number is sufficient for traceability.

Applied to files:

  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 🐍 Test (windows-2022) / 🐍 windows-2022
  • GitHub Check: 🐍 Test (macos-14) / 🐍 macos-14
  • GitHub Check: 🐍 Test (ubuntu-24.04) / 🐍 ubuntu-24.04
🔇 Additional comments (1)
CHANGELOG.md (1)

14-14: Changelog entry formatting and links corrected.

All issues from the previous review have been properly addressed:

Also applies to: 48-48, 66-66

Tip

✨ Issue Enrichment is now available for GitHub issues!

CodeRabbit can now help you manage issues more effectively:

  • Duplicate Detection — Identify similar or duplicate issues
  • Related Issues & PRs — Find relevant issues and PR's from your repository
  • Suggested Assignees — Find the best person to work on the issue
  • Implementation Planning — Generate detailed coding plans for engineers and agents
Disable automatic issue enrichment

To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

issue_enrichment:
  auto_enrich:
    enabled: false

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@flowerthrower
Copy link
Collaborator

@Shaobo-Zhou, could you please add a brief update to the changelog? You can merge this once all tests have succeeded. Thanks for fixing!

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 57e58ec and c0af637.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-14T14:37:38.047Z
Learnt from: burgholzer
Repo: munich-quantum-toolkit/yaqs PR: 212
File: CHANGELOG.md:12-15
Timestamp: 2025-10-14T14:37:38.047Z
Learning: In the munich-quantum-toolkit/yaqs project, changelog entries follow the template: "- $TITLE ([#$NUMBER]($URL)) ([**AUTHOR**](https://github.com/$AUTHOR))". Issue references should not be included in changelog entries; the PR number is sufficient for traceability.

Applied to files:

  • CHANGELOG.md
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: 🐍 Test (macos-14) / 🐍 macos-14
  • GitHub Check: 🐍 Test (ubuntu-24.04) / 🐍 ubuntu-24.04
  • GitHub Check: 🐍 Test (windows-2022) / 🐍 windows-2022

@Shaobo-Zhou
Copy link
Contributor Author

@Shaobo-Zhou, could you please add a brief update to the changelog? You can merge this once all tests have succeeded. Thanks for fixing!

I don't seem to have write access for merging. Can you do it as all checks have passed now?

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