Skip to content

Commit

Permalink
Update reqs to 1.0 (#536)
Browse files Browse the repository at this point in the history
* removed legacy ci

* Delete .github/workflows/tests.yml

* naming and 0.46 test

* rename

* update qiskit device

* dep warnings

* pylint

* removed devices

* pylint

* pylint

* docs fix

* setup.py changes

* delete

* revert

* reqs change

* setup

* change to reqs to match ci

* removed a test

* pylint

* put ibmq.rst back

* delete ibmq

* remove ibmq

* deletion

* codecov

* lint

* changes to tests

* Revert "Remove devices that will not be supported in the new release" (#544)

* changelogs
  • Loading branch information
austingmhuang authored May 22, 2024
1 parent 5e11e3a commit ae898be
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 160 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ibmq_tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: IBMQ integration tests
name: IBMQ integration tests with Qiskit 1.0
on:
schedule:
- cron: '0 0 * * 0,4' # At 00:00 on Sunday and Thursday.
- cron: '1 0 * * 0,4' # At 01:00 on Sunday and Thursday.
workflow_dispatch:

jobs:
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-ci-legacy.txt
pip install -r requirements-ci.txt
pip install wheel pytest pytest-cov pytest-mock flaky --upgrade
pip freeze
Expand Down
44 changes: 0 additions & 44 deletions .github/workflows/ibmq_tests_1.yml

This file was deleted.

17 changes: 6 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tests
name: Tests for 1.0
on:
push:
branches:
Expand Down Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/PennyLaneAI/pennylane.git
pip install -r requirements-ci-legacy.txt
pip install -r requirements-ci.txt
pip install wheel pytest pytest-cov pytest-mock flaky --upgrade
pip freeze
Expand All @@ -39,12 +39,9 @@ jobs:
pip install git+https://github.com/PennyLaneAI/pennylane-qiskit.git@${{ github.ref }}
pip freeze
- name: Run tests
# Skip IBMQ and Runtime tests as they depend on IBMQ's availability and
# easily result in timeouts
- name: Run standard Qiskit plugin tests
# Run the standard tests with the most recent version of Qiskit
run: python -m pytest tests -k 'not test_ibmq.py and not test_runtime.py' --cov=pennylane_qiskit --cov-report=term-missing --cov-report=xml -p no:warnings --tb=native
env:
IBMQX_TOKEN: ${{ secrets.IBMQX_TOKEN_TEST }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down Expand Up @@ -72,19 +69,17 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/PennyLaneAI/pennylane.git
pip install -r requirements-ci-legacy.txt
pip install -r requirements-ci.txt
pip install wheel pytest pytest-cov pytest-mock pytest-benchmark flaky --upgrade
pip freeze
- name: Install Plugin
run: |
python setup.py bdist_wheel
pip install dist/PennyLane*.whl
pip freeze
- name: Run tests
run: |
pl-device-test --device=qiskit.basicaer --tb=short --skip-ops --shots=20000 --device-kwargs backend=qasm_simulator
pl-device-test --device=qiskit.basicsim --tb=short --skip-ops --shots=20000 --device-kwargs backend=basic_simulator
pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=20000 --device-kwargs backend=qasm_simulator
pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=statevector_simulator
pl-device-test --device=qiskit.aer --tb=short --skip-ops --shots=None --device-kwargs backend=unitary_simulator
Expand Down
91 changes: 0 additions & 91 deletions .github/workflows/tests_qiskit_1.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
### Improvements 🛠

### Breaking changes 💔
* Support has been removed for Qiskit versions below 0.46. The minimum required version for Qiskit is now 1.0.
If you want to continue to use older versions of Qiskit with the plugin, please use version 0.36 of
the Pennylane-Qiskit plugin.
[(#536)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/536)

* The test suite no longer runs for Qiskit versions below 0.46.
[(#536)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/536)

### Deprecations 👋

Expand All @@ -15,6 +22,7 @@
### Contributors ✍️

This release contains contributions from (in alphabetical order):
Austin Huang

---
# Release 0.36.0
Expand Down
5 changes: 0 additions & 5 deletions requirements-ci-legacy.txt

This file was deleted.

14 changes: 8 additions & 6 deletions tests/test_qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,16 @@ def test_warning_raised_for_hardware_backend_analytic_expval(self, recorder):
with pytest.warns(UserWarning) as record:
dev = qml.device("qiskit.aer", backend="aer_simulator", wires=2, shots=None)

# check that only one warning was raised
assert len(record) == 1
# check that the message matches
assert (
record[0].message.args[0] == "The analytic calculation of "
record[1].message.args[0] == "The analytic calculation of "
"expectations, variances and probabilities is only supported on "
f"statevector backends, not on the {dev.backend.name}. Such statistics obtained from this "
"device are estimates based on samples."
)

# Two warnings are being raised: one about analytic calculations and another about deprecation.
assert len(record) == 2

@pytest.mark.parametrize("method", ["unitary", "statevector"])
def test_no_warning_raised_for_software_backend_analytic_expval(
self, method, recorder, recwarn
Expand All @@ -193,8 +193,10 @@ def test_no_warning_raised_for_software_backend_analytic_expval(

_ = qml.device("qiskit.aer", backend="aer_simulator", method=method, wires=2, shots=None)

# check that no warnings were raised
assert len(recwarn) == 0
# These simulators are being deprecated. Warning is raised in Qiskit 1.0
# Migrate to AerSimulator with AerSimulator(method=method) and append
# run circuits with the `save_state` instruction.
assert len(recwarn) == 1


class TestAerBackendOptions:
Expand Down

0 comments on commit ae898be

Please sign in to comment.