Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove basicaer #546

Merged
merged 47 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
20be42a
removed legacy ci
austingmhuang May 16, 2024
a2dade8
Delete .github/workflows/tests.yml
austingmhuang May 16, 2024
61b866f
naming and 0.46 test
austingmhuang May 17, 2024
78a7131
rename
austingmhuang May 17, 2024
fd87f82
update qiskit device
austingmhuang May 17, 2024
1b0d3af
dep warnings
austingmhuang May 17, 2024
7f13512
pylint
austingmhuang May 17, 2024
96ddb61
removed devices
austingmhuang May 17, 2024
e6a3e8f
pylint
austingmhuang May 17, 2024
725f30f
pylint
austingmhuang May 17, 2024
35096f9
docs fix
austingmhuang May 17, 2024
1b5a313
setup.py changes
austingmhuang May 17, 2024
68f200f
delete
austingmhuang May 17, 2024
97a9665
revert
austingmhuang May 17, 2024
2ba262d
reqs change
austingmhuang May 17, 2024
c89cdcb
setup
austingmhuang May 17, 2024
fdffa2c
change to reqs to match ci
austingmhuang May 17, 2024
7c91f32
removed a test
austingmhuang May 17, 2024
7caa28e
pylint
austingmhuang May 17, 2024
416a27b
put ibmq.rst back
austingmhuang May 17, 2024
d4da30f
delete ibmq
austingmhuang May 17, 2024
d3dbb81
remove ibmq
austingmhuang May 17, 2024
778f1b5
deletion
austingmhuang May 17, 2024
6776563
codecov
austingmhuang May 17, 2024
3cf89c8
lint
austingmhuang May 17, 2024
17325a2
changes to tests
austingmhuang May 21, 2024
e6e576e
Merge branch 'remove_devices' into update_reqs
austingmhuang May 22, 2024
c21c488
Revert "Remove devices that will not be supported in the new release"…
austingmhuang May 22, 2024
6b0564c
docs
austingmhuang May 22, 2024
d49ecfe
fix
austingmhuang May 22, 2024
93da3ca
remove basicaer
austingmhuang May 22, 2024
7e49a4e
reqs to build docs
austingmhuang May 22, 2024
9fcdc25
docs
austingmhuang May 22, 2024
4ac2de2
pylint
austingmhuang May 22, 2024
854a8c1
tests fix
austingmhuang May 22, 2024
0b75b9e
path change
austingmhuang May 22, 2024
967d59b
Changelog and doc
austingmhuang May 22, 2024
ba336fe
changelogs
austingmhuang May 22, 2024
62be73d
Merge branch 'update_reqs' into remove_basicaer
austingmhuang May 22, 2024
af29435
Update CHANGELOG.md
austingmhuang May 22, 2024
d8c57c3
deleted a test file
austingmhuang May 22, 2024
33d68b3
removed error
austingmhuang May 22, 2024
ffa1626
basic sim pylint
austingmhuang May 22, 2024
6168532
Update CHANGELOG.md
austingmhuang May 22, 2024
6f19eb6
merge conf
austingmhuang May 22, 2024
d8012f7
remove ifelse block
austingmhuang May 22, 2024
687001a
pylint
austingmhuang May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
### 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)

* The basic aer device has been removed.
austingmhuang marked this conversation as resolved.
Show resolved Hide resolved
[(#546)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/546)

### Deprecations 👋

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

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

---
# Release 0.36.0
Expand Down
32 changes: 0 additions & 32 deletions doc/devices/basicaer.rst

This file was deleted.

11 changes: 3 additions & 8 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ The following devices are available:
:description: Qiskit's staple simulator with great features such as noise models.
:link: devices/aer.html

.. title-card::
:name: 'qiskit.basicaer'
:description: A simplified version of the Aer device, which requires fewer dependencies.
:link: devices/basicaer.html

.. title-card::
:name: 'qiskit.basicsim'
Expand Down Expand Up @@ -76,9 +72,9 @@ follows:

dev = qml.device('qiskit.aer', wires=2, backend='unitary_simulator')

PennyLane chooses the ``qasm_simulator`` as the default backend if no backend is specified.
For more details on the ``qasm_simulator``, including available backend options, see
`Qiskit Qasm Simulator documentation <https://qiskit.org/ecosystem/aer/stubs/qiskit_aer.QasmSimulator.html>`_.
PennyLane chooses the ``aer_simulator`` as the default backend if no backend is specified.
For more details on the ``aer_simulator``, including available backend options, see
`Qiskit Aer Simulator documentation <https://qiskit.github.io/qiskit-aer/stubs/qiskit_aer.AerSimulator.html#qiskit_aer.AerSimulator.run>`_.
austingmhuang marked this conversation as resolved.
Show resolved Hide resolved

Tutorials
~~~~~~~~~
Expand Down Expand Up @@ -138,7 +134,6 @@ hardware access.
:hidden:

devices/aer
devices/basicaer
devices/basicsim
devices/ibmq
devices/runtime
Expand Down
8 changes: 4 additions & 4 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ pennylane==0.34
pybind11==2.11.1
pygments==2.17.2
pygments-github-lexers==0.0.5
qiskit==0.45.3
qiskit-aer==0.13.3
qiskit-ibm-runtime==0.20.0
qiskit-ibm-provider==0.10.0
qiskit==1.0.2
qiskit-aer==0.14.1
qiskit-ibm-runtime==0.23.0
qiskit-ibm-provider==0.11.0
Comment on lines +10 to +13
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this to build docs.

sphinxcontrib-bibtex==2.6.2
sphinx-automodapi==0.17.0
pennylane-sphinx-theme
2 changes: 1 addition & 1 deletion pennylane_qiskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from ._version import __version__
from .aer import AerDevice
from .basic_aer import BasicAerDevice, BasicSimulatorDevice
from .basic_sim import BasicSimulatorDevice
from .ibmq import IBMQDevice
from .remote import RemoteDevice
from .converter import load, load_pauli_op, load_qasm, load_qasm_from_file
Expand Down
49 changes: 1 addition & 48 deletions pennylane_qiskit/basic_aer.py → pennylane_qiskit/basic_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,9 @@

from semantic_version import Version

from qiskit.providers.basic_provider import BasicProvider
from .qiskit_device import QiskitDevice

if Version(qiskit.__version__) >= Version("1.0.0"):
from qiskit.providers.basic_provider import BasicProvider


class BasicAerDevice(QiskitDevice):
"""A PennyLane device for the native Python Qiskit simulator BasicAer.

Please see the `Qiskit documentations <https://qiskit.org/documentation/>`_
further information on the backend options and transpile options.

A range of :code:`backend_options` that will be passed to the simulator and
a range of transpile options can be given as kwargs.

For more information on backends, please visit the
`Basic Aer provider documentation <https://qiskit.org/documentation/apidoc/providers_basicaer.html>`_.

Args:
wires (int or Iterable[Number, str]]): Number of subsystems represented by the device,
or iterable that contains unique labels for the subsystems as numbers (i.e., ``[-1, 0, 2]``)
or strings (``['aux_wire', 'q1', 'q2']``).
backend (str): the desired backend
shots (int or None): number of circuit evaluations/random samples used
to estimate expectation values and variances of observables. For statevector backends,
setting to ``None`` results in computing statistics like expectation values and variances analytically.

Keyword Args:
name (str): The name of the circuit. Default ``'circuit'``.
compile_backend (BaseBackend): The backend used for compilation. If you wish
to simulate a device compliant circuit, you can specify a backend here.
"""

short_name = "qiskit.basicaer"

def __init__(self, wires, shots=1024, backend="qasm_simulator", **kwargs):

max_ver = Version("0.46", partial=True)

if Version(qiskit.__version__) > max_ver:
raise RuntimeError(
f"Qiskit has discontinued the BasicAer device, so it can only be used in"
f"versions of Qiskit below 1.0. You have version {qiskit.__version__} "
f"installed. For a Python simulator, use the 'qiskit.basicsim' device "
f"instead. Alternatively, you can downgrade Qiskit to use the "
f"'qiskit.basicaer' device."
)

super().__init__(wires, provider=qiskit.BasicAer, backend=backend, shots=shots, **kwargs)


class BasicSimulatorDevice(QiskitDevice):
"""A PennyLane device for the native Python Qiskit simulator.
Expand Down
5 changes: 0 additions & 5 deletions requirements-ci-legacy.txt

This file was deleted.

Loading
Loading