SXGate

class SXGate(label=None)[source]

The single-qubit Sqrt(X) gate (\(\sqrt{X}\)).

Matrix Representation:

\[\begin{split}\sqrt{X} = \frac{1}{2} \begin{pmatrix} 1 + i & 1 - i \\ 1 - i & 1 + i \end{pmatrix}\end{split}\]

Circuit symbol:

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

Note

A global phase difference exists between the definitions of \(RX(\pi/2)\) and \(\sqrt{X}\).

\[\begin{split}RX(\pi/2) = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -i \\ -i & 1 \end{pmatrix} = e^{-i pi/4} \sqrt{X}\end{split}\]

Create new SX gate.

Attributes

SXGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

SXGate.definition

Return definition in terms of other basic gates.

SXGate.label

Return gate label

SXGate.params

return instruction params.

Methods

SXGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

SXGate.assemble()

Assemble a QasmQobjInstruction

SXGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

SXGate.c_if(classical, val)

Add classical condition on register classical and value val.

SXGate.control([num_ctrl_qubits, label, …])

Return a (multi-)controlled-SX gate.

SXGate.copy([name])

Copy of the instruction.

SXGate.inverse()

Return inverse SX gate (i.e.

SXGate.is_parameterized()

Return True .IFF.

SXGate.mirror()

DEPRECATED: use instruction.reverse_ops().

SXGate.power(exponent)

Creates a unitary gate as gate^exponent.

SXGate.qasm()

Return a default OpenQASM string for the instruction.

SXGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

SXGate.reverse_ops()

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

SXGate.to_matrix()

Return a numpy.array for the SX gate.