5
$\begingroup$

I need to do the following:

Transpose[A.(B+C)]=Transpose[B].Transpose[A]+Transpose[C].Transpose[A]

How should I do this in mathematica? So far mathematica does not distribute the operation. Thank you!

$\endgroup$
1
  • $\begingroup$ The NCAlgebra package might be able to do this. $\endgroup$
    – Szabolcs
    Jul 21, 2015 at 18:31

1 Answer 1

7
$\begingroup$

Update: it seems this only works in 10.1 and later, but not in 10.0.

This works:

Assuming[(a | b | c) ∈ Matrices[{d, d}], TensorExpand@Transpose[a.(b + c)]]

(* Transpose[b, {2, 1}].Transpose[a, {2, 1}] + Transpose[c, {2, 1}].Transpose[a, {2, 1}] *)

We needed to tell Mathematica that a, b and c are square matrices and use TensorExpand.

Check here: Symbolic tensors.

$\endgroup$
10
  • $\begingroup$ What do the | change? $\endgroup$ Jul 21, 2015 at 18:35
  • $\begingroup$ @space_voyager Check Element, third line from the top. $\endgroup$
    – Szabolcs
    Jul 21, 2015 at 18:35
  • $\begingroup$ +1, just FTR it doesn't work in v9 $\endgroup$ Jul 21, 2015 at 18:39
  • $\begingroup$ @Szabolcs I'm sorry but doing what you said gives in Mathematica 10.0: Transpose[b + c, {2, 1}].Transpose[a, {2, 1}] which is not what I want. Suggestions? $\endgroup$ Jul 21, 2015 at 19:05
  • 1
    $\begingroup$ Yes there was a bug in 10.0 that prevented this from working. It is fixed in 10.1 and later versions. $\endgroup$
    – Stefan R
    Jul 21, 2015 at 19:48

Your Answer

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

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