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

Deprecate passing a string for backend #1787

Closed
jyu00 opened this issue Jul 3, 2024 · 0 comments · Fixed by #1804
Closed

Deprecate passing a string for backend #1787

jyu00 opened this issue Jul 3, 2024 · 0 comments · Fixed by #1804
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@jyu00
Copy link
Collaborator

jyu00 commented Jul 3, 2024

What is the expected feature or enhancement?

Related to #1681.

Today we allow one to pass the backend name (string) when initializing Sampler/Estimator/Session/Batch, for example, you can do

sampler = SamplerV2(backend="ibm_osaka")

This would actually call QiskitRuntimeService() (i.e. use your default account setting) under the cover, which can be a surprise to people if the default channel or h/g/p is not what they want to use.

Furthermore, some people would do

service = QiskitRuntimeService(name="foo")
sampler = SamplerV2(backend="ibm_osaka")

In the past this would cause confusion because it would actually use the default account instead of the account named foo. To address this, we added code to use the last-initialize account instead of the default one. But this was also inferring user's intent and contradicts with the docstring which says If a name is specified, the default account is used.

To make the account selection more explicit, we can 1) make both service and backend required or 2) disallow passing a string for backend.

With the ISA circuit requirement, people are more likely to initialize a backend object now to do transpilation, so (2) seems to be the better choice.

Acceptance criteria

  • Deprecate passing a string for backend when initializing Session, Batch, SamplerV2 and EstimatorV2.
@jyu00 jyu00 added the enhancement New feature or request label Jul 3, 2024
@kt474 kt474 self-assigned this Jul 16, 2024
@kt474 kt474 added this to the 0.26.0 milestone Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants