# DCXGate¶

class DCXGate[source]

Double-CNOT gate.

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

          ┌───┐
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.

$\begin{split}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}\end{split}$

Create new DCX gate.

Attributes

 DCXGate.decompositions Get the decompositions of the instruction from the SessionEquivalenceLibrary. DCXGate.definition Return definition in terms of other basic gates. DCXGate.label Return gate label DCXGate.params return instruction params.

Methods

 DCXGate.add_decomposition(decomposition) Add a decomposition of the instruction to the SessionEquivalenceLibrary. Assemble a QasmQobjInstruction DCXGate.broadcast_arguments(qargs, cargs) Validation and handling of the arguments and its relationship. DCXGate.c_if(classical, val) Add classical condition on register classical and value val. DCXGate.control([num_ctrl_qubits, label, …]) Return controlled version of gate. DCXGate.copy([name]) Copy of the instruction. Invert this instruction. Return True .IFF. DEPRECATED: use instruction.reverse_ops(). DCXGate.power(exponent) Creates a unitary gate as gate^exponent. Return a default OpenQASM string for the instruction. Creates an instruction with gate repeated n amount of times. For a composite instruction, reverse the order of sub-instructions. Return a numpy.array for the DCX gate.