What are the efficient options to perform matrix multiplications of the form `A*B*A`

and `A*B*A'`

? I am particularly intereted in the case when `A`

and `B`

are `Symmetric`

or `Hermitian`

and when these multiplications are performed repeatedly inside a loop, such as

`sum(A*B*A for B in Bset)`

,

where `Bset`

is an array of matrices.

Some time ago i found a post on this topic, but i am not able to retrive it anymore.