Skip to content

Commit

Permalink
Bump python version (#121)
Browse files Browse the repository at this point in the history
* 📝 docs (readthedocs): Add configuration file.

* 🧪 CI (tests): Avoid using python3.7.

* 🔧 refactor (readthedocs): Copy file from PL.

* bump python version in README

* ✏️ chore (changelog): Add changelog entry.

* ✏️ chore (changelog): Add changelog entry.
  • Loading branch information
AlbertMitjans committed Feb 9, 2023
1 parent f247ab6 commit c5637ab
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 13 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ on:
- master
pull_request:


jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8, '3.10']
python-version: ["3.8", "3.10"]

steps:
- name: Cancel Previous Runs
Expand Down Expand Up @@ -55,6 +54,10 @@ jobs:
integration-tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.8", "3.10"]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
Expand All @@ -72,7 +75,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7
python-version: ${{ matrix.python-version }}

- name: Install requirements
run: |
Expand Down
29 changes: 29 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml

# Optionally build your docs in additional formats such as PDF and ePub
formats:
- htmlzip

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: doc/requirements.txt
- method: pip
path: .

build:
image: latest
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Breaking changes

* `pennylane-rigetti` no longer supports `python3.7`. A newer python version is required.
[(#121)](https://github.com/PennyLaneAI/pennylane-rigetti/pull/121)

### Improvements

### Documentation
Expand All @@ -14,6 +17,8 @@

This release contains contributions from (in alphabetical order):

Albert Mitjans Coma

---

# Release 0.27.0
Expand All @@ -36,7 +41,7 @@ as a PennyLane device.
[#110](https://github.com/PennyLaneAI/pennylane-forest/pull/110)

* A new version of the QCS CLI is required if you want to use your QCS account
to run your workloads on a live Rigetti QPU. See
to run your workloads on a live Rigetti QPU. See
[Using the QCS CLI](https://docs.rigetti.com/qcs/guides/using-the-qcs-cli) for
details.
[#107](https://github.com/PennyLaneAI/pennylane-forest/pull/107)
Expand Down Expand Up @@ -70,8 +75,8 @@ as a PennyLane device.

### Bug fixes

* The QPU device now correctly sets the number of shots when parametric
compilation is disabled.
* The QPU device now correctly sets the number of shots when parametric
compilation is disabled.
[#107](https://github.com/PennyLaneAI/pennylane-forest/pull/107)

### Contributors
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Dependencies

PennyLane-Rigetti requires the following libraries be installed:

* `Python <http://python.org/>`__ >=3.7
* `Python <http://python.org/>`__ >=3.8

as well as the following Python packages:

Expand Down
3 changes: 0 additions & 3 deletions pennylane_rigetti/qpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ def expval(self, observable, shot_range=None, bin_size=None):

# `measure_observables` called only when parametric compilation is turned off
if not self.parametric_compilation:

# Single-qubit observable
if len(device_wires) == 1:

# Ensure sensible observable
assert observable.name in [
"PauliX",
Expand All @@ -142,7 +140,6 @@ def expval(self, observable, shot_range=None, bin_size=None):

# Multi-qubit observable
elif len(device_wires) > 1 and isinstance(observable, Tensor):

# All observables are rotated to be measured in the Z-basis, so we just need to
# check which wires exist in the observable, map them to physical qubits, and measure
# the product of PauliZ operators on those qubits
Expand Down
1 change: 0 additions & 1 deletion pennylane_rigetti/wavefunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ def expand_state(self):

for string, amplitude in zip(subsystem_bit_strings, self._state):
for w in inactive_wires:

# expand the bitstring by inserting a zero bit for each inactive qubit
string = np.insert(string, w, 0)

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
import sys
import os
import sys

from setuptools import setup

with open("pennylane_rigetti/_version.py") as f:
Expand Down Expand Up @@ -49,7 +50,6 @@
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down

0 comments on commit c5637ab

Please sign in to comment.