qlazy/DensOp.py
def spectrum(self):
        """
        get the spectrum.

        Parameters
        ----------
        None

        Returns
        -------
        qstate : list of QState
            list of the quantum state basis.
        prob : list of float
            list of coefficients for each quantum states basis.

        """
        mat = self.get_elm()
        eigvals,eigvecs = self.__mat_spectrum(mat)
        prob = [eigvals[i] for i in range(len(eigvals)) if abs(eigvals[i]) > EPS]
        vecs = [eigvecs[i] for i in range(len(eigvals)) if abs(eigvals[i]) > EPS]
        qstate = [QState(vector=vecs[i]) for i in range(len(prob))]

        #return prob,qstate
        return qstate,prob

        get the spectrum.

        Parameters
        ----------
        None

        Returns
        -------
        qstate : list of QState
            list of the quantum state basis.
        prob : list of float
            list of coefficients for each quantum states basis.

        
get the spectrum.
Parameters

None

Returns

qstate : list of QState
list of the quantum state basis.
prob : list of float
list of coefficients for each quantum states basis.
get the spectrum . Parameters None Returns qstate : list of QState list of the quantum state basis . prob : list of float list of coefficients for each quantum states basis .
def spectrum(self):
        mat = self.get_elm()
        eigvals,eigvecs = self.__mat_spectrum(mat)
        prob = [eigvals[i] for i in range(len(eigvals)) if abs(eigvals[i]) > EPS]
        vecs = [eigvecs[i] for i in range(len(eigvals)) if abs(eigvals[i]) > EPS]
        qstate = [QState(vector=vecs[i]) for i in range(len(prob))]
        return qstate,prob
def spectrum ( self ) : mat = self . get_elm ( ) eigvals , eigvecs = self . __mat_spectrum ( mat ) prob = [ eigvals [ i ] for i in range ( len ( eigvals ) ) if abs ( eigvals [ i ] ) > EPS ] vecs = [ eigvecs [ i ] for i in range ( len ( eigvals ) ) if abs ( eigvals [ i ] ) > EPS ] qstate = [ QState ( vector = vecs [ i ] ) for i in range ( len ( prob ) ) ] return qstate , prob
get the spectrum.
get the spectrum .
"""
        get the spectrum.

        Parameters
        ----------
        None

        Returns
        -------
        qstate : list of QState
            list of the quantum state basis.
        prob : list of float
            list of coefficients for each quantum states basis.

        """ #return prob,qstate
self