Re: Problem with mateigen() command.

Bill Allombert <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <Yk1apAe6x5aodaEy@seventeen>
n Wed, Apr 06, 2022 at 08:56:25AM +0000, Venkataraman Subramaniam wrote:
> The mateigen gives wrong answer for the input [1,0,-1;0,1,0;-1,0,-1]
> Pari]  m=[1,0,-1;0,1,0;-1,0,-1]
> 
> %1 = (
> 1  0 -1
> 0  1 0
> -1 0 -1
> )
> Pari]  mateigen(m)
> 
> 
> %2 = (
> 0 0.41421356237309504880168872420969807857 -2.4142135623730950488016887242096980786
> 1 0                                        0
> 0 1                                        1
> )

Hello Venkataraman,
Would you elaborate what is wrong exactly  ?

? M=[1,0,-1;0,1,0;-1,0,-1]
%1 =
[ 1 0 -1]

[ 0 1  0]

[-1 0 -1]

? P=mateigen(M)
%2 =
[0 0.41421356237309504880168872420969807857 -2.4142135623730950488016887242096980786]

[1                                        0 0]

[0                                        1 1]

? P^-1*M*P
%3 =
[1                                        0 0]

[0 -1.4142135623730950488016887242096980786 -5.877471754111437540 E-39]

[0                7.346839692639296925 E-40 1.4142135623730950488016887242096980786]


This seems good to me ?
If you want also the eigenvalues, you can use mateigen(M,1).

If you like to avoid floating points, you can check matfrobenius
that gives the Frobenius form of the matrix.

(maybe we could have a variant of mateigen that returns polmod instead of complex).

Cheers,
Bill.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.