#154 Wrong result of outer_product() of complex vectors


By: Yngve Selén (yngveselen) - 2007-05-28 13:41

It seems like the function outer_product does not work according to the convention for complex vectors. I'd expect that outer_product(x,y) (where x and y are of the type cvec) would return
(^H denoting Hermitian transpose). However, what you get instead get is
so you have to use outer_product(x,conj(y)) to get the "conventional" outer product of vectors. I haven't found this "bug" documented anywhere.


  • Adam Piątyszek

    Adam Piątyszek - 2007-05-29

    Logged In: YES
    Originator: YES

    This bug is now fixed in SVN.

  • Adam Piątyszek

    Adam Piątyszek - 2007-05-30

    Logged In: YES
    Originator: YES

    The fix was reverted from the repository, since it brakes interface without notifying end users. We are working on a better solution for this issue.

  • Adam Piątyszek

    Adam Piątyszek - 2007-06-02

    Logged In: YES
    Originator: YES

    Finally this problem was fixed as follows:
    1) In the current stable branch (3.10.x), we decided to only update documentation and do not change the code at all, mainly for backward compatibility. So the outer_product() of complex vectors x, y results in (x * y^T). One can use outer_product(x, conj(y)) to perform (x * y^H) operation.
    2) In the development branch (3.99.x), an extra "hermitian" parameter has been added to this method:
    Mat<T> outer_product(const Vec<T> &v1, const Vec<T> &v2, bool hermitian = false);
    This parameter is ignored for vector types other than cvec. For complex vectors, a standard transposition of the second argument is performed by default for backward compatibility (hermitian = false). But one can explicitly choose a Hermitian transposition setting hermitian to true, e.g.:
    cmat M = outer_product(v1, v2, true); // (v1 * v2^H)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks