forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Alternative construction mechanism for HLS config (Qiskit#9413)
* Alternative construction mechanism for HLS config * improved how synthesis methods can be specified * fixes * pass over release notes * adding tests for short form * Updating the documentation of HLSConfig and HighLevelSynthesis * removing unnecessary import in documentation --------- Co-authored-by: Luciano Bello <[email protected]>
- Loading branch information
1 parent
c8f0b04
commit eb14fd0
Showing
3 changed files
with
157 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
releasenotes/notes/add-alternative-hls-construction-afec157f7cf15b0b.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
features: | ||
- | | ||
Added an alternative way to specify in :class:`~.HLSConfig` the list of | ||
synthesis methods used for a given high-level-object. | ||
As before, a synthesis method can be specified as a tuple consisting of | ||
the name of the method and additional arguments. Additionally, a synthesis method | ||
can be specified as a tuple consisting of an instance of :class:`.HighLevelSynthesisPlugin` | ||
and additional arguments. Moreover, when there are no additional arguments, a synthesis | ||
method can be specified simply by name or by an instance of :class:`.HighLevelSynthesisPlugin`. | ||
The following example illustrates the new functionality:: | ||
from qiskit import QuantumCircuit | ||
from qiskit.circuit.library.generalized_gates import PermutationGate | ||
from qiskit.transpiler import PassManager | ||
from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis | ||
from qiskit.transpiler.passes.synthesis.high_level_synthesis import ACGSynthesisPermutation | ||
qc = QuantumCircuit(6) | ||
qc.append(PermutationGate([1, 2, 3, 0]), [1, 2, 3, 4]) | ||
# All of the ways to specify hls_config are equivalent | ||
hls_config = HLSConfig(permutation=[("acg", {})]) | ||
hls_config = HLSConfig(permutation=["acg"]) | ||
hls_config = HLSConfig(permutation=[(ACGSynthesisPermutation(), {})]) | ||
hls_config = HLSConfig(permutation=[ACGSynthesisPermutation()]) | ||
# The hls_config can then be passed as an argument to HighLevelSynthesis | ||
pm = PassManager(HighLevelSynthesis(hls_config=hls_config)) | ||
qc_synthesized = pm.run(qc) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters