> I tend to agree with not using the complex conjugate for vecmat, but would > prefer having > separate functions for that that make it explicit in the name. I also note > that mathematicians > use sesquilinear forms, which have the vector conjugate on the other side, so > there are > different conventions. I prefer the Dirac convention myself, but many > mathematical methods > texts use the opposite. It is tricky for the teacher in introductory courses, > right up there with > vectors being called contravariant when they are actually covariant (the > coefficients are > contravariant). Anyway, I think having the convention explicit in the name > will avoid confusion.
Hi Chuck, Indeed, which argument to conjugate seems not generally agreed on -- definitely found wikipedia pages using both convention! But I think numpy made the choice with vdot and vecdot, so that seems mostly a matter of documentation. I'm slightly confused whether or not you agree that the complex conjugate is useful, but can see your point of a name that makes it clear. Or perhaps one could have a wrapper function that let's one switch between conjugating the vector or not? One thing perhaps worth mentioning is that if we decide that vecmat does conjugate, the non-conjugating version can still trivially be done by a transpose using matvec(matrix.mT, vector) [1], while if vecmat does not conjugate by default, getting the conjugate version using the "obvious" vecmat(vector.conj(), matrix) implies a potentially costly copy of the whole vector array. (This can be avoided using the much less obvious np.vecdot(vec[..., np.newaxis, :], mat.mT), but I'm not sure that one really wants to suggest that...) More generally, in my own experience working with complex matrices and vectors, just about anytime one needs a transpose, a conjugate is generally needed too. All the best, Marten [1] Indeed, the implementation of vecmat uses the matvec loops with the matrix transposed for all but the complex numbers. _______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-le...@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: arch...@mail-archive.com