Skip to main content
Travis Codecov coverage Codacy grade Read the Docs PyPI PyPI - Python Version

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

qiskit is an open-source compilation framework capable of targeting various types of hardware and a high-performance quantum computer simulator with emulation capabilities, and various compiler plug-ins.

This PennyLane plugin allows to use both the software and hardware backends of qiskit as devices for PennyLane.

Features

  • Provides two providers to be used with PennyLane: qiskit.aer and qiskit.ibm. These provide access to the respective qiskit backends.

  • Supports a wide range of PennyLane operations and expectation values across the providers.

  • Combine qiskit high performance simulator and hardware backend support with PennyLane’s automatic differentiation and optimization.

Installation

This plugin requires Python version 3.5 and above, as well as PennyLane and qiskit. Installation of this plugin, as well as all dependencies, can be done using pip:

$ python -m pip install pennylane_qiskit

To test that the PennyLane qiskit plugin is working correctly you can run

$ make test

in the source folder. Tests restricted to a specific provider can be run by executing make test-aer or make test-ibm.

Getting started

You can instantiate a 'qiskit.aer' provider for PennyLane with:

import pennylane as qml
dev = qml.device('qiskit.aer', wires=2)

This device can then be used just like other devices for the definition and evaluation of QNodes within PennyLane. A simple quantum function that returns the expectation value of a measurement and depends on three classical input parameters would look like:

@qml.qnode(dev)
def circuit(x, y, z):
    qml.RZ(z, wires=[0])
    qml.RY(y, wires=[0])
    qml.RX(x, wires=[0])
    qml.CNOT(wires=[0, 1])
    return qml.expval.PauliZ(wires=1)

You can then execute the circuit like any other function to get the quantum mechanical expectation value.

circuit(0.2, 0.1, 0.3)

You can also change the default provider’s backend with

dev = qml.device('qiskit.aer', wires=2, backend='unitary_simulator')

To get a current overview what backends are available you can query this by

dev.capabilities()['backend']

Running your code on an IBM Quantum Experience simulator or even a real hardware chip is just as easy. Instead of the provider above, you would instantiate a 'qiskit.ibm' provider by giving your IBM Quantum Experience token:

import pennylane as qml
dev = qml.device('qiskit.ibm', wires=2, ibmqx_token="XXX")

Per default the provider ibm uses the simulator backend, but you can change that to be the real backend as given by

dev.capabilities()['backend']

Please refer to the documentation of the PennyLane qiskit Plugin as well as well as to the documentation of PennyLane for further reference.

How to cite

If you are doing research using PennyLane, please cite our whitepaper:

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran. PennyLane. arXiv, 2018. arXiv:1811.04968

Contributing

We welcome contributions - simply fork the repository of this plugin, and then make a pull request containing your contribution. All contributers to this plugin 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.

Authors

Carsten Blank

Support

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

License

The PennyLane qiskit plugin is free and open source, released under the Apache License, Version 2.0.

Download files

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

Source Distribution

PennyLane-qiskit-0.0.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

PennyLane_qiskit-0.0.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file PennyLane-qiskit-0.0.1.tar.gz.

File metadata

  • Download URL: PennyLane-qiskit-0.0.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for PennyLane-qiskit-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4d33c31ffcecf652c521e69c4f765aaf7d64e204a9f168f27be750dc900a502f
MD5 16eae1cdc2de54f90dbb07b20b7a18d5
BLAKE2b-256 d9f64b25e88359af042e5d6c9048278ec8b5165e3f5b28031ba3b3a32f234362

See more details on using hashes here.

File details

Details for the file PennyLane_qiskit-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: PennyLane_qiskit-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.5.2

File hashes

Hashes for PennyLane_qiskit-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ef3f8944c4ac8fa7329f7fa4e5c56535ed410076a47a300d2f4073564d56f3f0
MD5 d0c8bfd7d7959ed3acf62c97b7f1be36
BLAKE2b-256 5396d331ec2036ea8587af31cb653360e1efdca6b9fadb6227202a95cbd79afb

See more details on using hashes here.

Release history Release notifications | RSS feed

0.45.0

1 file

0.44.1

1 file

0.44.0

1 file

0.43.0

1 file

0.42.0

1 file

0.41.0.post0

1 file

0.41.0

1 file

0.40.1

1 file

0.40.0

1 file

0.39.1

1 file

0.39.0

1 file

0.38.1

1 file

0.38.0

1 file

0.37.0

1 file

0.36.0

1 file

0.35.1

1 file

0.35.0

1 file

0.34.1

1 file

0.34.0

1 file

0.33.1

1 file

0.33.0

1 file

0.32.0

1 file

0.31.0

1 file

0.30.1

1 file

0.30.0

1 file

0.29.0

1 file

0.28.0

2 files

0.27.0

1 file

0.24.0

1 file

0.23.0

1 file

0.22.0

1 file

0.21.0

1 file

0.20.0

2 files

0.18.0

1 file

0.17.0

1 file

0.16.0

1 file

0.15.0

1 file

0.14.0

1 file

0.13.0

1 file

0.12.0

1 file

0.11.0

1 file

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

0.0.8

1 file

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

This release

0.0.1 This release

2 files

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