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.

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.

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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.9.0rc2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (12.8 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.9.0rc2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (12.8 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.9.0rc2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (12.8 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.7 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.6 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.9.0rc2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (12.8 MB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)macOS 10.9+ x86-64macOS 11.0+ ARM64

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4d607193e18a484e8acf61e2d9a713bfa637209624ecb6e7f0b70f09a15fb7d
MD5 97306def806d2d707f43e54a60a48668
BLAKE2b-256 4f0c0a859370c30713ae8f173af6d5165c87d37b7b9035bd2e12599fcd42edfe

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 96edef63bfc24b0eddb6465367e6aeb8afbe59c72dedc79f903874f13c8b8d2c
MD5 4f9b04af362544790c39668171f56c88
BLAKE2b-256 5feadbdc952b520b9cea3cc97b4ed3e7b236adf9300ca3fb015e6ceb29b9b18b

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9995eb7468f6b239df2e8bfd1c07ec97c688a2343d13c49103b798e3bd9ed01f
MD5 f33a85616167c2d68219d615ba01a1a5
BLAKE2b-256 ef29d280ee08069fdb89cecd371971b1ca76dfafb0bab727490a6e96e80f031f

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4ba5ea8f8e29346c52f3ed83dc3b9dc9fba7529a201128c4a2a09f9d92c1a86c
MD5 8c2d8af7a00e67b5c16e813975f4632d
BLAKE2b-256 121613b30143f0a08b24eac473f1986b8db9a10e47787b90fb3b70abfbd5c332

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 dbcbefa90c57ef5d8e64395ff987a59ae486ed059a26324a6585dfc486ce0ef2
MD5 58ce664cf9dfa6bb0d5e8f3886d976c5
BLAKE2b-256 aaaf0edcb7af1a07e29247fca61f33ca8c90315a261880e938fbd5eb669d64fc

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 666c43ac570f10f47d516dc43fb0d6c6a75ba62cd6b452c7fda0f2fd937c3c7e
MD5 d52bfe761c996012658fc002a4bd3cc8
BLAKE2b-256 b6d5e66f333926e8816d31ea2996e4a435b3e25c69f45195f52a38d18f1d69b0

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0a18ae79d52b53f27d9e183cb321119c9b9d22b616626c63ce14966d20fc61ae
MD5 e7d296db6a57a40639e5cfae73dfc4d2
BLAKE2b-256 804cf09cd1539e60e6afc9938c4a443fa0c724eba2a238997c8f1a32b159bfe4

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 42955fa5eef4f29e7ee80c4e1f5a46a77521bec5ee10e3ba86f1af65b8a180fb
MD5 c1bc8ecdbcb211fc26b8c6d3e1e856ee
BLAKE2b-256 e283dadbf37d99bb9cae73e49103a7770c0c567db64a93c88f9e33063e12e85a

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 286063680a5394f93a5bbf71551ea0a10e9de25c3fe76576cf46627e32ab24ba
MD5 c7d6f24de1e7bd45e3c16d05de2fe19f
BLAKE2b-256 8b50fef858d8dcf5ca976a8b317f8f7770d9995c2abc2675017a8670f2bc193c

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c1ead81b64cd679fec011f957fc401138a5a634bdac59d1339b74baa078773f3
MD5 766e5862e2253c16d22c786dcfa2c5b8
BLAKE2b-256 947a9e17722a8968e83a952ae28f1b03b740fe6156eef3ec8a627594a8c11df0

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f5dacdb358fd338e8d9a68017d16f9268e7590834c30882acdf3086b94518182
MD5 14eeeaae4ac8243f1500562711c95a42
BLAKE2b-256 4dbbb8de5caae212ea03a8685c790201ae93ca76323db679e7c0caa2437dede5

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.9.0rc2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.9.0rc2-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 24db060b918af08cd1d6743e6aacee84db8cad4ea59dc20f02296d312ff78e2f
MD5 35d1e0c3df8ac23f62cd2305c2c0db5d
BLAKE2b-256 afb509dfef50e52bc747056935da92353e6b2ba0d0db6a511b0dc1415eedaad5

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