Set up your IBM Cloud account
If you have an invitation to join an account, follow the steps in Set up your IBM Cloud account - invited users instead.
You can run workloads on IBM® quantum processing units (QPUs) by setting up an account on IBM Cloud®. You will also need to install and set up Qiskit and Qiskit Runtime.
Your user account is associated with one or more instances, identified by Cloud Resource Names (CRNs) that give access to IBM Quantum services. Additionally, a unique API token (also called a key) is assigned to each account, allowing for IBM Quantum access from Qiskit. For instructions to choose a specific instance, see Connect to an instance.
The IBM Quantum Platform dashboard and the Instances page list the instances that you can access.
Set up to use IBM Cloud
Before you begin
If you do not already have one, set up an IBM Cloud account.
You can have multiple IBM Cloud accounts. You can access any of your IBM Cloud accounts at any time from the account switcher in the header of the IBM Quantum Platform interface.
1. Create an instance
Go to the IBM Quantum Platform dashboard. If you have one or more instances shown, skip this step. Otherwise, follow these steps to create an instance.
-
Make sure that the correct account and region are selected from the account and region switchers in the header, as shown in the following image.
- You can have multiple accounts. If you don't see the instances or jobs you're expecting, try a different account.
- The region controls where your jobs are run and where the job data is kept. You can access either region by using the same API key, but you can only see and access the instances that were created in the region that you're logged in to.
- If you want to create an Open instance, you must choose the us-east region.
IBM Quantum Platform header -
Click Create instance.
- Choose a name and the plan to use.
- If you are creating an instance of the Standard Plan, it is recommended that you set the total cost limit or the usage limit. (These values can be updated later.)
- Scroll down to see the Terms link. After reading the terms, agree to the license agreements by checking the box in the bottom right corner of the page, and click Next.
-
On the Plan inheritance page, leave the default setting (toggle is not enabled) and click Next if you're setting up an Open instance.
If you are not setting up an Open instance and you want different QPUs to be available on this instance, enable the "Customize allocated compute resources" toggle, choose the QPUs you want this instance to be able to access, then click Next.
NoteIf you customize the allocated compute resources, the available QPUs will never be automatically updated, regardless of any changes made to the parent plan. However, you can manually add or remove QPUs later.
-
Choose whether you want an access group to be created for this instance and click Create instance. This access group allows other users (collaborators) to share the time allocated to this instance. Collaborators can be added on the Users page.
For an Open instance, you probably don't need this access group, although creating one won't impact your usage unless you add another user to the group.
You can add or remove access groups at any time from IBM Cloud. See Setting up access groups for instructions.
NoteIf you are an administrator who needs to set up Qiskit Runtime on Cloud for your organization, refer to Plan Qiskit Runtime for an organization.
2. Find your access credentials
- Find your API key. From the dashboard, create your API key, then copy it to a secure location so you can use it for authentication. Note that you can use the same API key to connect to any region.
- Optional: Find the instance you want to use from the Instances page. Click the icon to copy its CRN, then save it in a secure location so you can use it to identify the instance.
3. Connect Qiskit with your service instance
If you are working in a trusted Python environment (such as on a personal laptop or workstation), use the save_account()
method to save your credentials locally, then use them to initialize the service.
-
Ensure you are working in an active Python environment with the Qiskit SDK and Qiskit Runtime installed.
-
Activate the Python virtual environment, run Python in your virtual environment, and enter the following:
token = "<your-API-token>"
-
Initialize the service.
When an instance CRN or name is passed in, only backends and jobs from that instance are available. If an instance is not specified (allowed in Qiskit Runtime v0.40.1 and later), all backends and jobs across all instances in your account are available. In this case, when a backend is specified, an instance that can access that backend is found and used.
from qiskit_ibm_runtime import QiskitRuntimeService
service = QiskitRuntimeService.save_account(
token=token, # Your token is confidential.
# Do not share your key in public code.
instance="<IBM Cloud CRN or instance name>", # Optionally specify the instance to use.
plans_preference="['plan-type1', 'plan-type2']", # Optionally set the types of plans to prioritize. This is ignored if the instance is specified.
region="<region>", # Optionally set the region to prioritize. This is ignored if the instance is specified.
name="<account-name>", # Optionally name this set of account credentials.
set_as_default=True, # Optionally set these as your default credentials.
)
from qiskit_ibm_runtime import QiskitRuntimeService
# If you named your credentials, optionally specify the name here, as follows:
# QiskitRuntimeService(name='account-name')
# If you don't specify a name, the default credentials are loaded.
service = QiskitRuntimeService()
- If you have saved credentials for both an IBM Quantum Platform account and an IBM Cloud account, IBM Cloud is the default account used when you initialize your account, unless you specify
set_as_default=True
in your IBM Quantum Platform account when you use thesave_account()
method. - If you are saving multiple accounts, 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.
- Follow these instructions to authenticate to IBM Cloud if you are not using a trusted environment. For example, if you are using a public comptuer.
- Follow these instructions if you want to connect by using the REST API instead of using Qiskit.
- If necessary, use this information to configure your firewall to enable access to the IBM Quantum API endpoints.
Next steps
- Overview of available plans.
- Configure the Qiskit SDK locally.
- Follow the steps in Hello world to write and run a quantum program.
- Set up to use IBM Quantum Platform with REST API.
- Try a tutorial.