Skip to main content

pennylane-snowflurry

The PennyLane-Snowflurry plugin provides a PennyLane device that allows the use of Anyon Systems' Snowflurry quantum computing platform with PennyLane.

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

Snowflurry is a quantum computing framework developed in Julia by Anyon Systems and aims to provide access to quantum hardware and simulators.

PennyLane-Snowflurry makes use of dependencies like PythonCall and JuliaCall to allow interfacing between Python and Julia, and thus between PennyLane and Snowflurry.

Project structure

As shown in the diagram below, this plugin is used in Pennylane as a device named snowflurry.qubit. This device is defined by the class SnowflurryQubitDevice. It converts a PennyLane circuit into a Snowflurry circuit, thanks to packages like JuliaCall that allow the communication between Python and Julia environments. The Snowflurry circuit can then be used with the available backends, either a simulator or real quantum hardware. The results are then converted back into PennyLane's format and returned to the user.

interaction_diagram

Local installation

Since this plugin interfaces between Python and Julia, it requires both languages to be installed on your machine. As Python is widely used amongst the quantum computing community, we assume you already have it installed with a package manager like pip.

Note that to use Calcul Québec's services, you may not need to install the plugin locally as our users might have access to a pre-configured environment.

Plugin installation

Pennylane-snowflurry can be installed using pip:

pip install pennylane-snowflurry

Alternatively, you can clone this repo and install the plugin with the following command from the root of the repo:

pip install -e .

Pennylane and other Python dependencies will be installed automatically during the installation process.

The plugin will also take care of installing Julia and the required Julia packages, such as Snowflurry and PythonCall during the first run. Some notes on that matter are provided below.

If you wish to disable this behaviour, you can edit the julia_env.py file and set the value of the variable IS_USER_CONFIGURED to TRUE:

IS_USER_CONFIGURED = True

Julia

As of version 0.3.0, there is no need to install Julia manually, since the plugin will download and install the required version automatically upon first use. This Julia environment is bound to the plugin.

However, if you wish to manage your Julia environment, you can download it from the official website. It is highly recommended to install using the installer file, as it will ask to add Julia to the system's environment variables.

To ensure this correct configuration, during the installation process, the checkbox Add Julia to PATH must be checked.

PennyLane and Snowflurry

Those packages are installed automatically during the plugin installation process and are necessary for the plugin to work. Here are the links to their respective documentation:

For PennyLane, please refer to the PennyLane documentation.

For Snowflurry, please refer to the Snowflurry documentation.

Usage

Running files

The plugin can be used both in python scripts and Jupyter notebooks. To run a script, you can use the following command:

python base_circuit.py

How to call the device

Once installed, you can write your PennyLane circuits as usual, but you'll need to specify the device as snowflurry.qubit and provide the Snowflurry backend you want to use if you have access to a quantum computer.

dev_def = qml.device("snowflurry.qubit", wires=1, shots=50)

Example if you have an API key from Anyon Systems:

dev_def = qml.device("snowflurry.qubit", wires=1, shots=50, host="example.anyonsys.com", user="test_user",access_token="not_a_real_access_token", realm="realm_name")

State of the project and known issues

This plugin is still very early in its development and aims to provide a basic interface between PennyLane and Snowflurry, which are both also under active development. As such, it is expected that there will be issues and limitations.

Future plans

  • Add a test suite to ensure the plugin works as expected.
  • Integrate a compiler to optimize the circuits.
  • Add device that allows for communication with MonarQ directly through its API.

Metadata

Release files for pennylane-snowflurry 0.4.3

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

Source distribution (sdist)

Source distribution for pennylane-snowflurry 0.4.3
File Size Uploaded
pennylane_snowflurry-0.4.3.tar.gz 518.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pennylane-snowflurry 0.4.3
File Interpreter ABI Platform
pennylane_snowflurry-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 541.7 kB

Release files / pennylane_snowflurry-0.4.3.tar.gz

Download URL pennylane_snowflurry-0.4.3.tar.gz
Size 518.7 kB
Tags Source
SHA-256 checksum
How to use checksums
aa8117234f6ea6db88fb1c6c212b6cde071a9fd0a9ffa220e0f4053456d777d8
BLAKE2b-256 checksum
How to use checksums
726b2b336cd597eb4e5e81cc223bcaa005ac270ba350e1081ab93bba366c71e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2024.

Transparency log

Release files / pennylane_snowflurry-0.4.3-py3-none-any.whl

Download URL pennylane_snowflurry-0.4.3-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac6205f3e0c854beff89450327f07e95cffa7f0ba72e262ebc768fa0cd78b9ca
BLAKE2b-256 checksum
How to use checksums
a441b430232e1b1183b357a4eb1432e4143de642902831a0c3b4c167e20fe1e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 9, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.0

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