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

Make channels handling code more generic #1052

Closed
jyu00 opened this issue Sep 5, 2023 · 2 comments · Fixed by #1060
Closed

Make channels handling code more generic #1052

jyu00 opened this issue Sep 5, 2023 · 2 comments · Fixed by #1060
Labels
enhancement New feature or request priority: medium Medium Priority issue (must have for current release)

Comments

@jyu00
Copy link
Collaborator

jyu00 commented Sep 5, 2023

What is the expected feature or enhancement?

Today we have two channels - ibm_quantum and ibm_cloud. The URLs are hard coded, and there is channel specific logic in various places.

Since there are plans to onboard additional channels, we should make channel account management more generic. That is, to have a configuration file that lists the channels, their default urls, and any channel strategies they support.

It is unlikely the code can be completely channel agnostic, but we can try to isolate such code to separate classes/methods. If there are actions that can be done on the server side, we can also bring that back to them.

Acceptance criteria

Ideally, when adding a new channel, all one has to do it to update the config file.

Suggested fix

Instead of hard coding the channels, we should have a config file that lists what channels are support. For example, in a format of:

channels:
    - name: ibm_quantum
      default_url: api.quantum-computing.ibm.com
      token_required: True
      instance_required: True
      channel_strategy: []
    - name: ibm_cloud 
      ...

Then a new channel can just update this file with a new section. create_account can return a GenericAccount (or use the base Account since it's not actually declared as an abstract class despite the comment).

@jyu00 jyu00 added the enhancement New feature or request label Sep 5, 2023
@kt474 kt474 added the priority: high High priority issue (must have for current release) label Sep 5, 2023
@kt474 kt474 added this to the 0.12.2 milestone Sep 18, 2023
@jyu00
Copy link
Collaborator Author

jyu00 commented Dec 12, 2023

This issue was brought up again in regards to new channel partners. The original PR didn't quite address the issue, as the two channels are still hard coded. For example, if I try to do

QiskitRuntimeService(channels="foo")

This would blow up as it only accepts ibm_quantum and ibm_cloud.

I updated the OP with a "Suggested fix"

@jyu00 jyu00 reopened this Dec 12, 2023
@jyu00 jyu00 removed this from the 0.12.2 milestone May 22, 2024
@jyu00 jyu00 added priority: medium Medium Priority issue (must have for current release) and removed priority: high High priority issue (must have for current release) labels May 22, 2024
@jyu00
Copy link
Collaborator Author

jyu00 commented Aug 5, 2024

Closing because of pending IQP changes.

@jyu00 jyu00 closed this as completed Aug 5, 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 priority: medium Medium Priority issue (must have for current release)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants