I have matrices: $ A = n\overbrace{ \left\{ \begin{matrix} \bullet & \cdots & \bullet\\ \vdots & \cdots & \vdots\\ \bullet & \cdots & \bullet\\ \end{matrix} \right\} }^{m_1}\\ B = n\overbrace{ \left\{ \begin{matrix} \bullet & \cdots & \bullet\\ \vdots & \cdots & \vdots\\ \bullet & \cdots & \bullet\\ \end{matrix} \right\} }^{m_2} $
I would like to find an orthogonal matrix T such that $T = m_1\overbrace{ \left\{ \begin{matrix} \bullet & \cdots & \bullet\\ \vdots & \cdots & \vdots\\ \bullet & \cdots & \bullet\\ \end{matrix} \right\} }^{m_2}$ \begin{align} T &= \begin{bmatrix} t_{1} \\ t_{2} \\ \vdots \\ t_{m_1} \end{bmatrix} \end{align}\
for each $t_i, t_j$ such that $i \neq j: \\ t_i \cdot t_j = 0$
And minimizes the function $f(T) = |A T - B|_F$
Is there a way to do that?