# Maximizing inner product with an orthogonal matrix inside

Take given matrices $$A, B \in \mathbb{R}^{m \times n}$$. We want to find an orthogonal matrix $$Q$$ (in $$\mathbb{R}^{n \times n}$$) to maximize the inner product $$\langle A, QB \rangle$$.

So I know that if this problem were instead to find $$Q, R$$ to maximize $$\langle A, QBR \rangle$$, we would just take $$Q = U_A U_B^T$$ and $$R = V_B V_A^T$$ from the SVDs of $$A, B$$. That actually achieves the maximum $$\textrm{Tr}(\Sigma_A \Sigma_B)$$.

But I'm not sure how to proceed when $$B$$ is only multiplied from the left. I suspect that we would still take $$Q = U_A U_B^T$$ so the inner product is $$\textrm{Tr}(\Sigma_A \Sigma_B V_B^T V_A)$$, but I have no idea how to show that this is indeed the maximum. My thought is that $$V_B^T V_A$$ will always be in the inner product, but why?

Would really appreciate answers centered around the SVD, as well as general intutition here. Thank you!

• This is basically an orthogonal Procrustes problem and its answer is well-known: the optimal $Q$ is $VU^T$, where $USV^T$ is a SVD of $BA^T$. Commented Apr 27, 2023 at 2:26
• Oh, that makes a ton of sense! Just gotta rotate in the trace. Commented Apr 27, 2023 at 2:29
• There appears to be a typo in the sizes of your matrices. If $\ A\$ and $\ B\$ are $\ m\times n\$ matrices won't you need $\ Q\$ to be an $\ m\times m\$ matrix (rather than $\ n\times n\$) for the product $\ QB\$ to be well-defined? Commented Apr 27, 2023 at 2:40