From f312d735039668527a55f628cb548c342511b39a Mon Sep 17 00:00:00 2001 From: jan Date: Sun, 17 Dec 2017 22:55:55 -0800 Subject: [PATCH] Return real part of the gradient --- fdfd_tools/bloch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdfd_tools/bloch.py b/fdfd_tools/bloch.py index 8d85b19..2d343ce 100644 --- a/fdfd_tools/bloch.py +++ b/fdfd_tools/bloch.py @@ -400,7 +400,7 @@ def eigsolve(num_modes: int, df_dy = scipy_iop @ (AzU - zU @ zTAzU) else: df_dy = (AzU - zU @ zTAzU) - return numpy.abs(f), numpy.sign(f) * df_dy.ravel() + return numpy.abs(f), numpy.sign(f) * numpy.real(df_dy).ravel() ''' Use the conjugate gradient method and the approximate gradient calculation to