How-To: Connect to the IBM Quantum Computers

How Do I Connect to the IBM Quantum Computers?

To run a job on the Mizzou QIC you will first need Premium Access granted to you.  Please see TDX article, "How to Get Access to the Mizzou QIC Quantum Computers".

 

Steps to Connect Your Local Computer to the IBM Quantum Computers

After obtaining access, you will need to do the following:

  1. Install Qiskit SDK and Python. We recommend running Qiskit SDK within a virtual environment and using Jupyter Notebook:
  2. Install Qiskit RuntimeService:
    • In a terminal:

pip install qiskit-ibm-runtime

  • Or in a Jupyter notebook:

!pip install qiskit-ibm-runtime

  1. Sign in to IBM Quantum Platform: 
    • quantum.cloud.ibm.com
    • When logging in, confirm you are accessing the Quantum - Missouri QIC through the drop down in the top right corner:
    • IBM Quantum Platform Logged into Quantum - Missouri
  2. Obtain an API Key:
    • On the Home page, click to Create an API Key:
    • Create an API Key
    • Name the key, then click create.
    • Name Your API Key
    • It is important that you immediately save the API key locally and NEVER share the API key.  Keep it private and be sure to remove it from notebooks before sharing the notebook.
  3. Obtain your Instance’s CRN:
    • Copy the CRN Token to your clipboard by pushing the squares next to the appropriate instance.
    • Copy the CRN Token
  4. In Python/Jupyter Notebook, insert the following ONE of the two following code blocks, editing the highlighted credentials:

import qiskit
from qiskit_ibm_runtime import QiskitRuntimeService
 
QiskitRuntimeService.save_account(
    token="your-api-key",
    instance="CRN",
)

The quotations around the credential tokens are required. 


If you’ve previously connected your API key and CRN, you may need to add the overwrite code. You can include to these other optional codes to give a name or set as default, changing the highlighted portions:

import qiskit
from qiskit_ibm_runtime import QiskitRuntimeService
 

QiskitRuntimeService.save_account(
  token="your-api-key", 
  instance="CRN",
  set_as_default=True, #Optional
  overwrite=True, #Optional
  name=”Account name”, #Optional
)

7. Verify the account saved by running the following two lines of code: 

service=QiskitRuntimeService() 
service.saved_accounts() 

8. Verify the API connection to the IBM quantum computers by running the following two lines of code: 

service=QiskitRuntimeService() 
service.backends() 

If everything ran correctly, you should see the following output (do NOT type this out):

IBM Backend QPU Computers

For Additional Assistance

To learn more visit: https://quantum.cloud.ibm.com/docs/en/guides/install-qiskit-runtime

For additional assistance please e-mail itrss@missouri.edu or open a general quantum support ticket via TDX.