Tensors for dummies



> Would someone please explain the what is happening in following example?

Sure, I can give it a try.

> (%i13) showcomps(a([i])*b([i]));
>                                    [ a  b   a  b  ]
>                                    [  1  1   2  2 ]
> (%t13)                     a  b  = [              ]
>                             i  i   [ a  b   a  b  ]
>                                    [  1  1   2  2 ]
> (%o13)                               false

Well, you discovered that showcomps() doesn't deal very well with invalid
tensor expressions. In this case, you have the same index (i) appearing
twice as a covariant index, and that is invalid: an index should appear
either just once, or twice, once in a covariant and once in a contravariant
position, in order for the indexed expression to be valid. So let's try
this:

(%i5) showcomps(a([i])*b([],[i]))$
                                      i
(%t5)                                b  a
                                         i

May not be what you were hoping to see, but it is an algebraically correct
result. (The showcomps() function is a helper function that is really useful
when you actually assign the elements of a matrix to a tensor using the
components() function.)

> Also what does the "false" in the output mean?

The showcomps() function, just as the ishow() function, displays tensor
expressions in "pretty" form as an intermediate result. They're best used
with the dollar sign ($) as opposed to the semicolon (;) as the terminator
character. (The actual output of ishow() is its argument, while the output
of showcomps() is nil, i.e., logical false. This is what you see when you
terminate the showcomps() line with a semicolon.)


Viktor