Pasqal Local QRMI - Examples in Rust#
Prerequisites#
Python 3.11 or 3.12
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 |
|---|---|
|
URL of the QPU middleware
(e.g. |
|
ID of the user executing the job |
|
ID of the job |
Where <backend_name> is the backend name passed via --backend
(e.g. PASQAL_LOCAL).
Create Pulser Sequence file as input#
Given a Pulser sequence sequence, we can convert it to a JSON string
and write it to a file like this:
1serialized_sequence = sequence.to_abstract_repr()
2
3with open("pulser_seq.json", "w") as f:
4 f.write(serialized_sequence)
How to build this example#
cargo clean
cargo build --release --features=qrmi/munge
How to run this example#
../target/release/qrmi-example-pasqal-local --help
QRMI for Pasqal Local - Example
Usage: qrmi-example-pasqal-local --backend <BACKEND> --input <INPUT>
Options:
-b, --backend <BACKEND> backend name (device identifier)
-i, --input <INPUT> sequence input file
-h, --help Print help
-V, --version Print version
For example:
../target/release/qrmi-example-pasqal-local -b PASQAL_LOCAL -i input.json