qiskit-addon-cutting icon indicating copy to clipboard operation
qiskit-addon-cutting copied to clipboard

Fix idle qubit detection to ignore barriers

Open raunakkumarsingh opened this issue 1 year ago • 9 comments

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.

raunakkumarsingh avatar Jul 16 '24 05:07 raunakkumarsingh

CLA assistant check
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.

CLAassistant avatar Jul 16 '24 05:07 CLAassistant

Added if instruction.operation.name == 'barrier': continue to skip over barrier operations during the idle wire detection process.

raunakkumarsingh avatar Jul 16 '24 06:07 raunakkumarsingh

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.

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 Coverage Status
Change from base Build 9983091228: 0.0%
Covered Lines: 2412
Relevant Lines: 2412

💛 - Coveralls

coveralls avatar Jul 16 '24 13:07 coveralls

It'd be nice to have an explicit test for this behavior, too.

garrison avatar Jul 16 '24 13:07 garrison

The lint failure can be fixed by merging main into this branch once #640 has been merged to main.

garrison avatar Jul 16 '24 13:07 garrison

@raunakkumarsingh, thank you for this contribution. Do you plan to add a test and merge main into this branch, or should I do it?

garrison avatar Jul 17 '24 17:07 garrison

I have added tests for the barrier Ignore and rebased my branch.

raunakkumarsingh avatar Jul 18 '24 05:07 raunakkumarsingh

Thank you. Please run tox -e style and make sure that tox -e lint passes.

garrison avatar Jul 18 '24 17:07 garrison

corrected lint

raunakkumarsingh avatar Jul 19 '24 09:07 raunakkumarsingh