Configure IBM Qiskit Runtime Environment

Overview

The following is an example of configuring your IBM Runtime environment.  You will fist need to be invited to RPI's Cloud Account, by opening a request at quantum.rpi.edu.

 

Details

from qiskit_ibm_runtime import QiskitRuntimeService

# Save an IBM Quantum account and set it as your default account.
# The CRN and API Token are copied from your quantum.cloud.ibm.com account
#
QiskitRuntimeService.save_account(
channel="ibm_cloud",
# Replace everything between "" with the IBM Cloud Resource Name (CRN).
instance="<CRN>",
# Replace everything between "" with your API Token
token="<API TOKEN>",
set_as_default=True,
overwrite=True,
)

#To use the saved runtime, start your programs with:

service = QiskitRuntimeService()
backend = service.backend("ibm_rensselaer")

# Saved Runtimes can also be named

QiskitRuntimeService.save_account(
name="CS102",
channel="ibm_cloud",
instance="<CRN for class account>",
# Replace everything between "" with your API Token
token="<API TOKEN>",
set_as_default=True,
overwrite=True,
)

service = QiskitRuntimeService(name="CS102")
backend = service.backend("ibm_rensselaer")

# To see the list of saved accounts:

service.saved_accounts()