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 missing fractional gates in primitive in session #1922

Merged

Conversation

nkanazawa1989
Copy link
Contributor

@nkanazawa1989 nkanazawa1989 commented Sep 12, 2024

Summary

We cannot run primitive inside session with fractional gates. This PR fixes the bug.

Details and comments

This is the current behavior:

from qiskit_ibm_runtime import QiskitRuntimeService, Session, SamplerV2

service = QiskitRuntimeService()
backend = service.backend(use_fractional_gates=True)

with Session(backend=backend) as _:
    primitive = SamplerV2()
    assert primitive._backend.options.use_fractional_gates is True  # fail

Because of this, this session fails in running the primitives because of the ISA circuit validation. When we instantiate a primitive inside the session context, the backend is reloaded from the service attached to the session without the optin flag.

@nkanazawa1989 nkanazawa1989 force-pushed the fix/missing_fractional_gates_in_session branch from 7ce65a0 to 1fe3507 Compare September 12, 2024 11:20
@kt474 kt474 added the Changelog: Bugfix Include in the Fixed section of the changelog label Sep 16, 2024
@kt474 kt474 added this to the 0.30.0 milestone Sep 16, 2024
@kt474 kt474 merged commit f3b6abe into Qiskit:main Sep 16, 2024
18 checks passed
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