Computing determinant in xCoba

797 views
Skip to first unread message

Leo Stein

unread,
Oct 20, 2010, 12:01:41 PM10/20/10
to xAct Tensor Computer Algebra
Hello xActers,
I attempted a calculation in xCoba involving the Levi-Civita tensor
("epsilon tensor"). Doing such a calculation involves the determinant
of the metric (in some basis), but I found that this quantity was not
automatically computed. To compute it, I had to do:
Determinant[metric[-{a,B},-{b,B}],B] // ToBasis[B] // TraceBasisDummy
// ToValues // Simplify
Or more quickly with Mathematica's Det function,
ComponentArray[metric[-{a,B}, -{b,B}]] // ToValues // Det // Simplify
Have I missed something in the documentation? It seems that this
quantity (DetmetricB[]) should be automatically computed in
MetricCompute and have a rule assigned.

What is the right way to do this?

Cheers
Leo

Alfonso Garcia-Parrado

unread,
Oct 21, 2010, 3:41:18 PM10/21/10
to Leo Stein, xAct Tensor Computer Algebra
Hi Leo,

As far as I know this is the only way to compute the explicit coordinate
value of the metric determinant in a basis. If you are doing
computations involving the "epsilon tensor", then you should have a look
at the command "epsilonToetaDown" (see section 4.3 of the file
xCobaDoc.nb in the documentation directory). This command computes the
explicit relation between the "epsilon tensor" and the tensor density
arising from the wedge product of all the elements of the co-basis. In
this relation the determinant of the metric in the basis enters
explicitly (but you have to compute the actual value of the determinant
separately).


Regards,

Alfonso.

Leo Stein

unread,
Oct 21, 2010, 4:18:16 PM10/21/10
to Alfonso Garcia-Parrado, xAct Tensor Computer Algebra
Alfonso,
Thanks for your response. I have read the section about epsilon and
determinants in the documentation. Indeed, the tools are there to
perform all the calculations.
I think that the calculations should be automated, so that one does
not have to run:

ComponentValue[DetmetricB[], ComponentArray[metric[-{a, B}, -{b, B}]]
// ToValues // Det // Simplify]

It would make sense to me to run:

MetricCompute[ metric, B, "DetmetricB"[] ]

Note: I also think that ToBasis[B][ Detmetric[] ] ought to return
DetmetricB[], whereas currently it returns Detmetric[].

Any suggestions?

Cheers,
Leo

JMM

unread,
Oct 21, 2010, 6:02:41 PM10/21/10
to xAct Tensor Computer Algebra
Hi,

> I think that the calculations should be automated, so that one does
> not have to run:
>
> ComponentValue[DetmetricB[], ComponentArray[metric[-{a, B}, -{b, B}]]
> // ToValues // Det // Simplify]
>
> It would make sense to me to run:
>
> MetricCompute[ metric, B, "DetmetricB"[] ]

Yes. This should be implemented. I would call it

MetricCompute[ metric, B, "DetMetric"[] ]

It would not be implemented as above, but in the internal form of
MetricCompute, which is faster.

> Note: I also think that ToBasis[B][ Detmetric[] ] ought to return
> DetmetricB[], whereas currently it returns Detmetric[].

Yes, you are right. This was also overlooked.

I put both things in the TODO list for the next version.

Thanks,
Jose.

>
> Any suggestions?
>
> Cheers,
> Leo
>
> On Thu, Oct 21, 2010 at 3:41 PM, Alfonso Garcia-Parrado
>

Jolyon Bloomfield

unread,
Oct 6, 2012, 7:36:57 PM10/6/12
to xa...@googlegroups.com
Hi folks,

Sorry for thread necromancy, but I just ran into this issue too. The metric determinant is computed using ComputeMetric[metric, B, all], but ToBasis[B] still doesn't take Detmetric -> DetmetricB.

Best,
Jolyon

Jose

unread,
Oct 6, 2012, 8:19:08 PM10/6/12
to xAct Tensor Computer Algebra
Thanks Jolyon!

I implemented the first of Leo's requests, about MetricCompute, but
overlooked again the second one.

This is the patch. Execute this after loading xCoba:

Begin["xAct`xCoba`Private`"];
DetToBasis[basis_][expr_] :=
DetToBasis[basis][expr, MetricsOfVBundle[VBundleOfBasis[basis]]];
DetToBasis[basis_][expr_, metrics_List] :=
Fold[
ReplaceAll[#1, Determinant[#2, AIndex][] -> Determinant[#2, basis]
[]] &,
expr,
metrics
];
Unprotect[ToBasis];
ToBasis[basis_][expr_, inds___] :=
DetToBasis[basis][
FreeToBasis[basis][
DummyToBasis[basis][
expr,
inds],
inds]
];
Protect[ToBasis];
End[];

Best,
Jose.
Reply all
Reply to author
Forward
0 new messages