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.12.2rc0-cp311-none-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.11Windows x86-64

qcs_sdk_python-0.12.2rc0-cp311-none-win32.whl (5.3 MB view details)

Uploaded CPython 3.11Windows x86

qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.12.2rc0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (13.2 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.12.2rc0-cp310-none-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.10Windows x86-64

qcs_sdk_python-0.12.2rc0-cp310-none-win32.whl (5.3 MB view details)

Uploaded CPython 3.10Windows x86

qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.12.2rc0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (13.2 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.12.2rc0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (13.2 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.12.2rc0-cp38-none-win_amd64.whl (5.9 MB view details)

Uploaded CPython 3.8Windows x86-64

qcs_sdk_python-0.12.2rc0-cp38-none-win32.whl (5.4 MB view details)

Uploaded CPython 3.8Windows x86

qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ ARM64

qcs_sdk_python-0.12.2rc0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (13.2 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.12.2rc0-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 36b5091f189a984202d91d06eeccb70d530af051231b1c206b926687d622866f
MD5 22280e1958f23c99156bd4b2f2529ce5
BLAKE2b-256 8c2d256e71961ac9ca5e10eeab6db0453682acb7afd4b2be12781d6a8a26673e

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp311-none-win32.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp311-none-win32.whl
Algorithm Hash digest
SHA256 32871390abeab62026f52567dbd5ba7b05156ebf258962ba75acda18fb64de5f
MD5 7a6530b7fdb06129a62cf6d5c1fdd46f
BLAKE2b-256 758215e43257880dd9caca978f2de6fd64515df944a6e5ed01d2a1fedbae25e0

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca2aac5fb966c6caf922f517b8fa00f66109226dcc47d3831d0271ca3d370089
MD5 2dbf484fc3e405d5f4f4af12acbfba15
BLAKE2b-256 8e80ba189f17d4481c44937238aef75fc17ec9125948126d8800ba654941f44d

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ce94ce8ea047e44b74d8a237275961812d91fbeb5cb1bde2b6ad5ca7119356b5
MD5 0a3995173f7e266c00b3234bf6e3bfd3
BLAKE2b-256 b503c41c9b081062b7abd0507a8992acf7742cce2345c41a23c83215e770da5b

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-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.12.2rc0-cp311-cp311-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 caaa30847f859ba1c55813fce814e75a860dae78e567dd4a5104461e4daacce9
MD5 0fb889509605ad4f6654be002735b6bb
BLAKE2b-256 987d8167259434be2b352a3dbb6677d8519aabb2535d3b93c1dfb2bddccf0547

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 3090c40dd9d95cb072fab34b449ec7515a2398c692c68a77e94124856cdb9758
MD5 d9ed680edf3d52755258c229efe53218
BLAKE2b-256 98d21679ed811af4b03942f9ea0d9f62f6afb5cf826b4c11980b153aa35bb780

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp310-none-win32.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp310-none-win32.whl
Algorithm Hash digest
SHA256 77e0154e32db4961c7ea976c32ba62082c0a058e277d56755428f840b707502f
MD5 b77c911a41359a8e677e3d6ab2f5549d
BLAKE2b-256 696319adad06e689ebee774f3a4edfefdeb153c33ee2b9819a476cb556cd25fb

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64e883a44c4ac3ca8796262ff8b5ff1add4692f0bbc559933af06d7bc3369798
MD5 10932b9dd7db14ae7cc9410766c3f013
BLAKE2b-256 040f488f93bb32fb5ee941726f5ad19fc2272d156009f292f7fc0646db995aa6

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c8af3a064464dc7c093229aae91ded0d11f36a78bc481f66a0764b911b9a99b2
MD5 b6371c2359ffc918d6c6e88353fc3bf5
BLAKE2b-256 1d5b75f972d70e536560c480f6374fdbe191f3820fc6612b66f10596bb2797b6

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-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.12.2rc0-cp310-cp310-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 b8a0163160aa866ecb01167d0153281bd70b5c31504fb78546563c19ffcd6239
MD5 9c251ff7bd1cfe68bcf241b353416332
BLAKE2b-256 6598f461d4717c46dc675f4f309d0aa73a44b2e059f70c42191c8672f00af835

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-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.12.2rc0-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1d033316029f2d61a66854b7efaef958024d761837b05b5e85c87472d88098e7
MD5 d85650cdd7f398383e0732fd2a47dc35
BLAKE2b-256 937d4b39bbcd748a0f918faec111baf8c648ad0478757e6db3e367bfd074ca12

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 c7746d0d53bcf80e2ad7a9c33294283567c42ec7803a0441f2ff7def26d975ea
MD5 987b4ebf4900dad72f6b5eee1c7c7ab0
BLAKE2b-256 b60c660c0aff7e5ecee39535802ba6b62ad8dd1a4749aec7a81d46e4fc1a1396

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp38-none-win32.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp38-none-win32.whl
Algorithm Hash digest
SHA256 9f12bafba73d3d660610c7e8f28dfca87b5ca2ecfa97bec4f8ef15ac4bf530fe
MD5 f863657f18c5cbd21912bffd64650db1
BLAKE2b-256 feec0e65600c0bf089d850f628bcbc5a9ce22462477fcafde92fb4b878b43e72

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 35e4456a2348fef5392d45f5b1c2e6fffba69452e170621cb6866b3f89053d29
MD5 4ea8c15d791b925765752bec8ad2264f
BLAKE2b-256 21b477e8343897251f79b6757014a1f92a960ceca380704b970ffad8001c608e

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for qcs_sdk_python-0.12.2rc0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 fba492b328ca0adf9fb5bd4341daa9d83de404d13d5c911727475497018420f1
MD5 6f668b76cb507a8115e661a60c822a6a
BLAKE2b-256 997dc6936d8141b0e60f63723145ea623c51db22e2d5cb9efe7b157e4c5549ac

See more details on using hashes here.

File details

Details for the file qcs_sdk_python-0.12.2rc0-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.12.2rc0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0cc2ebbec6c35f36c18cf0dbeb840eb035e38bdc2910de1747d0bb004e75cf1f
MD5 697398cadb88b09e6a20290e03086512
BLAKE2b-256 50f40d2d431d85c41580f47aed856db5405281e4c66eec28b15cbf0311a528b1

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