qiskit-addon-cutting
qiskit-addon-cutting copied to clipboard
Fix idle qubit detection to ignore barriers
Fixes #621 Check for Barriers: Added if instruction.operation.name == 'barrier': continue to skip over barrier operations during the idle wire detection process. Iterate Through Instructions:
For each instruction, if it is not a barrier, it iterates through the qubits involved in the instruction and removes those qubit indices from the idle_wires set. Filter Qubit Subsets:
The qubit_subsets list is filtered to remove any subsets that consist of only one qubit, and that qubit is in the idle_wires set.
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
Added if instruction.operation.name == 'barrier': continue to skip over barrier operations during the idle wire detection process.
Pull Request Test Coverage Report for Build 10002802415
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage remained the same at 100.0%
| Totals | |
|---|---|
| Change from base Build 9983091228: | 0.0% |
| Covered Lines: | 2412 |
| Relevant Lines: | 2412 |
💛 - Coveralls
It'd be nice to have an explicit test for this behavior, too.
The lint failure can be fixed by merging main into this branch once #640 has been merged to main.
@raunakkumarsingh, thank you for this contribution. Do you plan to add a test and merge main into this branch, or should I do it?
I have added tests for the barrier Ignore and rebased my branch.
Thank you. Please run tox -e style and make sure that tox -e lint passes.
corrected lint