# How do I get the energy, if I have the wavefunction?

I recently wrote a simple HF SCF program for my understanding and realized that I do not fully understand such QM calculations.

Suppose I have the ground state gaussian wave function of a system, $$\psi_0 = \sum C_iG_i \tag{1}$$ where $$G_i$$ is the gaussian function. And by some means I have the value of all the $$C_i$$ that define the ground state $$\psi_0$$, and coordinates for $$G_i$$. Can I calculate the energy of the ground state of this system using this information alone? For a known wave function, should I not be able to determine the energy?

For SCF I always need the Fock matrix and hence full density matrix. I could not comeup with relations which just involve $$C_i$$ and the one-e and two-e integrals. What I am not understanding here?

• The use of such functions are just an approximation to start solving the Schrödinger equation. Wave functions and energy are the eigenfunctions and eigenvalue for the differential equation (Schrödinger equation), so, they are determined at the same time, and not one after the other.
– Camps
Commented Jan 30 at 18:56
• I guess what i meant was that if I have an arbitrary state eigenfunction (approximated as the gaussian basis), can I estimate the energy of that state, without the need of other state eigenfunctions? I think the answer should be yes, but I could not figure it out. For it seems that even a single energy eigenvalue would need full density matrix Commented Jan 30 at 20:02

"For a known wave function, should I not be able to determine the energy?"

The wavefuncton is an eigenfunction of the Hamiltonian, and the energy is a corresponding eigenvalue of the same Hamiltonian. Therefore if the Hamiltonian is $$H$$ and the wavefunction is $$\psi$$, then simply multiply $$H$$ by $$\psi$$ on the right-side, and you are supposed to get back the wavefunction $$\psi$$ multiplied by a factor $$E$$, which is the energy:

$$\tag{1} H\psi = E\psi.$$

What you get back in reality might not be exactly the original wavefunction multiplied by a scalar factor $$E$$, because you might have an approximation to the wavefunction rather than an exact one (and if it's only an approximate eigenfunction, Eq. 1 will not work perfectly, but you have a good approximation of $$\psi$$ then Eq. 1 is likely to work quite well).

• Thank you for your reply. This was my first idea that I can determine the energy by simply figuring out the multiple of $H\psi$ or first eigenvalue of H using some power iteration method. But what confuses me is the equation 3.154 of Szabo ($F = H + \sum_{ij}P_{ij}((uv|ij) - 0.5(ui|jv))$ ) where the fock matrix still needs simultaneous values for all orbitals. I read ML papers where they were determining the ground state electron density from ML and using it to get the ground-state energy and forces. But with above restriction I fail to see how. Commented Jan 30 at 22:47
• @ipcamit I recommend that you ask a new question about Eq. 3.153 of "Szabo" and if you need help with understanding those ML papers, you can ask separate questions about those papers too.The question that you posted here, asks how to get the energy from the wavefunction in your Eq. 1, and that is what Ty Serling and I answered. Commented Jan 31 at 2:27
• OK. I will raise a separate question then. Thank you for the reply. Commented Jan 31 at 2:34

In your comment above you said

I guess what i meant was that if I have an arbitrary state eigenfunction (approximated as the gaussian basis), can I estimate the energy of that state, without the need of other state eigenfunctions? I think the answer should be yes, but I could not figure it out. For it seems that even a single energy eigenvalue would need full density matrix

Depending on some assumptions, I think the answer is yes. The assumption I will make are (i) that your basis set is complete enough that the solutions actually are eigenfunctions of the Hamiltonian (see Nike's answer above) and (ii) that you can write down the Hamiltonian. For self-consistent methods like HF and DFT, this might mean you have to know the eigenfunctions to calculate the density and potential, but this isn't generally true: e.g. for the free electron, I can write the Hamiltonian without knowing anything about the solutions. For a KS or HF Hamiltonian, assume we can read the density from a file or something.

The Schrodinger's equation (SE) is $$H | \psi_n \rangle = E_n | \psi_n \rangle$$. $$\psi_n$$ are the 'eigenfunctions' of the Hamiltonian. $$n$$ labels the eigenfunctions. $$E_n$$ is the eigenvalue/energy of the $$n^{th}$$ eigenfunction.

Recall that eigenfunctions are orthogonal (I further assume they are normalized): $$\langle \psi_m | \psi_n \rangle = \delta_{nm}$$. Then $$E_n = \langle \psi_n | H | \psi_n \rangle$$. Determining the energy depends on whether or not you can calculate the matrix element $$H_{nn} = \langle \psi_n | H | \psi_n \rangle$$.

Some examples: in periodic DFT, this means $$H_{nn} = N \int_V d{\bf{x}} u^*_{n} ({\bf{x}}) H({\bf{x}}) u_{n}({\bf{x}})$$, where the integral is over the unitcell, $$u_n({\bf{x}})$$ is the periodic part of the (Bloch) wavefunction, and $$N$$ is the number of unit cells in the crystal. For the 1d free electron, the solutions are $$\psi_k(x) = L^{-1/2} \exp(i k x)$$ and $$H_{kk} = -\frac{\hbar^2}{2mL} \int_L dx \exp(-ikx) \nabla^2 \exp(ikx) = \frac{\hbar^2 k ^2}{2m}$$ with $$E_k = \frac{\hbar^2 k ^2}{2m}$$ the energy of the eigenfunction $$\psi_k(x)$$.

Hopefully this helps :)