qiskit/extensions/standard/u2.py
def to_matrix(self):
        """Return a Numpy.array for the U3 gate."""
        isqrt2 = 1 / numpy.sqrt(2)
        phi, lam = self.params
        phi, lam = float(phi), float(lam)
        return numpy.array([[isqrt2, -numpy.exp(1j * lam) * isqrt2],
                            [
                                numpy.exp(1j * phi) * isqrt2,
                                numpy.exp(1j * (phi + lam)) * isqrt2
                            ]],
                           dtype=complex)
def to_matrix(self):
        """Return a Numpy.array for the U3 gate."""
        isqrt2 = 1 / numpy.sqrt(2)
        phi, lam = self.params
        phi, lam = float(phi), float(lam)
        return numpy.array([[isqrt2, -numpy.exp(1j * lam) * isqrt2],
                            [
                                numpy.exp(1j * phi) * isqrt2,
                                numpy.exp(1j * (phi + lam)) * isqrt2
                            ]],
                           dtype=complex)
def to_matrix ( self ) : isqrt2 = 1 / numpy . sqrt ( 2 ) phi , lam = self . params phi , lam = float ( phi ) , float ( lam ) return numpy . array ( [ [ isqrt2 , - numpy . exp ( 1j * lam ) * isqrt2 ] , [ numpy . exp ( 1j * phi ) * isqrt2 , numpy . exp ( 1j * ( phi + lam ) ) * isqrt2 ] ] , dtype = complex )
Return a Numpy.array for the U3 gate.
Return a Numpy . array for the U3 gate .