code: def linspace(n, d=None, a=0.0, b=1.0, right=True, left=True):
      
      if isinstance(n, six.integer_types):
          n = [n]
      if d is None:
          n0 = _np.asanyarray(n, dtype=_np.int32)
      else:
          n0 = _np.array(n * d, dtype=_np.int32)
      d = n0.size
      t = xfun(n0)
      e = ones(n0)
      N = _np.prod(n0)  # Size
      if left and right:
          h = (b - a) * 1.0 / (N - 1)
          res = a * e + t * h
      elif left and not right:
          h = (b - a) * 1.0 / N
          res = a * e + t * h
      elif right and not left:
          h = (b - a) * 1.0 / N
          res = a * e + (t + e) * h
      else:
          h = (b - a) * 1.0 / (N - 1)
          res = a * e + (t + e) * h
      return res.round(1e-13)
docs: Create a QTT-representation of a uniform grid on an interval [a, b]