qiskit/releasenotes/notes/0.22/pluggable-high-level-synthe...

35 lines
2.0 KiB
YAML

---
features:
- |
Introduced a new high level synthesis plugin interface which is used to enable
using alternative synthesis techniques included in external packages
seamlessly with the :class:`~qiskit.transpiler.passes.HighLevelSynthesis`
transpiler pass. These alternative synthesis techniques can be specified for
any "higher-level" objects of type :class:`~.Operation`, as for example for
:class:`~.Clifford` and :class:`~.LinearFunction` objects. This plugin interface
is similar to the one for unitary synthesis. In the latter case, the details on writing
a new plugin appear in the :mod:`qiskit.transpiler.passes.synthesis.plugin` module documentation.
- |
Introduced a new class :class:`~.HLSConfig` which can be used to specify alternative synthesis
algorithms for "higher-level" objects of type :class:`~.Operation`.
For each higher-level object of interest, an object :class:`~.HLSConfig` specifies a list of
synthesis methods and their arguments.
This object can be passed to :class:`.HighLevelSynthesis` transpiler pass or specified
as a parameter ``hls_config`` in :func:`~qiskit.compiler.transpile`.
As an example, let us assume that ``op_a`` and ``op_b`` are names of two higher-level objects,
that ``op_a``-objects have two synthesis methods ``default`` which does require any additional
parameters and ``other`` with two optional integer parameters ``option_1`` and ``option_2``,
that ``op_b``-objects have a single synthesis method ``default``, and ``qc`` is a quantum
circuit containing ``op_a`` and ``op_b`` objects. The following code snippet::
hls_config = HLSConfig(op_b=[("other", {"option_1": 7, "option_2": 4})])
pm = PassManager([HighLevelSynthesis(hls_config=hls_config)])
transpiled_qc = pm.run(qc)
shows how to run the alternative synthesis method ``other`` for ``op_b``-objects, while using the
``default`` methods for all other high-level objects, including ``op_a``-objects.