Series expansion of Scalar Functions in xAct

155 views
Skip to first unread message

David Vázquez

unread,
Feb 15, 2022, 9:23:25 AM2/15/22
to xAct Tensor Computer Algebra
Hi, I wonder if it's possible to expand simbolically scalar functions in xAct. For example, if I have the scalar functions "logB" and "logG" of the attached file, is it possible to expand the functions in terms of a generically series expansion like:
logB(x^a)= Σ b_n y_n(x^a) , b_n -> constant
logG(x^a)= Σ g_n y_n(x^a) , g_n-> constant

Thanks a lot. 

David 
Captura de pantalla 2022-02-15 a las 12.23.22.png

Jose

unread,
Feb 16, 2022, 9:05:48 PM2/16/22
to xAct Tensor Computer Algebra
Hi,

xAct does not have special functionality for this type of expansion, but we could do the following, without entering the discussion of what the expansion (in particular the vector x[a]) means if your manifold is curved.

Define the manifold:

    << xAct`xTensor`
    $PrePrint = ScreenDollarIndices;
    DefManifold[M, 4, {a, b, c, d, e}]

Define the vector x and two scalar functions F and G:

    DefTensor[x[a], M]
    DefScalarFunction[{F, G}]

Now we define the coefficients f[...] and g[...] of the expansions:

    DefTensor[f[AnyIndices[TangentM]], {}]
    DefTensor[g[AnyIndices[TangentM]], {}]

where AnyIndices[...] indicates that these f, g can take any number of indices. Define the action of "partial derivative" PD:

    f /: PD[_][_f] := 0;
    g /: PD[_][_g] := 0;
    x /: PD[a_][x[b_]] := delta[a, b]

Finally construct this function to expand a scalar function up to some order:

    series[f_, x_, n_] := Sum[With[{inds = Table[DummyIn[TangentM], i]}, Times[f @@ Minus[inds], Times @@ Map[x, inds]]]/i!, {i, 0, n}]

Now you can do something like this:

    series[f, x, 3] series[g, x, 3] // Expand

    PD[-a][%] // Expand

Is this the type of expansion you want?

Cheers,
Jose.

David Vázquez

unread,
Feb 17, 2022, 12:07:46 PM2/17/22
to xAct Tensor Computer Algebra
Hi Jose, thanks a lot for your response but that's not exactly the type of expansion I want. It's more something like this ( attached ) . A bunch of functions that can be rewritten just in terms of a sum in an abstract index (A in the example) which runs until a symbolical value N: A=1,...,N. ? I wish to replace every term logB, logG and so on in terms of things like: 
logB= ∑_A b_A log H_A   

logG= ∑_A g_A log H_A   

logC= ∑_A c_A log H_A   

so when product of this terms appears they can replaced by things like, for example: 
(∂_a logB) (∂^a logB) = ∑_{A,B} b_A b_B ( ∂_a log H_A ) (∂^a log H_B)  
so the point is to keep this abstract index "A,B..."  tracking each coefficient with its respective H_A, H_B function etc.  So I don't want a expansion to a given order, it's more like a general series expansion with no finite order assigned but a symbolical expansion. 

Thanks again! 
David 

Captura de pantalla 2022-02-17 a las 17.49.34.png

Jose

unread,
Feb 17, 2022, 5:32:23 PM2/17/22
to xAct Tensor Computer Algebra
Hi,

The abstract indices of xTensor are vector indices, not general-purpose indices. If H[-A] is a vector then Log[H[-A]] is not a vector and hence makes no sense in xTensor as something to attach indices to. That's one of the reasons why xTensor supports other types of indices, like "label indices", which can be used for any purpose, but then there is no actual functionality that can be built in advance, nor there are summation conventions when they are repeated, etc.

I'm not sure I fully understand yet what is it that you want to do, but I don't think xTensor is prepared to help with that kind of more general computation.

Cheers,
Jose.

David Vázquez

unread,
Feb 18, 2022, 9:43:42 AM2/18/22
to xAct Tensor Computer Algebra
Hi Jose, H[-A] is not a vector, H_A it wold be simply a set of scalar functions. What I want i's just to expand a function, let's say  f(x), in modes like Fourier-Series: f(x)= ∑_n c_n e^{inx} . My case is simply that the functions are not "e^{inx}" but a bunch of functions "log(H_A)" .  So the problem is if I have terms like (∂logB)^3, I'd would want to replace logB by its series expansion to finally receive an output of the type  (∂logB)^3=  b_A b_B b_C (∂logH_A)(∂logH_B)(∂logH_C)  where the different modes corresponding to each term are labeled separately. 

Thanks again!!  

Jose

unread,
Feb 21, 2022, 5:33:49 PM2/21/22
to xAct Tensor Computer Algebra
Sorry David. I'm afraid I still do not get what you want to do here. I don't understand why you use sometimes logH and sometimes log(H), or why you keep using quotes around them. Anyway, I suspect you need a non-tensorial type of index, so xAct will not be of much help here. You need to use non-tensorial indices LI[..], probably in combination with WL's Sum if there is a need for scoping.

Cheers,
Jose.

Reply all
Reply to author
Forward
0 new messages