I need to check whether a matrix is unitary in python, for that I use this function:
def is_unitary(m):
return np.allclose(np.eye(m.shape[0]), m.H * m)
but when I'm trying to specify a matrix by:
m1=np.matrix([complex(1/math.sqrt(2)),cmath.exp(1j)],[-cmath.exp(-1j).conjugate(),complex(1/math.sqrt(2))],dtype=complex)
I get a
TypeError: __new__() got multiple values for argument 'dtype'
What is the correct way of working with data types here?