Incorrect parameter passed to eigenvalue

48 views
Skip to first unread message

Shashank Balaji

unread,
Apr 19, 2021, 3:25:17 PM4/19/21
to sage-devel
Hello, 

I am using version 9.2 of Sage. I encountered the following error:

Input:
m = matrix([[1 - 2 * i, 2, 3 - i], [0, -1 + i, 4], [3, i, -1]])
t = linear_transformation(m)
t.eigenvalues()

Output:
TypeError                                 Traceback (most recent call last)
<ipython-input-3-c9bd1ed2c26c> in <module>
----> 1 t.eigenvalues()

~/sage/sage-9.2/local/lib/python3.8/site-packages/sage/modules/free_module_morphism.py in eigenvalues(self, extend)
    445         if self.base_ring().is_field():
    446             if self.is_endomorphism():
--> 447                 return self.matrix().eigenvalues(extend=extend)
    448             else:
    449                 raise TypeError("not an endomorphism")

TypeError: eigenvalues() takes no keyword arguments


On looking into the source code (I built Sage from source), I found that the function eigenvalue(self, extend) defined in sage/modules/free_module_morphism.py calls the function eigenvalue(self) defined in sage/matrix/matrix_symbolic_dense.pyx. Hence the argument mismatch.

If it is indeed a bug, I would be happy to file a ticket.

Best,
Shashank

Vincent Delecroix

unread,
Apr 19, 2021, 4:27:43 PM4/19/21
to sage-...@googlegroups.com
Dear Shashank,

Thanks for your report. This is indeed a bug in
matrix_symbolic_dense.pyx. Please post the url of the ticket
in this thread.

Note that on sage 9.3 this will not be a problem on this
particular example since the number ``i`` will not belong
anymore to the symbolic ring.

sage: parent(i)
Number Field in I with defining polynomial x^2 + 1 with I = 1*I

Best
Vincent

Le 19/04/2021 à 21:20, Shashank Balaji a écrit :
> Hello,
>
> I am using version 9.2 of Sage. I encountered the following error:
>
> *Input*:
> m = matrix([[1 - 2 * i, 2, 3 - i], [0, -1 + i, 4], [3, i, -1]])
> t = linear_transformation(m)
> t.eigenvalues()
>
> *Output*:

Shashank Balaji

unread,
Apr 20, 2021, 3:49:09 AM4/20/21
to sage-devel
Dear Vincent, 

Here is the link to the ticket: https://trac.sagemath.org/ticket/31700#ticket

Apologies if the ticket does not conform to the guidelines. I have tried my best to conform. I am new to the Sage community :D

Best, 
Shashank

Vincent Delecroix

unread,
Apr 20, 2021, 3:56:37 AM4/20/21
to sage-...@googlegroups.com
That is perfect! Thanks.

Vincent
Reply all
Reply to author
Forward
0 new messages