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

qiskit-terra == qiskit, in version libraries #10425

Merged
merged 30 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3b97cf3
__qiskit_version__ deprecation
1ucian0 Jun 7, 2023
251c13b
reno
1ucian0 Jun 7, 2023
2100746
reno feature
1ucian0 Jun 7, 2023
c527232
Merge branch 'main' of github.com:Qiskit/qiskit-terra into fixes/9753/1
1ucian0 Jun 10, 2023
d30025c
PackageNotFoundError
1ucian0 Jun 10, 2023
6764115
revert stacklevel=2
1ucian0 Jun 10, 2023
db99e1d
revert change in test
1ucian0 Jun 10, 2023
c32a965
Merge branch 'main' of github.com:Qiskit/qiskit-terra into fixes/9753/1
1ucian0 Jul 13, 2023
d0d8588
remove OrderedDict
1ucian0 Jul 13, 2023
a846ffe
other qiskit.__qiskit_version__ packages have their own __version__
1ucian0 Jul 13, 2023
bab5901
wording in the reno
1ucian0 Jul 13, 2023
08a3778
qiskit-terra == qiskit in version libraries
1ucian0 Jul 13, 2023
51aa73a
lint
1ucian0 Jul 13, 2023
940c83a
conflict
1ucian0 Jul 13, 2023
7b27fc6
readjust test
1ucian0 Jul 13, 2023
92b4ee1
raise an exception with a custom gate with no qubits or with one-or-m…
1ucian0 Jul 16, 2023
0c55990
Merge branch 'main' of github.com:Qiskit/qiskit-terra into fix/10435/1
1ucian0 Jul 18, 2023
9a24a1d
Merge branch 'main' of github.com:Qiskit/qiskit-terra into fix/10435/1
1ucian0 Jul 23, 2023
fc0d3be
QASM2ExportError
1ucian0 Jul 23, 2023
b4e8ce8
test_circuit_raises_invalid_custom_gate_1
1ucian0 Jul 24, 2023
a8127ba
test_circuit_raises_invalid_custom_gate_2
1ucian0 Jul 24, 2023
a03841e
reno
1ucian0 Jul 24, 2023
47e6eaf
conflict
1ucian0 Jul 24, 2023
980905d
revert
1ucian0 Jul 24, 2023
eb49e3d
revert
1ucian0 Jul 24, 2023
dbd1a14
conflict
1ucian0 Aug 4, 2023
e8e20d8
adapt test
1ucian0 Aug 4, 2023
40cf458
reno
1ucian0 Aug 4, 2023
bb80e1d
conflicts
1ucian0 Aug 25, 2023
cf5ba3c
conflict
1ucian0 Aug 28, 2023
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
14 changes: 2 additions & 12 deletions qiskit/tools/jupyter/version_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,14 @@ def qiskit_version_table(self, line="", cell=None):
html += "<table>"
html += "<tr><th>Software</th><th>Version</th></tr>"

packages = {"qiskit": None}

packages["qiskit-terra"] = qiskit.__version__

packages = {"qiskit": qiskit.__version__}
qiskit_modules = {module.split(".")[0] for module in modules.keys() if "qiskit" in module}

for qiskit_module in qiskit_modules:
packages[qiskit_module] = getattr(modules[qiskit_module], "__version__", None)

from importlib.metadata import metadata, PackageNotFoundError

try:
packages["qiskit"] = metadata("qiskit")["Version"]
except PackageNotFoundError:
packages["qiskit"] = None

for name, version in packages.items():
if name == "qiskit" or version:
if version:
html += f"<tr><td><code>{name}</code></td><td>{version}</td></tr>"

html += "<tr><th colspan='2'>System information</th></tr>"
Expand Down
14 changes: 7 additions & 7 deletions qiskit/utils/optionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"""
.. currentmodule:: qiskit.utils.optionals
Qiskit Terra, and many of the other Qiskit components, have several features that are enabled only
Qiskit has several features that are enabled only
if certain *optional* dependencies are satisfied. This module is a collection of objects that can
be used to test if certain functionality is available, and optionally raise
:class:`.MissingOptionalLibraryError` if the functionality is not available.
Expand All @@ -30,7 +30,7 @@
* - .. py:data:: HAS_AER
- :mod:`Qiskit Aer <qiskit.providers.aer>` provides high-performance simulators for the
quantum circuits constructed within Qiskit Terra.
quantum circuits constructed within Qiskit.
* - .. py:data:: HAS_IBMQ
- The :mod:`Qiskit IBMQ Provider <qiskit.providers.ibmq>` is used for accessing IBM Quantum
Expand Down Expand Up @@ -92,12 +92,12 @@
interactivity features.
* - .. py:data:: HAS_MATPLOTLIB
- Qiskit Terra provides several visualisation tools in the :mod:`.visualization` module.
- Qiskit provides several visualisation tools in the :mod:`.visualization` module.
Almost all of these are built using `Matplotlib <https://matplotlib.org/>`__, which must
be installed in order to use them.
* - .. py:data:: HAS_NETWORKX
- No longer used by Terra. Internally, Qiskit now uses the high-performance `rustworkx
- No longer used by Qiskit. Internally, Qiskit now uses the high-performance `rustworkx
<https://github.com/Qiskit/rustworkx>`__ library as a core dependency, and during the
change-over period, it was sometimes convenient to convert things into the Python-only
`NetworkX <https://networkx.org/>`__ format. Some tests of application modules, such as
Expand Down Expand Up @@ -132,7 +132,7 @@
<https://qiskit.github.io/qiskit-qasm3-import>`__.
* - .. py:data:: HAS_SEABORN
- Qiskit Terra provides several visualisation tools in the :mod:`.visualization` module. Some
- Qiskit provides several visualisation tools in the :mod:`.visualization` module. Some
of these are built using `Seaborn <https://seaborn.pydata.org/>`__, which must be installed
in order to use them.
Expand All @@ -156,13 +156,13 @@
:class:`~.circuit.Parameter`\\ s if available.
* - .. py:data:: HAS_TESTTOOLS
- Qiskit Terra's test suite has more advanced functionality available if the optional
- Qiskit's test suite has more advanced functionality available if the optional
`testtools <https://pypi.org/project/testtools/>`__ library is installed. This is generally
only needed for Qiskit developers.
* - .. py:data:: HAS_TWEEDLEDUM
- `Tweedledum <https://github.com/boschmitt/tweedledum>`__ is an extension library for
synthesis and optimization of circuits that may involve classical oracles. Qiskit Terra's
synthesis and optimization of circuits that may involve classical oracles. Qiskit's
:class:`.PhaseOracle` uses this, which is used in turn by amplification algorithms via
the :class:`.AmplificationProblem`.
Expand Down
12 changes: 2 additions & 10 deletions qiskit/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# pylint: disable=no-name-in-module,broad-except,cyclic-import

"""Contains Qiskit (terra) version."""
"""Contains Qiskit version."""

import os
import subprocess
Expand Down Expand Up @@ -94,8 +94,7 @@ class QiskitVersion(Mapping):

def __init__(self):
self._version_dict = {
"qiskit-terra": __version__,
"qiskit": None,
"qiskit": __version__,
}
self._loaded = False

Expand All @@ -109,9 +108,6 @@ def _load_versions(self):
category=DeprecationWarning,
stacklevel=3,
)

from importlib.metadata import version

try:
# TODO: Update to use qiskit_aer instead when we remove the
# namespace redirect
Expand Down Expand Up @@ -156,10 +152,6 @@ def _load_versions(self):
self._version_dict["qiskit-machine-learning"] = qiskit_machine_learning.__version__
except Exception:
self._version_dict["qiskit-machine-learning"] = None
try:
self._version_dict["qiskit"] = version("qiskit")
except Exception:
self._version_dict["qiskit"] = None
self._loaded = True

def __repr__(self):
Expand Down
4 changes: 4 additions & 0 deletions releasenotes/notes/qiskit_terra_version-956916f7b8d7bbb9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
upgrade:
- |
The magic ``%qiskit_version_table`` from ``qiskit.tools.jupyter`` and the deprecated ``qiskit.__qiskit_version__`` do not include `qiskit-terra` anymore. Now Qiskit Terra is called Qiskit.
2 changes: 1 addition & 1 deletion test/python/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ class TestVersion(QiskitTestCase):
def test_qiskit_version(self):
"""Test qiskit-version sets the correct version for terra."""
with self.assertWarnsRegex(DeprecationWarning, "__qiskit_version__"):
self.assertEqual(__version__, __qiskit_version__["qiskit-terra"])
self.assertEqual(__version__, __qiskit_version__["qiskit"])