← Atlas

Gates · Two-qubit gate

DCX (double-CNOT) gate

A two-qubit permutation gate defined as two CNOTs with reversed control and target applied back to back — a genuinely different two-CNOT gate from SWAP (which uses three), and notable for not being self-inverse.

Exact & formalUpdated

View frozen graph

q[0]q[1]Step 1 of 1 · DCX · on q[0], q[1]DCX

1 step across 2 wires. Hover a step, or press play to go through them in order.

Expected outcomes

  • |01⟩ → |11⟩100%
  • |10⟩ → |01⟩100%
  • Steps1
  • Wires2
  • Qubits2
  • Depth2 CNOTs (definitional)
  • OrderDCX³ = I (period 3)
  • Papers2

Definition

In the q[0]q[0]-leftmost basis ordering used throughout this catalog, composing CX(q0 ⁣→ ⁣q1)\mathrm{CX}(q_0\!\to\!q_1) then CX(q1 ⁣→ ⁣q0)\mathrm{CX}(q_1\!\to\!q_0) gives

DCX=(1000001000010100)\mathrm{DCX} = \begin{pmatrix} 1&0&0&0\\0&0&1&0\\0&0&0&1\\0&1&0&0 \end{pmatrix}

in the ordered basis {∣00⟩,∣01⟩,∣10⟩,∣11⟩}\{|00\rangle,|01\rangle,|10\rangle,|11\rangle\} (frameworks using a little-endian statevector ordering will print an index-permuted version of this same matrix).

Action on basis states

DCX∣00⟩=∣00⟩,DCX∣01⟩=∣11⟩,DCX∣10⟩=∣01⟩,DCX∣11⟩=∣10⟩\mathrm{DCX}|00\rangle = |00\rangle, \qquad \mathrm{DCX}|01\rangle = |11\rangle, \qquad \mathrm{DCX}|10\rangle = |01\rangle, \qquad \mathrm{DCX}|11\rangle = |10\rangle

∣00⟩|00\rangle is a fixed point; the other three basis states form a single 3-cycle ∣01⟩→∣11⟩→∣10⟩→∣01⟩|01\rangle\to|11\rangle\to|10\rangle\to|01\rangle, verified by direct basis-state tracking through both CNOTs.

Decomposition

DCX=CX(q1 ⁣→ ⁣q0)⋅CX(q0 ⁣→ ⁣q1)\mathrm{DCX} = \mathrm{CX}(q_1\!\to\!q_0)\cdot \mathrm{CX}(q_0\!\to\!q_1)

This is not really a "decomposition" in the sense of compiling a hardware-hard gate down to easier ones — two reversed CNOTs is the definition of DCX. The gate exists as a named primitive because this exact two-CNOT pattern recurs often enough in routing and partial-SWAP contexts to be worth naming directly.

Key identities

  • DCX\mathrm{DCX} is Clifford, since it is a product of two Clifford (CX\mathrm{CX}) gates.
  • DCX3=I⊗I\mathrm{DCX}^3 = I\otimes I (period 3, from the 3-cycle structure), but DCX2≠I⊗I\mathrm{DCX}^2 \ne I\otimes I — unlike CX\mathrm{CX}, CZ\mathrm{CZ}, or SWAP\mathrm{SWAP}, DCX\mathrm{DCX} is not self-inverse: DCX†=DCX2≠DCX\mathrm{DCX}^\dagger = \mathrm{DCX}^2 \ne \mathrm{DCX}.
  • DCX\mathrm{DCX} differs from SWAP\mathrm{SWAP} (three alternating CNOTs) by exactly one CNOT: SWAP=CX(q0 ⁣→ ⁣q1)⋅DCX\mathrm{SWAP} = \mathrm{CX}(q_0\!\to\!q_1)\cdot\mathrm{DCX}, so appending one more CNOT to DCX completes a full SWAP.
  • Because DCX is built from only two CNOTs rather than three, it is cheaper than a full SWAP whenever a circuit only needs the specific 3-cycle permutation rather than a genuine two-qubit exchange.

References

Exact & formal
  • Basis-state truth table
  • Unitary / matrix equivalence
  • Textbook / standard citation
Method
Track all four computational-basis inputs through CX(q0→q1) followed by CX(q1→q0) and compare the resulting permutation against the direct DCX definition.
Result
Pass · |00⟩→|00⟩, |01⟩→|11⟩, |10⟩→|01⟩, |11⟩→|10⟩, exactly the 3-cycle on {|01⟩,|10⟩,|11⟩} produced by the two-CNOT composition.
Qiskit DCXGate documentation ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
CC BY 4.0-compatible reference metadata
double cnottwo qubitcliffordrouting

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.