Compute symmetric trace-free components of tensors?

I am working on writing out some boundary conditions which have a few symmetric trace-free components of tensors in them, for example the symmetric trace-free component of x_i x_j f_k (where x_i and f_k are both vectors), the component of f_i x_j and also eye(3)*f_k.

At the moment in the codes I represent these with

Normal[Symmetrize[Outer[Times, xx , f]]]

Normal[Symmetrize[Outer[Times, eye , f]]];

Normal[Symmetrize[Outer[Times, f , x]]]

However, I need to have these symmetric trace-free components written out explicitly so that I have an expression where the vector f_k is being multiplied by everything else remaining in the expression. Is there some piece of code that would enable me t

1 Like