UGate

class UGate(theta, phi, lam, label=None)[source]

Generic single-qubit rotation gate with 3 Euler angles.

Implemented using two X90 pulses on IBM Quantum systems:

\[U(\theta, \phi, \lambda) = RZ(\phi - \pi/2) RX(\pi/2) RZ(\pi - \theta) RX(\pi/2) RZ(\lambda - \pi/2)\]

Circuit symbol:

     ┌──────────┐
q_0: ┤ U(ϴ,φ,λ) ├
     └──────────┘

Matrix Representation:

\[ \begin{align}\begin{aligned}\newcommand{\th}{\frac{\theta}{2}}\\\begin{split}U(\theta, \phi, \lambda) = \begin{pmatrix} \cos(\th) & -e^{i\lambda}\sin(\th) \\ e^{i\phi}\sin(\th) & e^{i(\phi+\lambda)}\cos(\th) \end{pmatrix}\end{split}\end{aligned}\end{align} \]

Examples:

\[U\left(\theta, -\frac{\pi}{2}, \frac{pi}{2}\right) = RX(\theta)\]
\[U(\theta, 0, 0) = RY(\theta)\]

Create new U gate.

Attributes

UGate.decompositions

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

UGate.definition

Return definition in terms of other basic gates.

UGate.label

Return gate label

UGate.params

return instruction params.

Methods

UGate.add_decomposition(decomposition)

Add a decomposition of the instruction to the SessionEquivalenceLibrary.

UGate.assemble()

Assemble a QasmQobjInstruction

UGate.broadcast_arguments(qargs, cargs)

Validation and handling of the arguments and its relationship.

UGate.c_if(classical, val)

Add classical condition on register classical and value val.

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

Return a (mutli-)controlled-U3 gate.

UGate.copy([name])

Copy of the instruction.

UGate.inverse()

Return inverted U gate.

UGate.is_parameterized()

Return True .IFF.

UGate.mirror()

DEPRECATED: use instruction.reverse_ops().

UGate.power(exponent)

Creates a unitary gate as gate^exponent.

UGate.qasm()

Return a default OpenQASM string for the instruction.

UGate.repeat(n)

Creates an instruction with gate repeated n amount of times.

UGate.reverse_ops()

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

UGate.to_matrix()

Return a numpy.array for the U gate.