From 6754eade5d289c927aedd4a3bef4fe1ac6b450e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanu=C3=ABl=20Habets?= Date: Fri, 4 Oct 2024 15:25:35 +0200 Subject: [PATCH] Fix verbose option --- anf_generator/MixingMatrix.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/anf_generator/MixingMatrix.py b/anf_generator/MixingMatrix.py index 607374b..05fc9a7 100644 --- a/anf_generator/MixingMatrix.py +++ b/anf_generator/MixingMatrix.py @@ -357,7 +357,7 @@ def absoluteUnitaryProcrustes(A, B): for _ in range(MaximumTrails): # Perform optimization - U = MixingMatrix.signVariableExchange(A, newPhases, True) + U = MixingMatrix.signVariableExchange(A, newPhases, False) # Evaluate l1-norm of obtained unitary matrix l1 = MixingMatrix.l1norm(U @ A) @@ -387,7 +387,7 @@ def absoluteOrthogonalProcrustes(A, B): for _ in range(MaximumTrails): # Perform optimization - U = MixingMatrix.signVariableExchange(A, newSigns, True) + U = MixingMatrix.signVariableExchange(A, newSigns, False) # Evaluate l1-norm of obtained unitary matrix l1 = MixingMatrix.l1norm(U @ A) @@ -446,10 +446,10 @@ def signVariableExchange(A, B, verbose=False): # Check convergence if delta > np.sqrt(np.finfo(float).eps): - if not verbose: + if verbose: print("Variable exchange optimization did not improve.") elif delta > -1e-5: - if not verbose: + if verbose: print( f"Variable exchange optimization converged within {counter} iterations." )