The Wayback Machine - https://web.archive.org/web/20200603195444/https://github.com/XanaduAI/pennylane
Skip to content
PennyLane is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations
Python Other
  1. Python 99.8%
  2. Other 0.2%
Branch: master
Clone or download

Latest commit

4 authors [WIRES] Use new wire class in templates (#645)
* do refactor

* update changelog

* change name of class

* change name again

* update changelog

* black

* revert name to ActsOn

* typo

* backup

* finish basic tests

* add injective check function

* check that input is iterable

* black

* make Wires accept integers

* interpret integer input as length

* adapt test

* added extend method

* black

* outsource clean function

* clean docstring

* interpret integers as single indices

* add get_index method

* add set methods, repr and eq, ne

* use wire function in templates

* add select_random and select methods

* finish rewriting templates

* polish

* polish

* improve error message

* backup

* change extend method to combine

* backup

* add periodic_boundary to select method

* make broadcast tests run

* make all tests pass

* black

* black

* deleted unnecessary import

* cleaning

* polish

* polish more

* fix combine() method and add test for numpy array conversion

* Update .github/CHANGELOG.md

Co-authored-by: Josh Izaac <[email protected]>

* Update pennylane/wires.py

Co-authored-by: Josh Izaac <[email protected]>

* Update pennylane/wires.py

Co-authored-by: Josh Izaac <[email protected]>

* implement josh's suggestions

* black

* some docstring polishing

* remove old default_config.toml file that keeps on cropping up

* change the way indexing works: now wires[1] returns a wires object

* backup

* add merge method

* backup

* fix test

* get tests to run again

* major revamp of wires class - now allowing any object to represent a wire

* polish

* delete tests that check for wrong wires type

* make set methods take lists of Wires

* black

* black

* improve hash function

* added all_unique function

* implement Nathan's suggestions

* improve class further from Nathan's comments

* update tests

* black

* fix strange change in jquery.min.map

* refactor

* fixed tolist()

* make representation use list instead of tuple

* make representation use list instead of tuple - update test

* fix accidental bug

* fix problem in _preprocess() logic

* black

* fix

* implement antal's suggestions

* delete comments in interferometwe

* black

* Update pennylane/templates/state_preparations/arbitrary_state_preparation.py

* Update pennylane/templates/embeddings/iqp.py

* Update tests/templates/test_broadcast.py

Co-authored-by: Tom Bromley <[email protected]>

* Update tests/templates/test_embeddings.py

Co-authored-by: Tom Bromley <[email protected]>

* implement Tom's suggestions

* update qchem templates

Co-authored-by: Josh Izaac <[email protected]>
Co-authored-by: antalszava <[email protected]>
Co-authored-by: Tom Bromley <[email protected]>
Latest commit 588c42f Jun 3, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Fix bug in the functions "test_single_ex_unitary_operations" and "tes… Jun 1, 2020
benchmark Add script to compare commits and additional benchmarks (#568) May 2, 2020
doc Uccsd template (#654) May 28, 2020
pennylane [WIRES] Use new wire class in templates (#645) Jun 3, 2020
qchem [WIRES] Make tensor observables wires a flat list (#656) May 28, 2020
tests [WIRES] Use new wire class in templates (#645) Jun 3, 2020
.coveragerc name change to pennylane Oct 26, 2018
.gitignore Add MSECost (#642) May 28, 2020
.pylintrc Add quantum geometric tensor optimizer (#295) Aug 23, 2019
.readthedocs.yml Adds the Qchem package (#453) Dec 26, 2019
.travis.yml fixes (#657) May 28, 2020
LICENSE first commit of new interface Aug 21, 2018
MANIFEST.in Update the default behaviour of the example configuration (#610) May 5, 2020
Makefile Adds the Qchem package (#453) Dec 26, 2019
README.rst Officially remove Python 3.5 support, update TF1.X support to >=1.15 (#… May 19, 2020
codecov.yml Adds the Qchem package (#453) Dec 26, 2019
example_config.toml Update the default behaviour of the example configuration (#610) May 5, 2020
requirements.txt Add support for asynchronous evaluation of QNode collections (#484) Jan 28, 2020
setup.py Officially remove Python 3.5 support, update TF1.X support to >=1.15 (#… May 19, 2020

README.rst

PennyLane


Travis Codecov coverage Codacy grade Read the Docs PyPI PyPI - Python Version Discourse posts

PennyLane is a cross-platform Python library for differentiable programming of quantum computers.

Train a quantum computer the same way as a neural network.

PennyLane provides open-source tools for quantum machine learning, quantum computing, quantum chemistry, and hybrid quantum-classical computing. Extensive examples, tutorials, and demos are available at https://pennylane.ai/qml.

Key Features

  • Device independent. Access quantum hardware and simulators from Xanadu Strawberry Fields, IBM Q, Google Cirq, Rigetti Forest, and Microsoft QDK.
  • Best of both worlds. Build hybrid models by connecting quantum hardware to PyTorch, TensorFlow, Keras, and NumPy.
  • Follow the gradient. Hardware-friendly automatic differentiation of quantum circuits.
  • Batteries included. Built-in tools for quantum machine learning, optimization, and quantum chemistry.

Getting started

For an introduction to quantum machine learning, we have several guides and resources available on PennyLane's quantum machine learning page:

You can also check out our documentation for quickstart guides to using PennyLane, and detailed developer guides on how to write your own PennyLane-compatible quantum device.

Available plugins

  • PennyLane-SF: Supports integration with Strawberry Fields, a full-stack Python library for simulating photonic quantum computing.
  • PennyLane-qiskit: Supports integration with Qiskit, an open-source quantum computation framework by IBM. Provides device support for the Qiskit Aer quantum simulators, and IBM Q hardware devices.
  • PennyLane-cirq: Supports integration with Cirq, an open-source quantum computation framework by Google.
  • PennyLane-Forest: Supports integration with PyQuil, the Rigetti Forest SDK, and the Rigetti QCS, an open-source quantum computation framework by Rigetti. Provides device support for the the Quantum Virtual Machine (QVM) and Quantum Processing Units (QPUs) hardware devices.
  • PennyLane-Qsharp: Supports integration with the Microsoft Quantum Development Kit, a quantum computation framework that uses the Q# quantum programming language.

For a full list of PennyLane plugins, see the PennyLane website.

Installation

PennyLane requires Python version 3.6 and above. Installation of PennyLane, as well as all dependencies, can be done using pip:

$ python -m pip install pennylane

Contributing to PennyLane

We welcome contributions — simply fork the PennyLane repository, and then make a pull request containing your contribution. All contributers to PennyLane will be listed as authors on the releases. All users who contribute significantly to the code (new plugins, new functionality, etc.) will be listed on the PennyLane arXiv paper.

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

See our contributions page for more details.

Authors

PennyLane is the work of many contributors.

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

Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, M. Sohaib Alam, Shahnawaz Ahmed, Juan Miguel Arrazola, Carsten Blank, Alain Delgado, Soran Jahangiri, Keri McKiernan, Johannes Jakob Meyer, Zeyue Niu, Antal Száva, and Nathan Killoran. PennyLane: Automatic differentiation of hybrid quantum-classical computations. 2018. arXiv:1811.04968

Support

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

We also have a PennyLane discussion forum - come join the discussion and chat with our PennyLane team.

License

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

You can’t perform that action at this time.