0
|
2569 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
GROUPS:

# BUG (or misunderstanding): tensor simplification

Posted 10 years ago
 I'm using Mathematica 9, so tell me if this is fixed in 10. Steps to reproduce: Enter and Evaluate: Assuming[Element[M , Matrices[{2, 2}]] && Element[Z , Matrices[{2, 2}] ], Simplify[M == M Z]] False This returns "False". However, this is not correct. Consider: Assuming[Element[M , Matrices[{2, 2}]] && Element[Z , Matrices[{2, 2}] ], Simplify[M == M Z /. Z -> {{1, 1}, {1, 1}}]] True Obviously, {{1,1},{1,1}} is n element of the domain, which Mathematica knows: Element[{{1,1},{1,1}}, Matrices[{2,2}]
3 Replies
Sort By:
Posted 10 years ago
 Yes, I think we agree. Yes I hope it was obvious that I was saying it should return "M == M Z", rather than "False" Yes There are solutions where M is not all zeros and Z is not all ones. True - and that means, that the mentioned result is not almost always correct (as I said), because there is not a finite set of exceptions, but an infinite set of exceptions.
Posted 10 years ago
 First In:= $Version Out= "10.0 for Microsoft Windows (64-bit) (June 29, 2014)" In:= Assuming[Element[M, Matrices[{2, 2}]] && Element[Z, Matrices[{2, 2}]], Simplify[M == M Z]] Out= False With this elementwise multiplication has been ordered. The result is almost always correct, with the exception of Z = {{1,1},{1,1}} or M = {{0,0},{0,0}} - over the complex numbers (which is the default field in Mathematica), so, with other words, the result is itself false. If matrix multiplication is ordered, the outcome is In:= Assuming[Element[M, Matrices[{2, 2}]] && Element[Z, Matrices[{2, 2}]], Simplify[M == M . Z]] Out= M == M.Z In:= Assuming[Element[M, Matrices[{2, 2}]], Simplify[M == M . IdentityMatrix]] Out= M == M.{{1, 0}, {0, 1}} Here Mathematica in fact states I don't know, which is the usual outcome for unspecified symbols: In:= a == b + c Out= a == b + c In:= a == b + c /. {a -> 7, b -> -1, c -> 8} Out= True Equal[] returns True if lhs and rhs are identical. For M = M Z or M = M . Z this is unkown, because they do not evaluate to something. You mean a check if assuming Element[M, Matrices[{2, 2}]] && Element[Z, Matrices[{2, 2}]] is then Element[M Z, Matrices[{2,2}]] or Element[M . Z, Matrices[{2,2}]] true? You cannot test this with Equal[]. A way is In $Assumptions = {M \[Element] Matrices[{2, 2}], Z \[Element] Matrices[{2, 2}]}; Out= {M \[Element] Matrices[{2, 2}, Complexes, {}], Z \[Element] Matrices[{2, 2}, Complexes, {}]} In:= M Z // TensorDimensions During evaluation of In:= TensorDimensions::ttimes: Product of nonscalar expressions encountered in M Z. >> Out= TensorDimensions[M Z] In:= {{x1, x2}, {x3, x4}} {{y1, y2}, {y3, y4}} // TensorDimensions Out= {2, 2} In:= M. Z // TensorDimensions Out= {2, 2} In:= \$Assumptions = {A \[Element] Arrays[{2, d, 4}], B \[Element] Arrays[{d, d}]}; In:= TensorDimensions[A\[TensorProduct]B] Out= {2, d, 4, d, d} elementwise multiplication is not recognized assumptions-symbolically under Mathematica 10 ...
Posted 10 years ago
 Yes, I think we agree. I hope it was obvious that I was saying it should return "M == M Z", rather than "False"There are solutions where M is not all zeros and Z is not all ones. Consider: M = {{0,2},{0,3}} and Z = {{4,1},{5,1}}The fact that TensorDimensions[M Z] fails is probably a clue to where the problems lie.