29 lines
1.6 KiB
Plaintext
29 lines
1.6 KiB
Plaintext
---
|
||
title: synth_permutation_depth_lnn_kms
|
||
description: API reference for qiskit.synthesis.synth_permutation_depth_lnn_kms
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: function
|
||
python_api_name: qiskit.synthesis.synth_permutation_depth_lnn_kms
|
||
---
|
||
|
||
# qiskit.synthesis.synth\_permutation\_depth\_lnn\_kms
|
||
|
||
<Function id="qiskit.synthesis.synth_permutation_depth_lnn_kms" isDedicatedPage={true} github="https://github.com/qiskit/qiskit/tree/stable/0.23/qiskit/synthesis/permutation/permutation_lnn.py" signature="synth_permutation_depth_lnn_kms(pattern)">
|
||
Synthesize a permutation circuit for a linear nearest-neighbor architecture using the Kutin, Moulton, Smithline method.
|
||
|
||
This is the permutation synthesis algorithm from [https://arxiv.org/abs/quant-ph/0701194](https://arxiv.org/abs/quant-ph/0701194), Chapter 6. It synthesizes any permutation of n qubits over linear nearest-neighbor architecture using SWAP gates with depth at most n and size at most n(n-1)/2 (where both depth and size are measured with respect to SWAPs).
|
||
|
||
**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>
|
||
|