Re: MetricCompute doesn't compute Christoffel symbols

1,872 views
Skip to first unread message

Jose

unread,
Mar 15, 2013, 1:04:22 AM3/15/13
to xAct Tensor Computer Algebra
Hi again,

Christoffel tensors in xAct depend on two connections. They are
connection-differences, if you want. If you are working with the Levi-
Civita connection CD of a metric g expressed in a chart S then the
Christoffel you want is Christoffel[CD, PDS], which xTensor will
construct as ChristoffelCDPDS. That's the Christoffel you want and no
other.

Every time a connection nabla is declared the Christoffel tensor
Christoffel[nabla, PD] is automatically defined, and called
Christoffelnabla. This is a trick to work in xTensor as if there was a
chart defined, even though there isn't yet. If you are going to work
in a xCoba chart I suggest you ignore the existence of PD and its
related objects.

Cheers,
Jose.

On Mar 14, 9:28 pm, Vladimir Lukovic <posta.za...@gmail.com> wrote:
> Hello,
>
> It's me again.
> I apologize my first message was so brief. I am having some problems with
> google groups, every time I write a message at least twice, because it
> keeps blocking...
> Not to bother you with that...
>
> I have one comment on my code above - I forgot to mention that I did also
> include
>
> ComponentValue[metric[-a, -b] // ToBasis[B] // ComponentArray,
> schwarzschild];
>
> before MetricCompute[].
>
> And I did notice that it created ChristoffelCDPDB and filled it with values
> I was expecting at ChristoffelCD. I also saw some other example in
> Intermediate concepts.nb by José M. Martín-García where ChristofelCD were
> computed!
>
> So, my question is maybe more clear now.
> Why in my case ChristoffelCD were not computed and how to set only one
> Christoffel tensor, instead of three?
>
> Best regards,
> Vladimir Luković

Jose

unread,
Mar 17, 2013, 8:20:14 PM3/17/13
to xAct Tensor Computer Algebra
Hi Vladimir,

> Thank you very much for your explanation. I very much like this google
> group. Your support is outstanding, especially considering that this is a
> free package.

Thanks!

> I am just learning to use xAct.  So, here is what made me confused
>
> DefMetric[-1,metric[-a,-b],CD]         defines abstract metric and cov
> derivative, and from these ChristoffelCD, RiemannCD, RicciCD and all other
> tensors.

Yes. That Christoffel is Christoffel[CD, PD]. Think of it as CD - PD.

> DefChart[B, M, {0, 1, 2, 3}, {t[], x[], y[], z[]}]        defines basis B
> and part. derivative PDB, and then from this derivative we get
> ChristoffelPDB, RiemannPDB and so on.

Yes. That other Christoffel is Christoffel[PDB, PD].

> Then just after calling MetricCompute another tensor is defined:
>
> MetricCompute[metric, B, All]          defines ChristoffelCDPDB and
> computes values for  this tensor

This Christoffel is Christoffel[CD, PDB] = Christoffel[CD, PD] -
Christoffel[PDB, PD]. That is the one for which we can compute
components.

> I do not understand the meaning of the last ChristoffelCDPDB, and it was
> the last place to expect to find values of Christoffel symbols for given
> metric and specified basis.

Christoffel[CD, PDB] is fully specified because you have given the
metric of CD in the basis B. However, PD is an abstract
**unspecified** ordinary derivative ("ordinary" is Wald's terminology,
meaning zero torsion and zero curvature), used only for abstract
computations. Hence we cannot assign explicit components for objects
depending on it. As I said, PD is just used to simulate the presence
of a chart in abstract computations.

> On the contrary, Riemann, Ricci, Weyl and all other tensor were stored in
> their respective TensorCD variables.

Exactly. Those are tensors depending only on **one** covariant
derivative, namely CD, which you have fully specified as being the
Levi-Civita connection of an explicit metric.

> There is another thing I would like to report. ChangeComponents creates
> very compact folded rules, but ToValues doesn't use them fully.
> For example
>
> RicciCD[a, b] // ToBasis[B]
> RicciCD[-a, -b] // ToBasis[B]
> ChangeComponents[%%, %]
>
> and then I have to call ToValues twice!!
>
> RicciCD[a, b] // ToBasis[B] // ComponentArray // ToValues // ToValues

Yes. I'm aware of this. I could define ToValues using FixedPoint, but
ToValues is a slow function, and FixedPoint would make it even slower.
I'm sorry but you have to use ToValues as many times as you need it.

> Because ToValues doesn't convert upper indexed metric symbols, such as
> SuperscriptBox["g", "00"]

The problem is the ToValues uses the values of the tensors which
appear explicitly in the expression. The first ToValues only sees
RicciCD, and hence doesn't know that it has to use values for the
metric as well, because the values of the upper RicciCD are converted
into values of the lower RicciCD and metric factors.

> I occurred to this when working with Tolman metric, which has non-zero
> Ricci tensor:
>
> << xAct`xCoba`;
> DefManifold[M, 4, IndexRange[a, l]];
> DefMetric[-1, metric[-a, -b], CD, PrintAs -> "g"];
> DefChart[B, M, {0, 1, 2, 3}, {t[], r[], \[Theta][], \[Phi][]}];
> TLB = DiagonalMatrix[{
>    Exp[n[r[], t[]]],
>    -Exp[l[r[], t[]]],
>    -R[r[], t[]]^2,
>    -R[r[], t[]]^2*Sin[\[Theta][]]^2
>    }];
> ComponentValue[
>  metric[-a, -b] // ToBasis[B] // ComponentArray,
>  TLB
>  ];
> MetricCompute[metric, B, All];
> RicciCD[a, b] // ToBasis[B]
> RicciCD[-a, -b] // ToBasis[B]
> ChangeComponents[%%, %]
> RicciCD[a, b] // ToBasis[B] // ComponentArray // ToValues // ToValues

Thanks for the example. Don't forget to declare the functions l, n, R
with DefScalarFunction. Note also that you are using l both as an
index and as a function. That's dangerous. If you declared l with
DefScalarFunction it would complain that it is already declared as an
index.

Cheers,
Jose.

Jose

unread,
Mar 17, 2013, 8:26:22 PM3/17/13
to xAct Tensor Computer Algebra
Hi again,

I think you can do the same with

DeleteCases[Last@TensorValues[EinsteinCD], _[_, 0]] // Column

The FoldedRule construction is there precisely to avoid having to use
ToCanonical again!

Cheers,
Jose.

On Mar 15, 1:22 pm, Vladimir Lukovic <posta.za...@gmail.com> wrote:
> Just to finish what I tried to say in my previous post...
>
> So, here is one easy way to show non-zero values of a tensor without
> duplicates:
>
> exp = Tensor[AIndeces] // ToBasis[chart] // ComponentArray //
> ComponentValue // Flatten;
> Cases[exp, x_ /;
>        \[Not] (x[[2]] === 0) \[And] x[[1]] === ToCanonical@x[[1]]
> ] // Column
>
> I use it quite often, so I made a function, but I think it would also be
> nice to have it implemented.
>
> Best wishes,
> Vladimir

Thomas Bäckdahl

unread,
Mar 18, 2013, 4:00:15 AM3/18/13
to xa...@googlegroups.com
Hi!

>> There is another thing I would like to report. ChangeComponents creates
>> very compact folded rules, but ToValues doesn't use them fully.
>> For example
>>
>> RicciCD[a, b] // ToBasis[B]
>> RicciCD[-a, -b] // ToBasis[B]
>> ChangeComponents[%%, %]
>>
>> and then I have to call ToValues twice!!
>>
>> RicciCD[a, b] // ToBasis[B] // ComponentArray // ToValues // ToValues
>
A way around this problem might be to use
$CCSimplify = Simplify@ToValues@# &;
before ChangeComponents.
This means that the ChangeComponents will call ToValues on the right
hand sides of the rules.
This might not be what you want, but in some cases I find it useful.

Regards
Thomas

Vladimir Lukovic

unread,
Feb 18, 2016, 9:20:09 AM2/18/16
to Thomas Bäckdahl, xa...@googlegroups.com
Hello again everybody,

May I ask you for a little help with derivatives in xTensor?

I am trying to use the partial derivative of a tensor expression that contains scalar products. A partial derivative PD[-a][V[-b]V[b]] should be zero, but it doesn't seem a simple task to implement. I am also having troubles with directional derivative of an expression where this vector appears, like PD[Dir[V[a]]][V[b]] should be Dirac delta (or the metric, if one index is lowered). How to properly do this?

And another thing - is there a way to say that the metric is constant, so that all the partial derivatives of the metric are zero?

Best wishes,
Vladimir
--
You received this message because you are subscribed to a topic in the Google Groups "xAct Tensor Computer Algebra" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/xact/4AUxvwbeJrM/unsubscribe?hl=en-US.
To unsubscribe from this group and all its topics, send an email to xact+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




--
If you wanna make the world a better place take a look at yourself and then make a change.
Reply all
Reply to author
Forward
0 new messages