# U2Gate#

class qiskit.circuit.library.U2Gate(phi, lam, label=None)[source]#

Bases: Gate

Single-qubit rotation about the X+Z axis.

Implemented using one X90 pulse on IBM Quantum systems:

Warning

This gate is deprecated. Instead, the following replacements should be used

$U2(\phi, \lambda) = U\left(\frac{\pi}{2}, \phi, \lambda\right)$
circuit = QuantumCircuit(1)
circuit.u(pi/2, phi, lambda)


Circuit symbol:

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


Matrix Representation:

$\begin{split}U2(\phi, \lambda) = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -e^{i\lambda} \\ e^{i\phi} & e^{i(\phi+\lambda)} \end{pmatrix}\end{split}$

Examples:

$U2(\phi,\lambda) = e^{i \frac{\phi + \lambda}{2}}RZ(\phi) RY\left(\frac{\pi}{2}\right) RZ(\lambda) = e^{- i\frac{\pi}{4}} P\left(\frac{\pi}{2} + \phi\right) \sqrt{X} P\left(\lambda- \frac{\pi}{2}\right)$
$U2(0, \pi) = H$
$U2(0, 0) = RY(\pi/2)$
$U2(-\pi/2, \pi/2) = RX(\pi/2)$

U3Gate: U3 is a generalization of U2 that covers all single-qubit rotations, using two X90 pulses.

Create new U2 gate.

Attributes

condition_bits#

Get Clbits in condition.

decompositions#

Get the decompositions of the instruction from the SessionEquivalenceLibrary.

definition#

Return definition in terms of other basic gates.

duration#

Get the duration.

label#

Return instruction label

name#

Return the name.

num_clbits#

Return the number of clbits.

num_qubits#

Return the number of qubits.

params#

return instruction params.

unit#

Get the time unit of duration.

Methods

inverse()[source]#

Return inverted U2 gate.

$$U2(\phi, \lambda)^{\dagger} =U2(-\lambda-\pi, -\phi+\pi)$$)