Ask Your Question
1

Eigenvalues of matrices of Laurent polynomials

asked 2015-08-14 16:26:16 +0200

fuglede gravatar image

updated 2015-10-16 19:18:09 +0200

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 20:22:36 +0200

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 16:56:22 +0200 )edit
2

answered 2015-08-14 16:45:39 +0200

vdelecroix gravatar image

updated 2015-08-15 11:45:23 +0200

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 17:04:18 +0200 )edit

I edited my answer...

vdelecroix gravatar imagevdelecroix ( 2015-08-15 11:45:57 +0200 )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 12:04:22 +0200 )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 16:57:25 +0200 )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 16:26:16 +0200

Seen: 970 times

Last updated: Aug 15 '15