The complex inner product $\langle u,v\rangle$ has two different definitions decided by conventions: $\bar{u}^Tv$ or $u^T\bar{v}$. In BLAS, I found the routines cdotu
, zdotu
, and cdotc
, zdotc
. The former two routines actually compute $u^Tv$ (a fake inner product!) and the last two routines conjugate the first vector in the inner product. Also, by either definition (conjugate $u$ or $v$), $\langle u,v\rangle=\overline{\langle v,u\rangle}$ with conjugation! Moreover, as pointed out in a comment, choosing the principal values for multi-valued complex functions can be convention dependent.
My question is: does this complication cause true danger for use of complex arithmetic in scientific computing? This issue is emphasised by the authors of deal.ii who suggest to always split complex numbers into real part and imaginary part and use the real arithmetic only. But I never found the splitting approach is convenient. For example, think about the Perfectly Matched Layer (PML) for time-harmonic Maxwell's equations.
It seems the worry of using complex numbers is prevalent in most open source FEM softwares except FreeFem++ and libmesh. But even for the two exceptions, the complex arithmetic is less tested than the real.
My final question is: shall we just always avoid using complex numbers?