Re: Problem with mateigen() command.

Samuel Lelièvre <[email protected]>
Newsgroups gmane.comp.mathematics.pari.devel
Message-ID <CAEcArF14YdeH=1gCbvpKP5Am+XYy4034Zg9V6Ne-TnS0VpC=yw@mail.gmail.com>
The returned eigenmatrix seems correct to me.

Each column `v` of the eigenmatrix `em` is an eigenvector:
`m * v` is `a * v` where `a` is the corresponding eigenvalue.

```
? m = [1, 0, -1; 0, 1, 0; -1, 0, -1]
%1 =
[ 1 0 -1]
[ 0 1  0]
[-1 0 -1]

? em = mateigen(m)
%2 =
[0   0.414   -2.414]
[1       0        0]
[0       1        1]

? m * em
%3 =
[0   -0.585   -3.414]
[1        0        0]
[0   -1.414    1.414]
```

Eigenvectors being normalized to have their last nonzero entry one,
eigenvalues are the last nonzero entry in the columns of `m * em`.

You can also get the eigenvalues using `flag=1`.

```
? aem = mateigen(m, flag=1)
%4 = [[1, -1.414, 1.414], [0, 0.414, -2.414; 1, 0, 0; 0, 1, 1]]
```

Maybe you expected the rows to be eigenvectors, so that
for each row `u`, we get `u * m = a * u`; in that case,
take the transpose of `em` as your eigenmatrix.

Or maybe you expected the diagonal matrix with the eigenvalues
on the diagonal? It can be obtained as:
```
? matdiagonal(aem[1])
%5 =
[1        0       0]
[0   -1.414       0]
[0        0   1.414]
```
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.