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

Fix Qiskit interop with v1.3 #2050

Merged
merged 4 commits into from
Dec 4, 2024
Merged

Fix Qiskit interop with v1.3 #2050

merged 4 commits into from
Dec 4, 2024

Conversation

swernli
Copy link
Collaborator

@swernli swernli commented Dec 3, 2024

Qiskit v1.3 changed the behavior of num_qubits on the Target class in way that broke our QirTarget usage, since we expect to default to None but the new logic ignores the num_qubits parameter to __init__ and always defaults to zero qubits, failing later calls to transpilation. By shadowing the parent class property in QirTarget we can continue returning None and trigger the right behavior in transpilation while preserving a setter for use with v1.2.

Note: I tested locally with both v1.2.4 and v1.3.0 integration tests to confirm the behavior is as expected.

Fixes #2047

Qiskit v1.3 changed the behavior of `num_qubits` on the `Target` class in way that broke our `QirTarget` usage, since we expect to default to `None` but the new logic ignores the `num_qubits` parameter to `__init__` and always defaults to zero qubits, failing later calls to transpilation. By shadowing the parent class property in `QirTarget` we can continue returning `None` and trigger the right behavior in transpilation while preserving a setter for use with v1.2.
Fixes #2047
@minestarks minestarks changed the title Fix Qiksit interop with v1.3 Fix Qiskit interop with v1.3 Dec 3, 2024
build.py Outdated Show resolved Hide resolved
@swernli swernli enabled auto-merge December 4, 2024 22:53
@swernli swernli added this pull request to the merge queue Dec 4, 2024
Merged via the queue into main with commit e731e84 Dec 4, 2024
18 checks passed
@swernli swernli deleted the swernli/issue2047 branch December 4, 2024 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Qiksit interop breaks with v1.3
3 participants