I would like to find the (orthonormal) basis $\boldsymbol u=(u_1,\dots u_{n-1})$ of the vector subspace \begin{equation} \mathcal S^{n-1}=\{x\in \mathbb R^n: \sum_i x_i=0\}\subsetneq \mathbb R^n\;. \end{equation}
Is there a general formular for the basis or an algorithm to build it that is significantly faster than the Gram-Schmidt method? Eventually I just want to have a projector $P=\sum_{i}^{n-1}u_iu_i^T$ onto that subspace. The problem originates from projecting on the boundary of a simplex.
Edit: This is equivalent to searching for a projection on the boundary of the simplex. Let $\xi\in \partial\Delta_{m-1}\subsetneq \mathbb R^m$ be a point on the boundary of an $m-1$-simplex. Then we denote by $\mathcal A:=\{i:\xi_i>0\}$ the active (nonzero) set of indices. A vector $v$ on the boundary satisfies $\sum_{j\in\mathcal A}v_j=0$. So I'm looking for the subspace of $\mathbb R^{|\mathcal A|}$ that satisfies this condition.
One such basis is the set of columns: $$\left[\begin{array}{r}-1&-1&-1&-1&\ldots\\1&-1&-1&-1&\ldots\\&2&-1&-1&\ldots\\&&3&-1&\ldots\\&&&4&\ldots\\&&&&\ddots\end{array}\right].$$ Since they are easy to generate, they can be easily normalized: $$\left[\begin{array}{r} -\frac{1}{\sqrt{2}}& -\frac{1}{\sqrt{6}}& -\frac{1}{\sqrt{12}}& \ldots& -\frac{1}{\sqrt{(n-3)(n-2)}}& -\frac{1}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ \frac{1}{\sqrt{2}}& -\frac{1}{\sqrt{6}}& -\frac{1}{\sqrt{12}}& \ldots& -\frac{1}{\sqrt{(n-3)(n-2)}}& -\frac{1}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ & \frac{2}{\sqrt{6}}& -\frac{1}{\sqrt{12}}& \ldots& -\frac{1}{\sqrt{(n-3)(n-2)}}& -\frac{1}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ & & \frac{3}{\sqrt{12}}& \ldots& -\frac{1}{\sqrt{(n-3)(n-2)}}& -\frac{1}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ &&& \ddots& \vdots& \vdots& \vdots\\ &&&& \frac{n-3}{\sqrt{(n-3)(n-2)}}& -\frac{1}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ &&&&& \frac{n-2}{\sqrt{(n-2)(n-1)}}& -\frac{1}{\sqrt{(n-1)n}}\\ &&&&&& \frac{n-1}{\sqrt{(n-1)n}}\\ \end{array}\right].$$ I reckon those $a/\sqrt{a}$ divisions are redundant, but you must compute $\sqrt{(a-1)a}$ anyway.
My source: I did perform Gram-Schmidt on these once: $$\left[\begin{array}{r}-1&-1&-1&-1&\ldots\\1&&&&\ldots\\&1&&&\ldots\\&&1&&\ldots\\&&&1&\ldots\\&&&&\ddots\end{array}\right].$$