Skip to content

Qiskit

Quantum Computing Library


Qiskit is a software development kit for creating quantum circuits and running them on simulators and/or quantum devices. In addition, it includes libraries for problem mapping, results post-processing, error correction, and more. Most workloads and packages on Qiskit use Python. However, the Qiskit C API allows you to submit code in C & C++ for increased performance for large HPC and optimized workflows.

To run Qiskit, you must install it in a Conda or uv environment. Instructions for both are provided below.

Running Qiskit in UV#

The following commands describe the installation for Qiskit using uv:

1
2
3
4
5
6
7
8
9
$ conda deactivate # Deactivate existing conda environment
$ module load webproxy # Enable Internet access
$ module load python-uv # Load the uv module
$ uv venv ~/quantum  # Name of your environment (can be anything)
$ source ~/quantum/bin/activate # Activate the environment

# Install your packages
$ uv pip install qiskit
$ uv pip install qiskit-ibm-runtime

Running Qiskit in a Conda environment#

The following commands describe the installation in a Conda environment:

1
2
3
4
5
6
7
$ module load anaconda # Load the conda module
$ conda create -n quantum  # Name of your environment (can be anything)
$ conda activate quantum # Activate the environment

# Install your packages
$ conda install conda-forge::qiskit-ibm-runtime
$ conda install conda-forge::qiskit

IBM Quantum Cloud job submission#

If you want to submit jobs to real quantum devices on IBM Quantum Cloud or other quantum hardware providers, load the webproxy module so your job can access the Internet, submit your quantum circuits, and extract the results.

Use the following example script as a starting point:

#!/bin/bash
#SBATCH -J qiskit-job
#SBATCH -t 00:30:00
#SBATCH -A genacc_q
#SBATCH -n 1

module load webproxy

# Load your environment (include ONLY one of the following options)

# Option 1 - uv environment
source ~/quantum/bin/activate

# Option 2- conda environment
module load anaconda
source activate ~/.conda/envs/quantum

# Run your Python file 
python3 code.py 

Note

You must load your IBM credentials inside the file code.py. For instructions on how to configure your IBM Quantum account and how to save your credentials, refer to the official documentation: