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.

DCXGate.assemble()

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.

DCXGate.inverse()

Invert this instruction.

DCXGate.is_parameterized()

Return True .IFF.

DCXGate.mirror()

DEPRECATED: use instruction.reverse_ops().

DCXGate.power(exponent)

Creates a unitary gate as gate^exponent.

DCXGate.qasm()

Return a default OpenQASM string for the instruction.

DCXGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

DCXGate.reverse_ops()

For a composite instruction, reverse the order of sub-instructions.

DCXGate.to_matrix()

Return a numpy.array for the DCX gate.