Why do I receive an error for the all
function in my function?
import numpy as np
A = np.matrix([[.6+1j,.5], [.6,.5]])
def isNormalcomplex(A):
if (all(A@A.T.conj() == A.T.conj()@A)):
print("The matrix is normal")
else:
print("The matrix is Non-normal")
isNormalcomplex(A)
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()