Skip to content

Commit

Permalink
Merge pull request #8 from calculquebec/release
Browse files Browse the repository at this point in the history
Release onto main
  • Loading branch information
Scirelgar authored Apr 24, 2024
2 parents 1488d4e + b8dad2d commit 7416ec1
Show file tree
Hide file tree
Showing 9 changed files with 520 additions and 231 deletions.
45 changes: 18 additions & 27 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,32 @@ on:
types: [published]
workflow_dispatch:


permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
permissions:
id-token: write
environment: release

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[Penylane](https://pennylane.ai/) is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.
[Pennylane](https://pennylane.ai/) is a cross-platform Python library for quantum machine learning, automatic differentiation, and optimization of hybrid quantum-classical computations.

[Snowflurry](https://snowflurry.org/) is a quantum computing framework developed in Julia by Anyon Systems and aims to provide access to quantum hardware and simulators.

Expand All @@ -12,7 +12,7 @@ PennyLane-Snowflurry makes use of dependencies such as PyJulia and PyCall to all

As shown in the diagram below, this plugin is used in Pennylane as a [device](https://pennylane.ai/plugins/) named `snowflurry.qubit`. This device is defined by the class `SnowflurryQubitDevice`. It converts a PennyLane circuit into a Snowflurry circuit, thanks to packages like PyJulia 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](./doc/interaction_diagram_extended.png)
![interaction_diagram](https://raw.githubusercontent.com/calculquebec/pennylane-snowflurry/main/doc/interaction_diagram_extended.png)

## Local installation

Expand Down
3 changes: 2 additions & 1 deletion pennylane_snowflurry/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.1.0.post1"

__version__ = "0.2.0"
10 changes: 8 additions & 2 deletions pennylane_snowflurry/execution_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
# limitations under the License.
"""
Contains the :class:`ExecutionConfig` data class.
This module has not been modified from the original Pennylane source.
"""
from dataclasses import dataclass
from typing import Optional

from pennylane.interfaces import SUPPORTED_INTERFACES
from pennylane.workflow import SUPPORTED_INTERFACES
from pennylane.gradients import SUPPORTED_GRADIENT_KWARGS

SUPPORTED_GRADIENT_METHODS = [
Expand Down Expand Up @@ -99,7 +102,10 @@ def __post_init__(self):
if self.gradient_keyword_arguments is None:
self.gradient_keyword_arguments = {}

if any(arg not in SUPPORTED_GRADIENT_KWARGS for arg in self.gradient_keyword_arguments):
if any(
arg not in SUPPORTED_GRADIENT_KWARGS
for arg in self.gradient_keyword_arguments
):
raise ValueError(
f"All gradient_keyword_arguments keys must be in {SUPPORTED_GRADIENT_KWARGS}, got unexpected values: {set(self.gradient_keyword_arguments) - set(SUPPORTED_GRADIENT_KWARGS)}"
)
Expand Down
Loading

0 comments on commit 7416ec1

Please sign in to comment.