code: def _separable_series2(h, N=1):
      
      if min(h.shape)<N:
          raise ValueError("smallest dimension of h is smaller than approximation order! (%s < %s)"%(min(h.shape),N))
  
      U, S, V = linalg.svd(h)
  
      hx = [-U[:, n] * np.sqrt(S[n]) for n in range(N)]
      hy = [-V[n, :] * np.sqrt(S[n]) for n in range(N)]
      return np.array(list(zip(hx, hy)))
docs: finds separable approximations to the 2d function 2d h
  
      returns res = (hx, hy)[N]
      s.t. h \approx sum_i outer(res[i,0],res[i,1])