From ff395277b0517f57780e7c7c8566e3f4ac5e4679 Mon Sep 17 00:00:00 2001 From: jan Date: Tue, 22 Nov 2022 22:21:51 -0800 Subject: [PATCH] add another comment about minmization --- meanas/fdfd/bloch.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meanas/fdfd/bloch.py b/meanas/fdfd/bloch.py index 848cd3d..7640354 100644 --- a/meanas/fdfd/bloch.py +++ b/meanas/fdfd/bloch.py @@ -582,6 +582,13 @@ def eigsolve( d_scale = num_modes / norm(D) D *= d_scale + # Now know the direction (D), but need to find how far to go (alpha) + # We are still minimizing E = tr((Z + alpha D)t A (Z + alpha D) U') + # = tr(ZtAZU' + alpha DtAZU' + alpha ZtADU' + alpha**2 DtADU') + + # where U' = inv((Z + alpha D)t (Z + alpha D)) + # = inv(ZtZ + alpha ZtD + alpha DtZ + alpha**2 DtD) + AD = scipy_op @ D DtD = D.conj().T @ D DtAD = D.conj().T @ AD