Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Determinant and Characteristic Polynomial not working properly

  • To: mathgroup at smc.vnet.net
  • Subject: [mg86343] Determinant and Characteristic Polynomial not working properly
  • From: Sebastian Meznaric <meznaric at gmail.com>
  • Date: Sun, 9 Mar 2008 05:00:11 -0500 (EST)

Recently I reported a problem with the symbolic evaluation of
eigenvalues of a Hermitian matrix. This time I also have a Hermitian
matrix, for which Eigenvalues works as expected but the
CharacteristicPolynomial and Det do not give the right results. Here
goes

The matrix is

mat = {{-1, 0, 1/Sqrt[3], 0, 0, 2 Sqrt[2/3], 0, 0, 0, 0, 0, 0, 0,
  0}, {0, -1, 0, 1/Sqrt[3], 0, 0, 2 Sqrt[2/3], 0, 0, 0, 0, 0, 0,
  0}, {1/Sqrt[3], 0, -5/3, 4/Sqrt[3], 2 Sqrt[2/3], (2 Sqrt[2])/3, 0,
  0, 0, 0, 0, 0, 0, 0}, {0, 1/Sqrt[3], 4/Sqrt[3], 1, -(2 Sqrt[2])/3,
  0, (2 Sqrt[2])/3, 0, 0, 0, 0, 0, 0, 0}, {0, 0,
  2 Sqrt[2/3], -(2 Sqrt[2])/3, 2/3, 0, 0, (5 Sqrt[2])/3, Sqrt[10/3],
  0, 0, 0, 0, 0}, {2 Sqrt[2/3], 0, (2 Sqrt[2])/3, 0, 0, -41/6, 4/Sqrt[
  3], 2 Sqrt[2/3], 0, Sqrt[15]/2, 0, 0, 0, 0}, {0, 2 Sqrt[2/3], 0, (
  2 Sqrt[2])/3, 0, 4/Sqrt[3], -25/6, -(2 Sqrt[2])/3, 0, 0, Sqrt[15]/2,
   0, 0, 0}, {0, 0, 0, 0, (5 Sqrt[2])/3,
  2 Sqrt[2/3], -(2 Sqrt[2])/3, -1, -Sqrt[5/3]/2, 0, 0, Sqrt[15]/2, 0,
  0}, {0, 0, 0, 0, Sqrt[10/3], 0, 0, -Sqrt[5/3]/2, 2, 0, 0, 0, Sqrt[
  15]/2, 0}, {0, 0, 0, 0, 0, Sqrt[15]/2, 0, 0, 0, -5/2, 4/Sqrt[3],
  2 Sqrt[2/3], 0, 0}, {0, 0, 0, 0, 0, 0, Sqrt[15]/2, 0, 0, 4/Sqrt[3],
  1/6, -(2 Sqrt[2])/3, 0, 0}, {0, 0, 0, 0, 0, 0, 0, Sqrt[15]/2, 0,
  2 Sqrt[2/3], -(2 Sqrt[2])/3, -2/3, Sqrt[3/5]/2, 3 Sqrt[2/5]}, {0, 0,
   0, 0, 0, 0, 0, 0, Sqrt[15]/2, 0, 0, Sqrt[3/5]/2, 9/5, (3 Sqrt[6])/
  5}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3 Sqrt[2/5], (3 Sqrt[6])/5, 6/
  5}}

It is Hermitian so there should be no imaginary eigenvalues. Now
Factor[CharacteristicPolynomial[ham52, x]]

1/69984000(-3439853567779 - 24078974976000 x - 56470929408000 x^2 -
  39558316032000 x^3 + 27303837696000 x^4 + 35330162688000 x^5 -
  5536014336000 x^6 - 8814624768000 x^7 + 425502720000 x^8 +
  954021888000 x^9 + 10077696000 x^10 - 47029248000 x^11 -
  2519424000 x^12 + 839808000 x^13 + 69984000 x^14)

Now we do
N[Solve[CharacteristicPolynomial[ham52, x] == 0, x]]
(note we are doing Solve first and then N) and we get
{{x -> -9.81623}, {x -> -4.34022}, {x -> -2.72532}, {x -> -0.62248}, \
{x -> -0.365633}, {x -> 2.}, {x -> 2.96246}, {x ->
   4.90719}, {x -> -4.34015 -
    0.0000367756 \[ImaginaryI]}, {x -> -4.34015 +
    0.0000367756 \[ImaginaryI]}, {x -> -0.622083 -
    0.000229308 \[ImaginaryI]}, {x -> -0.622083 +
    0.000229308 \[ImaginaryI]}, {x ->
   2.96235- 0.0000632158 \[ImaginaryI]}, {x ->
   2.96235+ 0.0000632158 \[ImaginaryI]}}

N[Eigenvalues[mat]]

{-9.81623, 4.90719, -4.34017, -4.34017, -4.34017, 2.96239, 2.96239, \
2.96239, -2.72532, 2., -0.622216, -0.622216, -0.622216, -0.365633}

and Eigenvalues[N[mat]]
{-9.81623, 4.90719, -4.34017, -4.34017, -4.34017, 2.96239, 2.96239, \
2.96239, -2.72532, 2., -0.622216, -0.622216, -0.622216, -0.365633}


  • Prev by Date: Re: Assignment problem
  • Next by Date: Re: Apply function to parts of a list
  • Previous by thread: Re: ListCorrelate and functions on it with an extra
  • Next by thread: Re: Determinant and Characteristic Polynomial not working properly