Skip to main content

Python interface for the QCS Rust SDK

Project description

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()

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qcs_sdk_python-0.21.22.tar.gz (557.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

qcs_sdk_python-0.21.22-cp312-cp312-win_amd64.whl (7.0 MB view details)

Uploaded CPython 3.12Windows x86-64

qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

qcs_sdk_python-0.21.22-cp312-cp312-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

qcs_sdk_python-0.21.22-cp312-cp312-macosx_10_12_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

qcs_sdk_python-0.21.22-cp311-cp311-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.11Windows x86-64

qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

qcs_sdk_python-0.21.22-cp311-cp311-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

qcs_sdk_python-0.21.22-cp311-cp311-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

qcs_sdk_python-0.21.22-cp310-cp310-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.10Windows x86-64

qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

qcs_sdk_python-0.21.22-cp310-cp310-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

qcs_sdk_python-0.21.22-cp310-cp310-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

qcs_sdk_python-0.21.22-cp39-cp39-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.9Windows x86-64

qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

qcs_sdk_python-0.21.22-cp39-cp39-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

qcs_sdk_python-0.21.22-cp39-cp39-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

qcs_sdk_python-0.21.22-cp38-cp38-win_amd64.whl (6.9 MB view details)

Uploaded CPython 3.8Windows x86-64

qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_x86_64.whl (6.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_aarch64.whl (6.2 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ ARM64

qcs_sdk_python-0.21.22-cp38-cp38-macosx_11_0_arm64.whl (5.9 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

qcs_sdk_python-0.21.22-cp38-cp38-macosx_10_12_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.8macOS 10.12+ x86-64

File details

Details for the file qcs_sdk_python-0.21.22.tar.gz.

File metadata

  • Download URL: qcs_sdk_python-0.21.22.tar.gz
  • Upload date:
  • Size: 557.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.8.2

File hashes

Hashes for qcs_sdk_python-0.21.22.tar.gz
Algorithm Hash digest
SHA256 cdedde65abe084f2aa049cbf214dbe45a0f35505147a26f3c9373b598c2ea918
MD5 d28710cd3b21f3ff53c06c27b8b7a392
BLAKE2b-256 998491e060d22536f1f4b3be06086108307fc9f1e352cc96f30359ac0c8c880f

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 becdb70a11345a0e13b072b57f5de1630be4495c5972d11d5d5d037500180fdd
MD5 07f1498f22f406775d0bb728cc0c44be
BLAKE2b-256 488810139528f9d29886036051dbea4566d418dc1e5a8b11bc5b231b185a603c

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d8c75597e8b3e87477f48a1554b3a34b8c289133853a2bec5db0c9561e96332c
MD5 8a6cb234d86ae22337444d22dabdd709
BLAKE2b-256 e05da98b6cbf036f244c37af7f9ef8d7aff75c8343e503eecd9995742bad30ea

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e0e55b477d5d053334aede3dd7f1613fb9c547d09d560ae7f43a67cdfe0d09a8
MD5 17d71ccb06ad6f137ac3ddb10f5a908d
BLAKE2b-256 80d7051d37d2de0b618f87b27e16986ca3fe5208df08f3e5c48a1910dd109f42

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 14c1a08550a67570b3965025228489e4400b123593442c677a1d0d8ea0ecb7ed
MD5 72807c4828600bca5ec142c9e74c47e1
BLAKE2b-256 4fade31ed02b86c6c2bc89ff2da64c2fe3117992afeb40b69588205f9d319dbe

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bd3998d7d8a9c09703667e65a72f2994b6e01aeed7f95bf42e828d22d734cdab
MD5 34c904e336ec9b111ab183e07c7fb930
BLAKE2b-256 b8ec0e490173015db25a3080772c44d83f2a4f07585460221ec360e071ce553b

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7a37b473f52bc4006369108e37ccc82357a727566faa7c494859f0a615cc3c4c
MD5 7698bb293b5e21cd842234e81c683a39
BLAKE2b-256 04229d0b13af45044abd9577d2dfe98a50887d49bcb74a008422ef6cc27a733b

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf1a6578b1b4382175f0db25d86e21e13c5b7b229396aceb2f5b264dc8b9b317
MD5 cf01ad5f5c2b24a70d70ca634201586b
BLAKE2b-256 b35514cd82cda804b2da54388218384abda873b827947ad5e8e3b9d90dd11bd2

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1113f957445f1663e5c0431fa1ee1cb6b08ce7574dc519203acb3c39b8a41678
MD5 a7323b418a50f29c6f526dd210582f28
BLAKE2b-256 fab8794ba7434126ad619bdcbdc418e7090e6ed61a728c15f82e920756bbe279

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 121cd94a8e09ce125bcc287efe56555eee350365be719961d05c51a456af4d00
MD5 538d969bc155f480fcd30a005fb6c488
BLAKE2b-256 e1400626e1966af6fb6120fc3ca568ec5f110ad35a56f277eeb5f1258c5721b5

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 35e1aef030083c1b58f4b95ad7da89ab939617da3ad98093d87298dbffea8994
MD5 da094fd13cf24655c18117be5b1a0620
BLAKE2b-256 f3f7cb1f88ff412a5e1aed846430e347b83d90772c451a36a09f15b2dc3c3daa

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 70f385b3329a6ab621a5aac56e02ed836657816edf8a2082ed04fff45b0f5870
MD5 4f94d6587b15d324c2b3a61d788abadf
BLAKE2b-256 663ef8fa40bd22040ddffd62f89ac7e8d1e26a1500a4dbd9287624bc686f9f59

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ca85831da9f25ed837c606b63f9b6ced5cb7b9241bd596451607643766acf158
MD5 46ea407d370b479a3864f31afdb239dc
BLAKE2b-256 9d1b8fa4375eeb8409ab91d02d39235eb7db32cda2d041e97f3a0dd7d30599d0

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 62aafe936bf60f053f2ad2ecef8399eed6e8a7d49e7f2cb19af0c9e308205cc6
MD5 c99772bb2a16f0e49e3ddd41848cba8d
BLAKE2b-256 020ba06b7f0c96b3ba3c147ed31f01075be639ad69da5fe4c93f872e8b8202f7

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6096bda4a7901d58505bbf44603b70a95b00d995ef2ddfd4d445f3ce0c746e37
MD5 c7d6f5e1a21bb730af67e5c5316ce42b
BLAKE2b-256 bae800977fb38c384c4c4e4b0ea7fb31a7279e57c0daa908651bd165be40048a

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2cb91c482b0fa9305f54bed35acfc7e75b62b9826d0686dfe21b2db9e96c2535
MD5 43a73e7ad10b86fe4534f8db624c39e1
BLAKE2b-256 692762399a52db10c65649fa4eeef88d668dbb159148db68dd18d66769bf37c8

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 882fb9600f0993027de7de49128bdd25d579acc2faaf4a6b4d7c09eab2806467
MD5 ff6e89fed0824cfd861f5c00191d696c
BLAKE2b-256 99fdcd799d6fba4ca5f54a69a2965c68a18697a0e15d936a29adf55a60e9ded8

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 353f7a485e40df974d2df19ff30b9b753f466469f611a1e46de9324e8ed90be6
MD5 22c81b13b42c0b5800e918132b566b3c
BLAKE2b-256 1cffbd25a7225aff2936d0ceb07e8abdd0cfa2eab97aa5925d34cf6679f0833a

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ad0ee18426c368a960b519d390fe4ca82cf32c3f7be747d41568e4e9fe298623
MD5 4e16df18fb07c8ae20c7043e0a474fe2
BLAKE2b-256 cc6a5b7d6dfc6172a5652997b24cbf61c493e4b4ef3e31eaca50265e11f83307

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d4f2585756aec307d461d5465eee8fba3fb6636bfe55b48c1876d9ec075522f
MD5 0d4fbaa0991fbc9795e9f7f76417490d
BLAKE2b-256 5a4cc93ec1e393faeefbf9a05dcf88bd76d602cf3de8b542835c8651245695c7

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 133548d3ceaaca71fc93161bb5213b5d843fbb79ff5dfaf2e06eacbd5b79abed
MD5 2b24ff6ce50e6709b897f617941e5fb0
BLAKE2b-256 92e1d0e0292c0dab89ea384f2e11da9f0c5e8d6aa00c18e202b739121add91f6

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 22c1d8692eef9c207a50f4c1a66f8b15e87d56adc6ad07d8a8db3388ceb5c818
MD5 1d9b35ef5cdc741f6736e11852444d90
BLAKE2b-256 2e093e1be866e1d6b15a6f8a4f17f2284c5ed53f2ca620ec6097c3682fe3a06f

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 98a8ebb898d2d2ae84ec1ab960afe91af7b08e744c260930782455dad1da9485
MD5 d390b7a6a61fd0b24dce6fc86f14fba7
BLAKE2b-256 77f1927c0298cdb51731e8a6cc4c4453a14fa3f871777b1f0f3bd9a258994ce5

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp38-cp38-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 54a80a96a3a2f83296aef2766829b9aea4c80eb185e925721711a9dc27873447
MD5 52ffb9e7d4a5127216b9a6fe769c890b
BLAKE2b-256 d5d6c4c810a695276d89130f08d5999ec120476d26b8406bb7853948b4a811b4

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bae9af7b1271ae32fccecca6c3dc2b8239d9b9703cc23567a9177ab5650c2010
MD5 0bd91afb9caa6808d16e188edbcb3788
BLAKE2b-256 bf05b956b22940b4580b490806e86023450c146ebb96a080637b6685045e6904

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.21.22-cp38-cp38-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.21.22-cp38-cp38-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9c37818ca9b511ddbbf80be2ed1c8eb3d0f59f5e3a3e9dc5c4ee017295ca1a80
MD5 2a5516cb72618d205d6413719d8c57dd
BLAKE2b-256 c04527f4d202546ca4cdcd8674c75817a119707797d328a83f527262778ce992

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page