# Trace of high dimensional matrix multiplication

I am examining when the following expression is true:

$$tr( \sum_{i\in G_1}^{k} {A_iB_iC_iB_i}) - tr(\sum_{i\in G_2}^{l} {A_jB_jC_jB_j}) = 0 \quad \quad \quad \: - (*)$$

where

$$A_{i},B_{i},C_{i}\quad (\forall i \in G_1 )$$ - symmetric and positive definite matrices of the dimension $$n\times n$$. $$A_{j},B_{j},C_{j}\quad(\forall j \in G_2 )$$ - symmetric and positive definite matrices of the dimension $$n\times n$$ $$G_1 = 1,2,..,k$$ ; $$G_2 = 1,2,..,l$$ ;

Numerically this will require $$o(n^2)$$ to solve. However, I am trying to evaluate the cases (in general) where this goes to zero.

Note: I am not considering the trivial solution (i.e. when $$l=k$$ and $$A_{i}=A_{j},B_{i}=B_{j},C_{i}=C{j}\: \forall i,j= 1,2,..l$$ )

What have I tried?

I have tried to do this for two-dimensional matrices and it gets messy! I also couldn't find (I am still trying) trace/multiplication properties that would simplify the equation! I could put the sum inside the trace but That does not make the problem easier.

This is an equation that I got after solving the hamiltonian and now I am trying to find the singular arch for a costate. In (*), $$A$$ is another costate that can be assumed to be positive definite all the time. $$B$$ is the estimate covariance error of some variables. $$C = H^T R^{-1} H$$; where $$R$$ is positive deﬁnite ($$R$$ is al)