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 all 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* The test suite no longer runs for Qiskit versions below 0.46.
[(#536)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/536)

* The ``qiskit.basicaer`` device has been removed because it is not supported for versions of Qiskit above 0.46.
[(#546)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/546)

### Deprecations 👋

### Documentation 📝
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
111 changes: 0 additions & 111 deletions pennylane_qiskit/basic_aer.py

This file was deleted.

49 changes: 49 additions & 0 deletions pennylane_qiskit/basic_sim.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2019 Xanadu Quantum Technologies Inc.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
This module contains the :class:`~.BasicAerDevice` class, a PennyLane device that allows
evaluation and differentiation of Qiskit Terra's BasicAer simulator
using PennyLane.
"""
from qiskit.providers.basic_provider import BasicProvider
from .qiskit_device import QiskitDevice


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

For more information on the ``BasicSimulator`` backend options and transpile options, please visit the
`BasicProvider documentation <https://docs.quantum.ibm.com/api/qiskit/providers_basic_provider>`_.
These options can be passed to this plugin device as keyword arguments.

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.
"""

short_name = "qiskit.basicsim"

analytic_warning_message = (
"The plugin does not currently support analytic calculation of expectations, variances "
"and probabilities with the BasicProvider backend {}. Such statistics obtained from this "
"device are estimates based on samples."
)

def __init__(self, wires, shots=1024, backend="basic_simulator", **kwargs):
super().__init__(wires, provider=BasicProvider(), backend=backend, shots=shots, **kwargs)
48 changes: 4 additions & 44 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,44 +1,4 @@
appdirs==1.4.4
autograd==1.6.2
autoray==0.6.8
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
charset-normalizer==3.3.2
cryptography==42.0.5
Cython==3.0.8
dill==0.3.8
future==1.0.0
idna==3.6
mpmath==1.3.0
networkx==3.2.1
ninja==1.11.1.1
ntlm-auth==1.5.0
numpy==1.26.4
orjson==3.9.15
pbr==6.0.0
pennylane==0.34
PennyLane-Lightning==0.34
ply==3.11
psutil==5.9.8
pycparser==2.21
python-constraint==1.4.0
python-dateutil==2.8.2
qiskit==0.45.3
qiskit-aer==0.13.3
qiskit-ibm-runtime==0.20.0
qiskit-ibm-provider==0.10.0
qiskit-ignis==0.7.1
qiskit-terra==0.45.3
requests==2.31.0
requests-ntlm==1.2.0
retworkx==0.14.1
scipy==1.12.0
semantic-version==2.10.0
six==1.16.0
stevedore==5.2.0
symengine==0.11.0
sympy==1.12
toml==0.10.2
urllib3==2.2.1
websocket-client==1.7.0
pennylane>=0.32
qiskit
numpy
sympy
28 changes: 9 additions & 19 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@
import os
import pytest
import numpy as np
import qiskit

import pennylane as qml
from semantic_version import Version
from qiskit_ibm_provider import IBMProvider
from pennylane_qiskit import AerDevice, BasicAerDevice, BasicSimulatorDevice
from pennylane_qiskit import AerDevice, BasicSimulatorDevice

# pylint: disable=protected-access, unused-argument, redefined-outer-name

Expand All @@ -40,22 +38,14 @@
A = np.array([[1.02789352, 1.61296440 - 0.3498192j], [1.61296440 + 0.3498192j, 1.23920938 + 0j]])


if Version(qiskit.__version__) < Version("1.0.0"):
test_devices = [AerDevice, BasicAerDevice]
hw_backends = ["qasm_simulator", "aer_simulator"]
state_backends = [
"statevector_simulator",
"unitary_simulator",
]
else:
test_devices = [AerDevice, BasicSimulatorDevice]
hw_backends = ["qasm_simulator", "aer_simulator", "basic_simulator"]
state_backends = [
"statevector_simulator",
"unitary_simulator",
"aer_simulator_statevector",
"aer_simulator_unitary",
]
test_devices = [AerDevice, BasicSimulatorDevice]
hw_backends = ["qasm_simulator", "aer_simulator", "basic_simulator"]
state_backends = [
"statevector_simulator",
"unitary_simulator",
"aer_simulator_statevector",
"aer_simulator_unitary",
]


@pytest.fixture
Expand Down
Loading
Loading