ó
    Óz	i&	  ã                  óV   • S r SSKJr  SSKrSSKJr  SSKJr  SSK	J
r
  SSKJr  S	S jrg)
a‡  
Optimize the synthesis of an n-qubit circuit contains only CX gates for
linear nearest neighbor (LNN) connectivity.
The depth of the circuit is bounded by 5*n, while the gate count is approximately 2.5*n^2

References:
    [1]: Kutin, S., Moulton, D. P., Smithline, L. (2007).
         Computation at a Distance.
         `arXiv:quant-ph/0701194 <https://arxiv.org/abs/quant-ph/0701194>`_.
é    )ÚannotationsN)ÚQiskitError)ÚQuantumCircuit)Úcheck_invertible_binary_matrix)Úpy_synth_cnot_depth_line_kmsc                óx   • [        U 5      (       d  [        S5      e[        U 5      n[        R                  " USS9$ )aÛ  
Synthesize linear reversible circuit for linear nearest-neighbor architectures using
Kutin, Moulton, Smithline method.

Synthesis algorithm for linear reversible circuits from [1], section 7.
This algorithm synthesizes any linear reversible circuit of :math:`n` qubits over
a linear nearest-neighbor architecture using CX gates with depth at most :math:`5n`.

Args:
    mat: A boolean invertible matrix.

Returns:
    The synthesized quantum circuit.

Raises:
    QiskitError: if ``mat`` is not invertible.

References:
    1. Kutin, S., Moulton, D. P., Smithline, L.,
       *Computation at a distance*, Chicago J. Theor. Comput. Sci., vol. 2007, (2007),
       `arXiv:quant-ph/0701194 <https://arxiv.org/abs/quant-ph/0701194>`_
z#The input matrix is not invertible.T)Úlegacy_qubits)r   r   Úfast_kmsr   Ú_from_circuit_data)ÚmatÚcircuit_datas     Úb/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/linear/linear_depth_lnn.pyÚsynth_cnot_depth_line_kmsr       s9   € ô. *¨#×.Ñ.ÜÐ?Ó@Ð@ä˜C“=€Lô ×,Ò,¨\ÈÑNÐNó    )r   znp.ndarray[bool]Úreturnr   )Ú__doc__Ú
__future__r   ÚnumpyÚnpÚqiskit.exceptionsr   Úqiskit.circuitr   Ú+qiskit.synthesis.linear.linear_matrix_utilsr   Ú#qiskit._accelerate.synthesis.linearr   r
   r   © r   r   Ú<module>r      s$   ðñ	õ #Û Ý )Ý )Ý VÝ XõOr   