2

I have found a similar question at Calculate Rotation Matrix to align k n dimensional vectors but not quite the same what I want to do.

Problem:

$S_1, S_2 \in \Re^{D \times d} $ where ${D > d} $ and columns of each matrix are orthonormal. Need to find a $R \in \Re^{D \times D}$ orthonormal rotation matrix such that $Col(S_2) \equiv Col(R S_1)$ where $Col(\cdot)$ represents the column space.

Any insight towards a solution is much appreciated.

Batta
  • 213

2 Answers2

1

Found a solution based on the answer at rotating linear dependent vectors in space.

In our case $S_1$ and $S_2$ are each similar to $A$ matrix described in above answer. For $S_1$ and $S_2$, find corresponding $G$ matrices $G_1$ and $G_2$. Finally the needed rotation $R=G_2 G_1^{-1}$.

Batta
  • 213
0

I write a more self-contained solution for this problem.

Let $S_1,S_2 \in \mathbb{R}^{D\times d}$ be two matrices such that the their columns contain orthonormal basis for the subspaces $S_1$ and $S_2$, respectively. Denote the set of columns of $S_1$ as $V = \{v_1,\dots,v_d\}$ and $S_2$ as $U = \{u_1,\dots,u_d\}$.

Using Gram-Schmidt procedure, we can complete $V$ and $U$ to have a orthonormal basis for $\mathbb{R}^D$. Denote the resulting matrix as $A_1 \in \mathbb{R}^{D\times D}$ and $A_2 \in \mathbb{R}^{D\times D}$. Note that the first $d$ columns of $A_1$ and $A_2$ are equal to $S_1$ and $S_2$, respectively.

We make the following observation: $A_1^\top S_1 = \mathbb{I}_{D \times d} $ and $A_2^\top S_2 = \mathbb{I}_{D \times k}$ where $\mathbb{I}_{D \times d} \in \mathbb{R}^{D \times d}$ is matrix which contain identity matrix of size $d\times d$ on top and zero on the rest. More precisely, $$ \mathbb{I}_{D \times d} = \begin{pmatrix} 1 & 0 & \cdots & 0 \\ 0 & 1 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 1 \\ 0 & 0 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & 0 \end{pmatrix}_{D \times d} $$

Then, we claim that $R = A_2 A_1^\top$.

To show that $\text{col-span}(S_2)= \text{col-span}(R S_1)$, let $x \in \mathbb{R}^d$. Then,

\begin{align} R S_1 x &= A_2 A_1^\top S_1 x\\ &=A_2 \mathbb{I}_{D \times d} x\\ &=S_2 x, \end{align} where the last line follows from $A_2 \mathbb{I}_{D \times d}=S_2$.

Finally notice that by definition it is straightforward to show that $A_2 A_1^\top$ is a unitary matrix.

MMH
  • 587