
    z	i                     J    S r SSKJr  SSKJr  SSKJr  SSKJr  S\S\4S jr	g	)
zK
Circuit synthesis for the CNOTDihedral class for all-to-all connectivity.
    )QuantumCircuit)CNOTDihedral)synth_cnotdihedral_two_qubits)synth_cnotdihedral_generalelemreturnc                 R    U R                   nUS:  a  [        U 5      $ [        U 5      $ )a?  Decompose a :class:`.CNOTDihedral` element into a :class:`.QuantumCircuit`.

For :math:`N \leq 2` qubits this is based on optimal CX-cost decomposition from reference [1].
For :math:`N > 2` qubits this is done using the general non-optimal compilation
routine from reference [2].

Args:
    elem: A :class:`.CNOTDihedral` element.

Returns:
    A circuit implementation of the :class:`.CNOTDihedral` element.

References:
    1. Shelly Garion and Andrew W. Cross, *Synthesis of CNOT-Dihedral circuits
       with optimal number of two qubit gates*, `Quantum 4(369), 2020
       <https://quantum-journal.org/papers/q-2020-12-07-369/>`_
    2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta,
       *Scalable randomized benchmarking of non-Clifford gates*,
       npj Quantum Inf 2, 16012 (2016).
   )
num_qubitsr   r   )r   r   s     s/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_full.pysynth_cnotdihedral_fullr      s*    , JA~,T22%d++    N)
__doc__qiskit.circuitr   qiskit.quantum_infor   ?qiskit.synthesis.cnotdihedral.cnotdihedral_decompose_two_qubitsr   <qiskit.synthesis.cnotdihedral.cnotdihedral_decompose_generalr   r    r   r   <module>r      s0    * , d,, ,> ,r   