I would like to understand the difference between Hilbert space and real space in a molecular code.

My understanding is that the Hilbert space of a system (such as a molecule) can be represented by a set of atomic orbitals (AOs) while the real space represents a system through a grid of points in the specific space of a system. Is this true?

For a more concrete example, consider electronic excitations. Using the entire (orbital) space of a reference system, one can project out (excite) an electron to the virtual space of a reference ground state. However, I'm not sure how this is handled in a "real space" program, or what that even means.

  • $\begingroup$ Generally true, but what do you want to make of that? Electron density or position of nuclei are real values, orbitals or wave functions are complex. Nothing more to it. $\endgroup$
    – Karl
    Oct 13, 2017 at 9:04
  • $\begingroup$ electronic excitations, using the entire space of a reference system one can project out an electron to the virtual space of a reference ground state. However, conceptually I wanted to distinguish between these two "spaces". I am not quite sure what people mean by real space codes. Thanks for asking $\endgroup$
    – Pablor
    Oct 13, 2017 at 9:30
  • $\begingroup$ What do you mean by "molecular code"? I honestly have no idea what you are aiming for. The first part of your comment above is totally incomprehensible. Please update your question. $\endgroup$
    – Karl
    Oct 13, 2017 at 16:55

1 Answer 1


A Hilbert space is a kind of linear vector space.

In chemistry which encounter it when quantum mechanics, when we can represent wavefunctions by their contributions from different orthonormal single particle states. It is these single particle states which we build up out our atomic orbitals (AOs).


Consider a two level systems - minimal basis $\ce{H2}$:

Each atom has a $1s$ AO on its hydrogen: $\phi_1(\textbf{r})$, $\phi_2(\textbf{r})$. These AOs aren't orthogonal though: $$ \iiint d^3\textbf{r}\ \phi_1^*(\textbf{r}) \phi_2(\textbf{r}) \ne 0 $$but we can construct orthonormal states: $$ \psi_\pm(\textbf{r}) = \frac{1}{\sqrt{2}}\left(\phi_1(\textbf{r})\pm\phi_2(\textbf{r})\right) $$ such that like functions integrate to $1$ and functions of unlike functions vanish: $$ \iiint d^3\textbf{r}\ \psi_\pm^*(\textbf{r}) \psi_\mp(\textbf{r}) = 0 \\ \iiint d^3\textbf{r}\ \psi_\pm^*(\textbf{r}) \psi_\pm(\textbf{r}) = 1 $$. These two orthogonal function can be represented as state vectors: $$ \psi_+(\textbf{r}) = \pmatrix{1\\0},\; \psi_-(\textbf{r}) = \pmatrix{0\\1} $$ This defines a Hilbert or vector space, where our single particle states $\psi_\pm$ are our vectors and the inner product of two vectors, $\psi_i$ and $\psi_j$, is defined by the integral over all space: $$ \langle\psi_i\vert\psi_j\rangle = \iiint d^3\textbf{r}\ \psi_i^*(\textbf{r}) \psi_j(\textbf{r}) $$ and is equivalent to the dot product of two state vectors.

In a electronic structure (specifically DFT) code, a "real space code" means using atom orbitals as basis functions rather than plane waves.

The Hilbert space described above is complete - it describes all possible wavefunctions which can be made from the AOs included. If you included the infinite number of hydrogenic wavefunctions on each atom you would be able to have an exact description of all possible wavefunctions for $\ce{H_2}$ - as the hydrogenic wavefunctions form a complete set, instead you include as many as practical.

An alternative complete set of functions is the infinite set of all plane waves of all frequencies. In cases where you are performing calculations on a periodic system, such as a solid, plane waves can be a more natural choice as they themselves are also periodic. In a box of width $L$, the set of waves with wavelengths: $$\lambda = \frac{2L}{n}$$ for all integral n, form a complete set. They are more commonly described by their wavevectors, $\textbf{k}$, a vector in what is called reciprocal space, which describes the momentum of the wave.

In DFT, when calculating integrals over density, in a plane wave code you manipulate the density in terms of wavevectors, $\textbf{k}$. In a real space code, you compose your density from Kohn-Sham orbitals in real space and calculate integrals of the density over quadrature grids in real (Euclidean) space.

Hence "real space" is used as a descriptor, for DFT codes that work with AOs and basis functions defined on atoms in Euclidean space, in contrast to "plane wave" codes which used basis functions defined in position space.

  • 2
    $\begingroup$ This isn't quite right; the common quantum chemistry packages that use MOs formed from CGTOs are not real space, they're Fock space. Real space programs would evaluate AOs/basis functions directly on a grid. $\endgroup$ Oct 15, 2017 at 16:47
  • $\begingroup$ I find it hard to connect your answer with the math, but it is interesting to read a chemical viewpoint. @pentavalentcarbon , they belong to Fock spaces, however, they belong to Hilbert spaces too $\endgroup$ Oct 16, 2017 at 3:25
  • $\begingroup$ @user1420303 Yes, that is true, but the point is that they are not necessarily evaluated on a grid. In fact, you could evaluate any type of basis function (GTOs, STOs, plane waves, splines, ...) on a Cartesian grid and it would be real space. $\endgroup$ Oct 16, 2017 at 3:29
  • $\begingroup$ @pentavalentcarbon - It's the quadrature grid bit that I didn't fully appreciate until seeing the comment and googling some more. I'm more used to wavefunction methods than DFT - hence the slight confusion over the typical usage the term "real space". $\endgroup$
    – user213305
    Oct 16, 2017 at 12:22
  • 2
    $\begingroup$ By our discussion, yes, though we don't call it a real-space calculation. That terminology is reserved for when all operators ($\hat{T}, \hat{V}, \hat{J}, \hat{K}$) are evaluated on a grid. $\endgroup$ Oct 16, 2017 at 12:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.