# TensorReduce not simplifying transpose for symmetric matrix?

I know Mathematica is not very good with symbolic manipulation of matrix expressions, but I was surprised to find that it can't reduce the following expression:

$Assumptions = G ∈ Matrices[{n, n}, Reals, Symmetric[{1, 2}]] (* G ∈ Matrices[{n, n}, Reals, Symmetric[{1, 2}]] *) TensorReduce[G.G - G.Transpose[G]] (* -G.Transpose[G, {2, 1}] + MatrixPower[G, 2] *)  For real symmetric matrices, Transpose operation is an identity map. How do I this expression in this case? • Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Jan 26, 2015 at 15:05 • Others will appreciate it if the code can be copied, pasted directly into Mathematica, and executed. The In/Out tags make that difficult. If you set the option SetOptions[$FrontEnd, ExportMultipleCellsOptions -> {"IncludeCellLabels" -> False}], then they won't be copied from your notebook. Note using $FrontEnd sets it for all sessions. Use $FrontEndSession if you just want to set it for your current session. Generally people put output inside comments (*...*) so that it won't affect execution when pasted. Jan 26, 2015 at 15:06
• @MichaelE2 Thanks for the tips. :) Jan 26, 2015 at 15:25
• If you aren't really interested in tensor algebra, then you may as well just go the simple route: Transpose[G] ^= G. With this, G.G-G.Transpose[G] directly evaluates to 0.
– Jens
Jan 26, 2015 at 18:43

You should use \[TensorProduct] and TensorTranspose instead the usual . and Transposematrix operations.

TensorReduce[G\[TensorProduct]G - G\[TensorProduct]TensorTranspose[G]]

returns 0

• Thx, but I'm not trying to do tensor product. . is for Hadamard product. It also doesn't work for simple matrix multiplication... Jan 26, 2015 at 18:11

This works as expected in M10.3+:

\$Assumptions = G \[Element] Matrices[{n, n}, Reals, Symmetric[{1, 2}]];

TensorReduce[G.G - G.Transpose[G]]


0

• Was it a bug that is fixed in 10.3? Sep 12, 2017 at 6:43
• @AlexeyPopkov I think it's more of a new feature than a bug fix. Sep 12, 2017 at 15:01