Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fix: ISA check inside control flow operations whose body is defined in a separate circuit #1954

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

yaelbh
Copy link
Collaborator

@yaelbh yaelbh commented Sep 29, 2024

#1916 fixed a bug related to connectivity inside control operations. @jakelishman has pointed out a case where the fix does not apply correctly. The case is exemplified in the test test_isa_inside_condition_block_body_in_separate_circuit, which is added in the current PR. Running the test, either on Shrebrooke or Cusco, results with

qiskit_ibm_runtime/utils/utils.py:61: in _is_isa_circuit_helper
    qargs = tuple(qubit_map[bit] for bit in instruction.qubits)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.0 = <tuple_iterator object at 0x7f3c30d83af0>

>   qargs = tuple(qubit_map[bit] for bit in instruction.qubits)
E   KeyError: Qubit(QuantumRegister(2, 'inner'), 0)

The current PR fixes the error, and makes the test pass.

The fix is copied from qiskit's GatesInBasis pass, from a previous version where the pass was still written in Python.

@yaelbh yaelbh requested a review from kt474 September 29, 2024 12:25
@kt474 kt474 merged commit d5895d5 into Qiskit:main Sep 30, 2024
18 checks passed
@kt474 kt474 added the Changelog: Bugfix Include in the Fixed section of the changelog label Sep 30, 2024
@kt474 kt474 added this to the 0.31.0 milestone Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the Fixed section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants