Defining \(H = A^TA + B^TB\) where \(A\) and \(B\) are low rank, compute \(n - 2tr(H) + tr(HH)\) in \(O(np^2)\) instead of \(O(n^2p^2)\).
Defining \(H = A^TA + B^TB\) where \(A\) and \(B\) are low rank, compute \(n - 2tr(H) + tr(HH)\) in \(O(np^2)\) instead of \(O(n^2p^2)\).