forked from jan/fdfd_tools
Fix eigenvalue solver for complex matrices
This commit is contained in:
parent
6748181f8f
commit
c14298484d
@ -64,7 +64,7 @@ def solve_waveguide_mode_2d(mode_number: int,
|
|||||||
|
|
||||||
eigval = None
|
eigval = None
|
||||||
for _ in range(40):
|
for _ in range(40):
|
||||||
eigval = v @ A @ v
|
eigval = v.conj() @ A @ v
|
||||||
if numpy.linalg.norm(A @ v - eigval * v) < 1e-13:
|
if numpy.linalg.norm(A @ v - eigval * v) < 1e-13:
|
||||||
break
|
break
|
||||||
w = spalg.spsolve(A - eigval * sparse.eye(A.shape[0]), v)
|
w = spalg.spsolve(A - eigval * sparse.eye(A.shape[0]), v)
|
||||||
|
Loading…
Reference in New Issue
Block a user