Q0:
Is exp() supported by cuComplex.h?
Q1:
How to write A = B * exp(i * C), where A, B, C are same size arrays of real numbers? Is this right?
ma
cuComplex.h only offers some basic operations on cuComplex (principally those used inside the CUBLAS and CUFFT libraries), the exponential function is not supported.
You can implement the exponential yourself using component-wise arithmetic. cuComplex stores the real part of a complex number in the x component and the imaginary part in the y component. Given a complex number z = x + i*y, the exponent can be computed as:
exp(z) = exp(x) * (cos(y) + i * sin(y))
This leads to the following CUDA code (untested):
cuComplex my_complex_exp (cuComplex arg)
{
cuComplex res;
float s, c;
float e = expf(arg.x);
sincosf(arg.y, &s, &c);
res.x = c * e;
res.y = s * e;
return res;
}