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

Uploaded CPython 3.7+ Windows x86-64

qsharp_lang-1.0.11.dev0-cp37-abi3-manylinux_2_31_x86_64.whl (1.4 MB view details)

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

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

File metadata

File hashes

Hashes for qsharp_lang-1.0.11.dev0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f89a5c11bdde63273b3eac93fff6d4fa94b3555a5171a8b62771da277a5a2da8
MD5 0d78a3bffffed0bd4e75dd41c9d37e28
BLAKE2b-256 18c28840728ae702ec8928ba9a1cb9f7605c9f0aa6632de33fad566a85be5725

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for qsharp_lang-1.0.11.dev0-cp37-abi3-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 82d732497cb7bf60843047fd2ded472f4eccd53a028be3a51c581df8b06922a1
MD5 8e8bee67559cbf5ad2fe98fd29701740
BLAKE2b-256 68588e619a917457e92626c61efaee3aaf0711cad7d5d7c7c373452f074d1af6

See more details on using hashes here.

File details

Details for the file qsharp_lang-1.0.11.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.11.dev0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 838480748669c7a516c3fec9cc00f4acb5843bd946d0dae65c530e31cf480e6f
MD5 46bd20566cba12fd4838560976fe73ea
BLAKE2b-256 c6287c4000790e394cab7cb893dee467795d996f471d65902b37b3402a0512af

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