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 usage of qiskit.extensions #2023

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented Jan 8, 2024

Summary

The qiskit.extensions module has been pending deprecation since Qiskit 0.45. It is deprecated for 0.46 and removed in 1.0.

This is blocking Qiskit/qiskit#11488 and Qiskit/qiskit#11498.

Details and comments

This removal concerns the import location of UnitaryGate and the usage of the ExtensionError. The first is easily fixed, whereas for the latter I tried using ValueError or TypeError, which seemed to cover the error meanings. Technically, this is a breaking change and we could introduce an intermediary class that inherits from the deprecated ExtensionError and the new choice of error. However, since we will soon be changing to 1.0 and we also skipped this in Qiskit Terra (as we thought it highly unlikely that users are actually relying on this error type) it might be fine to just change the error type.

The module has been pending deprecation since Qiskit 0.45.
It is deprecated for 0.46 and removed in 1.0.

This removal concerns the import location of ``UnitaryGate`` and the
usage of the ``ExtensionError``. The first is easily fixed, whereas for
the latter I tried using ``ValueError`` or ``TypeError``, which seemed
to cover the error meanings. Technically, this is a breaking change and
we could introduce an intermediary class that inherits from the deprecated
``ExtensionError`` and the new choice of error. However, since we will
soon be changing to 1.0 and we also skipped this in Qiskit Terra (as we
thought it highly unlikely that users are actually relying on this error
type) it might be fine to just change the error type.
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Changing the error types is technically not stable - what did we do for any ExtensionErrors being raised by the same objects during the move on the Terra side? If we can switch these over to match whatever we did there, that's probably the safest. If not, maybe let's make it QiskitError, since the chances are that if there's anybody attempting to catch these errors, that's what they'll be using.

@Cryoris
Copy link
Contributor Author

Cryoris commented Jan 8, 2024

Yeah that's what I tried to explain above; we didn't do anything and just changed the type: Qiskit/qiskit#10725 (comment). I can add an intermediary type, though that'll require a bunch of filtering warnings for the 0.46 release and is not compatible with Qiskit/qiskit#11488 since there we remove ExtensionError completely, right?

@jakelishman
Copy link
Member

Oh sorry, the GitHub notification just took me to the diff and I missed that I hadn't already read the top comment of this one. Yeah, in that case let's just bite the bullet and accept it here too - if we did it on Terra, it'd be tricky to hold Aer to a higher standard.

@jakelishman
Copy link
Member

(I'll leave unmerged for the Aer team to look.)

@doichanj doichanj merged commit e6aaf03 into Qiskit:main Jan 9, 2024
31 checks passed
@Cryoris Cryoris deleted the remove-extensions branch January 9, 2024 09:11
Cryoris added a commit to Cryoris/qiskit-terra that referenced this pull request Jan 9, 2024
@doichanj doichanj mentioned this pull request Jan 16, 2024
doichanj pushed a commit to doichanj/qiskit-aer that referenced this pull request Jan 16, 2024
The module has been pending deprecation since Qiskit 0.45.
It is deprecated for 0.46 and removed in 1.0.

This removal concerns the import location of ``UnitaryGate`` and the
usage of the ``ExtensionError``. The first is easily fixed, whereas for
the latter I tried using ``ValueError`` or ``TypeError``, which seemed
to cover the error meanings. Technically, this is a breaking change and
we could introduce an intermediary class that inherits from the deprecated
``ExtensionError`` and the new choice of error. However, since we will
soon be changing to 1.0 and we also skipped this in Qiskit Terra (as we
thought it highly unlikely that users are actually relying on this error
type) it might be fine to just change the error type.
doichanj added a commit that referenced this pull request Jan 17, 2024
* PR to release 0.13.2

* Remove usage of ``qiskit.extensions`` (#2023)

The module has been pending deprecation since Qiskit 0.45.
It is deprecated for 0.46 and removed in 1.0.

This removal concerns the import location of ``UnitaryGate`` and the
usage of the ``ExtensionError``. The first is easily fixed, whereas for
the latter I tried using ``ValueError`` or ``TypeError``, which seemed
to cover the error meanings. Technically, this is a breaking change and
we could introduce an intermediary class that inherits from the deprecated
``ExtensionError`` and the new choice of error. However, since we will
soon be changing to 1.0 and we also skipped this in Qiskit Terra (as we
thought it highly unlikely that users are actually relying on this error
type) it might be fine to just change the error type.

* Fix GPU batched execution (#2014)

* Fix GPU batched execution

* format

* Use Apple-specific API to determine system memory on macOS (#2016)

The unistd.h API that had been used for both Linux and macOS is not
always available in macOS environments, for example when building with
upstream clang rather than AppleClang.

Closes #1923

* Remove qiskit.test from test/common.py (#1971)

* remove qiskit.test from test/common.py

* fix format, add releasenote

---------

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>

* raise Qiskit dependency to 0.45.0 (#2008)

Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>

* `deprecate_func(..., since=...)`  should be a string, not a float (#2006)

* deprecate_func "since" parameter should be a str, not a float

* black

* Avoid accessing GPUs when using CPU only (#2012)

* avoid accessing GPUs when using CPU only

* remove unused import/parameter

* Reduce warning meesages (#2013)

* reduce warning meesages

* format

* fix Windows

* uint -> uint_t

* fix Thrust seg fault

* format

* Add support for running with Python 3.12 (#2022)

* Add support for running with Python 3.12

Python 3.12.0 was released on 10-02-2023, this commit marks the start
of support for Python 3.12 in qiskit-aer. It adds the supported Python
version in the package metadata and updates the CI configuration to run
test jobs on Python 3.12 and build Python 3.12 wheels on release.

* Remove numpy constraints

* Uncap six

* Fix i686 build steps

* Use python 3.12.0 in tests to work around unittest breakage in 3.12.1

* Use 3.12.0 for all test jobs

---------

Co-authored-by: Jun Doi <doichan@jp.ibm.com>

* enable bit operations for boolean types (#2024)

Co-authored-by: Jun Doi <doichan@jp.ibm.com>

---------

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Will Shanks <willshanks@us.ibm.com>
Co-authored-by: Hiroshi Horii <hhorii@users.noreply.github.com>
Co-authored-by: Luciano Bello <bel@zurich.ibm.com>
Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Cryoris added a commit to Cryoris/qiskit-terra that referenced this pull request Jan 17, 2024
github-merge-queue bot pushed a commit to Qiskit/qiskit that referenced this pull request Jan 17, 2024
* Delete ``qiskit-extensions`` for 1.0

* add reno

* black

* rm deprecate qc methods + extensions mod

* Update reno, remove dangling TeX file

* Lint and latex test

* Try fix docstring, detailed reno

* Update plot barrier test

Snapshot instruction has been removed

* Skip Aer tests that rely on Qiskit/qiskit-aer#2023

* Fix barrier image

* Revert "Skip Aer tests that rely on Qiskit/qiskit-aer#2023"

This reverts commit 5dbe66d.
github-merge-queue bot pushed a commit to Qiskit/qiskit that referenced this pull request Jan 17, 2024
* Delete ``qiskit-extensions`` for 1.0

* add reno

* black

* rm deprecate qc methods + extensions mod

* Update reno, remove dangling TeX file

* Lint and latex test

* Try fix docstring, detailed reno

* Update plot barrier test

Snapshot instruction has been removed

* Skip Aer tests that rely on Qiskit/qiskit-aer#2023

* Fix barrier image

* Revert "Skip Aer tests that rely on Qiskit/qiskit-aer#2023"

This reverts commit 5dbe66d.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants