Standard reference for gate matrices, the Clifford/non-Clifford distinction, and controlled-gate constructions used throughout this record.
doi.org/10.1017/cbo9780511976667 ↗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.
Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.
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.
Circuit & simulation
What this takes and returns
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 →
How it works
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.
Implementation
OPENQASM 3.0;
include "stdgates.inc";
qubit[2] q;
x q[1];
cx q[0], q[1];
cx q[1], q[0];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.
Declared gaps
Nobody has reviewed this record for gaps yet.
Literature & references
Defines the standard gate library (id, sdg, tdg, cy, crz, rxx, rzz, ccx, cx…) used natively by the code snippets on this record.
arxiv.org/abs/2104.14722 ↗