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

        :param phi: angle
        :param lamda: angle
        :return: U2 matrix
        """

        self._matrix = (1 / numpy.sqrt(2)) * numpy.array([[1, -numpy.exp(1j * lamda)],
                                                          [numpy.exp(1j * phi), numpy.exp(1j * (phi + lamda))]])
        return self._matrix

        Generate a single-qubit rotation gate with 2 angles

        :param phi: angle
        :param lamda: angle
        :return: U2 matrix
        
Generate a single-qubit rotation gate with 2 angles
Generate a single - qubit rotation gate with 2 angles
def _u2Matrix(self, phi: float, lamda: float) -> numpy.ndarray:
        self._matrix = (1 / numpy.sqrt(2)) * numpy.array([[1, -numpy.exp(1j * lamda)],
                                                          [numpy.exp(1j * phi), numpy.exp(1j * (phi + lamda))]])
        return self._matrix
def _u2Matrix ( self , phi : float , lamda : float ) -> numpy . ndarray : self . _matrix = ( 1 / numpy . sqrt ( 2 ) ) * numpy . array ( [ [ 1 , - numpy . exp ( 1j * lamda ) ] , [ numpy . exp ( 1j * phi ) , numpy . exp ( 1j * ( phi + lamda ) ) ] ] ) return self . _matrix
Generate a single-qubit rotation gate with 2 angles
Generate a single - qubit rotation gate with 2 angles
"""
        Generate a single-qubit rotation gate with 2 angles

        :param phi: angle
        :param lamda: angle
        :return: U2 matrix
        """
None
self
phi
float
None
lamda
float
None