Skip to main content

Q# Python Bindings

Project description

Q# Language Support for Python

Q# is an open-source, high-level programming language for developing and running quantum algorithms. The qsharp-lang package for Python provides interoperability with the Q# interpreter, making it easy to simulate Q# programs within Python.

Installation

To install the Q# language package, run:

pip install qsharp-lang

Usage

First, import the qsharp module:

import qsharp

Then, use the %%qsharp cell magic to run Q# directly in Jupyter notebook cells:

%%qsharp

open Microsoft.Quantum.Diagnostics;

@EntryPoint()
operation BellState() : Unit {
    use qs = Qubit[2];
    H(qs[0]);
    CNOT(qs[0], qs[1]);
    DumpMachine();
    ResetAll(qs);
}

BellState()

Support

For more documentation and to browse issues, please visit the Q# project wiki at [https://github.com/microsoft/qsharp/wiki].

Contributing

Q# welcomes your contributions! Visit the Q# GitHub repository at [https://github.com/microsoft/qsharp] to find out more about the project.

Project details


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

qsharp_lang-1.0.5.dev0-cp37-abi3-win_amd64.whl (1.2 MB view details)

Uploaded CPython 3.7+ Windows x86-64

qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ x86-64

qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_aarch64.whl (1.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

qsharp_lang-1.0.5.dev0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (2.5 MB view details)

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

File details

Details for the file qsharp_lang-1.0.5.dev0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.5.dev0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a8448f8ff3b50163a2e461eab300b678fc0baa243501d2cffdac18a5a76f2ce6
MD5 a839c34ac7496f05bb4a01be3db474a4
BLAKE2b-256 ded256775b903bf6bba0226c8117ece66a4ae6143add04f19fbb38989193179e

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c4c4d3652ab62f33a9ce521546f72529bdde7cdbebaa01a788ab0156afa81706
MD5 0f345caf863b892f6fcfdd83cde32e8a
BLAKE2b-256 a204d15065ac62a4db039ac0d942ea9802d4f5b0903b0bcc796c7e3318b92253

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.5.dev0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 552a1b036c2d94de056c4f4062495c929f9450bbc3ab374b4ebf06a90ad6d27a
MD5 c34eb0f8439a792c966a4613fb08942f
BLAKE2b-256 aebf1d40355eb6849bdbfe0711af9c59de65e5c79dfde856bce178016d5a5814

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.5.dev0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.5.dev0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 860a545817afc3e8f27dec0d22c4f08d45634187bfbcd425fd63c3f751ceeed9
MD5 0a675cd38642bbd816d34cf8f94c7505
BLAKE2b-256 521686adebb063023ebf1bec2a58fc7fb32ac348f27dcd7d9e6d0cb7ac2e53b2

See more details on using hashes here.

Supported by

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