Hello Andreas,
Currently CURAND wrapper cannot fill_normal() or fill_uniform() the
array of complex64 or complex128. I can add this functionality, but
first I'd like to clarify some details:
1. Should I add this to XORWOW RNG only? In CURAND "*2" functions were
not implemented for Sobol intentionally, but we can fill complex
number by two successive calls to curand_normal() with note that it is
done at user's own risk.
2. Should I scale randoms if they are written to complex array? As far
as I understand, normally distributed complex numbers are expected to
have (a * a.conj()).std() == 1, not 2 as will happen if we just fill
the array with curand_normal2() return values.
3. As a partial alternative to 2., should I add custom shift/scaling to randoms?
At the moment I am using the following workaround:
class _RandomNumberGeneratorBase(object):
...
def fill_normal(self, data, stream=None):
if data.dtype in (np.float32, np.complex64):
func_name = "normal_float"
elif data.dtype in (np.float64, np.complex128):
func_name = "normal_double"
else:
raise NotImplementedError
data_size = data.size
if data.dtype in (np.complex64, np.complex128):
data_size *= 2
...
Best regards,
Bogdan
_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda