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