[GAP Forum] Computing eigenvalues with multiplicities
Jean-Claude Arbaut
jeanclaudearbaut at orange.fr
Wed Dec 3 18:12:15 GMT 2014
To get the multiplicities, you may use
List(Eigenspaces(Rationals, m), Dimension);
Since it uses the output of the function Eigenvalues, the lists should
have the same order (unless the algorithm is randomized...).
However, it's maybe to much work for GAP to get only the multiplicites.
Then you can check the code for function Eigenvalues in gap4r7\lib\matrix.gi
and adapt it to your needs:
Eigenvalues actually calls GeneralisedEigenvalues, which returns a
Set(Factors(...)).
Here the factors are
gap> Factors(UnivariatePolynomialRing(Rationals),
MinimalPolynomial(Rationals, m, 1));
[ x_1-1, x_1+1 ]
If you replace MinimalPolynomial with CharacteristicPolynomial, you get
gap> Factors(UnivariatePolynomialRing(Rationals),
CharacteristicPolynomial(Rationals, m));
[ x_1-1, x_1-1, x_1+1 ]
Then you can recover the multiplicities.
HTH,
Jean-Claude Arbaut
Le 03/12/2014 16:59, Moritz Schmitt a écrit :
> Dear all,
>
> Let's assume we are given an integer matrix like
>
> m := [ [ 1, 0, 0 ], [ 0, -1, 0 ], [ 0, 0, 1 ] ]
>
> How do we compute all eigenvalues of m with multiplicities? If I use the command
>
> Eigenvalues(Rationals, m);
>
> I only get as output
>
> [1,-1]
>
> but actually need something like [1,1,-1]. I browsed GAP's manual but
> didn't find anything.
>
> Thanks in advance.
>
> Moritz
>
> _______________________________________________
> Forum mailing list
> Forum at mail.gap-system.org
> http://mail.gap-system.org/mailman/listinfo/forum
>
More information about the Forum
mailing list