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)

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 Distribution

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

qsharp_widgets-1.31.2.dev0-py2.py3-none-any.whl (374.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file qsharp_widgets-1.31.2.dev0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for qsharp_widgets-1.31.2.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6c7cf9ebfcdc67bd5e39fd0264c22a02259c426e7199024697204294733c67e4
MD5 6a0609aab4cea5235b15f96f9215cea0
BLAKE2b-256 679e5a6cd3009bf935d77ecb026a6f7789f2abfa15b84b89f7ee590701dd02a2

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.31.2.dev0 This release

1 file

1.31.0

1 file

1.30.0

1 file

1.29.1

1 file

1.28.0

1 file

1.27.0

1 file

1.26.1

1 file

1.26.0

1 file

1.25.1

1 file

1.25.0

1 file

1.23.0

1 file

1.22.0

1 file

1.21.0

1 file

1.20.0

1 file

1.19.0

1 file

1.18.0

1 file

1.17.0

1 file

1.16.0

1 file

1.15.0

1 file

1.14.0

1 file

1.13.2

1 file

1.13.0

1 file

1.12.1

1 file

1.12.0

1 file

1.11.1

1 file

1.10.1

1 file

1.10.0

1 file

1.9.0

1 file

1.8.0

1 file

1.7.0

1 file

1.6.0

1 file

1.5.0

1 file

1.4.0

1 file

1.3.1

1 file

1.3.0

1 file

1.2.0

1 file

1.1.3

1 file

1.1.1

1 file

1.0.33

1 file

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