Solving Schrödinger equation

I want to solve the eigenfunctions of the harmonic oscillator Hamiltonian.

This is my code:

NDEigensystem[
{-Laplacian[u[x], {x}] + 0.5 x^2 u[x],
DirichletCondition[u[x] == 0, True]},
u[x], x ∈ {-1000, 1000}, 4]


However Mathematica is returning my input as an output. Suggestions on how to find the eigenfunctions?

If you want solve for one variable you don't need ∈:

NDEigensystem[{-Laplacian[u[x], {x}] + 0.5 x^2 u[x],
DirichletCondition[u[x] == 0, True]}, u[x], {x, -1000, 1000}, 4]


NDEigensystem doesn't like x ∈ {-1000, 1000}. When I substitute {x, -1000, 1000}, I get

NDEigensystem[
{-Laplacian[u[x], {x}] + 0.5 x^2 u[x],
DirichletCondition[u[x] == 0, True]},
u[x], {x, -1000, 1000}, 4]


The above answers actually return something, which is good though the results are a bit nonsensical. The actual eigenfunctions should have 0, 1, 2 and 3 nodes respectively. It looks like the range of x is too large and is causing artifacts. Try [-10,10] instead of [-1000,1000] i.e.

NDEigensystem[{-Laplacian[u[x], {x}] + 0.5 x^2 u[x], DirichletCondition[u[x] == 0, True]}, u[x], {x, -10, 10}, 4]


This gives the right eigenfunctions. Note that harmonic oscillator eigenfunctions is an example given in the Mathematica documentation for NDEigensystem under 'scope.'