Re: Working with arrays
- To: mathgroup at smc.vnet.net
- Subject: [mg131211] Re: Working with arrays
- From: Roland Franzius <roland.franzius at uos.de>
- Date: Mon, 17 Jun 2013 06:29:52 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-outx@smc.vnet.net
- Delivered-to: mathgroup-newsendx@smc.vnet.net
- References: <kpjvhm$9n8$1@smc.vnet.net>
Am 16.06.2013 11:12, schrieb amannucci:
> lA = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
> xtest = {4, 5, 6};
> lA\[CenterDot]xtest (* First case *)
> {{a, b}, {c, d}} . {x, y} (* Second case *)
>
> The output is:
>
> {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}\[CenterDot]{4, 5, 6}
>
> {a x + b y, c x + d y}
The Dot-multiplication operator is overloaded with conventional physical
applications.
In the mathematical sense you may declare matrix multiplication from the
left with row vectors
{1,2,3}.{{1,2,3},{4,5,6},{7,8,9}}
or multiplication from the right with column vectors
{{1,2,3},{4,5,6},{7,8,9}.{{1},{2},{3}}
But since the most common three bilinear procedures on higher
dimensional objects of maximal tensor rank 2:
1) scalar multiplication with implicitely assumed euclidean metrics,
2) applying forms on vectors and tensors of rank 2
3) matrix multiplication procedures
are obcsured in physics textbooks, completely, Mathematica, as a user
friendly package, deliberately is guessing if a given Dot product may
make any sense.
A hint to the background of this strange behavour is given in the "more
information" statement in the Help for Dot:
" When its arguments are not lists or sparse arrays, Dot remains
unevaluated"
Evaluate[lA].Evaluate[xtest]
is working as expected.
Take it as a hint that Dot is a generic name for a library of highly
specialized subfunctions, that will be called with the arguments by name
and not by value or on the stack.
It is the same reason why Plot or Integrate do not Evaluate the
functional arguments. If needed, the values explicitely have to be
handed over with an Evaluate beforehand in order to replace the name by
its value in an argument at a Hold position.
But this behaviour is not documented for Dot.
Attributes[Dot] ...
Perhaps this behaviour may force numerical linear programmers to use the
correct mathematical tensor categories even in case of simple numerics
with numerical arrays -- or perhaps they will use other packages not so
sophisticated.
--
Roland Franzius