qiskit/releasenotes/notes/0.20/vf2layout-preset-passmanage...

35 lines
2.1 KiB
YAML

---
upgrade:
- |
The preset passmanagers in :mod:`qiskit.transpiler.preset_passmanagers`
for all optimization levels 2 and 3 as generated by
:func:`~qiskit.transpiler.preset_passmanagers.level_2_pass_manager` and
:func:`~qiskit.transpiler.preset_passmanagers.level_3_pass_manager` have
been changed to run the :class:`~qiskit.transpiler.passes.VF2Layout` by
default prior to the layout pass. The
:class:`~qiskit.transpiler.passes.VF2Layout` pass will quickly check if
a perfect layout can be found and supersedes what was previously
done for optimization levels 2 and 3 which were using a combination of
:class:`~qiskit.transpiler.passes.TrivialLayout` and
:class:`~qiskit.transpiler.passes.CSPLayout` to try and find a perfect
layout. This will result in potentially different behavior when
:func:`~qiskit.compiler.transpile` is called by default as it removes a
default path for all optimization levels >=2 of using a trivial layout
(where ``circuit.qubits[0]`` is mapped to physical qubit 0,
``circuit.qubits[1]`` is mapped to physical qubit 1, etc) assuming the
trivial layout is perfect. If your use case was dependent on the
trivial layout you can explicitly request it when transpiling by specifying
``layout_method="trivial"`` when calling :func:`~qiskit.compiler.transpile`.
- |
The preset pass manager for optimization level 1 (when calling
:func:`~qiskit.compiler.transpile` with ``optimization_level=1`` or when
no ``optimization_level`` argument is set) as generated by
:func:`~qiskit.transpiler.preset_passmanagers.level_1_pass_manager` has
been changed so that :class:`~qiskit.transpiler.passes.VF2Layout` is
called by default to quickly check if a a perfect layout can be found
prior to the :class:`~qiskit.transpiler.passes.DenseLayout`. However,
unlike with optimization level 2 and 3 a trivial layout is still attempted
prior to running :class:`~qiskit.transpiler.passes.VF2Layout` and if
it's a perfect mapping the output from
:class:`~qiskit.transpiler.passes.VF2Layout` will be used.