Is there any inbuilt lanczos algortihm in matlab,or we need to write ourselve script for this,since i want to solve Tri diagonal Hamiltonain actually in matlab,so any body has any idea .
The Matlab function 'eigs' for finding eigenpairs of a sparse matrix utilizes the Lanczos method. It seems to me that it is exactly what you are looking for. Good luck!
Thanks a lot Pekko,I see it works sam as Lanczos algorithm used to work,since as you suggested with this we can determine eigen values as well eigen vectors for corresponding Hamiltonian.
You're welcome, Surender. I suggest going carefully through the documentation for eigs, since typically you need to change the default options and possibly also utilize some preconditioning (which are also available as built-in functions) to ensure optimal convergence of the algorithm.
I have not understood since like it is written in numerical recipes that we can use directly lanczos algorithm in fortan or in c language ,but here in matlab eig will work like this or not that i want to confirm.
Yes, 'eigs' will implement the basic Lanczos algorithm described in numerical recipes books. I was just alluding to problematic matrices where the convergence is poor for the algorithm in general (irrespective of where you implement it), in which case this may be possible to cure by preconditioning.
Finally, for clarification, I stress that there is also another Matlab function 'eig' which calculates the full eigenspectrum of a full matrix using QR or Cholesky factorization. But if you are dealing with a sparse matrix (with presumably large dimensions), then it is 'eigs' that you want to use. (I believe the 's' in the name is for 'sparse'.)
Ok thanks,i need to use it for tri-diagonal Hamiltonian to solve in my research problem,so i was trying for it,so that i can use it for my purp[ose.And althogh the size of my matrix is not that much big,but in future i can use it for bigger size.
Pekko do you have any idea,how to use iteration in my system,i want to increase iteration in my system.
If i need to solve tri diagonal system,then i need to use again eig funtion or i need to use some other built in function.please help me in this matter,so that it will not affect my calculations.