Looking for a (nonlinear) map from $n$-dimensional cube to an $n$-dimensional simplex

If all you want is a homeomorphism this is pretty simple. I'll do the 2-dimensional case because it's easiest and the leg work for extending to higher dimensions can be annoying if not done carefully.

Let $X=\{(x,y)\in\mathbb{R}^2\:|\:x\in[0,1], y\in[0,1]\}$, let $X'=\{(x,y)\in\mathbb{R}^2\:|\:x\in[0,\frac{1}{2}], y\in[0,\frac{1}{2}]\}$, let $Y=\{(x,y)\in X\:|x+y\leq 1\}\:$. We want a homeomorphism $h\colon X\rightarrow Y$.

Let $g\colon X\rightarrow X'$ be given by $g(x,y)=(\frac{1}{2}x,\frac{1}{2}y)$. Let $f\colon X'\rightarrow Y$ be given by $$f(x,y)=\left\{\begin{array}{lr}(2x-y,y),&\mbox{ if }x\geq y\\ (x,2y-x),&\mbox{ if }x\leq y\end{array}\right.$$ and so both $g$ and $f$ are homeomorphisms and hence their composition $(f\circ g)=h\colon X\rightarrow Y$ is a homeomorphism.


For a point $P=(x_1,...,x_n)$ in the unit cube $0 \le x_i \le 1$, define $$s=x_1+\cdots +x_n, \ \ \ m=\max(x_1,...,x_n).$$ Then map $P$ to the point $$f(P)=(x_1 \cdot \frac{m}{s},...,x_n \cdot \frac{m}{s}).$$ This maps the unit cube onto the simplex $x_i \ge 0, \ \sum x_i \le 1.$

This map works by contracing each ray from the origin to $P$ by the right amount so that it ends up inside or on the boundary of the simplex. A few examples in 3-d:

$F(P)=F((1/3,1/3,1/3))=(1/9,1/9/1/9).$ Here $F(P)$ is strictly inside the simplex. If one follows the ray from the origin through $P$ one will hit the remote corner $P'=(1,1,1)$ of the cube, for which $f(P')=(1/3,1/3,1/3),$ a point exactly on the boundary of the simplex.

Or look at $F(P)=F((1/2,1/3,1/4))=(3/13,2/13,3/26)$ inside the simplex, while if we rescale $P$ until its largest coordinate becomes $1$ to obtain $P'=(1,2/3,1/2)$ (so that $P'$ lies on the boundary of the unit cube) we find that $f(P')=(6/13,4/13,3/13)$, again a point exactly on the boundary since its coordinates sum to 1.