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.7.dev0-cp37-abi3-win_amd64.whl (1.3 MB view details)

Uploaded CPython 3.7+ Windows x86-64

qsharp_lang-1.0.7.dev0-cp37-abi3-manylinux_2_31_x86_64.whl (1.3 MB view details)

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

qsharp_lang-1.0.7.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.7.dev0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.7.dev0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 19bb5b28171038240dcb30dfc9165b6a1f281f16d65ca53ed663441a76a59300
MD5 fb4a2cecc6f54f050fd7769718debed6
BLAKE2b-256 54d1addd723582ad13e82ca7005804f5a85eede57d6a549631e40fa6cf2feb12

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.7.dev0-cp37-abi3-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for qsharp_lang-1.0.7.dev0-cp37-abi3-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 1da0b17c694bbb2f0f03ad56085ba8117a1ef823ec2925653b2cb4121c9ccfef
MD5 84647770dae21e8e52a7f43ea7f45d78
BLAKE2b-256 e60dfabc1cfea5174b2f76cb3f01e31bface3dce1ff4fa016a6f8a37d75e92f9

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.7.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.7.dev0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 393656fe584c4b00c22d42efc63e8b4e88e246ef623e9449a7f711236a38cb27
MD5 8420e1a8ee4bc10949dc0ddf0effa1bd
BLAKE2b-256 014ac04acec33e1d14e0a63323a2a9b177f1a2c003ecee956a75a352d3f1603a

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