def uifftn(inarray, dim=None):
 if (dim is None):
  dim = inarray.ndim
 outarray = np.fft.ifftn(inarray, axes=range((- dim), 0))
 return (outarray * np.sqrt(np.prod(inarray.shape[(- dim):])))

def uifftn ( inarray , dim = None ) : if ( dim is None ) : dim = inarray . ndim outarray = np . fft . ifftn ( inarray , axes = range ( ( - dim ) , 0 ) ) return ( outarray * np . sqrt ( np . prod ( inarray . shape [ ( - dim ) : ] ) ) )
n-dimensional unitary inverse fourier transform .