2
$\begingroup$

This question already has an answer here:

The Eigensystem in version 10 seems to give slightly different results as in version 9:

Hmtx={{12.375, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I, -1.2338675571278232*^-17 - 2.208718528794109*^-18*I, -4.6634340043469916*^-18 - 1.1043592643970545*^-18*I, 5.9846202809437726*^-18 - 1.8774107494749925*^-17*I, -5.0917886236526596*^-17 - 3.6443855725102797*^-17*I, -1.7364763179227213*^-17 + 5.2457065058860084*^-17*I}, {-0.06250000000000006 + 8.834874115176436*^-18*I, 7.875, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I, -1.2338675571278232*^-17 - 2.208718528794109*^-18*I, -4.6634340043469916*^-18 - 1.1043592643970545*^-18*I, 5.9846202809437726*^-18 - 1.8774107494749925*^-17*I, -5.0917886236526596*^-17 - 3.6443855725102797*^-17*I}, {-1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 4.375, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I, -1.2338675571278232*^-17 - 2.208718528794109*^-18*I, -4.6634340043469916*^-18 - 1.1043592643970545*^-18*I, 5.9846202809437726*^-18 - 1.8774107494749925*^-17*I}, {7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 1.8749999999999998, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I, -1.2338675571278232*^-17 - 2.208718528794109*^-18*I, -4.6634340043469916*^-18 - 1.1043592643970545*^-18*I}, {3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 0.3749999999999999, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I, -1.2338675571278232*^-17 - 2.208718528794109*^-18*I}, {6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, -0.12500000000000014, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I, 6.284659706684547*^-19 - 2.6504622345529306*^-17*I}, {-1.2338675571278232*^-17 + 2.208718528794109*^-18*I, 6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 0.3749999999999999, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I, 3.5296840598063115*^-17 - 4.417437057588218*^-18*I}, {-4.6634340043469916*^-18 + 1.1043592643970545*^-18*I, -1.2338675571278232*^-17 + 2.208718528794109*^-18*I, 6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 1.8749999999999998, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I, 7.507272729062478*^-19 + 2.4295903816735198*^-17*I}, {5.9846202809437726*^-18 + 1.8774107494749925*^-17*I, -4.6634340043469916*^-18 + 1.1043592643970545*^-18*I, -1.2338675571278232*^-17 + 2.208718528794109*^-18*I, 6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 4.375, -0.06250000000000006 - 8.834874115176436*^-18*I, -1.1548235516929313*^-17 - 4.417437057588218*^-18*I}, {-5.0917886236526596*^-17 + 3.6443855725102797*^-17*I, 5.9846202809437726*^-18 + 1.8774107494749925*^-17*I, -4.6634340043469916*^-18 + 1.1043592643970545*^-18*I, -1.2338675571278232*^-17 + 2.208718528794109*^-18*I, 6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 7.875, -0.06250000000000006 - 8.834874115176436*^-18*I}, {-1.7364763179227213*^-17 - 5.2457065058860084*^-17*I, -5.0917886236526596*^-17 + 3.6443855725102797*^-17*I, 5.9846202809437726*^-18 + 1.8774107494749925*^-17*I, -4.6634340043469916*^-18 + 1.1043592643970545*^-18*I, -1.2338675571278232*^-17 + 2.208718528794109*^-18*I, 6.284659706684547*^-19 + 2.6504622345529306*^-17*I, 3.5296840598063115*^-17 + 4.417437057588218*^-18*I, 7.507272729062478*^-19 - 2.4295903816735198*^-17*I, -1.1548235516929313*^-17 + 4.417437057588218*^-18*I, -0.06250000000000006 + 8.834874115176436*^-18*I, 12.375}};

{vals, vecs} = Eigensystem[Hmtx];
vals
vecs[[1]]

in version 9 I get:

eigenvalue

(*
{12.3759, 12.3759, 7.87525, 7.87525, 4.37545, 4.37545, 1.87605, 1.87604, 0.387613, 0.372399, -0.140221}
*)

first eigenvector

(*
{-0.000534641 + 0.00179264 I, 7.42495*10^-6 - 0.0000248957 I, -5.80038*10^-8 + 1.94486*10^-7 I,  3.45242*10^-10 - 1.15759*10^-9 I, -1.71049*10^-12 +  6.02886*10^-12 I, -1.68042*10^-11 - 3.01451*10^-14 I,  3.36278*10^-9 + 1.56589*10^-16 I, -6.45683*10^-7 + 1.38957*10^-18 I, 0.00010848 - 5.32021*10^-19 I, -0.0138864 -  1.97975*10^-18 I, 0.999902}
*)

in version 10 I get:

eigenvalue

(*
{12.3759 - 1.02031*10^-15 I, 12.3759 - 9.91618*10^-29 I, 7.87525 - 8.85813*10^-16 I, 7.87525 - 4.21836*10^-20 I,  4.37545 + 8.4819*10^-17 I, 4.37545 + 8.48193*10^-17 I, 1.87605 - 9.81335*10^-20 I, 1.87604 - 9.81346*10^-20 I,  0.387613 - 1.396*10^-22 I,  0.372399 - 1.40297*10^-22 I, -0.140221 - 1.24838*10^-24 I}
*)

first eigenvector

(*
{-0.00639256 + 0.0131895 I,  0.0000887781 - 0.000183172 I, -6.93536*10^-7 + 1.43094*10^-6 I,  4.12798*10^-9 - 8.51706*10^-9 I, -2.14113*10^-11 +   4.43576*10^-11 I, -1.67039*10^-11 - 2.21781*10^-13 I,  3.36242*10^-9 + 1.15472*10^-15 I, -6.45615*10^-7 + 1.42743*10^-17 I,  0.000108469 - 7.67751*10^-17 I, -0.0138849 - 4.92661*10^-16 I,  0.999796 + 0. I}
*)

How can I make version 10 produce the same results as version 9? How can I know which method is used in version 9? I tried to set the Method options in version 10 but still unable to get an agreement.

Edit

I agree that the comments are all right, that they are both correct results. I'm curious what's the change in the "internal mechanism", method, etc, so that it produce different correct results. I use this Eigensystem in calculating some quantum mechanic problem called high harmonic generation, which is very sensitive to small errors in the results. In theory , an overall phase change should not effect my results, but after upgrading to version 10, the noise floor in my results increase more then one order of magnitude. I'm trying to see why that happens, and this is my first stop.

Mathematica is now a language, I guess I would expect to have exactly the same results if I update the "compiler", or at least I should know why the results are different.

$\endgroup$

marked as duplicate by Jens, RunnyKine, m_goldberg, Verbeia Aug 5 '14 at 4:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Does Chop help? $\endgroup$ – Mr.Wizard Aug 4 '14 at 20:55
  • $\begingroup$ @Mr.Wizard The eigenvector seems quite different. $\endgroup$ – xslittlegrass Aug 4 '14 at 20:57
  • 3
    $\begingroup$ It's good to mention that both results are correct (there are degenerate eigenvalues). $\endgroup$ – Szabolcs Aug 4 '14 at 21:11
  • 1
    $\begingroup$ @xslittlegrass: The eigenvectors are different in V9 and V10. However, they are both correct, despite being different. Your matrix has a degenerate spectrum, and thus the degenerate eigenspace decompositions are subject to arbitrariness depending on the internal architecture used in the computation. This is not a bug, and should be expected. $\endgroup$ – DumpsterDoofus Aug 4 '14 at 21:17
  • 1
    $\begingroup$ Also, I noticed that Max[Abs[Im[Hmtx]]] is on the order of machine precision, and that the matrix appears to be real symmetric with the exception of what looks like machine-precision Hermitian noise, so you can simplify it quite a bit using Chop[Hmtx]. $\endgroup$ – DumpsterDoofus Aug 4 '14 at 21:19