Quanlse/QOperation/RotationGate.py
def _u3Matrix(self, theta: float, phi: float, lamda: float) -> numpy.ndarray:
        """
        Generate a single-qubit rotation gate with 3 angles

        :param theta: angle
        :param phi: angle
        :param lamda: angle
        :return: U3 matrix
        """

        self._matrix = numpy.array([[numpy.cos(theta / 2.0), -numpy.exp(1j * lamda) * numpy.sin(theta / 2.0)],
                                    [numpy.exp(1j * phi) * numpy.sin(theta / 2.0),
                                     numpy.exp(1j * lamda + 1j * phi) * numpy.cos(theta / 2.0)]])
        return self._matrix

        Generate a single-qubit rotation gate with 3 angles

        :param theta: angle
        :param phi: angle
        :param lamda: angle
        :return: U3 matrix
        
Generate a single-qubit rotation gate with 3 angles
Generate a single - qubit rotation gate with 3 angles
def _u3Matrix(self, theta: float, phi: float, lamda: float) -> numpy.ndarray:
        self._matrix = numpy.array([[numpy.cos(theta / 2.0), -numpy.exp(1j * lamda) * numpy.sin(theta / 2.0)],
                                    [numpy.exp(1j * phi) * numpy.sin(theta / 2.0),
                                     numpy.exp(1j * lamda + 1j * phi) * numpy.cos(theta / 2.0)]])
        return self._matrix
def _u3Matrix ( self , theta : float , phi : float , lamda : float ) -> numpy . ndarray : self . _matrix = numpy . array ( [ [ numpy . cos ( theta / 2.0 ) , - numpy . exp ( 1j * lamda ) * numpy . sin ( theta / 2.0 ) ] , [ numpy . exp ( 1j * phi ) * numpy . sin ( theta / 2.0 ) , numpy . exp ( 1j * lamda + 1j * phi ) * numpy . cos ( theta / 2.0 ) ] ] ) return self . _matrix
Generate a single-qubit rotation gate with 3 angles
Generate a single - qubit rotation gate with 3 angles
"""
        Generate a single-qubit rotation gate with 3 angles

        :param theta: angle
        :param phi: angle
        :param lamda: angle
        :return: U3 matrix
        """
None
self
theta
float
None
phi
float
None
lamda
float
None