qiskit-documentation/docs/api/qiskit/0.42/qiskit.synthesis.synth_perm...

29 lines
1.4 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: synth_permutation_basic
description: API reference for qiskit.synthesis.synth_permutation_basic
in_page_toc_min_heading_level: 1
python_api_type: function
python_api_name: qiskit.synthesis.synth_permutation_basic
---
# qiskit.synthesis.synth\_permutation\_basic
<Function id="qiskit.synthesis.synth_permutation_basic" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/synthesis/permutation/permutation_full.py" signature="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**
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
</Function>