Skip to main contentIBM Quantum Documentation

Select and set up an IBM Quantum channel

You can access IBM Quantum systems by using the IBM Quantum Platform or IBM Cloud channel.

IBM Quantum Platform

IBM Quantum Platform has Open (free access) and Premium (enterprise subscription) plans. See IBM Quantum access plans (opens in a new tab) for details.

You can make requests locally (on your laptop or other device) using the qiskit-ibm-runtime client or use a cloud-based environment, such as IBM Quantum Lab (opens in a new tab) (a Jupyter Notebook environment) or IBM Quantum Composer (opens in a new tab) (a virtual circuit composer). To make requests from a local environment, you need to install and set up Qiskit with the Qiskit Runtime Client and set up to use IBM Quantum Platform.

Note

IBM Quantum Lab (opens in a new tab) and IBM Quantum Composer (opens in a new tab) are self-contained tools and require no setup.

Available plans:

  • Open Plan - Run your quantum circuits on the world's best quantum systems for free (up to 10 minutes quantum time per month).

  • Premium Plan - Run quantum circuits on the world's best quantum systems using an enterprise quantum time subscription.

IBM Cloud

IBM Cloud offers pay-as-you-go access plans. See IBM Quantum access plans (opens in a new tab) for details.

IBM Cloud has Lite (free access) and Standard (pay-as-you-go access) plans. See Qiskit Runtime plans (opens in a new tab) on IBM Cloud for details.

This channel does not support a cloud-based development environment. Therefore, you will need to install and set up Qiskit and Qiskit Runtime and set up to use IBM Cloud.

Available plans:

  • Standard (Pay-as-you-go) Plan - Run quantum circuits on the world's best quantum systems and pay only for the quantum time you use.

  • Lite plan: Debug and learn about quantum circuits using free simulators.


Set up to use IBM Quantum Platform

You need access credentials to use cloud-based IBM Quantum systems.

  1. If you do not already have a user account, get one at the IBM Quantum login page. (opens in a new tab) Your user account is associated with one or more instances (in the form hub / group / project) that give access to IBM Quantum services. Additionally, a unique token is assigned to each account, allowing for IBM Quantum access from Qiskit. The instructions in this section use our default instance. For instructions to choose a specific instance, see Connect to an instance.

    Note

    The Instances section in your IBM Quantum account page (opens in a new tab) lists the instances that you can access.

  2. Retrieve your IBM Quantum token from the IBM Quantum account page, (opens in a new tab) then start Python. For example:

    python3
  3. Authenticate to the service by calling QiskitRuntimeService with your IBM Cloud API key and CRN:

    from qiskit_ibm_runtime import QiskitRuntimeService
     
    service = QiskitRuntimeService(channel="ibm_quantum", token="<MY_IBM_QUANTUM_TOKEN>")
     

    Or, optionally use the save_account() method to save your credentials for easy access later on, before initializing the service.

    from qiskit_ibm_runtime import QiskitRuntimeService
     
    # Save an IBM Quantum account and set it as your default account.
    QiskitRuntimeService.save_account(channel="ibm_quantum", token="<MY_IBM_QUANTUM_TOKEN>", set_as_default=True)
     
    # Load saved credentials
    service = QiskitRuntimeService()
    • If you save your credentials to disk, you can use QiskitRuntimeService() in the future to initialize your account. The channel parameter distinguishes between different account types. If you are saving multiple accounts per channel, consider using the name parameter to differentiate them.
    • If you are saving multiple accounts per channel, consider using the name parameter to differentiate them.
    • Credentials are saved to $HOME/.qiskit/qiskit-ibm.json. Do not manually edit this file.
    • If you don't save your credentials, you must specify them every time you start a new session.
    • The channel parameter allows you to distinguish between different account types. When initializing the account, IBM Cloud is the default account used if have saved credentials for an IBM Quantum Platform and an IBM Cloud account.
    Caution

    Account credentials are saved in plain text, so only do so if you are using a trusted device.

    Note

    IBM Cloud is the default account used if you don't specify a different channel or account name.

  4. Test your setup. Run a simple circuit using Sampler to ensure that your environment is set up properly:

    from qiskit.test.reference_circuits import ReferenceCircuits
    from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
     
     # You'll need to specify the credentials when initializing QiskitRuntimeService, if they were not previously saved.
     service = QiskitRuntimeService()
     backend = service.backend("ibmq_qasm_simulator")
     job = Sampler(backend).run(ReferenceCircuits.bell())
     print(f"job id: {job.job_id()}")
     result = job.result()
     print(result)

Set up to use IBM Cloud

  1. Start Python. For example:

    python3
  2. If you do not already have one, set up an IBM Cloud account from the IBM Cloud Registration page (opens in a new tab).

  3. Create a service instance, if necessary. Open your IBM Cloud Instances page (opens in a new tab). If you have one or more instances shown, continue to the next step. Otherwise, click Create instance. When creating your instance you can name it, tag it, select a resource group for it, and select a performance strategy. Next, agree to the license agreements by checking the box in the bottom right corner of the page, and click Create.

    Note

    If you are an administrator who needs to set up Qiskit Runtime on Cloud for your organization, refer to Plan Qiskit Runtime for an organization (opens in a new tab).

    Note

    When selecting a performance strategy there are two options available. One from IBM (default) another from Q-CTRL. The IBM performance strategy allows you to leverage all of the standard options available with Qiskit Runtime and the Q-CTRL strategy uses an automated preset. To learn more about the Q-CTRL option, visit the Q-CTRL documentation (opens in a new tab).

  4. Find your access credentials.

    1. Find your API key. From the API keys page (opens in a new tab), view or create your API key, then copy it to a secure location so you can use it for authentication.
    2. Find your Cloud Resource Name (CRN). Open the Instances page (opens in a new tab) and click your instance. In the page that opens, click the icon to copy your CRN. Save it in a secure location so you can use it for authentication.
  5. Authenticate to the service by calling QiskitRuntimeService with your saved credentials or with your IBM Cloud API key and CRN:

    from qiskit_ibm_runtime import QiskitRuntimeService
     
    service = QiskitRuntimeService(channel="ibm_cloud", token="<IBM Cloud API key>", instance="<IBM Cloud CRN>")
    Note

    If you set up your instance in step 3 to include Q-CTRL performance management, when initializing the QiskitRuntimeService() you should include the additional argument channel_strategy="q-ctrl". To learn more about Q-CTRL performance management strategy visit the Q-CTRL documentation (opens in a new tab).

    You can optionally use the save_account() method to save your credentials for easy access later on, before initializing the service.

     from qiskit_ibm_runtime import QiskitRuntimeService
     
     # Save account to disk. 
     QiskitRuntimeService.save_account(channel="ibm_cloud", token="<IBM Cloud API key>", instance="<IBM Cloud CRN>", name="<account-name>")
     
     # Load saved credentials
     service = QiskitRuntimeService(name="<account-name>")
    • If you save your credentials to disk, you can use QiskitRuntimeService() in the future to initialize your account. The channel parameter distinguishes between different account types. When initializing the account, IBM Cloud is the default account used if you have saved credentials for both an IBM Quantum Platform and an IBM Cloud account.
    • If you are saving multiple accounts per channel, consider using the name parameter to differentiate them.
    • Credentials are saved to $HOME/.qiskit/qiskit-ibm.json. Do not manually edit this file.
    • If you don't save your credentials, you must specify them every time you start a new session.
    Caution

    Account credentials are saved in plain text, so only do so if you are using a trusted device.

  6. Test your setup. Run a simple circuit using Sampler to ensure that your environment is set up properly:

from qiskit.test.reference_circuits import ReferenceCircuits
from qiskit_ibm_runtime import QiskitRuntimeService, Sampler
 
 # You'll need to specify the credentials when initializing QiskitRuntimeService, if they were not previously saved.
 service = QiskitRuntimeService()
 backend = service.backend("ibmq_qasm_simulator")
 job = Sampler(backend).run(ReferenceCircuits.bell())
 print(f"job id: {job.job_id()}")
 result = job.result()
 print(result)

Next steps

Recommendations
Was this page helpful?