Ticket #10346: trac_10346_eigenvectors_right.patch

File trac_10346_eigenvectors_right.patch, 1.7 KB (added by jvkersch, 3 years ago)

Adding eigenvectors_right method to matrix_symbolic_dense

  • sage/matrix/matrix_symbolic_dense.pyx

    # HG changeset patch
    # User Joris Vankerschaver <joris.vankerschaver@gmail.com>
    # Date 1290837192 28800
    # Node ID af331344a3ec3bdb7f063b10a24a029bc3629621
    # Parent  120c07be6358d93bcff503363d379c26b8342f2b
    #10346: added method eigenvectors_right()
    
    diff -r 120c07be6358 -r af331344a3ec sage/matrix/matrix_symbolic_dense.pyx
    a b  
    260260 
    261261        return result 
    262262 
     263    def eigenvectors_right(self): 
     264        r""" 
     265        Compute the right eigenvectors of a matrix. 
     266 
     267        For each distinct eigenvalue, returns a list of the form (e,V,n) 
     268        where e is the eigenvalue, V is a list of eigenvectors forming a 
     269        basis for the corresponding right eigenspace, and n is the 
     270        algebraic multiplicity of the eigenvalue. 
     271 
     272        EXAMPLES:: 
     273 
     274            sage: A = matrix(SR,2,2,range(4)); A 
     275            [0 1] 
     276            [2 3] 
     277            sage: right = A.eigenvectors_right(); right 
     278            [(-1/2*sqrt(17) + 3/2, [(1, -1/2*sqrt(17) + 3/2)], 1), (1/2*sqrt(17) + 3/2, [(1, 1/2*sqrt(17) + 3/2)], 1)] 
     279 
     280        The right eigenvectors are nothing but the left eigenvectors of the  
     281        transpose matrix:: 
     282 
     283            sage: left  = A.transpose().eigenvectors_left(); left 
     284            [(-1/2*sqrt(17) + 3/2, [(1, -1/2*sqrt(17) + 3/2)], 1), (1/2*sqrt(17) + 3/2, [(1, 1/2*sqrt(17) + 3/2)], 1)] 
     285            sage: right[0][1] == left[0][1] 
     286            True 
     287        """ 
     288        return self.transpose().eigenvectors_left() 
     289 
    263290    def exp(self): 
    264291        r""" 
    265292        Return the matrix exponential of this matrix $X$, which is the matrix