a = np.array([1., 2., 3.]) # 1. ensures data type is floatb = np.array([4.j, 5.j, 6.j]) # 1j = complex imaginary unitprint(a * b) # use broadcasting: array as result, not a scalar productprint((a * b).sum(), np.sum(a * b)) # object functions should be fasterprint(b @ a) # no conjugationprint(np.dot(b, a)) # no conjugation, better styleprint(np.vdot(b, a)) # conjugation of first argumentprint(np.dot(b.conj(), a)) # manual conjugation; b.conj() makes no copyprint((b.conj() * a).sum(), np.sum(np.conjugate(b) * a)) # last makes a copyprint(np.tensordot(b, a, axes=1)) # same as dotprint(np.tensordot(b.conj(), a, axes=1)) # same as vdot# Look up np.einsumprint(np.einsum("i,i", b, a)) # np.dot(b, a)print(np.einsum("i,i", b.conj(), a)) # np.vdot(b, a)# Make them 2D ndarrays; caution on type and shape of outputA = a.reshape(1, 3)print(A) # view, no copyB = b.reshape(1, 3)print(B)print(A @ b)# print(A @ B) # mismatchprint(B @ A.T) # real scalar product of b and aprint(B.conj() @ A.T) # complex scalar product of b and aprint(A @ b, A @ b.conj())