ó
    Óz	i’	  ã                  ó>   • S r SSKJr  SSKrSSKJr  SSKJr  SS jr	g)z:Depth-efficient synthesis algorithm for Permutation gates.é    )ÚannotationsN)ÚQuantumCircuit)Ú _synth_permutation_depth_lnn_kmsc                ó>   • [         R                  " [        U 5      SS9$ )a  Synthesize a permutation circuit for a linear nearest-neighbor
architecture using the Kutin, Moulton, Smithline method.

This is the permutation synthesis algorithm from [1], section 6.
It synthesizes any permutation of n qubits over linear nearest-neighbor
architecture using SWAP gates with depth at most :math:`n` and size at most
:math:`n(n-1)/2` (where both depth and size are measured with respect to SWAPs).

Args:
    pattern: 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.

References:
    1. Samuel A. Kutin, David Petrie Moulton and Lawren M. Smithline.
       *Computation at a distance.*,
       `arXiv:quant-ph/0701194v1 <https://arxiv.org/abs/quant-ph/0701194>`_
T)Úlegacy_qubits)r   Ú_from_circuit_datar   )Úpatterns    Úf/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/permutation/permutation_lnn.pyÚsynth_permutation_depth_lnn_kmsr      s!   € ô> ×,Ò,Ü(¨Ó1Àñð ó    )r	   zlist[int] | np.ndarray[int]Úreturnr   )
Ú__doc__Ú
__future__r   ÚnumpyÚnpÚqiskit.circuit.quantumcircuitr   Ú(qiskit._accelerate.synthesis.permutationr   r   © r   r
   Ú<module>r      s   ðñ Aå "Û Ý 8Ý Uõ!r   