Hello there,

I’m trying to solve the generalized eigen problem Ax=\lambda Bx with A and B being linear maps. However, I encountered a problem when using a shift-invert method (A-\sigma B)^{-1}Bx=\frac{1}{\lambda-\sigma}x to solve the system: Even when considering a symmetric matrices (see example with Laplacian) the eigen modes have a non-zero imaginary part, that “takes the shape” of the real part. I don’t see why this is happening and how I can avoid this, especially when the problem is more complicated and I can’t just ignore the imaginary part. Here’s the problem:

```
using DiffEqOperators, LinearMaps
n = 50
B=complex.(sparse(DerivativeOperator{Float64}(2,2,1.,n,:Dirichlet0, :Dirichlet0)))
A=complex.(speye(n))
a,u=eig(full(A),full(B))
@show isreal(u)
@show isreal(a)
σ = a[1]
Alo=LinearMap{Complex128}((y,x)->A_mul_B!(y,A,x),n)
Blo=LinearMap{Complex128}((y,x)->A_mul_B!(y,B,x),n)
C = A-σ*B
C_lu = lufact(C)
Clo = LinearMap{Complex128}((y,x)->A_ldiv_B!(y,C_lu,Blo*x),n)
ae,ue = eigs(Clo,nev=5)
@show isreal(ae)
@show isreal(ue)
@show maximum(imag.(ue))
```

Thanks for any help, there is probably an easy explanation or workaround!?