eigenvalues between two matrix square

142 views
Skip to first unread message

jmarcell...@ufpi.edu.br

unread,
Mar 20, 2016, 10:25:49 AM3/20/16
to sage-support
n Matlab , you can return the eigenvalue between two arrays (A, B ) square in shape :

e = eig ( A, B)
How do the sagemath ?

slelievre

unread,
Mar 21, 2016, 9:13:58 AM3/21/16
to sage-support
2016-03-20 15:25:49 UTC+1, jmarcell...@ufpi.edu.br:

> In Matlab, you can return the eigenvalues
> between two arrays (A, B) square in shape:

>
>  e = eig(A, B)
>
> How do the sagemath?

I don't know if this is available in SageMath,
even though it might be provided by some of
the libraries shipped by SageMath...

For reference, the MATLAB documentation for eig is at:
  http://fr.mathworks.com/help/matlab/ref/eig.html
 
A similar question was asked in 2013 on Ask Sage:
  http://ask.sagemath.org/question/10751/qz-decomposition-for-generalized-eigenvalues/
and is still unanswered.

Samuel

Dima Pasechnik

unread,
Mar 21, 2016, 11:01:22 AM3/21/16
to sage-support
for matrices supported by numpy/scipy, you can do the following:

sage: a=matrix([[1,2],[3,4]])
sage: b=matrix([[2,2],[3,4]])

sage: from scipy.linalg import eig
sage: eig(a.numpy(), b.numpy())
(array([-1.+0.j,  1.+0.j]), array([[ -8.00000000e-01,  -7.10542736e-16],
        [  6.00000000e-01,   1.00000000e+00]]))


HTH,
Dima

João Marcello Pereira

unread,
Mar 21, 2016, 11:04:33 AM3/21/16
to sage-s...@googlegroups.com
Yes, is this ;)

Thanks Dima.

--
You received this message because you are subscribed to a topic in the Google Groups "sage-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-support/YHJyuy5t2Ek/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-support...@googlegroups.com.
To post to this group, send email to sage-s...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.



--
+ ----------------------------------------------------------------------------------- +
  João Marcello Pereira
  Física, matemática, informática e eletrônica UFPI/CTBJ
  skype: jmarcellopereira
  Celular (TIM) / WhatsApp: 61 81239941 89 999394331
+ ----------------------------------------------------------------------------------- +
Reply all
Reply to author
Forward
0 new messages