FEAST Theory

Assume A∈(ℂ^(n×n)) is semi-simple with the eigen-value decomposition
	A=Q Λ (Q^(-1))
where 
	Λ=SparseArray[Band[{1,1}]->{(Subscript[λ, 1]),(Subscript[λ, 2]),…,(Subscript[λ, n])},{n,n}] 
	Λ=(({{(Subscript[λ, 1]), 0, 0, 0, 0}, {0, (Subscript[λ, 2]), 0, 0, 0}, {⋮, ⋱, ⋱, ⋱, ⋮}, {0, 0, 0, (Subscript[λ, n-1]), 0}, {0, 0, 0, 0, (Subscript[λ, n])}}))
is the diagonal matrix with the eigenvalues on the diagonal and
	Q=[(Subscript[q, 1])|(Subscript[q, 2])|…|(Subscript[q, n])] 
is the matrix of eigenvectors. As a result 
	A-z Id=Q Λ (Q^(-1))-Q Z (Q^(-1))=Q (Λ-Z)(Q^(-1))
where Z is the diagonal matrix with constant diagonal z∈ℂ.  The inverse is 
	Γ[z]=(((A-z Id))^(-1))=(((Q (Λ-Z)(Q^(-1))))^(-1))=Q (((Λ-Z))^(-1))(Q^(-1))
where
(((Λ-z))^(-1))=(({{-(1/(z-(Subscript[λ, 1]))), 0, 0, 0, 0}, {0, -(1/(z-(Subscript[λ, 2]))), 0, 0, 0}, {⋮, ⋱, ⋱, ⋱, ⋮}, {0, 0, 0, -(1/(z-(Subscript[λ, n-1]))), 0}, {0, 0, 0, 0, -(1/(z-(Subscript[λ, n])))}}))=(∑_(i=1)^n)(-(1/(z-(Subscript[λ, i])))[(Subscript[e, i])⊗(Subscript[e, i])])
Isolating this diagonal matrix gives
	(((Λ-z))^(-1))=(Q^(-1))Γ[z]Q
Consider a closed simple contour in ℂ that encloses exactly M eigenvalues with a ccw orientation. Renumber the eigenvalues and eigenvectors so that these are the first M eigenvalues then 
	 (∫_c)(((Λ-z))^(-1))dz=(({{-2π i, 0, 0, 0, 0, …, 0}, {0, -2π i, 0, 0, 0, …, 0}, {⋮, ⋱, ⋱, ⋱, ⋱,  , ⋮}, {0, …, 0, -2π i, 0, …, 0}, {0, 0, 0, 0, 0, …, 0}, {⋮, ⋮, ⋮, ⋮, ⋱, ⋱, ⋮}, {0, 0, 0, 0, 0, 0, 0}}))=(∑_(i=1)^M)(-2π i [(Subscript[e, i])⊗(Subscript[e, i])])=(Q^(-1))((∫_c)Γ[z]dz )Q
undoing the Qs and dividing by -2π i gives us 
	Q((∑_(i=1)^M)(Subscript[e, i])⊗(Subscript[e, i]))(Q^(-1))=(1/(-2π i ))(∫_c)Γ[z]dz 
In other words, the contour integration isolates the M eigenvalues within the contour.