diff --git a/qiskit/tools/jupyter/version_table.py b/qiskit/tools/jupyter/version_table.py index 959e155239c4..9d54ed080946 100644 --- a/qiskit/tools/jupyter/version_table.py +++ b/qiskit/tools/jupyter/version_table.py @@ -36,24 +36,14 @@ def qiskit_version_table(self, line="", cell=None): html += "" html += "" - 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"" html += "" diff --git a/qiskit/utils/optionals.py b/qiskit/utils/optionals.py index 68be4fdc2a6b..8655f4346a0c 100644 --- a/qiskit/utils/optionals.py +++ b/qiskit/utils/optionals.py @@ -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. @@ -30,7 +30,7 @@ * - .. py:data:: HAS_AER - :mod:`Qiskit 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 ` is used for accessing IBM Quantum @@ -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 `__, 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 `__ library as a core dependency, and during the change-over period, it was sometimes convenient to convert things into the Python-only `NetworkX `__ format. Some tests of application modules, such as @@ -132,7 +132,7 @@ `__. * - .. 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 `__, which must be installed in order to use them. @@ -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 `__ library is installed. This is generally only needed for Qiskit developers. * - .. py:data:: HAS_TWEEDLEDUM - `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`. diff --git a/qiskit/version.py b/qiskit/version.py index 7be28ae51bcd..79cadf189742 100644 --- a/qiskit/version.py +++ b/qiskit/version.py @@ -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 @@ -94,8 +94,7 @@ class QiskitVersion(Mapping): def __init__(self): self._version_dict = { - "qiskit-terra": __version__, - "qiskit": None, + "qiskit": __version__, } self._loaded = False @@ -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 @@ -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): diff --git a/releasenotes/notes/qiskit_terra_version-956916f7b8d7bbb9.yaml b/releasenotes/notes/qiskit_terra_version-956916f7b8d7bbb9.yaml new file mode 100644 index 000000000000..06ded95fc998 --- /dev/null +++ b/releasenotes/notes/qiskit_terra_version-956916f7b8d7bbb9.yaml @@ -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. diff --git a/test/python/test_version.py b/test/python/test_version.py index c64788b34b3f..3d260d6a3a8e 100644 --- a/test/python/test_version.py +++ b/test/python/test_version.py @@ -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"])
SoftwareVersion
{name}{version}
System information