This repo provides two crates:
qcswhich is the Rust SDK for executing quantum programs on Rigetti QPUs; andqcs-sdk-pythonwhich defines, generates, and publishes the Python bindgins to make use of the Rust SDK.
This crate is documented primarily via rustdoc comments and examples, which are available on docs.rs.
Most development tasks are automated with cargo-make (like make, but you can have dependencies on other Rust tools and a ton of useful tasks are built in). Install cargo-make by doing cargo install cargo-make. Then you can invoke it with either cargo make <task> or makers <task>. Tasks are defined in files called Makefile.toml.
In order to run all checks exactly the same way that CI does, use makers ci-flow from the project root (workspace).
Commits should follow the conventional commit syntax, with one of the following scopes:
liborrust: changes to the rust SDKpython: changes to the Python bindings- No scope: changes to both crates
Because this library relies on [ØMQ], [cmake] is required:
- macOS [Homebrew] :
brew install cmake - Windows [Chocolatey]:
choco install cmake - Debian:
apt install cmake
The best way to go about this is via makers or cargo make with no task. This will default to dev-test-flow which formats all code, builds, and tests everything.
Any tests which cannot be run in CI should be run with makers manual. These tests require configured QCS credentials with access to internal functions, as well as a connection to the Rigetti VPN.
libquil provides quilc and QVM as a shared library, which can be used by qcs-sdk-rust as an alternative client for those tools.
To use libquil:
-
install the library with libquil's own installer, which
--install-depstells to install the prerequisite packages too:curl -fsSL "https://raw.githubusercontent.com/rigetti/libquil/v${LIBQUIL_VERSION}/scripts/install.sh" \ | sudo bash -s -- --install-deps "${LIBQUIL_VERSION}" -
also install
libclang, which bindgen needs to generatelibquil-sys's bindings. It ships with the Xcode command line tools on macOS; on Debian it islibclang-dev -
enable the feature with
--features libquil
--install-deps uses apt on Linux and Homebrew on macOS, and stops if neither is
present, pointing at libquil's
requirements so you can install them
with your own package manager. libquil publishes no Windows build.
LIBQUIL_VERSION must be at least 0.4.1.
To build against a libquil source tree instead of an installed one, set
LIBQUIL_SRC_PATH to that directory; libquil-sys searches it before the system
locations.
makers lint will lint run all static checks.
To build the docs.rs-style docs, run makers docs. You can also do makers serve-docs to launch a local webserver for viewing immediately.
To release, manually run the Prepare Release workflow in GitHub Actions.
Pre-releases for both the library crate and Python package happen automatically on merge to main.
This repository uses GitHub actions for its CI. If you are making changes to a workflow, consider using our test events to help validate the changes.