Skip to content

Commit

Permalink
Remove deprecated BIPMapping pass (#10526)
Browse files Browse the repository at this point in the history
* Remove deprecated BIPMapping pass

This commit removes the deprecated BIPMapping pass. It was deprecated in
qiskit-terra 0.24.0 and the minimum deprecation period has elapsed for
the Qiskit 0.45.0 release. This pass has been moved to an external
plugin that can be installed separately and integrated into the
transpiler more cleanly than a single pass and also separates the
optional dependency on the proprietary CPLEX into a separate package.

* Apply suggestions from code review

Co-authored-by: Kevin Hartman <kevin@hart.mn>

* Remove additional uses of BIPMapping

There were still two locations where the BIPMapping pass was being used.
First the dedicated unit tests, and then also import redirects for the
docs and easier access. This commit removes these locations so nothing
left is using the BIPMapping pass.

* Update optionals documentation

* Update install commands

---------

Co-authored-by: Kevin Hartman <kevin@hart.mn>
  • Loading branch information
mtreinish and kevinhartman authored Sep 12, 2023
1 parent 884cfe6 commit 2ab1e54
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 1,156 deletions.
2 changes: 0 additions & 2 deletions qiskit/transpiler/passes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
LookaheadSwap
StochasticSwap
SabreSwap
BIPMapping
Commuting2qGateRouter
Basis Change
Expand Down Expand Up @@ -199,7 +198,6 @@
from .routing import LookaheadSwap
from .routing import StochasticSwap
from .routing import SabreSwap
from .routing import BIPMapping
from .routing import Commuting2qGateRouter

# basis change
Expand Down
1 change: 0 additions & 1 deletion qiskit/transpiler/passes/routing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@
from .lookahead_swap import LookaheadSwap
from .stochastic_swap import StochasticSwap
from .sabre_swap import SabreSwap
from .bip_mapping import BIPMapping
from .commuting_2q_gate_routing.commuting_2q_gate_router import Commuting2qGateRouter
from .commuting_2q_gate_routing.swap_strategy import SwapStrategy
497 changes: 0 additions & 497 deletions qiskit/transpiler/passes/routing/algorithms/bip_model.py

This file was deleted.

273 changes: 0 additions & 273 deletions qiskit/transpiler/passes/routing/bip_mapping.py

This file was deleted.

10 changes: 6 additions & 4 deletions qiskit/utils/optionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
* - .. py:data:: HAS_CPLEX
- The `IBM CPLEX Optimizer <https://www.ibm.com/analytics/cplex-optimizer>`__ is a
high-performance mathematical programming solver for linear, mixed-integer and quadratic
programming. It is required by the :class:`.BIPMapping` transpiler pass.
programming. This is no longer by Qiskit, but it weas historically and the optional
remains for backwards compatibility.
* - .. py:data:: HAS_CVXPY
- `CVXPY <https://www.cvxpy.org/>`__ is a Python package for solving convex optimization
Expand All @@ -68,7 +69,8 @@
* - .. py:data:: HAS_DOCPLEX
- `IBM Decision Optimization CPLEX Modelling
<http://ibmdecisionoptimization.github.io/docplex-doc/>`__ is a library for prescriptive
analysis. Like CPLEX, it is required for the :class:`.BIPMapping` transpiler pass.
analysis. Like CPLEX, this is no longer by Qiskit, but it weas historically and the
optional remains for backwards compatibility.
* - .. py:data:: HAS_FIXTURES
- The test suite has additional features that are available if the optional `fixtures
Expand Down Expand Up @@ -246,13 +248,13 @@

HAS_CPLEX = _LazyImportTester(
"cplex",
install="pip install 'qiskit-terra[bip-mapper]'",
install="pip install cplex",
msg="This may not be possible for all Python versions and OSes",
)
HAS_CVXPY = _LazyImportTester("cvxpy", install="pip install cvxpy")
HAS_DOCPLEX = _LazyImportTester(
{"docplex": (), "docplex.mp.model": ("Model",)},
install="pip install 'qiskit-terra[bip-mapper]'",
install="pip install docplex",
msg="This may not be possible for all Python versions and OSes",
)
HAS_FIXTURES = _LazyImportTester("fixtures", install="pip install fixtures")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
upgrade:
- |
The deprecated transpiler routing pass, ``BIPMapping`` has been removed.
It was marked as deprecated in the Qiskit 0.43.0 release. It has been
replaced by an external plugin package: ``qiskit-bip-mapper``. Details for
this new package can be found at the package's github repository:
https://github.com/qiskit-community/qiskit-bip-mapper
The pass was made into a separate plugin package for two reasons, first
the dependency on CPLEX makes it harder to use and secondly the plugin
package more cleanly integrates with :func:`~.transpile`. The optional
extra ``bip-mapper`` to install the ``cplex`` and ``docplex`` to support
this pass has been removed as nothing in Qiskit optionally requires it anymore.
Loading

0 comments on commit 2ab1e54

Please sign in to comment.