Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Q# widgets

The Q# widgets are Jupyter Widgets built using the AnyWidget package https://anywidget.dev/

Build with ./build.py --widgets.

Install the built wheel via

pip install --force-reinstall ./target/wheels/qsharp_widgets-0.0.0-py2.py3-none-any.whl

For development, perform an 'editable' install with pip install -e ./widgets in the venv used for testing. Any changes made to the package are then immediately reflected.

If developing the web code (JS and CSS), then in the test environment also install pip install watchfiles, and in the ./widgets directory run npm run dev to build in watch mode. This will use AnyWidget's hot module reloading to automatically update the Python package as changes are made. (See https://anywidget.dev/blog/anywidget-02/).

With the above done, use the Q# widgets in you Python test environment via import qsharp_widgets.

Usage

In a notebook, generate the estimates for a program and display the widgets with code such as that shown below:

# Cell-1 : Import the modules and generate some estimates
from qdk import qsharp
from qdk.widgets import SpaceChart, EstimateDetails

with open("sample.qs", "r") as f:
    contents = f.read()
qsharp.eval(contents)
result1 = qsharp.estimate("Sample.Main()")

# Cell-2 : Display the details in table form
EstimateDetails(result1)

# Cell-3 : Display the space chart
SpaceChart(result1)

# Cell-4 : Use the logical counts to get estimates for a different qubit
result2 = qsharp.physical_estimates_from_logical_counts(
    result1.get("logicalCounts"),
    {
        "qubitParams": { "name": "qubit_maj_ns_e6" },
        "qecScheme": { "name": "floquet_code" }
    }
)
SpaceChart(result2)

Metadata

Release files for qsharp-widgets 1.33.2.dev0

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

Built distribution (wheel)

Table of built distributions (wheels) for qsharp-widgets 1.33.2.dev0
File Interpreter ABI Platform Actions
qsharp_widgets-1.33.2.dev0-py2.py3-none-any.whl Python 2, Python 3 none any Details for qsharp_widgets-1.33.2.dev0-py2.py3-none-any.whl

Release files / qsharp_widgets-1.33.2.dev0-py2.py3-none-any.whl

Download URL qsharp_widgets-1.33.2.dev0-py2.py3-none-any.whl
Size 905.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
a6dd58b33570da4a1e35ed8fb3cf37917135e4f8b30e4225d4abaa14b71161e5
BLAKE2b-256 checksum
How to use checksums
4cc426122072c47f1c33516c9f8101c7f2e6de8bfc5286fa1e69644938903c1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via RestSharp/106.13.0.0

Security for qsharp-widgets 1.33.2.dev0

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