Skip to main content

PennyLane Braket plugin #######################

.. image:: https://img.shields.io/badge/code_style-black-000000.svg :alt: Code Style: Black :target: https://github.com/psf/black

The Amazon Braket PennyLane plugin offers two Amazon Braket quantum devices to work with PennyLane:

  • braket.aws.qubit for running with the Amazon Braket service's quantum devices, both QPUs and simulators
  • braket.local.qubit for running with the Amazon Braket SDK's local simulator

.. header-start-inclusion-marker-do-not-remove

The Amazon Braket Python SDK <https://github.com/aws/amazon-braket-sdk-python>_ is an open source library that provides a framework to interact with quantum computing hardware devices and simulators through Amazon Braket.

PennyLane <https://pennylane.readthedocs.io>_ is a machine learning library for optimization and automatic differentiation of hybrid quantum-classical computations.

.. header-end-inclusion-marker-do-not-remove

The plugin documentation can be found here: <https://amazon-braket-pennylane-plugin-python.readthedocs.io/en/latest/>__.

Features

  • Provides two devices to be used with PennyLane: braket.aws.qubit for running on the Braket service, and braket.local.qubit for running on Braket's local simulator.

  • Both devices support most core qubit PennyLane operations.

  • All PennyLane observables are supported.

  • Provides custom PennyLane operations to cover additional Braket operations: ISWAP, PSWAP, and many more. Every custom operation supports analytic differentiation.

  • Combines Amazon Braket with PennyLane's automatic differentiation and optimization.

.. installation-start-inclusion-marker-do-not-remove

Installation

Before you begin working with the Amazon Braket PennyLane Plugin, make sure that you installed or configured the following prerequisites:

  • Download and install Python 3.7.2 <https://www.python.org/downloads/>_ or greater. If you are using Windows, choose the option Add Python to environment variables before you begin the installation.

  • Make sure that your AWS account is onboarded to Amazon Braket, as per the instructions here <https://github.com/aws/amazon-braket-sdk-python#prerequisites>_.

  • Download and install PennyLane <https://pennylane.ai/install.html>_:

    .. code-block:: bash

    pip install pennylane
    

You can then install the latest release of the PennyLane-Braket plugin as follows:

.. code-block:: bash

pip install amazon-braket-pennylane-plugin

You can also install the development version from source by cloning this repository and running a pip install command in the root directory of the repository:

.. code-block:: bash

git clone https://github.com/aws/amazon-braket-pennylane-plugin-python.git
cd amazon-braket-pennylane-plugin-python
pip install .

You can check your currently installed version of amazon-braket-pennylane-plugin with pip show:

.. code-block:: bash

pip show amazon-braket-pennylane-plugin

or alternatively from within Python:

.. code-block:: python

from braket import pennylane_plugin
pennylane_plugin.__version__

Tests


Make sure to install test dependencies first:

.. code-block:: bash

    pip install -e "amazon-braket-pennylane-plugin-python[test]"

Unit tests
**********

Run the unit tests using:

.. code-block:: bash

    tox -e unit-tests


To run an individual test:

.. code-block:: bash

    tox -e unit-tests -- -k 'your_test'


To run linters and unit tests:

.. code-block:: bash

    tox

Integration tests
*****************

To run the integration tests, set the ``AWS_PROFILE`` as explained in the amazon-braket-sdk-python
`README <https://github.com/aws/amazon-braket-sdk-python/blob/main/README.md>`_:

.. code-block:: bash

    export AWS_PROFILE=Your_Profile_Name


Running the integration tests creates an S3 bucket in the same account as the ``AWS_PROFILE``
with the following naming convention ``amazon-braket-pennylane-plugin-integ-tests-{account_id}``.

Run the integration tests with:

.. code-block:: bash

    tox -e integ-tests

To run an individual integration test:

.. code-block:: bash

    tox -e integ-tests -- -k 'your_test'

Documentation

To build the HTML documentation, run:

.. code-block:: bash

tox -e docs

The documentation can then be found in the doc/build/documentation/html/ directory.

.. installation-end-inclusion-marker-do-not-remove

Contributing

We welcome contributions - simply fork the repository of this plugin, and then make a pull request <https://help.github.com/articles/about-pull-requests/>_ 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 with the plugin.

.. support-start-inclusion-marker-do-not-remove

Support

If you are having issues, please let us know by posting the issue on our Github issue tracker, or by asking a question in the forum.

.. support-end-inclusion-marker-do-not-remove

.. license-start-inclusion-marker-do-not-remove

License

This project is licensed under the Apache-2.0 License.

.. license-end-inclusion-marker-do-not-remove

Release files for amazon-braket-pennylane-plugin 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for amazon-braket-pennylane-plugin 1.0.0
File Size Uploaded
amazon-braket-pennylane-plugin-1.0.0.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for amazon-braket-pennylane-plugin 1.0.0
File Interpreter ABI Platform
amazon_braket_pennylane_plugin-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 28.9 kB

Release files / amazon-braket-pennylane-plugin-1.0.0.tar.gz

Download URL amazon-braket-pennylane-plugin-1.0.0.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e2a628c83eda3fafe3d6aed753db9d4065f5f09fe873cef662c33b65e037ce79
BLAKE2b-256 checksum
How to use checksums
bd744bbc6d77054824aa3afe8bafd13441ad10130fa0314cf39ed9a225e79e1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release files / amazon_braket_pennylane_plugin-1.0.0-py3-none-any.whl

Download URL amazon_braket_pennylane_plugin-1.0.0-py3-none-any.whl
Size 17.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca762a88283c72514347731542605cb32908eb555e6feee12f05771b7c164b39
BLAKE2b-256 checksum
How to use checksums
fa0cfa7a3a5cebf085966649459a9d2b524caa433c3e96691a50ee0e4ab2c046
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/49.4.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Release history Release notifications | RSS feed

1.35.2

2 release files

1.35.1

2 release files

1.34.2

2 release files

1.34.0

2 release files

1.33.7

2 release files

1.33.6

2 release files

1.33.5

2 release files

1.33.4

2 release files

1.33.3

2 release files

1.33.2

2 release files

1.33.1

2 release files

1.33.0

2 release files

1.32.0

2 release files

1.31.2

2 release files

1.31.1

2 release files

1.30.2

2 release files

1.30.1

2 release files

1.30.0

2 release files

1.27.6

2 release files

1.27.5

2 release files

1.27.3

2 release files

1.26.0

2 release files

1.25.0

2 release files

1.24.4

2 release files

1.24.3

2 release files

1.24.2

2 release files

1.24.1

2 release files

1.23.0

2 release files

1.22.0

2 release files

1.21.0

2 release files

1.20.3

2 release files

1.20.2

2 release files

1.20.1

2 release files

1.20.0

2 release files

1.19.1

2 release files

1.19.0

2 release files

1.18.0

2 release files

1.17.4

2 release files

1.17.3

2 release files

1.17.2

2 release files

1.17.0

2 release files

1.16.0

2 release files

1.15.3

2 release files

1.15.2

2 release files

1.14.1

2 release files

1.14.0

2 release files

1.13.1

2 release files

1.11.2

2 release files

1.10.3

2 release files

1.9.0

2 release files

1.8.0

2 release files

1.7.0

2 release files

1.6.9

2 release files

1.6.8

2 release files

1.6.7

2 release files

1.6.6

2 release files

1.6.5

2 release files

1.6.4

2 release files

1.6.3

2 release files

1.6.2

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.7

2 release files

1.5.6

2 release files

1.5.5

2 release files

1.5.4

2 release files

1.5.3

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

This release

1.0.0 This release

2 release 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