Code Monkey home page Code Monkey logo

Comments (3)

daka1510 avatar daka1510 commented on August 19, 2024

Took a look at the implementation details and see the risk to bloat or overload some of the function signatures if we stick with the plan to use the same class (IBMRuntimeService) to handle both cases in a fully transparent way.

Context

To my understanding there are different terms that end users are familiar with, i.e.

Challenge / Risk

To map the above terms to the proposed common interface, additional overloaded terms like locator have to be introduced. This might come with an additional learning curve and/or confuse users.

cloud_service = IBMRuntimeService(auth="cloud", token=cloud_api_key, locator="crn:v1:bluemix:public:quantum-computing:us-east:...")
legacy_service = IBMRuntimeService(auth="legacy", token=legacy_api_token, locator="https://auth.quantum-computing.ibm.com") 

The same challenge will also become relevant when the save_account function is updated to serve both worlds.

# how to extend this
IBMRuntimeService.save_account(
    token: str, url: str,
    # how to design the interface to not mix and match parameters that are only relevant for legacy/cloud
    hub: Optional[str] = None,
    group: Optional[str] = None,
    project: Optional[str] = None,
)

Proposal

from abc import ABC
class IBMRuntimeService(ABC, RuntimeService):
    # implements common functionality across cloud / legacy but is not directly instantiated

class IBMCloudRuntimeService(IBMRuntimeService):
    # cloud users explicitly need to instantiate this class
    def __init__(self, api_key, crn):

class IBMLegacyRuntimeService(IBMRuntimeService):
   # legacy users explicitly need to instantiate this class
    def __init__(self, token, url):

from qiskit-ibm-runtime.

daka1510 avatar daka1510 commented on August 19, 2024

@rathishcholarajan, @jyu00 - added a few thoughts in my previous commment. Let me know what you think (or discuss on Monday). As always: I may be totally wrong with these concerns. If so, I'm happy to learn why.

from qiskit-ibm-runtime.

daka1510 avatar daka1510 commented on August 19, 2024

Discussed in during our daily sync meeting and agreed to move forward as initially planned for now (i.e. use a single IBMRuntimeService). This decision is heavily based on the assumption that the runtime APIs will be the same across Cloud/Legacy and not require users to supply different parameters (cc: @renier).

from qiskit-ibm-runtime.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.