[GiNaC-list] About 'incomprehensible' output (Was: extending the symbol)
varg at theor.jinr.ru
Tue Oct 7 14:37:10 CEST 2008
> Can you please attach a copy of your replies to my email address? I disable
> email delivery whenever I subscribe to forums as most of the times I post
Sure. Also you can set proper Reply-To: header so my email client software
will do this automatically.
> If vector and scalar products of vectors are not given their own identities
> but are implemented using the clifford algebra as in the post
> http://www.ginac.de/pipermail/ginac-list/2005-June/000671.html then the
> output no longer bears any resemblance to the original definition. For
> example the consider the following output
> There is no resemblance to the original definition
In general, the canonical form of GiNaC expressions is unpredictable, i.e.
it changes from run to run (no matter what is the type of the expression).
The following script demonstrates this:
for i in `seq 1 100`; do
echo "a = x; b = y; x - y;" | ginsh
done | sort -n | uniq
Depending on luck, canonical form of the same expression (x-y) might be
either 'x-y' or '-y+x' (of course it's the same during one run).
This is kind of design decision: we trade deterministic output for speed.
(Still nothing prevents interested parties from writing a custom printing
method which outputs terms in a more or less predictable manner).
> which could be printed nicely "A . (B x C)"
> To emphasize my point, I dont really care how the triple product is
> represented inside. But when things go wrong (due to bugs) I would like to
> easily debug the code. For example, if I was expecting A . (C x B), the
> second output will immediately point out that to me.
This problem can be solved with a custom printing method. But the real
question is: do you really need/want to represent tensor expressions in
a component form?
> On the other hand if scalar and vector products of vectors are given their
> own identities, then there is no need for clifford algebra any more to
> evaluate them.
You can write a new class from scratch if modifying clifford (or indexed)
is not an option.
All science is either physics or stamp collecting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 827 bytes
Desc: Digital signature
Url : http://www.cebix.net/pipermail/ginac-list/attachments/20081007/95fde903/attachment.sig
More information about the GiNaC-list