How to authenticate with IBM Credentials
Authenticating to use IBM Cloud and IBM Quantum backends
IBM has two platforms for accessing their devices according to different plan options: IBM Cloud and IBM Quantum. This guide explains how to set your IBM credentials with Fire Opal to access these platforms.
In this guide, you will learn how to:
- Access IBM Cloud Pay-as-you-go Plan backends through Fire Opal.
- Access IBM Quantum Premium and Open Plan backends through Fire Opal.
1. Authenticate to use devices via IBM Cloud
Note: Q-CTRL's native integration with Qiskit Runtime on IBM Cloud will be deprecated on October 18th, 2024. You can still use Fire Opal to submit jobs to IBM Cloud to get the same performance benefits on the IBM Pay-as-you-go Plan. See the migration guide for more details.
Fire Opal supports backends on IBM Cloud. To access these devices, you will need to sign up for a Pay-as-you-go Plan via IBM Cloud and use your token and credentials to authenticate. Visit the documentation for more information on how to get started.
After signing up, you will need to obtain your access credentials. The following code demonstrates how to to pass your credentials to Fire Opal for device access. You will need to provide your IBM Cloud API key as the token and the Cloud Resource Name as the instance.
import fireopal as fo
token = "YOUR_IBM_CLOUD_API_KEY"
instance = "YOUR_IBM_CRN"
credentials = fo.credentials.make_credentials_for_ibm_cloud(
token=token, instance=instance
)
You can use the function show_supported_devices
to validate that your credentials are properly defined and list the devices that are both supported by Fire Opal and accessible via the IBM Cloud credentials
provided.
supported_devices = fo.show_supported_devices(credentials=credentials)[
"supported_devices"
]
for name in supported_devices:
print(name)
2. Authenticate to use devices via IBM Quantum
You can also access devices on IBM Quantum via Fire Opal. To do so, you will need to sign up for an IBM Quantum account and use your token and credentials to authenticate.
Use the obtained credentials to replace "YOUR_IBM_TOKEN"
with the instance that you will use to access devicees. For access to your organization's plan, replace hub
, group
, and project
with those of your organization.
import fireopal as fo
# These are the properties for the publicly available provider for IBM backends.
# If you have access to a private provider and wish to use it, replace these values.
hub = "ibm-q"
group = "open"
project = "main"
token = "YOUR_IBM_TOKEN"
credentials = fo.credentials.make_credentials_for_ibmq(
token=token, hub=hub, group=group, project=project
)
You can use the function show_supported_devices
to validate that your credentials are properly defined and list the devices that are both supported by Fire Opal and accessible via the IBM Cloud credentials
provided.
supported_devices = fo.show_supported_devices(credentials=credentials)[
"supported_devices"
]
for name in supported_devices:
print(name)
Now that you've set up your credentials to access devices, try running a circuit by following the get started guide!
The following package versions were used to produce this notebook.
from fireopal import print_package_versions
print_package_versions()
| Package | Version |
| --------------------- | ------- |
| Python | 3.11.0 |
| networkx | 2.8.8 |
| numpy | 1.26.2 |
| sympy | 1.12 |
| fire-opal | 6.7.0 |
| qctrl-workflow-client | 2.2.0 |