2

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.

xslittlegrass
  • 27,549
  • 9
  • 97
  • 186
  • Does Chop help? – Mr.Wizard Aug 04 '14 at 20:55
  • @Mr.Wizard The eigenvector seems quite different. – xslittlegrass Aug 04 '14 at 20:57
  • 3
    It's good to mention that both results are correct (there are degenerate eigenvalues). – Szabolcs Aug 04 '14 at 21:11
  • 1
    @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. – DumpsterDoofus Aug 04 '14 at 21:17
  • 1
    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]. – DumpsterDoofus Aug 04 '14 at 21:19
  • You Hamiltonian has degenerate eigenvalues, see here. I am guessing this is a single particle in a harmonic oscillator potential (ListPlot[Diagonal[Chop@Hmtx]]), in which case the degeneracy is physically due to the reflection symmetry of the potential. If you plot the absolute value of the eigenvectors (the density) you'll see what is going on and why hybridisation is so weak. – acl Aug 04 '14 at 21:30
  • @Jens I think here it really is due to degeneracies. It would have been useful to have a canonical question and answer to this somewhere. – acl Aug 04 '14 at 21:50
  • @acl Right - your answer to the other question (which got closed) could perhaps be combined with mine to give a canonical answer. If xslittlegrass rephrases the question to be more general maybe it could remain open to serve that purpose... (sorry I have to leave right now...) – Jens Aug 04 '14 at 21:57
  • Actually, your Hamiltonian is literally that of a SHO on a 1d lattice (plus noise). You can find analytical solutions to this here or here, although I'm not sure how useful they are to you. – acl Aug 04 '14 at 22:09
  • @acl Good catch! Yes, I'm solving a 1d lattice hamiltonian! I'm curious how did you know that? The closed form can be written in terms of Mathieu functions (also discussed in The Mathematica GuideBooks), but is only limited to this special potential. Plus, I'm interested in the time-dependent dynamics, so I need the numerical results. – xslittlegrass Aug 04 '14 at 22:17
  • @xslittlegrass right, I know the closed form solution from the papers I cited (that's where I first saw them, but I am not sure if they first appeared elsewhere). If you're interested in general potentials and/or time dependent solutions then you indeed have to do it this way (numerically). As to how I knew it, I guess it's like asking "wow how did you know this is the Schrodinger equation?" isn't it? Now, if you had an interacting Hamiltonian and I spotted the potential, that would have indeed been noteworthy :) – acl Aug 04 '14 at 22:24
  • @xslittlegrass: Off-topic, but I downloaded your PovrayRender.m file, and attempted to run it on your first example from your blog using the directory to my Windows executable for Pov-Ray by executing p = SphericalPlot3D[ 1 + 2 Cos[2 \[Theta]], {\[Theta], 0, Pi}, {\[Phi], 0, 2 Pi}, Mesh -> None, PlotPoints -> 80]; povrayRender[p, "C:\\Program \ Files\\POV-Ray\\v3.7\\bin\\pvengine64.exe"] but it just gave a "File not found during Import" error. Am I using the correct filepath to Pov-Ray? – DumpsterDoofus Aug 04 '14 at 22:27
  • I also tried povrayRender[p, "C:\Program Files\POV-Ray\v3.7\bin\pvengine.exe"], but it didn't work either. – DumpsterDoofus Aug 04 '14 at 22:37
  • @DumpsterDoofus Thanks for letting me know. I only tested mac and linux before. I'll test windows when I get home. – xslittlegrass Aug 04 '14 at 22:43
  • I figured out what the problem was, it's doing something wrong with the filepaths (and I forgot to insert escape sequences for the space in "Program Files"), seems to work fine. – DumpsterDoofus Aug 05 '14 at 01:08
  • @DumpsterDoofus good to hear that :) – xslittlegrass Aug 05 '14 at 02:15

0 Answers0