# how to compute matrix polar decomposition of a non square matrix

I know that for any matrix $A\in \mathbb{C}^{n\times m}$ we can find a polar decomposition such that $A=UP=U|A|=U\sqrt{A^*A}$ where $P\in \mathbb{C}^{m\times m}$ and $U\in \mathbb{C}^{n\times m}$ is an isometry matrix whose columns are orthonormal.. For $A$ square matrix I know how to compute the isometry matrix using SVD but I'm wondering how to compute $U$ for non square $A$.

Is it simply $U=AP^{-1}$ and this would give a unique decomposition of $A$.

-
Presumably $n\ge m$. Let $A=RSQ^\ast$ be a SVD of $A$. Then $S=\begin{pmatrix}\Sigma\\0\end{pmatrix}$ for some $m\times m$ nonnegative diagonal matrix $\Sigma$. Hence we can rewrite $A$ as $R\begin{pmatrix}Q^\ast\\0\end{pmatrix}(Q\Sigma Q^\ast)$. Now $P=R\begin{pmatrix}Q^\ast\\0\end{pmatrix}$ has orthonormal columns ($P^\ast P=I_m$) and $U=Q\Sigma Q^\ast$ is the positive semidefinite square root of $A^\ast A$. The matrix $P$ is unique if $A$ has full rank.