
    z	i	                        S r SSKJr  SSKJrJr  SSKJr  SSKJ	r	  \" / SQ/ SQ/ SQ/ S	Q/5       " S
 S\5      5       r
g)zDouble-CNOT gate.    )annotations)SingletonGatestdlib_singleton_key)with_gate_array)StandardGate)   r   r   r   )r   r   r   r   )r   r   r   r   )r   r   r   r   c                  f   ^  \ rS rSrSr\R                  rSSU 4S jjjr\	" 5       r
S rS rSrU =r$ )	DCXGate   u  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}
c                &   > [         TU ]  SS/ US9  g)z2
Args:
    label: An optional label for the gate.
dcx   )labelN)super__init__)selfr   	__class__s     c/home/james-whalen/.local/lib/python3.13/site-packages/qiskit/circuit/library/standard_gates/dcx.pyr   DCXGate.__init__7   s    
 	2U3    c                    SSK Jn  UR                  [        R                  R                  U R                  5      SU R                  S9U l        g)zDefault definitionr   )QuantumCircuitT)legacy_qubitsnameN)	qiskit.circuitr   _from_circuit_datar   DCX_get_definitionparamsr   
definition)r   r   s     r   _defineDCXGate._define@   sC     	2 );;,,T[[9TXT]T] < 
r   c                "    [        U[        5      $ N)
isinstancer
   )r   others     r   __eq__DCXGate.__eq__O   s    %))r   )r    r$   )r   z
str | NonereturnNone)__name__
__module____qualname____firstlineno____doc__r   r   _standard_gater   r   _singleton_lookup_keyr!   r'   __static_attributes____classcell__)r   s   @r   r
   r
      s9    < "%%N4 4 12
* *r   r
   N)r/   
__future__r   qiskit.circuit.singletonr   r   qiskit.circuit._utilsr   qiskit._accelerate.circuitr   r
    r   r   <module>r9      s@     " H 1 3 ,lLIJ:*m :* K:*r   