mirror of https://github.com/Qiskit/qiskit.git
49 lines
2.2 KiB
YAML
49 lines
2.2 KiB
YAML
---
|
|
features:
|
|
- |
|
|
Added a new transpiler analysis pass,
|
|
:class:`~qiskit.transpiler.passes.ContainsInstruction`, to the
|
|
:mod:`qiskit.transpiler.passes` module. This pass is used to determine
|
|
if a circuit contains a specific instruction. It takes in a single
|
|
parameter at initialization, the name of the instruction to check for
|
|
and set a boolean in the property set whether the circuit contains that
|
|
instruction or not. For example::
|
|
|
|
from qiskit.transpiler.passes import ContainsInstruction
|
|
from qiskit.circuit import QuantumCircuit
|
|
|
|
circuit = QuantumCircuit(2)
|
|
circuit.h(0)
|
|
circuit.cx(0, 1)
|
|
circuit.measure_all()
|
|
|
|
property_set = {}
|
|
# Contains Hadamard
|
|
contains_h = ContainsInstruction("h")
|
|
contains_h(circuit, property_set)
|
|
assert property_set["contains_h"] == True
|
|
# Not contains SX
|
|
contains_sx = ContainsInstruction("sx")
|
|
contains_sx(circuit, property_set)
|
|
assert property_set["contains_sx"] == False
|
|
upgrade:
|
|
- |
|
|
The preset pass managers for optimization levels 0, 1, 2, and 3 which are
|
|
generated by
|
|
:func:`~qiskit.transpiler.preset_passmanagers.level_0_pass_manager`,
|
|
:func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager`,
|
|
:func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager`, and
|
|
:func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager`
|
|
respectively will no longer unconditionally run the
|
|
:class:`~qiskit.transpiler.passes.TimeUnitConversion`. Previously, the
|
|
preset pass managers would always run this pass regardless of the inputs
|
|
to the transpiler and the circuit. Now this pass will only be run if
|
|
a ``scheduling_method`` parameter is set or the circuit contains a
|
|
:class:`~qiskit.circuit.Delay` instruction and the
|
|
``instruction_durations`` parameter is set. This change was made in
|
|
the interest of runtime performance as in some cases running
|
|
:func:`~qiskit.compiler.transpile` on circuits with a large number of gates
|
|
and no delays, timing, or scheduling being used the
|
|
:class:`~qiskit.transpiler.passes.TimeUnitConversion` could be the largest
|
|
bottleneck in the transpilation.
|