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
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
DCX is useful less as an algorithmic primitive and more as a compiler/transpiler building block: it is literally the two-CNOT circuit that appears naturally when routing swaps are partially applied, and Qiskit exposes it as a named gate so transpilers do not have to re-recognize the pattern.
Takes2 qubitsWhat joins here
Takes a 2-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 2 qubits can feed it.
16 entries meet this end. Named below.
Returns2 qubitsWhat joins here
Returns a 2-qubit register a next stage can take. This is the end that joins.
11 entries meet this end. Named below.
A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →
Definition
In the -leftmost basis ordering used throughout this catalog, composing then gives
in the ordered basis (frameworks using a little-endian statevector ordering will print an index-permuted version of this same matrix).
Action on basis states
is a fixed point; the other three basis states form a single 3-cycle , verified by direct basis-state tracking through both CNOTs.
Decomposition
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
- is Clifford, since it is a product of two Clifford () gates.
- (period 3, from the 3-cycle structure), but — unlike , , or , is not self-inverse: .
- differs from (three alternating CNOTs) by exactly one CNOT: , 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.
Takes2 qubitsWhat joins here
Takes a 2-qubit register and states no assumption about what is on it. That is the whole condition: anything returning 2 qubits can feed it.
16 entries meet this end. Named below.
Returns2 qubitsWhat joins here
Returns a 2-qubit register a next stage can take. This is the end that joins.
11 entries meet this end. Named below.
A unitary. The same register goes in and comes out, and this entry states no assumption about what is on it — which is what lets anything of the same width feed it. See all 29 →
- Qubits
- 2
- Depth
- 2 CNOTs (definitional)
- Order
- DCX³ = I (period 3)
- Matrix
- 3-cycle on {01,10,11}, fixes 00 (q[0]-leftmost convention)
- Decomposition
- CX(0→1) · CX(1→0)
- Self-inverse
- No: DCX† = DCX² ≠ DCX
- Gate family
- Clifford
DCXon q[0], q[1]
Quantum vs classical
Classical baseline
Use a classical state-vector or matrix simulation at the same width, precision, and measurement objective.
Quantum claim
The quantum record demonstrates a state or operator behavior; it does not make classical simulation or communication costs disappear.
How to compare
Compare fidelity, samples, gate depth, noise, memory, and the cost of preparing and reading the state.
Nobody has reviewed this record for gaps yet.
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
x q[1];
cx q[0], q[1];
cx q[1], q[0];Related entries
- Controlled-X gate
Gates
- SWAP gate
Gates
- iSWAP gate
Gates
References
- Quantum Computation and Quantum Information: 10th Anniversary Edition
Michael A. Nielsen and Isaac L. Chuang · 2010
Standard reference for gate matrices, the Clifford/non-Clifford distinction, and controlled-gate constructions used throughout this record.
- OpenQASM 3: A broader and deeper quantum assembly language
Andrew W. Cross, Ali Javadi-Abhari, Thomas Alexander, Niel de Beaudrap, Lev S. Bishop, Steven Heidel, Colm A. Ryan, Prasahnt Sivarajah, John Smolin, Jay M. Gambetta, Blake R. Johnson · 2021
Defines the standard gate library (id, sdg, tdg, cy, crz, rxx, rzz, ccx, cx…) used natively by the code snippets on this record.