code: def left(X, i):
      
      if i < 0:
          return np.ones([1, 1])
      answ = np.ones([1, 1])
      cores = tt.tensor.to_list(X)
      for dim in xrange(i+1):
          answ = np.tensordot(answ, cores[dim], 1)
      answ = reshape(answ, (-1, X.r[i+1]))
      return answ
docs: Compute the orthogonal matrix Q_{\leq i} as defined in [1].