Semyon,
You may want to take a closer look at the ctensor package, which has
specific functionality related to metrics that are provided in the form of
Taylor series. If you expand around a specific metric, as opposed to trying
to keep things general and expanding around an arbitrary metric, perhaps the
result becomes more manageable.
Actually, maxima doesn't even know that g is symmetric unless you tell it.
The itensor package is quite capable of dealing with nonsymmetric metrics
(see the Papapetrou example among the tensor demos.) But even if Maxima knew
that g was symmetric, it does not follow from it that g0, g1, g2, etc. are
symmetric. As a counterexample, consider arbitrary tensors g1, g2, and
g0[i,j] = S0[i,j] + (1/2)(h*g1[i,j] + h^2*g2[i,j] - h*g1[j,i] -
h^2*g2[j,i]),
where S0 is a symmetric tensor. In the general case, all three tensors g0,
g1, and g2 are nonsymmetric, but the sum, g = g0 + h*g1 + h^2*g2, will be
symmetric. So yes, you have to tell Maxima the symmetry properties of each
tensor in question.
In some cases (though not, unfortunately, in your case) it also helps to do
simplifications first before expanding. I.e., do a
decsym(g,2,0,[sym(all)],[]);
decsym(g,0,2,[],[sym(all)]);
then use expand, contract, rename, and canform to simplify your expressions
to the extent possible, and only then do a
components(g,...)
before you re-evaluate your expressions (e.g., ev(expr,g)), and try to
simplify them again.
It won't help this time though... the curvature tensor will remain nasty.
Viktor
-----Original Message-----
From: Semyon Glazyrin [mailto:siglazyrin at gmail.com]
Sent: Tuesday, May 05, 2009 2:53 PM
To: Viktor T. Toth
Cc: maxima at math.utexas.edu
Subject: Re: [Maxima] General Relativity calculations
Thanks a lot!
I thought that such expansion - with parameter t, can help in
postnewton calculations. I tried to
load(itensor);
components(g([i,j],[]),g0([i,j],[])+h*g1([i,j],[])+h^2*g2([i,j],[]));
components(g([],[i,j]),g0([],[i,j])+h*g1([],[i,j])+h^2*g2([],[i,j]));
imetric(g);
ishow(ichr2([i,j],[k]))$
ishow(coeff(expand(%),h,2))$
ishow(icurvature([i,j,k],[l]))$
%,ichr2$
%,g$
expr:coeff(expand(%),h,2);
decsym(g0,2,0,[sym(all)],[]);
decsym(g1,2,0,[sym(all)],[]);
decsym(g2,2,0,[sym(all)],[]);
decsym(g0,0,2,[],[sym(all)]);
decsym(g1,0,2,[],[sym(all)]);
decsym(g2,0,2,[],[sym(all)]);
canform(%o11);
nterms(%);
and 210 term is to much too.
And it's strange to me that maxima doesn't set automatically symmetric
properties for g0, g1, g2 - these are parts of metrics which is symmetric.
Semyon.
On Mon, May 04, 2009 at 10:49:05AM -0400, Viktor T. Toth wrote:
> Semyon,
>
> Several comments:
>
> 1. I recommend using imetric(g) instead of imetric:g; the former also sets
> up the contraction properties of the metric, whereas the latter only
assigns
> the metric tensor.
>
> 2. Before using coeff, you need to expand the expression in question. I
> don't think coeff can deal with unexpanded expressions.
>
> 3. Before attempting to expand an expression containing symbols like
ichr2,
> you need to evaluate those symbols as they also contain implicit
> dependencies on h. Afterwards, you need to evaluate g again.
>
> 4. Make sure you specify the components for both the covariant and
> contravariant forms of the metric tensor to ensure that g is expanded
> properly in all cases.
>
> In view of these three points, try:
>
> load(itensor);
> components(g([i,j],[]),g0([i,j],[])+h*g1([i,j],[])+h^2*g2([i,j],[]));
> components(g([],[i,j]),g0([],[i,j])+h*g1([],[i,j])+h^2*g2([],[i,j]));
> imetric(g);
> ishow(ichr2([i,j],[k]))$
> ishow(coeff(expand(%),h,2))$
> ishow(icurvature([i,j,k],[l]))$
> %,ichr2$
> %,g$
> coeff(expand(%),h,2)$
> nterms(%);
>
> Your final expression is not very manageable of course, with 216 terms.
> Still, perhaps this is what you were looking for. You might consider
> attempting to set up symmetry properties for g0, g1, g2 using decsym, and
> then simplifying with canform, but it seems it only eliminates a small
> number of terms.
>
>
> Viktor
>
>
> -----Original Message-----
> From: maxima-bounces at math.utexas.edu
[mailto:maxima-bounces at math.utexas.edu]
> On Behalf Of Semyon Glazyrin
> Sent: Monday, May 04, 2009 10:02 AM
> To: maxima at math.utexas.edu
> Subject: General Relativity calculations
>
> Hello!
>
> I'd like to do the following computations. There is a mertic, which
> has power series of h - constant scalar:
>
> g_{ik}=g0_{ik}+h*g1_{ik}+h^2*g2_{ik}
>
> and I want to calculate some expression by this metric, for example
> Riemann tensor and obtain expressions in front of h^n. But I fail in
> doing this even for Christoffel symbol
>
> Code:
>
> load(itensor)$
> components(g([i,j],[]),g0([i,j],[])+h*g1([i,j],[])+h^2*g2([i,j],[]))$
> imetric:g$
> ishow(ichr2([i,j],[k]));
> ishow(coeff(%,h,2));
> ishow(icurvature([i,j,k],[l]));
> ishow(coeff(%,h,2));
>
> answer for coeff in ichr2 is 0.
> What is the problem? I should use another function instead coeff?
> And why icurvature does not substitute Christoffel symbols?
>
> Semyon.
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>