Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate get_vf2_call_limit in preset_passmanagers #10065

Merged
merged 4 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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