Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
15 votes

Time and memory required to diagonalize a 18000 by 18000 matrix using numpy in python

A 20000 by 20000 double-precision complex matrix requires $20000 \times 20000 \times 8 \times 2=6.4 \mbox{gigabytes}$ of RAM. The LAPACK routines ZHEEV that will do the work for you will store the ...
Brian Borchers's user avatar
14 votes
Accepted

Quality of eigenvalue approximation in Lanczos method

The convergence behavior you are seeing is actually expected. One of things that makes the Lanczos method so interesting is that it does a good job of simultaneously converging eigenvalues at both ...
Bill Greene's user avatar
  • 6,074
12 votes
Accepted

Generalization of eigendecomposition problem

Yes. You could rewrite it as $$B v = \lambda v\, $$ with $B = A - M$, $M = \textrm{diag}(\mu)$.
nicoguaro's user avatar
  • 8,515
9 votes
Accepted

Correct eigenfunctions of Laplace operator by Finite Differences

You should specify the eigenvalues you want with which="SM", for example. Check the following snippet. I also changed the solver, since your system is symmetric. <...
nicoguaro's user avatar
  • 8,515
7 votes
Accepted

Eigenvector with maximum overlap

The following paper suggests that the Jacobi-Davidson method can be used to target eigenvectors based on "any property that can be computed from the eigenvector", which would seem to include overlap ...
deemaregee's user avatar
7 votes

'eigs()' in Matlab gives inaccurate eigenvector when only several eigenvalues are calculated

Eigenvectors are not unique, especially when you have repeat eigenvalues. Let's define each unique eigenvalue as $\lambda_1$, $\lambda_2$, ..., $\lambda_i$, where $\lambda_i$ has a multiplicity of $...
helloworld922's user avatar
6 votes

Approximate spectrum of a large matrix

Arnold Neumaier's answer is discussed in more detail in section 3.2 of the paper "Approximating Spectral Densities of Large Matrices" by Lin Lin, Yousef Saad and Chao Yang (2016). Some other methods ...
A. Van Werde's user avatar
6 votes

Fast and accurate eigenvalue computation for 3x3 posdef matrices

For a symmetric 3x3 matrix, one Householder transformation will bring your matrix in tridiagonal form. The required algorithm is given (for general $n\times n$ matrices) on page 459 of Matrix ...
GertVdE's user avatar
  • 6,149
6 votes

Eigenvectors of Laplacian

They're on Wikipedia, for instance, in a page with the slightly unclear name of "Eigenvalues and eigenvectors of the second derivative".
Federico Poloni's user avatar
5 votes
Accepted

Roots of a function for eigensystem

I suspect the main problem is the magnitude of the values. If you divide through by $\cosh$ to make all the numbers smaller, then ApproxFun doesn't seem to have a problem finding all the roots. ...
Kirill's user avatar
  • 11.4k
4 votes

What are some ideas to preprocess / precondition the following linear system?

You have noticed that any eigenvector of $A$ is also an eigenvector of your composed matrix. When you compute eigenvectors of your matrix, you can use them in a deflation-type preconditioner, as ...
H. Rittich's user avatar
4 votes
Accepted

Sorting eigenvalues by the dominant contribution

You'd like to sort eigenvalues/eigenvectors in a way that is continuous as you move through momentum. This highly constrains the sorting - for most k-points, you must sort the eigenvalues to be a ...
deemaregee's user avatar
4 votes
Accepted

All eigenpairs of large sparse symmetric matrix

To emphasize what the comments have said, if you want to produce the dense 52728x52728 matrix containing the eigenvectors, there is no point to computing using the sparse input. Use a dense input ...
Jeff Hammond's user avatar
  • 2,126
4 votes
Accepted

Discrepancies between numerical and analytical solution for particle in a finite potential well?

I think that your potential for the numerical case is wrong. The potential should be a big positive number, so the solution tends to zero outside the well when the value of the potential increases. ...
nicoguaro's user avatar
  • 8,515
4 votes
Accepted

Nystrom approximation of SVD for asymmetric matrices

Nemtsov, Averbuchm, and Schclar's "Matrix compression using the Nyström method" (2016) seems relevant: The Nyström method is routinely used for out-of-sample extension of kernel matrices. We ...
Richard's user avatar
  • 3,971
4 votes
Accepted

LAPACK sorting eigenvalues differently each time

You write, that you are computing the eigenvalues of a symmetric matrix. Does the matrix have real entries? In this case all eigenvalues are real, and you can use a symmetric eigenvalue solver, which ...
H. Rittich's user avatar
4 votes

Solving the eigenvalue from a set of coupled second order differential equation numerically

This problem can be interpreted as a coupled convection-diffusion-reaction equation in two variables. You can use the Finite Element Method to solve it. Must be mentioned that you need to use some ...
Chenna K's user avatar
  • 944
4 votes
Accepted

Computing eigenvalues of Schrodinger equation with spin

When modelling spin in the Schrödinger equation, one has several alternatives which need to be chosen in advance. I'll copy an excerpt from a work of mine to give an overview (it considers atomic ...
davidhigh's user avatar
  • 3,127
4 votes

LOBPCG bad preconditioned performance for largest eigenpairs

I would not be surprised by this, my understanding is that LOPCG is specifically designed to seek small eigenpairs (at least, that's what I have used it for). I find it a novel algorithm, because it ...
rchilton1980's user avatar
  • 4,896
4 votes

Numerical estimation of eigenfunctions of Laplacian

Fundamentally, here are the building blocks of what you are asking for: Consider solving the problem $$ -\Delta u = f $$ in a domain $\Omega$ with boundary values $u=g$ on $\partial\Omega$. ...
Wolfgang Bangerth's user avatar
3 votes
Accepted

Preconditioning ARPACK eigenvalue solver

I've summarized the comments thread of your original question into an answer. Here are a few things that you can try: Increase the number of your Arnoldi vectors (NCV) generated at each iteration. ...
GoHokies's user avatar
  • 2,216
3 votes

Matrix exponential of hermitian matrix with eigenvectors from generalized eigenvalue problem

I guess your problem is the following. Your working in a non-orthogonal basis $\phi_i$, and solved the time-independent Schrödinger equation $$\mathbf H \mathbf C = E \mathbf S \mathbf C$$ Here $\...
davidhigh's user avatar
  • 3,127
3 votes

Can the Power Method be used here?

Your intuition is right, solving $\Lambda x = x$ for $x$ given $\Lambda$ is similar to an eigenvalue problem, except you already know the eigenvalue $\lambda_1 = 1$ and its corresponding eigenvector $...
A. B. Marnie's user avatar
3 votes

Efficient Eigen Solver

MATLAB's eigs function simply calls ARPACK. So if you are using that, there is no difference and they should be equally fast. If they are not, the difference is ...
David Ketcheson's user avatar
3 votes
Accepted

Numerical Solution to Schrödinger Equation--Multiple Wells

While I cannot help you with your specific implementation, I want to point out to an alternative method (as already indicated in a comment to phil's answer) : Marston's "Fourier Grid Hamiltonian" (FGH)...
AlexE's user avatar
  • 782
3 votes

What is the fastest way to compute all eigenvalues of a very big and sparse adjacency matrix in python?

I would like to comment on Daniel Shapero's answer but I don't have enough SE reputation. The accepted answer confuses me a lot. I think shift-invert mode can be readily used to compute interior ...
Alex's user avatar
  • 131
3 votes
Accepted

Efficient ways to numerically evaluate matrix exponentials

As I mentioned in my comment, due to that you are searching for a method based on Python and ideally available in NumPy or SciPy, my suggestion is to use ...
Mithridates the Great's user avatar
3 votes

2d Schrodinger Equation via matrix diagonalization in C

Test your code. "I don't know if my linear algebra routines work or not" is a problem you can solve easily. It is easy to check if you have computed the correct eigenvalues or not; just check that $...
Federico Poloni's user avatar
3 votes
Accepted

Can Spectra find eigenvectors and eigenvalues of complex-valued matrices?

The projects discussion page for future features (link below, see item #3) suggests there's no support for complex numbers. I don't think I'd hold my breath for this .. that link is from 2020, ...
rchilton1980's user avatar
  • 4,896

Only top scored, non community-wiki answers of a minimum length are eligible