Solving Schrödinger equation by neural networks - trial function explanation I'm reading this paper about solving Schrödinger equation using the combination of genetic algorithm and neural networks.
But one part confuses me - the author defines his trial function, i.e. the function, which signifies the mistake of approximation of both the wavefunction $\psi(x)$ and the corresponding energy $E$ like this:
$$R = \frac{\langle \psi | \hat{H} - E | \psi \rangle}{\langle \psi | \psi \rangle}$$
I don't really understand, what's meant by this formula. I suppose, that it is related to the expectation value of the Hamiltonian, but I don't understand it in depth. What does it mean to substract a number from an operator? And what does $\left< \psi | \psi \right>$ in the denominator mean (I know, that for "precise" $\psi$ it equals to 1)?
Would you, please, explain it to me in more detail?
 A: 
What does it mean to substract a number from an operator?

I agree that it can seem weird to do this. For example, if we represent our operators as matrices, how do we subtract a number from the matrix? To get around this, you can instead think of $\hat H - E$ as $\hat H - E\hat I$, where $\hat I$ is just the identity operator.
Or what you can do is break up the inner product:
$$\langle\psi|\hat H-E|\psi\rangle=\langle\psi|\hat H|\psi\rangle-\langle\psi|E|\psi\rangle$$

And what does $\langle\psi|\psi\rangle$ in the denominator mean?

If our state is normalized, then this is equal to $1$. But we don't have to work with normalized states. If we choose not to work with normalized states, we must include this in the denominator. Why we need to is explained below:
It looks like the quantity they are wanting to calculate is just the expectation value of how far off the energy $E$ is from the actual mean value of the Hamiltionian $\hat H$. Therefore, we would want to compute the value $\langle\hat H-E\rangle$, i.e., the expected value of a measurement of $H-E$. If we are not working with normalized states, then we need to include the term in the denominator to normalize everything. Therefore we end up with
$$R=\frac{\langle\psi|\hat H-E|\psi\rangle}{\langle\psi|\psi\rangle}$$
Or if you want to do some extra math:
$$\frac{\langle\psi|\hat H-E|\psi\rangle}{\langle\psi|\psi\rangle}=\frac{\langle\psi|\hat H|\psi\rangle}{\langle\psi|\psi\rangle}-\frac{\langle\psi|E|\psi\rangle}{\langle\psi|\psi\rangle}=\langle\hat H\rangle-E$$
So it is just the expectation value of the Hamiltonian subtracted by the value $E$. The closer this value is to $0$, the more confident we are in using $E$ to approximate the "actual energy" $\langle\hat H\rangle$.
