From c14298484db30b20a02e9aaca50b2f0767ce9c17 Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 24 Sep 2017 19:11:56 -0700 Subject: [PATCH] Fix eigenvalue solver for complex matrices --- fdfd_tools/waveguide_mode.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdfd_tools/waveguide_mode.py b/fdfd_tools/waveguide_mode.py index df62143..51a6266 100644 --- a/fdfd_tools/waveguide_mode.py +++ b/fdfd_tools/waveguide_mode.py @@ -64,7 +64,7 @@ def solve_waveguide_mode_2d(mode_number: int, eigval = None for _ in range(40): - eigval = v @ A @ v + eigval = v.conj() @ A @ v if numpy.linalg.norm(A @ v - eigval * v) < 1e-13: break w = spalg.spsolve(A - eigval * sparse.eye(A.shape[0]), v)