About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
KMSSynthesisPermutation
class KMSSynthesisPermutation
Bases: qiskit.transpiler.passes.synthesis.plugin.HighLevelSynthesisPlugin
The permutation synthesis plugin based on the Kutin, Moulton, Smithline method.
This plugin can be accessed by the kms
method name in the HLSConfig
for permutation
. For example:
from qiskit.circuit import QuantumCircuit
from qiskit.circuit.library import PermutationGate
from qiskit.transpiler import PassManager
from qiskit.transpiler.passes.synthesis.high_level_synthesis import HLSConfig, HighLevelSynthesis
from qiskit.transpiler.passes.synthesis.plugin import HighLevelSynthesisPluginManager
# Create a permutation and add it to a quantum circuit
perm = PermutationGate([4, 6, 3, 7, 1, 2, 0, 5])
qc = QuantumCircuit(8)
qc.append(perm, range(8))
# KMSSynthesisPermutation plugin for permutations
# Returns a quantum circuit with size 18 and depth 6
# but adhering to the linear nearest-neighbor architecture.
qct = PassManager(HighLevelSynthesis(HLSConfig(permutation=[("kms", {})]))).run(qc)
print(f"kms: {qct.size() = }, {qct.depth() = }")
Methods
run
KMSSynthesisPermutation.run(high_level_object, **options)
Run synthesis for the given Permutation.
Was this page helpful?
Report a bug or request content on GitHub.