Dot product of complex vectors



> > I wonder, why it is so, and how can I redefine it to:
> > dotproduct(c*a, b) = c * y1 * conjugate(y2)+ c * x1 * x2? 
> Maybe you would like:
> (%i15) mydot(a,b) := conjugate(dotproduct(a,b))$
> (%i16) mydot(c*a,b);
> (%o16) c*y1*conjugate(y2)+c*x1*conjugate(x2)
> This differs from your (%o12). Was this a typo?
Yes, it was a typo. Such redefinition is ok. Thank you. (I just thought that
there is more 'elegant' way to redefine it by setting some option or something
like this :) )

> Maybe declare(x, nonscalar), declare(x,complex) will work for you.

I've tried it. But it gives an error:

(%i1) declare(x1, complex)$
(%i2) declare(x2, complex)$
(%i3) declare(x1, nonscalar)$
(%i4) declare(x2, nonscalar)$
(%i5) declare(c, complex);
(%i7) dotproduct(c*x1,x2);
The "first" argument of the function "dotproduct" must be a matrix
#0: dotproduct(a=c*x1,b=x2)(linearalgebra.mac line 50)
#1: dotproduct(?_l=[c*x1,x2])
 -- an error.  To debug this try debugmode(true);


> What does >> and ~= mean?
It means much greater and approximately.