Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Eigenvalues works very slow

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128495] Re: Eigenvalues works very slow
  • From: "Harker, Anthony" <a.harker at ucl.ac.uk>
  • Date: Thu, 25 Oct 2012 01:41:53 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20121024073027.16F80685E@smc.vnet.net>

As you want real values in the end, stop Mathematica from manipulating enormously complicated exact expressions by letting Eigenvalues[] work on the real form:
Eigenvalues[N[q4 + h0]]


   Tony Harker


]-> -----Original Message-----
]-> From: jure lapajne [mailto:lapajne.jure at gmail.com]
]-> Sent: 24 October 2012 08:30
]-> To: mathgroup at smc.vnet.net
]-> Subject: Eigenvalues works very slow
]->
]-> Hello,
]-> I'm trying to calculate eigenvalues of different sized matrices (from 10x10
]-> to 1000x1000) using mathematica's built-in function - Eigenvalues. For
]-> smaller matrices it works ok, but for larger matrices it's just too slow. I tried
]-> writing the code in another system and it finds eigenvalues very quickly (in
]-> a second or two at most) even for big matrices. I'm not sure whether am I
]-> doing something wrong or is the speed difference really this big.
]-> My code (you only need to change d to change the size of matrix):
]-> d = 25;
]-> q = Table[Table[1/2*Sqrt[i + j + 1]*KroneckerDelta[Abs[i - j], 1], {j, 0, d-
]-> 1}],{i, 0, d - 1}];
]-> h0 = Table[Table[(i + 1/2)*KroneckerDelta[i, j], {j, 0, d - 1}], {i, 0,d-1}];
]-> lambda = 1/2;
]-> q4 = lambda*q.q.q.q;
]-> N[Eigenvalues[q4 + h0]]
]->
]-> Thanks for help.
]->





  • Prev by Date: CDF Security
  • Next by Date: NDSolve very very slow
  • Previous by thread: Eigenvalues works very slow
  • Next by thread: Re: Eigenvalues works very slow