0

I find the eigenvalues of the Hamiltonian in two ways - numerically and matrix . Why do different calculations give different eigenvalues?
The Hamiltonian is H = -1/2*Laplacian -(2/r)
It can be seen that the minimum energy calculated numerically is -2.00001, and matrix-wise is -1.55846. Why is this happening?

  1. numerically
In[82]:= H = 
  Simplify[-1/2*
     Laplacian[Psi[r], {r, \[Theta], \[Phi]}, "Spherical"] - 
    Psi[r]*2/r];

{vals, funs} = NDEigensystem[{H + Psi[r]*0.5}, Psi[r], {r, 0, 100}, 100, Method -> {"SpatialDiscretization" -> {"FiniteElement",
{"MeshOptions" -> {"MaxCellMeasure" -> 0.015}}}, "Eigensystem" -> {"Arnoldi", "MaxIterations" -> 10000}}];

In[84]:= (Take[Sort[vals], 5] - 0.5)

Out[84]= {-2.00001, -0.500001, -0.222223, -0.125, -0.0800001}

  1. matrix
In[26]:= ClearAll["Global`*"]
Psi1[r_, n1_] = (2 E^(-(r/n1)) Sqrt[n1!/(-1 + n1)!] Hypergeometric1F1[
      1 - n1, 2, (2 r)/n1])/n1^2;

Psi2[r_, n2_] = (2 E^(-(r/n2)) Sqrt[n2!/(-1 + n2)!] Hypergeometric1F1[ 1 - n2, 2, (2 r)/n2])/n2^2;

(kinetic energy)

K[r_, n1_, n2_] = FullSimplify[ Psi2[r, n2]* Laplacian[Psi1[r, n1], {r, [Theta], [Phi]}, "Spherical"]];

(potential energy)

P[r_] = -2/r;

(calculation of matrix elements,I am using 20 basis functions)

EE = Table[-1/2* NIntegrate[K[r, n1, n2]r^2, {r, 0, [Infinity]}, MaxRecursion -> 15, WorkingPrecision -> 32] + NIntegrate[Psi2[r, n2]P[r]Psi1[r, n1]r^2, {r, 0, [Infinity]}, MaxRecursion -> 15, WorkingPrecision -> 32], {n1, 1, 20}, {n2, 1, 20}] // Chop;

(eigenvalues)

Eeig = Eigenvalues[EE]

Out[32]= {-1.5584632981876349185146804146007,
-0.3623635914395303877441420153245,
-0.15669498305937198905543539839599,
-0.08683775701950283493030149036754,
-0.05501734483287334369748266587302,
-0.03790244105929780721020220539079,
-0.027651029147976237708049044437355,
-0.021028273261568554013526089309235,
-0.016502425356337140815385665090984,
-0.013271998387649143824131249079151,
-0.010884520722145291443991307150682,
-0.009068777306934890312009174759412,
-0.007654074742951805746421678011622,
-0.006528495175126375499971622294854,
-0.005615980338382413802381791780753,
-0.004863061581404067179392515633070,
-0.004230715950120777335031723062825,
-0.003688843483376281574694297474038,
-0.0032113000791884747824869858880628,
-0.0027659547381622397716009741638790}

In[33]:= Emin = Min[Eeig]

Out[33]= -1.5584632981876349185146804146007

Mam Mam
  • 1,843
  • 2
  • 9
  • What is the value of Hop0? – Ulrich Neumann Dec 09 '22 at 10:36
  • @Ulrich Neumann, thanks, I fixed it, it was a typo – Mam Mam Dec 09 '22 at 10:40
  • threes error in NIntegrate try to resolve this error firstly ! Think of alternative ways. your question posted 3 days ago. it still NIntegrate issue – nufaie Dec 09 '22 at 13:49
  • @Alrubaie, I fixed the code as Daniel Huber advised me, now it is error-free. But this does not change the figures and the question remains the same, why are the minimum eigenvalues obtained by different methods for the same Hamiltonian different? – Mam Mam Dec 09 '22 at 14:19
  • In the NDEigensystem approach you seem to be calculating the eigensystem of H + Psi[r]*0.5 instead of H, and then subtracting 0.5 from the eigenvalues. This is only equivalent if the normalization is equal to 1, which you don't enforce. To be exact, the Jacobian $r^2$ needs to be included when normalizing; but you are not telling the solver anything about this Jacobian. As a solution, you could try using $u(r)=r\cdot\psi(r)$ as radial wavefunctions, which can be normalized with a trivial Jacobian. – Roman Dec 09 '22 at 14:19
  • @Roman, yes, I do it intentionally so as not to lose the lower eigenvalue. In the line (In[84]:= (Take[Sort[vals], 5] - 0.5)) I subtract this addition (-0.5). Such manipulation was discussed earlier in this thread https://mathematica.stackexchange.com/questions/235662/ndeigensystem-and-radial-function-equation-for-hydrogen-atom between Alex Trounev and Jorge Castaño – Mam Mam Dec 09 '22 at 14:29
  • Last comment in this post https://mathematica.stackexchange.com/questions/235662/ndeigensystem-and-radial-function-equation-for-hydrogen-atom @Alex Turnev wrote "It is very good you got the ground state. Actually I know this trick with adding sR and have used it on this forum as well. " – Mam Mam Dec 09 '22 at 14:33
  • Again: your wavefunction solution in (1.) is normalized in the sense of $\int_0^{\infty}\psi^2(r)dr=1$ but what you need is $\int_0^{\infty}\psi^2(r)r^2dr=1$, and so this trick does not work properly. – Roman Dec 09 '22 at 14:34
  • @Roman, thanks! Could you write in more detail about what I need to do in the numerical method, that the problem was solved correctly. I realized that NDEigensystem gets non-normalized functions, but it's not very clear to me how to fix it? If it’s not difficult for you, please correct the code. – Mam Mam Dec 09 '22 at 14:44
  • @Roman, thanks a lot. The actual values have become closer to those obtained by the matrix method, but still they differ quite a lot. The minimum energy obtained is numerically is -1.46467, and matrix is -1.55846, but these values must be the same. Why do they turn out different? – Mam Mam Dec 09 '22 at 16:32
  • @Roman Now I've changed the potential to (-1/r), just change the 2 in the numerator to 1. The resulting eigenvalues are as follows {-0.376749, -0.107874, -0.0502911, -0.0289872, -0.0188283...}. Eigenvalues obtained matrix in this case {-0.50000, -0.12500, -0.05556, -0.03125, -0.02000,...}. In this case, if we write the wave function in the Schrödinger equation in the numerical method in the previous form eigenvalues are the same {-0.5, -0.125, -0.0555556, -0.03125, -0.02}. Could you please explain why? – Mam Mam Dec 09 '22 at 19:44
  • This problem has an analytic solution that every introductory book on quantum mechanics describes. I'd recommend you start comparing eigenvalues and eigenfunctions to the analytic solutions (computing scalar products to the analytic solutions, for example) and see what can improve your numerical solutions. – Roman Dec 10 '22 at 10:13
  • @Roman, thanks. The real potential for which I consider the energies to be more complex, in addition to the term proportional to the Coulomb potential, it has an additional term. For more complex potential, would you also suggest analyzing eigenfunctions? – Mam Mam Dec 10 '22 at 10:27
  • The usual sequence of software development is to test code against an example where the exact answer is known, and then use the same code with parameters (here: Hamiltonians) where the exact answer is to be found. – Roman Dec 10 '22 at 10:48
  • @Roman, thanks! – Mam Mam Dec 10 '22 at 22:09

1 Answers1

1

A common trick in spherical coordinates is to define $\psi(r)=\frac{u(r)}{r}$ to simplify the normalization and Laplacian expressed in terms of $u(r)$:

$$ \nabla^2\psi(r)=\psi''(r)+\frac{2}{r}\psi'(r) \qquad\leftrightarrow\qquad \nabla^2\frac{u(r)}{r}=\frac{u''(r)}{r}\\ \int_0^{\infty}\psi^2(r)r^2dr=1 \qquad\leftrightarrow\qquad \int_0^{\infty}u^2(r)dr=1 $$

The Schrödinger equation then becomes $$ -\frac12\nabla^2\psi(r)-\frac{2}{r}\psi(r)=E\psi(r) \qquad\leftrightarrow\qquad -\frac12u''(r)-\frac{2}{r}u(r)=E u(r) $$ which is much easier to deal with (looking like pseudo-straight coordinates with trivial Jacobian).

H = -1/2 u''[r] - 2/r u[r];

{vals, funs} = NDEigensystem[H, u[r], {r, 0, 100}, 100, Method -> {"SpatialDiscretization" -> {"FiniteElement", {"MeshOptions" -> {"MaxCellMeasure" -> 0.015}}}, "Eigensystem" -> {"Arnoldi", "MaxIterations" -> 10000}}] // Transpose // Sort // Transpose;

vals[[;; 5]] (* {-1.46467, -0.424888, -0.199048, -0.11502, -0.0748264} *)

Roman
  • 47,322
  • 2
  • 55
  • 121
  • Thanks a lot. The actual values have become closer to those obtained by the matrix method, but still they differ quite a lot. The minimum energy obtained is numerically is -1.46467, and matrix is -1.55846, but these values must be the same. Why do they turn out different? – Mam Mam Dec 09 '22 at 16:01
  • The eigenvalues depend strongly on the spatial discretization. I suppose it's very difficult to discretize a grid well in order to properly treat a singular potential. – Roman Dec 09 '22 at 17:33
  • I'm new to this and some of the terms are a little tricky for me. By discretization you mean the area of changing r and MaxCellMeasure? – Mam Mam Dec 09 '22 at 18:04