khinsen / mittag-leffler

The generalized Mittag-Leffler in Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

problem for complex z

arieder opened this issue · comments

Hi,
thank you for your work.
Unfortunately your code does not seem to work correctly for complex parameters, as it seems to cast to float64.

As a quick and dirty hack, if i add the check
if(type(z)==complex):
return np.vectorize(ml_, [np.complex128])(z, alpha, beta, gama)
else:
return np.vectorize(ml_, [np.float64])(z, alpha, beta, gama)
to the ml function, it seems to work correctly.

Thanks for your report. The function ml is indeed optimized for float64 (which is all I ever needed myself). The unvectorized ml_ should work for arbitrary complex z.

Your quick and dirty hack is probably the only possible fix, given how np.vectorize works.