Fix: depth calculations for decompose gates#211
Merged
TheGupta2012 merged 4 commits intoqBraid:mainfrom Jun 24, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅ 📢 Thoughts on this report? Let us know! |
Member
TheGupta2012
left a comment
There was a problem hiding this comment.
Some minor comments @vinayswamik , but overall looks good! Bump CHANGELOG, as usual :)
7a7c497 to
7eb9a62
Compare
Member
|
Hi @vinayswamik , I don't see any new changes in the commit |
b9621ae to
7eb9a62
Compare
- Introduced a new property in QasmModule to control gate decomposition during depth calculations. - Added tests to validate depth calculations for decomposable gates
- Updated logic to increment qubit depth and reset counts only when not in a branching statement. - Added a new test case to validate depth calculations for qubit resets within branching statements.
7eb9a62 to
24e89a5
Compare
- Refactored QasmVisitor to use `_decompose_native_gates` instead of `_decompose_gates`. - Enhanced depth calculation for decomposable gates by ensuring accurate depth updates. - Updated tests in `test_depth.py` and `test_depth.py` to reflect changes in depth calculation logic. - Added a new test for custom decomposable gates to validate depth calculations.
- Updated QasmVisitor and QasmModule to replace decompose_gates with decompose_native_gates for depth calculations. - Adjusted logic in QasmVisitor to ensure accurate depth updates for decomposable custom gates. - Modified tests in test_depth.py and test_depth.py to reflect the new parameter and validate depth calculations for decomposable gates.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #201
Summary of changes
Added special handling for depth calculation for decompose gates
decompose_gateswas added to theQasmModuleclass to control whether gates should be decomposed during depth calculations.