Q:

Solving the Schrödinger Equation by exact diagonalization

I am solving the Schrödinger equation via finite difference, via the substitution

where we are assuming $V_1 = V_N = \infty$. I solved this using Mathematica for the case that $V(x) = 0$ and get the correct eigenvalues (in units with $\hbar = m = 1$, measuring length in units of the width of the well $a$, the eigenvalues are simply $n^2 \pi^2$).  I find the eigenvectors and plot them via
d2dx[n_] := 
  SparseArray[{Band[{1, 1}] -> -2, Band[{1, 2}] -> 1, 
     Band[{2, 1}] -> 1}, {n, n}]/(1/n^2);
evecs[n_, m_] := Last@Eigenvectors[N[-d2dx[n]], m]
ListPlot[evecs[100, 1], Joined -> True]
ListPlot[evecs[100, 2], Joined -> True]
ListPlot[evecs[100, 3], Joined -> True]

But the results look like this:

The profiles are correct but of course it shouldn't be oscillating in this way.  Every other point is reflected.  I am not sure if there is an issue in how I am solving for the eigenvectors or if this is a mathematical issue.  Does anyone know why am I seeing these oscillations and how do I get the correct eigenvectors? 

A:

Eigenvalues and Eigenvectors return the eigenvalues sorted from highest to lowest.   From the documentation:

Eigenvectors with numeric eigenvalues are sorted in order of decreasing absolute value of their eigenvalues. 

This means that the last three eigenvectors returned by Eigenvectors will correspond to the lowest-energy states:
ListPlot[{evecs[100, 98], evecs[100, 99], evecs[100, 100]}, Joined -> True]

The eigenvectors you found were valid solutions to the discretized problem.   However, given that your "grid spacing" was comparable to the "wavelength" of the particle for these functions, it is doubtful that they were physically meaningful. 
Addendum:  Your original problem is equivalent to the normal modes of a beaded string, for which the eigenvalues are known to be
$$
\omega^2 \propto 4 \sin^2 \left( \frac{r \pi}{2 (n+1)} \right), \qquad r = 1, 2, \dots, n
$$
where $n$ is the number of "beads" on the string.   If you're familiar with this system, the patterns you found corresponding to the highest eigenvalues (i.e. highest normal frequencies) might make a bit more sense.   For more information, see the link above;  Thornton & Marion's Classical Dynamics of Particles & Systems has a more in-depth discussion of the system. 