# How to simplify this trace term?

I have the following trace term:

trace(Sk' Ck Sk)


where Sk is a KxM matrix and Ck is a KxK positive semidefinite matrix. I'm involving this trace term in a Matlab code and it seems to suffer when computing this term. How could I simplify it (if possible)?

• Which is bigger, K or M? – Omnomnomnom Mar 31 '19 at 13:21
• K is far more smaller than M – Alberto Mar 31 '19 at 13:22

In general, note that $$\operatorname{trace}(AB) = \operatorname{trace}(BA)$$, whenever both matrix multiplications are defined.
So, we can rewrite your expression as $$\operatorname{trace}(S_k' C_k S_k) = \operatorname{trace}(S_k S_k' C_k)$$ Note that $$S_k' C_k S_k$$ is $$M \times M$$, whereas $$S_k S_k' C_k$$ is $$K \times K$$.