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.duration

Get the duration.

XGate.label

Return gate label

XGate.params

return instruction params.

XGate.unit

Get the time unit of duration.

Methods

XGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

XGate.assemble()

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.

XGate.inverse()

Return inverted X gate (itself).

XGate.is_parameterized()

Return True .IFF.

XGate.mirror()

DEPRECATED: use instruction.reverse_ops().

XGate.power(exponent)

Creates a unitary gate as gate^exponent.

XGate.qasm()

Return a default OpenQASM string for the instruction.

XGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

XGate.reverse_ops()

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

XGate.to_matrix()

Return a numpy.array for the X gate.

XGate.validate_parameter(parameter)

Gate parameters should be int, float, or ParameterExpression