Skip to content

Commit

Permalink
Fix verbose option
Browse files Browse the repository at this point in the history
  • Loading branch information
ehabets committed Oct 4, 2024
1 parent dfd3fcb commit 6754ead
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions anf_generator/MixingMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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."
)
Expand Down

0 comments on commit 6754ead

Please sign in to comment.