"how to write down my matrix in Mathematica"
Band
could be useful to construct a matrix with the structure you describe.
Assuming
diagonal = RandomReal[10, {1500}];
holds your data for the diagonal entries,
mtrx = SparseArray[{
Band[{1, 1}] -> diagonal,
{1, 1500} -> -1,
Band[{1, 2}] -> -1,
Band[{2, 1}] -> -1}, {1500, 1500}];
gives the matrix you need.
"and find the eigen values"
You can use
Eigenvalues[mtrx]
but you get the warning
Eigenvalues::arh: Because finding 1500 out of the 1500 eigenvalues and/or eigenvectors is likely to be faster with dense matrix methods, the sparse input matrix will be converted. If fewer eigenvalues and/or eigenvectors would be sufficient, consider restricting this number using the second argument to Eigenvalues (emphasis added.)
Despite the warning, Eigenvalues[mtrx]
works faster than using the dense list Normal[mtrx]
as the argument:
ev= Eigenvalues[Normal[mtrx]]; // AbsoluteTiming
(* {3.2860000, Null} *)
gives the eigenvalues you need.
You can also use Eigensystem
which gives both eigenvalues and eigenvectors:
{evalues,evectors}=Eigensystem[Normal[mtrx]];//AbsoluteTiming
(* {11.7250000, Null}*)