Skip to content

Commit

Permalink
Merge branch 'main' into hls-import
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Jan 11, 2024
2 parents 68d6a57 + 5d5bfa9 commit 14a0ea6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 30 deletions.
4 changes: 3 additions & 1 deletion qiskit/circuit/quantumcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,9 @@ def add_register(self, *regs: Register | int | Sequence[Bit]) -> None:

def add_bits(self, bits: Iterable[Bit]) -> None:
"""Add Bits to the circuit."""
duplicate_bits = set(self._qubit_indices).union(self._clbit_indices).intersection(bits)
duplicate_bits = {
bit for bit in bits if bit in self._qubit_indices or bit in self._clbit_indices
}
if duplicate_bits:
raise CircuitError(f"Attempted to add bits found already in circuit: {duplicate_bits}")

Expand Down
23 changes: 0 additions & 23 deletions qiskit/transpiler/preset_passmanagers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

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

from qiskit.passmanager.flow_controllers import ConditionalController
from qiskit.transpiler.passmanager import PassManager
Expand Down Expand Up @@ -609,28 +608,6 @@ 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",
package_name="qiskit-terra",
)
def get_vf2_call_limit(
optimization_level: int,
layout_method: Optional[str] = None,
initial_layout: Optional[Layout] = None,
) -> Optional[int]:
"""Get the vf2 call limit for vf2 based layout passes."""
vf2_call_limit = None
if layout_method is None and initial_layout is None:
if optimization_level == 1:
vf2_call_limit = int(5e4) # Set call limit to ~100ms with rustworkx 0.10.2
elif optimization_level == 2:
vf2_call_limit = int(5e6) # Set call limit to ~10 sec with rustworkx 0.10.2
elif optimization_level == 3:
vf2_call_limit = int(3e7) # Set call limit to ~60 sec with rustworkx 0.10.2
return vf2_call_limit


VF2Limits = collections.namedtuple("VF2Limits", ("call_limit", "max_trials"))


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
upgrade:
- |
Removed deprecated function :func:`~qiskit.transpiler.preset_passmanagers.common.get_vf2_call_limit`
and its corresponding test. Instead, use
:func:`~qiskit.transpiler.preset_passmanagers.common.get_vf2_limits`
6 changes: 0 additions & 6 deletions test/python/transpiler/test_preset_passmanagers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

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 @@ -272,11 +271,6 @@ 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 14a0ea6

Please sign in to comment.