Skip to main content

Microsoft Quantum Development Kit backend for PennyLane

Project description


Contains the PennyLane Q# plugin. This plugin allows the full state simulator from the Microsoft Quantum Development Toolkit devices to work with PennyLane.

The Microsoft Quantum Development Kit is an open-source library for quantum programming using the .NET Q# quantum programming language. Resulting quantum programs can be executed using built in local simulators, or via the cloud-based Azure quantum simulator.

PennyLane is a machine learning library for optimization and automatic differentiation of hybrid quantum-classical computations.


  • Provides a Microsoft QDK device to be used with PennyLane: microsoft.QuantumSimulator. This provides access to the local full state simulator.
  • All provided devices support all core qubit PennyLane operations and observables.
  • Provides custom PennyLane operations to cover additional Q# operations, including T, S, ISWAP, CCNOT, PSWAP, and many more. Every custom operation supports analytic differentiation.
  • Combine Microsoft Azure quantum simulators with PennyLane’s automatic differentiation and optimization.


PennyLane-qsharp requires both PennyLane and the Microsoft Quantum Development Kit. To install the Microsoft QDK and IQ#, see the intruction details provided by Microsoft.

Once the QDK is installed, you can install PennyLane-qsharp via pip:

$ python -m pip install pennylane-qsharp

Getting started

Once the PennyLane Q# plugin is installed, the provided QDK devices can be accessed straight away in PennyLane.

You can instantiate provided devices for PennyLane as follows:

import pennylane as qml
dev = qml.device('microsoft.QuantumSimulator', wires=2, shots=1000)

These devices can then be used just like other devices for the definition and evaluation of QNodes within PennyLane. For more details, refer to the PennyLane documentation.


We welcome contributions - simply fork the PennyLane-qsharp repository, and then make a pull request containing your contribution.

All contributers to PennyLane-qsharp will be listed as authors on the releases.

We also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built on PennyLane and the Microsoft QDK.


Josh Izaac


If you are having issues, please let us know by posting the issue on our Github issue tracker.


PennyLane-qsharp is free and open source, released under the Apache License, Version 2.0.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for PennyLane-qsharp, version 0.8.0
Filename, size File type Python version Upload date Hashes
Filename, size PennyLane_qsharp-0.8.0-py3-none-any.whl (14.8 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size PennyLane-qsharp-0.8.0.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page