Crossposted on Mathematica SE
Is there a systematic/algorithmic/computational way to "complete the square" or find a sum-of-squares decomposition for a trace of non-commuting operators? For example, I know that
$$\operatorname{Tr} \left( \rho A^{2\dagger} \rho A^2 - \rho A^{\dagger} \rho A^2 - \rho A^{2\dagger} \rho A + \rho A^\dagger \rho A \right) \equiv \operatorname{Tr} \left( \rho (A^2 - A)^\dagger \rho (A^2 - A) \right)$$
Given that $\rho$ is a positive semi-definite operator, this reduction reveals that the expression is non-negative for all operators $A$. While this reduction is easy enough to spot "by inspection", I find myself faced with a more complicated expression that I am almost sure is non-negative, but I haven't been able to reduce "by inspection" into a manifestly non-negative form.
The expression I am currently faced with has 5 terms that each involve 2 powers of $\rho$, 2 powers of $A$, and 2 powers of $A^\dagger$, arranged in different orders. For example, one term looks like $\operatorname{Tr} \left( \rho A^\dagger A^2 \rho A^\dagger \right)$.
For the sake of completeness, I've written the full expression below, although I'd love an answer that provides a systematic approach for tackling this sort of problem, rather than a solution to this specific instance of the problem. Any help would be appreciated.
$$ \operatorname{Tr} \left( \rho^2 A^\dagger A^\dagger A A + 2 \rho A^\dagger A \rho A^\dagger A + \rho A A \rho A^\dagger A^\dagger - 2 (A^\dagger A \rho + \rho A^\dagger A) A \rho A^\dagger \right) $$