The matrix you show is not diagonal (which means that only the main diagonal is non zero) it is rather tridiagonal (which means that the main diagonal AND one diagonal above and below it are nonzero.
The matrix you show is not diagonal (which means that only the main diagonal is non zero) it is rather tridiagonal (which means that the main diagonal AND one diagonal above and below it are nonzero.