docs: def separable_series(h, N=1):
      """
      finds the first N rank 1 tensors such that their sum approximates
      the tensor h (2d or 3d) best
  
      returns (e.g. for 3d case) res = (hx,hy,hz)[i]
  
      s.t.
  
      h \approx sum_i einsum("i,j,k",res[i,0],res[i,1],res[i,2])
  
      Parameters
      ----------
      h: ndarray
          input array (2 or 2 dimensional)
      N: int
          order of approximation
  
      Returns
      -------
          res, the series of tensors
           res[i] = (hx,hy,hz)[i]
  
      """
      if h.ndim == 2:
          return _separable_series2(h, N)
      elif h.ndim == 3:
          return _separable_series3(h, N)
      else:
          raise ValueError("unsupported array dimension: %s (only 2d or 3d) " % h.ndim)