MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathematica 6 obtains imaginary eigenvalues for a Hermitian matrix

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86111] Re: [mg86010] Mathematica 6 obtains imaginary eigenvalues for a Hermitian matrix
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sun, 2 Mar 2008 13:55:39 -0500 (EST)
  • References: <200803010947.EAA23583@smc.vnet.net>

In fact, for your matrix exact computation with Eigenvalues gives a  
wrong answer. Thus this is not a numerical problem, as often happens  
in such cases, but something much more basic.

mat = {{-6, 0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0, 0}, {0, -6,
     0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0}, {-Sqrt[3], 0, -4,
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], 0, 0, Sqrt[3],  
0, 0, 0,
     0, 0, 0}, {0, -Sqrt[3],
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -4/3, -(2 Sqrt[2])/3, 0, 0, 0,
     Sqrt[3], 0, 0, 0, 0, 0}, {0, 0, 2 Sqrt[2/3], -(2 Sqrt[2])/3, 7/3,  
0, 0, 0,
      0, Sqrt[3], 0, 0, 0, 0}, {Sqrt[3], 0, 0, 0, 0, -4, 0,
     2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, 0, 2 Sqrt[2/3], 0, 0, 0}, {0,  
Sqrt[3],
     0, 0, 0, 0, -4, 0, 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, 0, 2  
Sqrt[2/3], 0,
     0}, {0, 0, Sqrt[3], 0, 0, 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4), 0, -14/3,
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], (2 Sqrt[2])/3,  
0, 0,
     0}, {0, 0, 0, Sqrt[3], 0, 0, 2 (-1/(4 Sqrt[3]) + Sqrt[3]/4),
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -2, -(2 Sqrt[2])/3, 0, (2  
Sqrt[2])/3,
     0, 0}, {0, 0, 0, 0, Sqrt[3], 0, 0, 2 Sqrt[2/3], -(2 Sqrt[2])/3,  
-7/3, 0,
     0, 2 (1/(3 Sqrt[2]) + (2 Sqrt[2])/3), Sqrt[10/3]}, {0, 0, 0, 0, 0,
     2 Sqrt[2/3], 0, (2 Sqrt[2])/3, 0, 0, -16/3,
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], 0}, {0, 0, 0, 0,  
0, 0,
     2 Sqrt[2/3], 0, (2 Sqrt[2])/3, 0,
     2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), -8/3, -(2 Sqrt[2])/3, 0}, {0,  
0, 0, 0,
      0, 0, 0, 0, 0, 2 (1/(3 Sqrt[2]) + (2 Sqrt[2])/3),
     2 Sqrt[2/3], -(2 Sqrt[2])/3, 1/2, 2 (-Sqrt[5/3]/16 - Sqrt[15]/ 
16)}, {0, 0,
      0, 0, 0, 0, 0, 0, 0, Sqrt[10/3], 0, 0, 2 (-Sqrt[5/3]/16 -  
Sqrt[15]/16),
     7/2}};

Take the "largest" eigenvalue:

eig = First[Eigenvalues[mat, 1]];

f[x_] = CharacteristicPolynomial[mat, x]

N[f[eig], 10]
  -1.8696095421628027977`10.111112547559953*^10 -
    8.339392668664626899`9.760496055115645*^9*I

which is far from zero.


Another related point is that setting the Options Cubics->True  should  
give a radical expression, in cases when the Characteristic Polynomial  
can be factored into linear factors, quadratics and quadratics as is  
the case here:

Factor[f[x]]
x*(x + 4)^2*(x^2 + 4*x - 24)*(x^3 + 8*x^2 - 32)^2*(x^3 + 8*x^2 - 24*x  
- 128)

But actually using this options makes no difference. It looks very  
much like Eigenvalues is solving the wrong polynomial of the same  
degree since

g = MinimalPolynomial[eig, x]

17006112*x^14 + 612220032*x^13 + 8162933760*x^12 + 40814668800*x^11 -
  81629337600*x^10 - 1671768834048*x^9 -
    4667021328384*x^8 + 11702381838336*x^7 + 76901366366208*x^6 +
  42669909636920*x^5 - 337697299646488*x^4 -
    551524516377720*x^3 + 576589503454408*x^2 +
  260729243794329*x + 2600447009874406

This is a prime polynomial and it is not clear how, if at all, it is  
related to the characteristic polynomial.

Andrzej Kozlowski


On 1 Mar 2008, at 10:47, Sebastian Meznaric wrote:

> I have a 14x14 Hermitian matrix, posted at the bottom of this message.
> The eigenvalues that Mathematica obtains using the
> N[Eigenvalues[matrix]] include non-real numbers:
> {-9.41358 + 0.88758 \[ImaginaryI], -9.41358 -
>  0.88758 \[ImaginaryI], -7.37965 + 2.32729 \[ImaginaryI], -7.37965 -
>  2.32729 \[ImaginaryI], -4.46655 + 2.59738 \[ImaginaryI], -4.46655 -
>  2.59738 \[ImaginaryI], 4.36971, 3.21081, -2.32456 +
>  2.10914 \[ImaginaryI], -2.32456 - 2.10914 \[ImaginaryI],
> 2.04366+ 0.552265 \[ImaginaryI],
> 2.04366- 0.552265 \[ImaginaryI], -0.249588 +
>  1.29034 \[ImaginaryI], -0.249588 - 1.29034 \[ImaginaryI]}.
> However, if you do Eigenvalues[N[matrix]] it obtains different results
> {-9.09122, -7.41855, -7.41855, -7.2915, 4.33734, -4., -4., 3.2915, \
> -3.24612, -2.38787, -2.38787, 1.80642, 1.80642, 0}.
>
> These results agree with Solve[CharacteristicPolynomial[matrix,x],x].
> Therefore I assume that the latter are correct. Has anyone seen this?
> I am using 6.0.0.
>
>
> Here is the matrix:
> {{-6, 0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0, 0}, {0, -6,
>  0, -Sqrt[3], 0, 0, Sqrt[3], 0, 0, 0, 0, 0, 0, 0}, {-Sqrt[3], 0, -4,
>  2 (-1/(4 Sqrt[3]) + (3 Sqrt[3])/4), 2 Sqrt[2/3], 0, 0, Sqrt[3], 0,
>  0, 0, 0, 0, 0},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2])/3),
>  2 Sqrt[2/3], -(2 Sqrt[2])/3, 1/2,
>  2 (-Sqrt[5/3]/16 - Sqrt[15]/16)}, {0, 0, 0, 0, 0, 0, 0, 0, 0, Sqrt[
>  10/3], 0, 0, 2 (-Sqrt[5/3]/16 - Sqrt[15]/16), 7/2}}
>



  • Prev by Date: Re: Re: Re: Re: Version 6.0.2
  • Next by Date: Re: Mathematica Integration help
  • Previous by thread: Mathematica 6 obtains imaginary eigenvalues for a Hermitian matrix
  • Next by thread: Re: Mathematica 6 obtains imaginary eigenvalues for a Hermitian