7.8. Replacing TensorValues in expressions

ToValues        Replace tensor values in a given expression

Replacing TensorValues in expressions

As we have seen, xCoba` does not provide an automatic tool for setting values (use Set or SetDelayed instead of rules), because this is potentially dangerous and removing the definitions would not be trivial. However, it is very simple to apply all the rules in TensorValues to a given expression

In[395]:=

? ToValues

In[396]:=

TensorValues[T, {{polar, polar}}]

Out[396]=

In[397]:=

$CVVerbose = False ;

In[398]:=

ChangeComponents[T[-{a, polar}, -{b, polar}], T[{a, polar}, {b, polar}]]

Computed T_ ( b)^a →g_ (bc)^   T_  ^(ac)  in 0.052983 Seconds

Computed T_ (ab)^  →g_ (ac)^   T_ ( b)^c  in 0.034351 Seconds

Out[398]=

In[399]:=

T[{a, polar}, {b, polar}] T[-{a, polar}, -{b, polar}]

Out[399]=

T_ (ab)^   T_  ^(ab)

In[400]:=

TraceBasisDummy[%]

Out[400]=

That expression has only the tensor T and so we get

In[401]:=

ToValues[%]

Out[401]=

Now the metric tensors are explicit and hence:

In[402]:=

ToValues[%]

Out[402]=

574


Created by Mathematica  (May 16, 2008) Valid XHTML 1.1!