IQM Qiskit - Python Example#
Prerequisites#
Python 3.11 or 3.12
Install the QRMI Python package
Install dependencies#
Assuming your Python virtual environment is located at
~/py311venv_qrmi_primitives/bin/activate:
source ~/py311venv_qrmi_primitives/bin/activate
pip install -r requirements.txt
Set environment variables#
Because QRMI is an environment variable driven software library, all
configuration parameters must be specified in environment variables. The
required environment variables are listed below. This example assumes
that a .env file is available under the current directory.
Common#
When run as a job in a Slurm cluster, these environment variables are set by the SPANK plugin.
Environment variables |
Descriptions |
|---|---|
|
Quantum resource names.
Comma-separated values,
e.g. |
|
Quantum resource types. Specify
|
IQM Server specific#
When run as a job in a Slurm cluster, these environment variables are set by users or administrator.
Environment variables |
Descriptions |
|---|---|
|
IQM Server API endpoint |
|
IQM Server API token |
Note
Replace the “:” in the {qc_alias_name} with “_” when
specifying it. For example, sirius:mock -> sirius_mock.
Example#
export QRMI_JOB_QPU_RESOURCES=garnet_mock
export QRMI_JOB_QPU_TYPES=iqm-server
export garnet_mock_QRMI_IQM_ISA_ENDPOINT=https://resonance.meetiqm.com
export garnet_mock_QRMI_IQM_ISA_TOKEN=your token
How to run this example#
Run iqm_example.py:
python iqm_example.py