Feature/Added depth calculation for branching statements#200
Feature/Added depth calculation for branching statements#200TheGupta2012 merged 18 commits intoqBraid:mainfrom
Conversation
removed barriers in test_qasm3_depth_branching test case
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TheGupta2012
left a comment
There was a problem hiding this comment.
Hey @vinayswamik , thanks for working on this! Giving a preliminary review right now, but the code looks good!
Please add some more tests whenever you get time
Co-authored-by: Harshit Gupta <harshit.11235@gmail.com>
Thanks for the review 👍, |
remove the skip test
|
Changes lgtm @vinayswamik ! Can you please also add a Thanks for working on this! |
Added new test case for the external gates inside branching statements. New code (line: 974 to 979 under _visit_custom_gate_operation in visitor.py never ran under the previous test suite.
Thanks for your support @TheGupta2012. I have update the |
Summary of changes
This PR addresses an issue in
QasmVisitorwhere depth calculations forGateandMeasurementoperations inside branching statements were being treated the same asnon-conditionaloperations. As a result, both quantum and classical registers were not reflecting the correct depth, leading to inaccuratecircuit-depth.With this change, we introduce logic to:
(e.g., if or else): we set a flag at the start ofQasmVisitor.qubitandclbitparticipating in the conditional arguments to the correct final depth.Closes #53