Skip to content

Commit

Permalink
Deprecate get_vf2_call_limit in preset_passmanagers (#10065)
Browse files Browse the repository at this point in the history
* Deprecate get_vf2_call_limit in preset_passmanagers

This has been replaced by get_vf2_limits

* Black formatting

* Add release note for #10065
  • Loading branch information
jlapeyre authored May 19, 2023
1 parent 81d3834 commit c3b0afa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions qiskit/transpiler/preset_passmanagers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from typing import Optional

from qiskit.circuit.equivalence_library import SessionEquivalenceLibrary as sel
from qiskit.utils.deprecation import deprecate_func

from qiskit.transpiler.passmanager import PassManager
from qiskit.transpiler.passes import Error
Expand Down Expand Up @@ -546,6 +547,10 @@ def _require_alignment(property_set):
return scheduling


@deprecate_func(
additional_msg="Instead, use :func:`~qiskit.transpiler.preset_passmanagers.common.get_vf2_limits`.",
since="0.25.0",
)
def get_vf2_call_limit(
optimization_level: int,
layout_method: Optional[str] = None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
deprecations:
- |
The function ``get_vf2_call_limit`` available via the module
:mod:`qiskit.transpiler.preset_passmanagers.common` has been
deprecated. This will likely affect very few users since this function was
neither explicitly exported nor documented. Its functionality has been
replaced and extended by a function in the same module.
6 changes: 6 additions & 0 deletions test/python/transpiler/test_preset_passmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import numpy as np

import qiskit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit.circuit import Qubit, Gate, ControlFlowOp, ForLoopOp
from qiskit.compiler import transpile, assemble
Expand Down Expand Up @@ -263,6 +264,11 @@ def counting_callback_func(pass_, dag, time, property_set, count):
)
self.assertEqual(gates_in_basis_true_count + 1, collect_2q_blocks_count)

def test_get_vf2_call_limit_deprecated(self):
"""Test that calling test_get_vf2_call_limit emits deprecation warning."""
with self.assertWarns(DeprecationWarning):
qiskit.transpiler.preset_passmanagers.common.get_vf2_call_limit(optimization_level=3)


@ddt
class TestTranspileLevels(QiskitTestCase):
Expand Down

0 comments on commit c3b0afa

Please sign in to comment.