Skip to content

Commit

Permalink
Adapt docs to PennyLane theme (#64)
Browse files Browse the repository at this point in the history
* redo docs

* fix doctree error

* Update README.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update README.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* update gitignore to not commit built folder

* temporarily whitelist code folder

* delete api files

* blacklist again

* clean pic

* Update doc/devices/numpy_wavefunction.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update doc/devices/qpu.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update doc/devices/qvm.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update doc/devices/qvm.rst

Co-authored-by: Theodor <theodor@xanadu.ai>

* Update README.rst

Co-authored-by: antalszava <antalszava@gmail.com>

* Update doc/devices/numpy_wavefunction.rst

Co-authored-by: antalszava <antalszava@gmail.com>

* Update doc/devices/numpy_wavefunction.rst

Co-authored-by: antalszava <antalszava@gmail.com>

* code review

* polish

* Update doc/devices/numpy_wavefunction.rst

Co-authored-by: antalszava <antalszava@gmail.com>

* Update doc/devices/numpy_wavefunction.rst

* add requirements file

* add pyquil as requirement

* change pennylane version in requirements

* make pygments a docs requirement

* Update README.rst

Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>

* undo deletion of importing gates

* don't import superfluous gates

* increase number of flaky tuns

Co-authored-by: Theodor <theodor@xanadu.ai>
Co-authored-by: antalszava <antalszava@gmail.com>
Co-authored-by: Josh Izaac <josh146@gmail.com>
Co-authored-by: Nathan Killoran <co9olguy@users.noreply.github.com>
  • Loading branch information
5 people committed Nov 30, 2020
1 parent 76072bc commit e5b3016
Show file tree
Hide file tree
Showing 60 changed files with 6,466 additions and 534 deletions.
19 changes: 14 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
*~
*.pyc
.vscode/*
.pytest_cache/*
build/*
dist/*
*egg-info*
doc/_build
build
dist
PennyLane_Forest.egg-info
.idea
*.ipynb
*.ipynb_checkpoints
*.egg-info*
.coverage
coverage_html_report/*
notebooks/*
.pytest_cache/*
.vscode/*
doc/code/api/*
95 changes: 67 additions & 28 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ PennyLane Forest Plugin

.. header-start-inclusion-marker-do-not-remove
Contains the PennyLane Forest plugin. This plugin allows three Rigetti devices to work with
Contains the PennyLane Forest plugin. This plugin allows different Rigetti devices to work with
PennyLane --- the wavefunction simulator, the Quantum Virtual Machine (QVM), and Quantum Processing
Units (QPUs).

`pyQuil <https://pyquil.readthedocs.io>`_ is a Python library for quantum programming using the
quantum instruction language (Quil) --- resulting quantum programs can be executed using the
`Rigetti Forest SDK <https://www.PennyLaneAI.com/forest>`_ and the `Rigetti QCS
<https://www.PennyLaneAI.com/qcs>`_.
`Rigetti Forest SDK <https://pyquil-docs.rigetti.com/en/stable/>`_ and the `Rigetti QCS
<https://qcs.rigetti.com/>`_.

`PennyLane <https://pennylane.ai>`_ is a machine learning library for optimization and automatic
differentiation of hybrid quantum-classical computations.
`PennyLane <https://pennylane.readthedocs.io>`__ is a cross-platform Python library for quantum machine
learning, automatic differentiation, and optimization of hybrid quantum-classical computations.


.. header-end-inclusion-marker-do-not-remove
The plugin documentation can be found here: `<https://pennylane-forest.readthedocs.io/en/latest/>`__.

Features
========

Expand All @@ -54,8 +56,8 @@ Features
* All provided devices support all core qubit PennyLane operations and observables.


* Provides custom PennyLane operations to cover additional pyQuil operations: ``T``, ``S``,
``ISWAP``, ``CCNOT``, ``PSWAP``, and many more. Every custom operation supports analytic
* Provides custom PennyLane operations to cover additional pyQuil operations:
``ISWAP``, ``PSWAP``, and ``CPHASE``. Every custom operation supports analytic
differentiation.

* Combine Forest and the Rigetti Cloud Services with PennyLane's automatic differentiation and
Expand All @@ -67,36 +69,73 @@ Features
Installation
============

PennyLane-Forest requires both PennyLane and pyQuil. It can be installed via ``pip``:
PennyLane-Forest, as well as all required Python packages mentioned above, can be installed via ``pip``:
::

.. code-block:: bash
$ python -m pip install pennylane-forest

$ python -m pip install pennylane-forest

Make sure you are using the Python 3 version of pip.

.. installation-end-inclusion-marker-do-not-remove
Alternatively, you can install PennyLane-Forest from the source code by navigating to the top-level directory and running
::

$ python setup.py install

Dependencies
~~~~~~~~~~~~

.. highlight:: bash

PennyLane-Forest requires the following libraries be installed:

* `Python <http://python.org/>`_ >=3.6

as well as the following Python packages:

* `PennyLane <http://pennylane.readthedocs.io/>`_
* `pyQuil <https://pyquil-docs.rigetti.com/en/stable/>`_

If you currently do not have Python 3 installed, we recommend
`Anaconda for Python 3 <https://www.anaconda.com/download/>`_, a distributed version
of Python packaged for scientific computation.

Additionally, if you would like to compile the quantum instruction language (Quil) and run it
locally using a quantum virtual machine (QVM) server, you will need to download and install the
Forest software development kit (SDK):

Getting started
===============
* `Forest SDK <https://pyquil-docs.rigetti.com/en/stable/>`_

Once the PennyLane-Forest plugin is installed, the three provided pyQuil devices can be accessed straight away in PennyLane.
Alternatively, you may sign up for Rigetti's Quantum Cloud Services (QCS) to acquire a Quantum Machine
Image (QMI) which will allow you to compile your quantum code and run on real quantum processing units (QPUs),
or on a preinstalled QVM. Note that this requires a valid QCS account.

You can instantiate these devices for PennyLane as follows:
* `Quantum Cloud Services <https://docs.rigetti.com/en/>`_

.. code-block:: python
Tests
~~~~~

import pennylane as qml
dev_numpy = qml.device('forest.numpy_wavefunction', wires=2)
dev_simulator = qml.device('forest.wavefunction', wires=2)
dev_pyqvm = qml.device('forest.qvm', device='2q-pyqvm', shots=1000)
dev_qvm = qml.device('forest.qvm', device='2q-qvm', shots=1000)
dev_qpu = qml.device('forest.qpu', device='Aspen-8', shots=1000)
To test that the PennyLane-Forest plugin is working correctly you can run

.. code-block:: bash
$ make test
in the source folder.

Documentation
~~~~~~~~~~~~~

To build the HTML documentation, go to the top-level directory and run:

.. code-block:: bash
$ make docs
These devices can then be used just like other devices for the definition and evaluation of QNodes
within PennyLane. For more details, see the `plugin usage guide
<https://pennylane-forest.readthedocs.io/en/latest/usage.html>`_ and refer to the PennyLane
documentation.
The documentation can then be found in the ``doc/_build/html/`` directory.

.. installation-end-inclusion-marker-do-not-remove
Contributing
============
Expand All @@ -121,7 +160,7 @@ If you are doing research using PennyLane and PennyLane-Forest, please cite `our
Zeyue Niu, Antal Száva, and Nathan Killoran.
*PennyLane: Automatic differentiation of hybrid quantum-classical computations.* 2018. arXiv:1811.04968


.. support-start-inclusion-marker-do-not-remove
Support
=======
Expand All @@ -143,4 +182,4 @@ License
PennyLane-Forest is **free** and **open source**, released under the BSD 3-Clause `license
<https://github.com/PennyLaneAI/pennylane-forest/blob/master/LICENSE>`_.

.. license-end-inclusion-marker-do-not-remove
.. license-end-inclusion-marker-do-not-remove
2 changes: 1 addition & 1 deletion doc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python3 -msphinx
SPHINXPROJ = PennyLane
SPHINXPROJ = PennyLane-Forest
SOURCEDIR = .
BUILDDIR = _build

Expand Down
Binary file added doc/_static/favicon.ico
Binary file not shown.
Binary file added doc/_static/logo_new.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/pennylane.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/puzzle_forest.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e5b3016

Please sign in to comment.