From 7273facb36c2552b3ef23196bc48e05acf6067be Mon Sep 17 00:00:00 2001 From: Julien Gacon Date: Fri, 29 Sep 2023 10:11:51 +0200 Subject: [PATCH] Deprecate ``qiskit.extensions`` (Qiskit/qiskit#10725) * big moves, import still works * most tests pass (some I cannot seem to run locally) * fix tests -- how to remove DiagonalGate? * typehints and docs * more type hints * Deprecate SQU * deprecate Snapshot * Fix missing future annotations import * minimize deprecation effort * Change to pending deprecation, no exact-location import supported * fix MCG<->MGC typo and snapshot deprecation * fix pylint, try fixing docs * remove gates from extensions toctree * Add reno, fully deprecate SQU and Snapshot * Apply Sasha's review comments - fix usage of .squ and .snapshot w/o import - fix docstring usage of extensions - fix tests * capture snapshot deprecation warning * review comments - capture warning of SQU - update reno to explicitly mention pending deprecation, add DiagonalGate and ExtensionError * missed `diagonal` method --------- Co-authored-by: Alexander Ivrii --- qiskit-docs/migration_guides/opflow_migration.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qiskit-docs/migration_guides/opflow_migration.rst b/qiskit-docs/migration_guides/opflow_migration.rst index 34554934a9..d84638d4ef 100644 --- a/qiskit-docs/migration_guides/opflow_migration.rst +++ b/qiskit-docs/migration_guides/opflow_migration.rst @@ -1004,8 +1004,8 @@ delayed synthesis of the gates or efficient transpilation of the circuits, so th (for example, :class:`~qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE`\). In a similar manner, the :class:`qiskit.opflow.evolutions.MatrixEvolution` class performs evolution by classical matrix exponentiation, - constructing a circuit with :class:`.UnitaryGate`\s or :class:`.HamiltonianGate`\s containing the exponentiation of the operator. - This class is no longer necessary, as the :class:`.HamiltonianGate`\s can be directly handled by the algorithms. + constructing a circuit with :class:`~.library.UnitaryGate`\s or :class:`~.library.HamiltonianGate`\s containing the exponentiation of the operator. + This class is no longer necessary, as the :class:`~.library.HamiltonianGate`\s can be directly handled by the algorithms. Trotterizations --------------- @@ -1046,7 +1046,7 @@ Other Evolution Classes - No direct replacement. The workflow no longer requires a specific operator for evolutions. * - :class:`~qiskit.opflow.evolutions.MatrixEvolution` - - :class:`.HamiltonianGate` + - :class:`~.library.HamiltonianGate` * - :class:`~qiskit.opflow.evolutions.PauliTrotterEvolution` - :class:`.PauliEvolutionGate`