XGate¶

class XGate(label=None)[source]

The single-qubit Pauli-X gate ($$\sigma_x$$).

Matrix Representation:

$\begin{split}X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\end{split}$

Circuit symbol:

┌───┐
q_0: ┤ X ├
└───┘

Equivalent to a $$\pi$$ radian rotation about the X axis.

Note

A global phase difference exists between the definitions of $$RX(\pi)$$ and $$X$$.

$\begin{split}RX(\pi) = \begin{pmatrix} 0 & -i \\ -i & 0 \end{pmatrix} = -i X\end{split}$

The gate is equivalent to a classical bit flip.

$\begin{split}|0\rangle \rightarrow |1\rangle \\ |1\rangle \rightarrow |0\rangle\end{split}$

Create new X gate.

Attributes

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

Methods

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