I am working on a project and part of the output of my code is the following: $$ \text{a1}\otimes\text{a2}+\text{a1}\otimes(\text{a1}\otimes\text{a1}-\text{a2})-\text{a1}\otimes\text{a1}\otimes\text{a1}. $$

To me this clearly simplifies to 0, but for some reason, Mathematica cannot see this even if I use Simplify or FullSimplify. Is there any way to help it to see this?

In[283]:= ExpandAll[ a1\[TensorProduct]a2 + a1\[TensorProduct](-a2 + a1\[TensorProduct]a1) 
 - a1\[TensorProduct]a1\[TensorProduct]a1]

Out[283]= a1\[TensorProduct]a2 + a1\[TensorProduct](-a2 + a1\[TensorProduct]a1)
- a1\[TensorProduct]a1\[TensorProduct]a1
  • $\begingroup$ Here it's considered helpful to show your own efforts and share your code in a well formatted form instead of images or links to external files, so we can quickly Copy&Paste your code, test it, and see the problem you are facing. Please help us to help you and edit your question accordingly. This question in Meta could be useful. $\endgroup$
    – rhermans
    Commented Aug 9, 2018 at 10:10
  • 1
    $\begingroup$ @rhermans I didn't put the raw code as it was very ugly and didn't show my point as well as an image. I have replaced with the code now. $\endgroup$
    – wilsnunn
    Commented Aug 9, 2018 at 10:16
  • 2
    $\begingroup$ Still it's better that you share your ugly code than to ask us to guess and type the code for you. Using images it's fine provided you also provide plain text code (in InputForm) that we can Copy&Paste. Thanks for editing your question. Don't forget to take the tour $\endgroup$
    – rhermans
    Commented Aug 9, 2018 at 11:30

1 Answer 1

expr = a1\[TensorProduct]a2 +  a1\[TensorProduct](-a2 + a1\[TensorProduct]a1) - 

enter image description here

TensorExpand @ expr


  • 1
    $\begingroup$ while your solution works its a bit disappointing that FullSimplify does not attempt TensorExpand? $\endgroup$
    – chris
    Commented Aug 9, 2018 at 14:42
  • $\begingroup$ @chris, I agree. PowerExpand and ComplexExpand are also not used by FullSimplify because they "make special assumptions on input". Perhaps TensorExpand is not used for the same reason. $\endgroup$
    – kglr
    Commented Aug 9, 2018 at 14:53
  • $\begingroup$ @chris you can always manually add TensorExpand to TransformationFunctions: FullSimplify[expr, TransformationFunctions -> {Automatic, TensorExpand}]. $\endgroup$
    – jkuczm
    Commented Aug 10, 2018 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.