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.
qiskit.synthesis.synth_permutation_basic
synth_permutation_basic(pattern)
Synthesize a permutation circuit for a fully-connected architecture using sorting.
More precisely, if the input permutation is a cycle of length m
, then this creates a quantum circuit with m-1
SWAPs (and of depth m-1
); if the input permutation consists of several disjoint cycles, then each cycle is essentially treated independently.
Parameters
pattern (Union[list[int], np.ndarray]) – permutation pattern, describing which qubits occupy the positions 0, 1, 2, etc. after applying the permutation. That is, pattern[k] = m
when the permutation maps qubit m
to position k
. As an example, the pattern [2, 4, 3, 0, 1]
means that qubit 2
goes to position 0
, qubit 4
goes to position 1
, etc.
Returns
the synthesized quantum circuit.
Return type
Was this page helpful?
Report a bug or request content on GitHub.