§
    ¹³ÙgÒ	  ã                   ó”   — d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	  eg d¢g d¢g d¢g d	¢g¦  «         G d
„ de¦  «        ¦   «         Z
dS )zDouble-CNOT gate.é    )ÚSingletonGateÚstdlib_singleton_key)ÚQuantumRegister)Úwith_gate_array)ÚStandardGate)é   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   c                   óZ   ‡ — e Zd ZdZej        Zddddœˆ fd„Z e¦   «         Z	d„ Z
d„ Zˆ xZS )	ÚDCXGateu  Double-CNOT gate.

    A 2-qubit Clifford gate consisting of two back-to-back
    CNOTs with alternate controls.

    Can be applied to a :class:`~qiskit.circuit.QuantumCircuit`
    with the :meth:`~qiskit.circuit.QuantumCircuit.dcx` method.

    .. code-block:: text

                  â”Œâ”€â”€â”€â”�
        q_0: â”€â”€â– â”€â”€â”¤ X â”œ
             â”Œâ”€â”´â”€â”�â””â”€â”¬â”€â”˜
        q_1: â”¤ X â”œâ”€â”€â– â”€â”€
             â””â”€â”€â”€â”˜

    This is a classical logic gate, equivalent to a CNOT-SWAP (CNS) sequence,
    and locally equivalent to an iSWAP.

    .. math::

        DCX\ q_0, q_1 =
            \begin{pmatrix}
                1 & 0 & 0 & 0 \\
                0 & 0 & 0 & 1 \\
                0 & 1 & 0 & 0 \\
                0 & 0 & 1 & 0
            \end{pmatrix}
    NÚdt)ÚdurationÚunitc                óV   •— t          ¦   «                              ddg |||¬¦  «         dS )zCreate new DCX gate.Údcxé   )Úlabelr   r   N)ÚsuperÚ__init__)Úselfr   r   r   Ú	__class__s       €ú_/granary/edev/quantum/lib/python3.11/site-packages/qiskit/circuit/library/standard_gates/dcx.pyr   zDCXGate.__init__7   s.   ø€ å‰Œ×Ò˜  2¨U¸XÈDÐÑQÔQÐQÐQÐQó    c                 ó  — ddl m} ddlm} t	          dd¦  «        } ||| j        ¬¦  «        } |¦   «         |d         |d         gg f |¦   «         |d         |d         gg fg}|D ]\  }}}|                     |||¦  «         Œ|| _        dS )	z5
        gate dcx a, b { cx a, b; cx b, a; }
        r   )ÚQuantumCircuitr   )ÚCXGater   Úq)ÚnameN)Úqiskit.circuit.quantumcircuitr   Úxr   r   r   Ú_appendÚ
definition)	r   r   r   r   ÚqcÚrulesÚinstrÚqargsÚcargss	            r   Ú_definezDCXGate._define=   sÄ   € ð
 	AÐ@Ð@Ð@Ð@Ð@ØÐÐÐÐÐå˜A˜sÑ#Ô#ˆØˆ^˜A D¤IÐ.Ñ.Ô.ˆØ�&‘(”(˜Q˜qœT 1 Q¤4˜L¨"Ð-°°±´¸1¸Q¼4ÀÀ1Ä¸,ÈÐ/KÐLˆØ#(ð 	,ð 	,ÑˆE�5˜%Ø�JŠJ�u˜e UÑ+Ô+Ð+Ð+àˆŒˆˆr   c                 ó,   — t          |t          ¦  «        S ©N)Ú
isinstancer
   )r   Úothers     r   Ú__eq__zDCXGate.__eq__M   s   € Ý˜%¥Ñ)Ô)Ð)r   r(   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   Ú_standard_gater   r   Ú_singleton_lookup_keyr&   r+   Ú__classcell__)r   s   @r   r
   r
      s–   ø€ € € € € ðð ð< "Ô)€NðR¨t¸$ð Rð Rð Rð Rð Rð Rð Rð 1Ð0Ñ2Ô2Ððð ð ð *ð *ð *ð *ð *ð *ð *r   r
   N)r/   Úqiskit.circuit.singletonr   r   Úqiskit.circuit.quantumregisterr   Úqiskit.circuit._utilsr   Úqiskit._accelerate.circuitr   r
   © r   r   ú<module>r8      sÀ   ðð Ð à HÐ HÐ HÐ HÐ HÐ HÐ HÐ HØ :Ð :Ð :Ð :Ð :Ð :Ø 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3ð €�,�,�,   ¨l¨l¨l¸L¸L¸LÐIÑJÔJð8*ð 8*ð 8*ð 8*ð 8*ˆmñ 8*ô 8*ñ KÔJð8*ð 8*ð 8*r   