Skip to content

Commit

Permalink
Deprecate the BIPMapping transpiler pass in favor of external plugin
Browse files Browse the repository at this point in the history
This commit deprecates the BIPMapping transpiler pass. Since its
introduction the pass has been in a weird state since it's introduction.
It is a standalone transpiler pass that we never integrated it into
transpile() because it has an external dependency on cplex which is a
proprietary software package that most people don't have access too.
With the introduction of the transpiler stage plugin interface the pass
has been turned into an external package:

https://github.com/qiskit-community/qiskit-bip-mapper

By using the plugin interface the pass can now be cleanly integrates
into the transpile() function and also makes the requirement to have
cplex installed much more explicit. For users with cplex it's much
easier to run the BIPMapping pass as part of a transpilation workflow
with `transpile(..., routing_method="bip")`.

Closes #8662
  • Loading branch information
mtreinish committed Apr 6, 2023
1 parent fe2f0f2 commit 483336e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qiskit/transpiler/passes/routing/algorithms/bip_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
trace_to_fid,
)
from qiskit.utils import optionals as _optionals
from qiskit.utils.deprecation import deprecate_func

logger = logging.getLogger(__name__)

Expand All @@ -41,6 +42,12 @@ class BIPMappingModel:
the solution will be stored in :attr:`solution`). None if it's not yet set.
"""

@deprecate_func(
since="0.24.0",
additional_msg="This has been replaced by a new transpiler plugin package: "
"qiskit-bip-mapper. More details can be found here: "
"https://github.com/qiskit-community/qiskit-bip-mapper",
)
def __init__(self, dag, coupling_map, qubit_subset, dummy_timesteps=None):
"""
Args:
Expand Down
7 changes: 7 additions & 0 deletions qiskit/transpiler/passes/routing/bip_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from qiskit.transpiler import TransformationPass
from qiskit.transpiler.exceptions import TranspilerError
from qiskit.transpiler.passes.routing.algorithms.bip_model import BIPMappingModel
from qiskit.utils.deprecation import deprecate_func

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -62,6 +63,12 @@ class BIPMapping(TransformationPass):
`arXiv:2106.06446 <https://arxiv.org/abs/2106.06446>`_
"""

@deprecate_func(
since="0.24.0",
additional_msg="This has been replaced by a new transpiler plugin package: "
"qiskit-bip-mapper. More details can be found here: "
"https://github.com/qiskit-community/qiskit-bip-mapper",
)
def __init__(
self,
coupling_map,
Expand Down
14 changes: 14 additions & 0 deletions releasenotes/notes/deprecate-bip-mapping-f0025c4c724e1ec8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
deprecations:
- |
The transpiler routing pass, :class:`~.BIPMapping` has been deprecated
and will be removed in a future 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
packge more cleanly integrates with :func:`~.transpile`.

0 comments on commit 483336e

Please sign in to comment.