Ask Your Question
1

Eigenvalues of matrices of Laurent polynomials

asked 2015-08-14 09:26:16 -0500

fuglede gravatar image

updated 2015-10-16 12:18:09 -0500

FrédéricC gravatar image

Say that I have a matrix whose entries are univariate Laurent polynomials over complex numbers. In that case, I can substitute the variable for non-zero complex numbers to obtain an ordinary complex matrix. My question is the following: what the correct way to obtain the eigenvalues of the resulting complex matrix? My first guess was to do something like the following which just throws a NotImplementedError:

sage: R = LaurentPolynomialRing(CC, 'x')
sage: x = R.gens()[0]
sage: m = matrix([[x]])
sage: m.subs({x: 2}).eigenvalues()
edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
2

answered 2015-08-14 13:22:36 -0500

nbruin gravatar image

One structural way of obtaining the answer you want is to first define the homomorphism from the laurent series ring to CC (or whatever ring you want); in your case the one obtained from substituting a particular complex value for x:

sage: s=Hom(R,CC)(2)
sage: s
Ring morphism:
  From: Univariate Laurent Polynomial Ring in x over Complex Field with 53 bits of precision
  To:   Complex Field with 53 bits of precision
  Defn: 1.00000000000000*x |--> 2.00000000000000

Making sure this gets applied to a matrix properly is now just (tedious) bookkeeping:

sage: mm=matrix(s.codomain(),m.nrows(),m.ncols(),[s(n) for n in m.list()] )
sage: mm.eigenvalues()
... UserWarning ...
[2.00000000000000]

Ideally, sage would know how to do the bookkeeping so that the definition of mm above can be written as

sage: mm=m.change_ring(s)
<doesn't work currently>
edit flag offensive delete link more

Comments

Thanks for the answer. I'd upvote both of them if I had the karma.

fuglede gravatar imagefuglede ( 2015-08-18 09:56:22 -0500 )edit
2

answered 2015-08-14 09:45:39 -0500

updated 2015-08-15 04:45:23 -0500

Hello,

The problem with your code is that the substitution does a too naive substitution

sage: R = LaurentPolynomialRing(CC, 'x')
sage: x = R.gens()[0]
sage: m = matrix([[x]])
sage: mm = m.subs({x: 2})
sage: mm.base_ring()
Univariate Laurent Polynomial Ring in x over Complex Field with 53 bits of precision

In order to get eigenvalues, you need to say explicitely that the matrix is now defined over complex numbers

sage: mm.change_ring(CC).eigenvalues()
... UserWarning ...
[2.00000000000000]

EDIT: as mentioned in the comment, the above solution does not work. This is because there is no way to initialize a complex number from a power series, even if it is constant

sage: a = R(CC(2,1))
sage: CC(a)
Traceback (most recent call last):
...
TypeError: unable to coerce to a ComplexNumber: <type 'sage.rings.power_series_poly.PowerSeries_poly'>

In the case the constant is real it works by some strange magic.

Vincent

edit flag offensive delete link more

Comments

Thanks for the answer. That almost works. If I replace the '2' of the example by a non-real, though, I get a TypeError instead. Can anything be done about that?

fuglede gravatar imagefuglede ( 2015-08-14 10:04:18 -0500 )edit

I edited my answer...

vdelecroix gravatar imagevdelecroix ( 2015-08-15 04:45:57 -0500 )edit

I also opened a sage-devel thread to modify matrix.subs(). It would also be cool to allow constant power series to be converted to their base ring.

vdelecroix gravatar imagevdelecroix ( 2015-08-15 05:04:22 -0500 )edit

Nifty. Hope that one goes through. I've accepted the other answer as it does the job for now.

fuglede gravatar imagefuglede ( 2015-08-18 09:57:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2015-08-14 09:26:16 -0500

Seen: 663 times

Last updated: Aug 15 '15