Skip to main content

QCS SDK Python

⚠️ In Development

qcs-sdk-python provides an interface to Rigetti Quantum Cloud Services (QCS), allowing users to compile and run Quil programs on Rigetti quantum processors. Internally, it is powered by the QCS Rust SDK.

While this package can be used directly, pyQuil offers more functionality and a higher-level interface for building and executing Quil programs. This package is still in early development and breaking changes should be expected between minor versions.

Documentation

Documentation for the current release of qcs_sdk is published here. Every version of qcs_sdk ships with type stubs that can provide type hints and documentation to Python tooling and editors.

Troubleshooting

Enabling Debug logging

This package integrates with Python's logging facility through a Rust crate called pyo3_log. The quickest way to get started is to just enable debug logging:

import logging
logging.basicConfig(level=logging.DEBUG)

Because this is implemented with Rust, there are some important differences in regards to log levels and filtering.

The TRACE log level

Rust has a TRACE log level that doesn't exist in Python. It is less severe than DEBUG and is set to a value of 5. While the DEBUG level is recommended for troubleshooting, you can choose to target TRACE level logs and below like so:

import logging
logging.basicConfig(level=5)

Runtime Configuration and Caching

pyo3_log caches loggers and their level filters to improve performance. This means that logger re-configuration done at runtime may cause unexpected logging behavior in certain situations. If this is a concern, this section of the pyo3_log documentation goes into more detail.

These caches can be reset using the following:

qcs_sdk.reset_logging()

This will allow the logging handlers to pick up the most recently-applied configuration from the Python side.

Filtering Logs

Because the logs are emitted from a Rust library, the logger names will correspond to the fully qualified path of the Rust module in the library where the log occurred. These fully qualified paths all have their own logger, and have to be configured individually.

For example, say you wanted to disable the following log:

DEBUG:hyper.proto.h1.io:flushed 124 bytes

You could get the logger for hyper.proto.h1.io and disable it like so:

logging.getLogger("hyper.proto.h1.io").disabled = True

This can become cumbersome, since there are a handful of libraries all logging from a handful of modules that you may not be concerned with. A less cumbersome, but more heavy handed approach is to apply a filter to all logging handlers at runtime. For example, if you only cared about logs from a qcs library, you could setup a log filter like so:

class QCSLogFilter(logging.Filter):
    def filter(self, record) -> bool:
        return "qcs" in record.name

for handler in logging.root.handlers:
    handler.addFilter(QCSLogFilter())

This applies to all logs, so you may want to tune the filter method to include other logs you care about. See the caching section above for important information about the application of these filters.

OpenTelemetry Integration

This package supports collection of OpenTelemetry trace data. Clients may configure any OpenTelemetry collector that supports the OTLP Specification. Rigetti will not have access to the OpenTelemetry data you collect.

To enable the integration, you should install the qcs-sdk[tracing-opentelemetry] extra; this installs opentelemetry-api. By default, no tracing data is collected at runtime. Because the QCS-SDK is built as a pyo3 Rust extension-module, you will need to use pyo3-tracing-subscriber to configure collection of your client network requests. See qcs_sdk._tracing_subscriber module level documentation for more detail.

import my_module
from qcs_sdk._tracing_subscriber import (
    GlobalTracingConfig,
    SimpleConfig,
    Tracing,
    subscriber,
)
from qcs_sdk._tracing_subscriber.layers import otel_otlp


def main():
    tracing_configuration = GlobalTracingConfig(
        export_process=SimpleConfig(
            subscriber=subscriber.Config(
                # By default this supports the standard OTLP environment variables.
                # See https://opentelemetry.io/docs/specs/otel/protocol/exporter/
                layer=otel_otlp.Config()
            )
        )
    )
    with Tracing(config=config):
        result = my_module.example_function()
        my_module.other_example_function(result)

if __name__ == '__main__':
    main()

Metadata

Release files for qcs-sdk-python 0.31.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for qcs-sdk-python 0.31.2
File Actions
qcs_sdk_python-0.31.2-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for qcs_sdk_python-0.31.2-cp312-cp312-macosx_11_0_arm64.whl
qcs_sdk_python-0.31.2-cp312-cp312-macosx_10_12_x86_64.whl CPython 3.12 CPython 3.12 macOS 10.12+ x86-64 Details for qcs_sdk_python-0.31.2-cp312-cp312-macosx_10_12_x86_64.whl
qcs_sdk_python-0.31.2-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for qcs_sdk_python-0.31.2-cp311-cp311-win_amd64.whl
qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64 Details for qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_x86_64.whl
qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_aarch64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ ARM64 Details for qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_aarch64.whl
qcs_sdk_python-0.31.2-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for qcs_sdk_python-0.31.2-cp311-cp311-macosx_11_0_arm64.whl
qcs_sdk_python-0.31.2-cp311-cp311-macosx_10_12_x86_64.whl CPython 3.11 CPython 3.11 macOS 10.12+ x86-64 Details for qcs_sdk_python-0.31.2-cp311-cp311-macosx_10_12_x86_64.whl
qcs_sdk_python-0.31.2-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details for qcs_sdk_python-0.31.2-cp310-cp310-win_amd64.whl
qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64 Details for qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_x86_64.whl
qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_aarch64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ ARM64 Details for qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_aarch64.whl
qcs_sdk_python-0.31.2-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for qcs_sdk_python-0.31.2-cp310-cp310-macosx_11_0_arm64.whl
qcs_sdk_python-0.31.2-cp310-cp310-macosx_10_12_x86_64.whl CPython 3.10 CPython 3.10 macOS 10.12+ x86-64 Details for qcs_sdk_python-0.31.2-cp310-cp310-macosx_10_12_x86_64.whl

Total release size: 102.3 MB

Release files / qcs_sdk_python-0.31.2-cp312-cp312-macosx_11_0_arm64.whl

Download URL qcs_sdk_python-0.31.2-cp312-cp312-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d7851010b9a32d34b3e4eda6318599e15ffa0178a3cd43e12ce1a1c3771bcf1a
BLAKE2b-256 checksum
How to use checksums
d6b012e014ba7b29a8387a9fce5c2909b3e5ee28c6d83eac335e15bcec628e56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp312-cp312-macosx_10_12_x86_64.whl

Download URL qcs_sdk_python-0.31.2-cp312-cp312-macosx_10_12_x86_64.whl
Size 8.5 MB
Tags CPython 3.12 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7415446010d17b694165945d048c6e93aa3193edbba5a62203a90547ab71d2a3
BLAKE2b-256 checksum
How to use checksums
88e543bade12508fbf0bafceb7fa269826fe5225b9473b188de198ab2f7d7cab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp311-cp311-win_amd64.whl

Download URL qcs_sdk_python-0.31.2-cp311-cp311-win_amd64.whl
Size 9.2 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
6da3042d36092ab049c66a546bca858db81727d2085375ebcb7e44937d8e4838
BLAKE2b-256 checksum
How to use checksums
b78ecf063281815778a17ad03e99aedfbea03e5b45fb41f11adc4a7b2dc4ba9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_x86_64.whl

Download URL qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_x86_64.whl
Size 8.9 MB
Tags CPython 3.11 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
89dfcada103fe50ff24c23070accda1b4759ac2a3def45b330d36b7a5b273fe7
BLAKE2b-256 checksum
How to use checksums
f7e14c40598f802f9a6ee47745cc376242d347c5a8b49cce41afeff2abe0d32f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_aarch64.whl

Download URL qcs_sdk_python-0.31.2-cp311-cp311-manylinux_2_28_aarch64.whl
Size 8.4 MB
Tags CPython 3.11 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
9e296cb75ce601bf6a5efc015e0f9840afe44e132ff6525166beeb9bf20a877d
BLAKE2b-256 checksum
How to use checksums
8622edb30470aad47bc4269aa9511e050b0283daa0b00f2b2a515af0ffb15980
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp311-cp311-macosx_11_0_arm64.whl

Download URL qcs_sdk_python-0.31.2-cp311-cp311-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3d8e96365add4dd8e9b713291afe69eac77c824ce8e4e9cfd5b1545532e14486
BLAKE2b-256 checksum
How to use checksums
f4c6cac5313f647f85f58ad37accee8740924dd140f4edcce40a232efac34c44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp311-cp311-macosx_10_12_x86_64.whl

Download URL qcs_sdk_python-0.31.2-cp311-cp311-macosx_10_12_x86_64.whl
Size 8.5 MB
Tags CPython 3.11 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0c433e5393539f3d58bd23f8d654d87898aa2996f4ee497c6fbf049025fd0b7a
BLAKE2b-256 checksum
How to use checksums
cb014ead94e44598709c890c43c040ecc4a683699f6a212cd14d176fc949d3c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp310-cp310-win_amd64.whl

Download URL qcs_sdk_python-0.31.2-cp310-cp310-win_amd64.whl
Size 9.2 MB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
586da370c30dc44d2233caf9f97acd9e65b97b5ec47ea3c625606ad8ecb0391e
BLAKE2b-256 checksum
How to use checksums
328d307212411ccc1002d12e2f0e62c94e3a18b37ff8addb0f40ecb899bc5671
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_x86_64.whl

Download URL qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_x86_64.whl
Size 8.9 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
719bbc2b0bcb8a1f64f678d6ebdea82f965e7be757b8ae30701e6a60835012e8
BLAKE2b-256 checksum
How to use checksums
46689b4bceb0f010b4c3214e7a711e523510ebf094baf1bb0723a18d7970a5aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_aarch64.whl

Download URL qcs_sdk_python-0.31.2-cp310-cp310-manylinux_2_28_aarch64.whl
Size 8.4 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64
SHA-256 checksum
How to use checksums
8c90446af08f7c99854aca6572dc984e7c16f32448674754fe529c97ef0134e8
BLAKE2b-256 checksum
How to use checksums
805c874cbaa4eabb6b111c9e24145f870d31e2247b0a1637d6739199d21695ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp310-cp310-macosx_11_0_arm64.whl

Download URL qcs_sdk_python-0.31.2-cp310-cp310-macosx_11_0_arm64.whl
Size 8.0 MB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
01017f47c36ae64492acf31c0185be1ff6928ce251ec04ea743e9341baf1220e
BLAKE2b-256 checksum
How to use checksums
8ee1dbec1e3f68a534fffbec70cebb4a89ce307d60ce4e9475a6b2e00b4a386f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Release files / qcs_sdk_python-0.31.2-cp310-cp310-macosx_10_12_x86_64.whl

Download URL qcs_sdk_python-0.31.2-cp310-cp310-macosx_10_12_x86_64.whl
Size 8.5 MB
Tags CPython 3.10 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
fcb6b00bd9c6e6085853e659ded25f909b642f6b60a9080f914c968274b731b1
BLAKE2b-256 checksum
How to use checksums
23c7c4efd6f1ae498292bba3c1bb61d708b722aa02ccd420db47d6456862b9bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via maturin/1.9.4

Security for qcs-sdk-python 0.31.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.31.2 This release

12 release files No provenance

0.6.0rc4

0.6.0rc3

0.6.0rc2

0.6.0rc0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page