Quantum System QRMI - Examples in C#
Prerequisites#
C compiler/linker, cmake and make
Build the QRMI Rust library
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.
Environment variables |
Descriptions |
|---|---|
|
Quantum System endpoint URL |
|
IBM Cloud IAM endpoint
URL (e.g. |
|
IBM Cloud IAM API Key |
|
Cloud Resource Name (CRN) of the
provisioned Quantum System
instance, starting with
|
|
AWS Access Key ID to access S3 bucket |
|
AWS Secret Access Key to access S3 bucket |
|
S3 endpoint URL |
|
S3 bucket name |
|
S3 bucket region
name (e.g. |
|
Time (in seconds) after which job should time out and get cancelled. It is based on system execution time (not wall clock time). System execution time is the amount of time that the system is dedicated to processing your job. |
Create Qiskit Primitive input file as input#
Refer to this tool to generate. You can customise quantum circuits by editing the code.
Note
Use the file with name ending _params_only.json,
e.g. sampler_input_ibm_torino_params_only.json.
How to build this example#
mkdir build
cd build
cmake ..
make
How to run this example#
./build/quantum_system
quantum_system <backend_name> <primitive input file> <program id>
For example:
export test_eagle_QRMI_IBM_QS_ENDPOINT=http://localhost:8080
export test_eagle_QRMI_IBM_QS_IAM_ENDPOINT=https://iam.cloud.ibm.com
export test_eagle_QRMI_IBM_QS_IAM_APIKEY=your_apikey
export test_eagle_QRMI_IBM_QS_SERVICE_CRN=your_instance
export test_eagle_QRMI_IBM_QS_AWS_ACCESS_KEY_ID=your_aws_access_key_id
export test_eagle_QRMI_IBM_QS_AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
export test_eagle_QRMI_IBM_QS_S3_ENDPOINT=https://s3.us-east.cloud-object-storage.appdomain.cloud
export test_eagle_QRMI_IBM_QS_S3_BUCKET=test
export test_eagle_QRMI_IBM_QS_S3_REGION=us-east
export test_eagle_QRMI_JOB_TIMEOUT_SECONDS=86400
./build/quantum_system test_eagle sampler_input.json sampler