sage: gp_console()
?  \p 100
   realprecision = 115 significant digits (100 digits displayed)
? a=matrix(3,3,k,m,random(1.0))+I*matrix(3,3,k,m,random(1.0));
?  m=a*conj(a)~;
?  mateigen(m)

On 30 Mar, 18:20, Jason Grout <jason-s...@creativetrax.com> wrote:
> On 3/30/11 10:44 AM, Ben123 wrote:
>
>
>
> > Hello. I've written a sage program which produces a complex matrix. I
> > want to find the eigenvalues and associated eigenvectors. I also want
> > to use arbitrary precision. I don't care about speed. I've read old
> > posts to this group on this topic, but am unsure how to proceed.
> > Currently I'm using the following method and using sage 4.6.1
>
> > precision_digits=30
> > nop=5 # rank of matrix
> > MS_nop_comp=MatrixSpace(ComplexField(precision_digits),nop,nop)
> > tmat=MS_nop_comp(0) # zero-ize the values
> > ttdag=MS_nop_comp(0)
>
> > # I realize there are more efficient methods of getting a random
> > matrix, but this is explicit
> > for a in range(nop):
> >    for b in range(nop):
> >      tmat[a,b]=random()+I*random()
>
> > ttdag=tmat*tmat.conjugate().transpose() # get a Hermitian matrix
> > print 'ttdag is'
> > print ttdag
> > print 'eigenvalues of ttdag are '
> > print ttdag.eigenvalues() # eigenvalues of Hermitian matrix should be
> > real. Imaginary component is due to finite precision.
> > # I can get better precision here by increasing precision_digits
>
> > #print ttdag.eigenmatrix_right()
> > # IndexError: list index out of range
>
> > print ttdag.eigenvectors_right()
> > # this is not returning the eigenvectors, even when precision is
> > increased to 500
>
> > How can I find the eigenvectors of a complex Hermitian matrix with
> > arbitrary precision?
>
> One option: you might look at using the alglib library; at one time, the
> author was writing a Sage interface, but that work has stalled for
> several months.  Alglib appears to have a python interface, though.
>
> Alglib:http://www.alglib.net/
>
> Rob Beezer's been doing some work on the numerical linear algebra in
> Sage, so he also might have something to add...
>
> Thanks,
>
> Jason

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to