Skip to content

Commit

Permalink
Update CI (#63)
Browse files Browse the repository at this point in the history
* Update CI

* fix

* fix
  • Loading branch information
josh146 committed Nov 3, 2020
1 parent 0654128 commit 76072bc
Show file tree
Hide file tree
Showing 10 changed files with 483 additions and 101 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Formatting check
on:
- pull_request

jobs:
black:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Install dependencies
run: pip install black

- uses: actions/checkout@v2

- name: Run Black
run: black -l 100 pennylane_forest/ --check
96 changes: 96 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Tests
on:
push:
branches:
- master
pull_request:


jobs:
tests:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [3.8]

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Run Forest Quilc
run: docker run --rm -d -p 5555:5555 rigetti/quilc -R

- name: Run Forest QVM
run: docker run --rm -d -p 5000:5000 rigetti/qvm -S

- uses: actions/checkout@v2

- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel pytest pytest-cov pytest-mock flaky --upgrade
- name: Install Plugin
run: |
python setup.py bdist_wheel
pip install dist/PennyLane*.whl
- name: Run tests
run: python -m pytest tests --cov=pennylane_forest --cov-report=term-missing --cov-report=xml -p no:warnings --tb=native

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.7
with:
file: ./coverage.xml

integration-tests:
runs-on: ubuntu-latest

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}

- name: Run Forest Quilc
run: docker run --rm -d -p 5555:5555 rigetti/quilc -R

- name: Run Forest QVM
run: docker run --rm -d -p 5000:5000 rigetti/qvm -S

- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install requirements
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel pytest pytest-cov pytest-mock flaky --upgrade
- name: Install Plugin
run: |
python setup.py bdist_wheel
pip install dist/PennyLane*.whl
- name: Run tests
run: |
pl-device-test --device=forest.numpy_wavefunction --tb=short --skip-ops --analytic=True
pl-device-test --device=forest.wavefunction --tb=short --skip-ops --analytic=False --shots=20000
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.7
with:
file: ./coverage.xml
35 changes: 35 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Upload
on:
release:
types: [published]

jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Build and install Plugin
run: |
python -m pip install --upgrade pip wheel
python setup.py bdist_wheel
pip install dist/PennyLane*.whl
- name: Install test dependencies
run: |
pip install wheel pytest pytest-cov pytest-mock --upgrade
- name: Run tests
run: |
python -m pytest tests --tb=native
- name: Publish
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI }}
31 changes: 31 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[MASTER]
# A comma-separated list of packages or module names from where C extensions may
# be loaded. Extensions are loaded into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=numpy,scipy,autograd,pyquil

[TYPECHECK]

# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=numpy,scipy,autograd,pyquil

# List of class names for which member attributes should not be checked
# (useful for classes with attributes dynamically set). This can work
# with qualified names.
ignored-classes=numpy,scipy,autograd,pyquil

[MESSAGES CONTROL]

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifiers separated by comma (,) or put this option
# multiple times.
#enable=

# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this option
# multiple times (only on the command line, not in the configuration file where
# it should appear only once).
disable=line-too-long,invalid-name,too-many-lines,redefined-builtin,too-many-locals,duplicate-code,bad-continuation
133 changes: 133 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# Release 0.13.0-dev

### New features since last release

### Improvements

### Bug fixes

### Documentation

### Contributors

This release contains contributions from (in alphabetical order):

---

# Release 0.12.0

* Version bump

---

# Release 0.11.0

### New features

* Forest devices now support custom wire labels. #55 #57 #58 #59

One can now specify any string or number as a custom wire label, and use these labels to address subsystems on the device:

```python
dev = qml.device('forest.qvm' device='4q-qvm', wires=['q1', 'ancilla', 0, 1])

@qml.qnode(dev)
def circuit():
qml.Hadamard(wires='q1')
qml.CNOT(wires=[1, 'ancilla'])
return qml.expval(qml.PauliZ(0))
```

### Bug fixes

* Fixes a bug where basis states were not correctly initialized #56

* Tensor measurements have been fixed due to a change in PL v0.11 #52

* The QCS no longer supports lattice-based devices such as Aspen-4-5Q-E. As a result, the `forest.qvm` and `forest.qpu` devices no longer accept lattice-based devices, and must be loaded with the full device name (e.g. Aspen-4). #51

### Contributors

Theodor Isacsson, Josh Izaac, Maria Schuld, Antal Száva

---

# Release 0.9.0

* Adding support for multi-qubit observable estimation.

* Added a new method `analytic_probability()` to the `Wavefunction` simulator devices, so that analytic and non-analytic probabilities are correctly returned.

* Reduced the default number of shots for the `QPUDevice` to 1000 from 1024.

* The test suite now programmatically queries `pyquil.list_quantum_computers()` for valid QPU lattices for integration tests, and additional gradient integration tests have been added.

* The minimum required version of PennyLane has been increased to v0.9 due to plugin API changes in PennyLane.

---

# Release 0.8.0

* Added parametric compilation for `forest.qvm` and `forest.qpu`, leading to significant speed increases when performing optimization

* The plugin has been ported to use the new [`QubitDevice`](https://pennylane.readthedocs.io/en/stable/code/api/pennylane.QubitDevice.html) API for plugins, resulting in a cleaner interface with built-in support for multi-qubit observables.

* Bug fixes to allow the plugin to work with pyQuil >= 2.16

* Operator estimation on `forest.qpu` now works with both 1 and 2 qubit gates

* Adds a converter so that pyQuil and Quil programs can be loaded as differentiable PennyLane templates

---

# Release 0.6.0

* Added ability to return multi-qubit expectation values to all devices

* Added variance support

* Replaced dense matrix expansion with a tensordot implementation

* Added support for `samples`

* Readout Error Mitigation using Operator Estimation

* Updates the plugin to work with PyQuil 2.13 and PennyLane 0.6

---

# Release 0.3.0

### New features

* Updated to support PyQuil v2.9.0 and PennyLane v0.4.0. Note that PennyLane-Forest now requires PennyLane>=0.4

* The observable `qml.Hermitian(A, wires)` can now be measured on an arbitrary number of wires. That is, you can now pass a matrix A of size `[2**N, 2**N]` which acts on `N` qubits (i.e., `len(wires)==N`).

* Adds support for the `qml.var()` measurement return type provided by PennyLane v0.4.

---

# Release 0.2.0

* Using any of the available lattices at any given time, instead of a specifically named one

* updated minimum pyquil version requirement to 2.7

* added support for pyQVM

* removed 2.4 changes

* Updating compiler urls

* Replacing old lattice with new

* pyqvm working without the compiler

* Updating compiler urls

* Replacing old lattice with new

* added build and documentation badges

* Remove the LocalQVMCompiler from the tests

0 comments on commit 76072bc

Please sign in to comment.