tblis icon indicating copy to clipboard operation
tblis copied to clipboard

(complex) conjugation

Open Jutho opened this issue 8 years ago • 2 comments

Hi Devin,

thanks for this nice package. As I am not fluent in C/C++, I wrote a light Julia wrapper and I am now testing this, especially the use of tensor contraction (tblis_tensor_mult). However, my tests only seem to result in the correct answer if I don't try to complex conjugate A or B. Is this not implemented yet, or am I incorrectly specifying the conjugation flag. Why is this an int and not a bool?

Thanks,

Jutho

Jutho avatar Jul 19 '17 10:07 Jutho

Yes, unfortunately complex conjugation does not work at the moment. I should get time to fix this in a month or so.

As for the conjugation flag, it is an int because that is easier than supporting both C99 bool and C++ bool simultaneously. It uses the usual 0 = false, not 0 = true.

devinamatthews avatar Jul 20 '17 01:07 devinamatthews

Hi,

thank you for this useful library. Has there been any news on this issue? As far as I can see, conjugation still does not work in tblis_tensor_mult and so I have been explicitly conjugating (and back-conjugating) before (and after) using the routine. But after a quick look at the code, I can see that conj is used at some points in the code, e.g. in src/internal/3t/dense/mult.cxx at line 869

                    *C = alpha*(conj_A ? conj(*A) : *A)*
                               (conj_B ? conj(*B) : *B) +
                          beta*(conj_C ? conj(*C) : *C);

but I wasn't able to get a clear enough picture on which overloaded mult function is called where and why and when conjugating would work and where not so far.

Edit: After having another look, I see the "TODO"s in internal/3t/dpd/mult.cxx before

TBLIS_ASSERT(!conj_A && !conj_B && !conj_C);

ZehDeckel avatar May 05 '23 10:05 ZehDeckel