I cannot compile this code:
import numpy as np
import numba
from numba import jit, float64, complex128
import math
@jit(complex128[:](float64,float64[:],float64))
def GaborWavelet(omega, t, Gabor_coef):
c1 = 0.3251520240633*math.sqrt(omega)
c2 = -0.5*Gabor_coef
c3 = omega*0.187390625129278
res = np.array(c2*(t * c3)**2, dtype = np.complex128)
res.imag = omega*t
return c1*np.exp(res)
It raises:
Compilation is falling back to object mode WITH looplifting enabled because Function "GaborWavelet" failed type inference due to: No implementation of function Function() found for signature:
array(array(float64, 1d, C), dtype=class(complex128))
There are 2 candidate implementations: - Of which 2 did not match due to: Overload in function 'array': File: numba\core\typing\npydecl.py: Line 504. With argument(s): '(array(float64, 1d, C), dtype=class(complex128))': Rejected as the implementation raised a specific error: TypingError: array(float64, 1d, C) not allowed in a homogeneous sequence
res = np.array(c2*(t * c3)**2, dtype = np.complex128)
^
What do I wrong?
How to compile this code (with numpy methods inside)?