lastgunslinger

25 Reputation

One Badge

0 years, 49 days

MaplePrimes Activity


These are replies submitted by lastgunslinger

Thank you very much for responding as well as for providing a suggestion, nonetheless, once I try typing in what was suggested I get a different error when attempting to define the f[mu,~nu] tensor as rhs(e[definition])^(-1), thus, I then decided to take it step by step and instead wrote only rhs(e[definition])^(-1), yet this seems to give me the reciprocal of the matrix that was used to define the e[~mu,nu] tensor. In reality what I am looking for, if we think of these simply as matrices is f[mu,~nu]=e^{-1}, where "e" would be the matrix used to define the tensor, i.e. the rhs of e[~mu,nu]. Thus, I tried using the calling sequence MatrixInverse(), using the with(LinearAlgebra) package. My attempt was as follows

MatrixInverse(rhs(e[definition]));

 

which then gave me an error saying that Length of the output exceeds limit of 1000000. Thus, I wanted to ask if you could perhaps be a bit more specific in your suggestion for taking the inverse if an arbitrary matrix and then substituting in the values. So should I create the matrix M as M:= Matrix(4,symbol)^(-1) then one by one input the values of the matrix used to define tensor e? But would this not just give me the reciprocal, when what I am looking for is the inverse matrix? Thank you once again  @ecterrab 

@ecterrab 

I apologize for not being specific when mentioning the "already computed" results. What I meant by that was results I had previously derived (which I had not shared with you, my mistake). The results which I refer to as "already computed" are actually the results which appear in the "old" Maple code. I apologzie for this as you had already mentioned that you do not work with "old" Maple any more, thus I'll try to write the given (computed) solutions that I am looking for and what I mean by antisymmetry, even though I am not completely certain that it does indeed display an anti-symmetry, rather it is due to inspection that it seems to display said properties. Thus, we have 

(2,1,2) = d/dt (a(t))/a(t)     and      (2,2,1) = - d/dt (a(t))/a(t)

(3,1,3) = d/dt (a(t))/a(t)     and       (3,3,1)= - d/dt (a(t))/a(t) 

(3,2,3) = sqrt(-kr^2 +1)/(a(t)r)      and     (3,3,2) = - sqrt(-kr^2 +1)/(a(t)r)

(4,1,4) = d/dt (a(t))/a(t)     and      (4,4,1) = - d/dt (a(t))/a(t)     

(4,2,4) = sqrt(-kr^2 +1)/(a(t)r)      and      (4,4,2) = - sqrt(-kr^2 +1)/(a(t)r)   

(4,3,4)= cos(theta)/(a(t) r sin(theta))      and     (4,4,3) = - cos(theta)/(a(t) r sin(theta)) 

 

Note that you can notice the anti-symmetry in the last two indices, at least it appear that way, as permutation of these two indices leads to correspoding results differing only in sign. These results, like I had previously mentioned, are the results that I had previously computed using the "old" Maple code and would like to recreate with the "new" Maple code. Yet, these last 12 elements correspond to the very last inner product that I am trying to compute. That is what I meant by the "antisymmetry" and the "already computed" results. Notice that in the "new" code the results do not coincide up to a change in sign and permutation of the first two indices, all I want to do is get equivalent results, even if they don't look exactly the same as the already computed results when considering the indices, so far as the "new" code gives the same functions everything will be great. Though you mention that the j tensor is not symmetric. But shouldn't it be? Thank you so much for your help thus far.

@ecterrab 

Just in case, I shall attach here the worksheet with the new Maple code. Within the worksheet are my concerns at the end of the worksheet, regarding the calcultation I require assistance with.

 

Download Maple_inner_tensor_product.mw

@ecterrab 

Thank you for your prompt response. I have actually included the "new" Maple code in a separate comment above. It retains the same name that you had previously named it as such. Within the worksheet, at the very bottom there is a couple of comments in which I have displayed my concerns. I believe the title of the comment is "I shall attach the new code here". Thank you

@ecterrab 

I shall attach here the "new" Maple code

Maple_inner_tensor_product.mw



 

@ecterrab 

Certainly, I shall attach to this comment my computations thus far. I apologize in advance the mess in the worksheet. 

 

I note that the problem will arises in the last part of the worksheet and will comment on the problem there. I shall also include the "old" Maple code I keep referring to. Please note that as long as all values coincide, not necessarily keeping the same indexing, i.e. all values which appear in the old code also appear in the "new" code, then that suffices. I note that in the old code there exists an antisymmetry in the last two indices, while in the "new" code the same antisymmetry holds but in the first two indices. Once again, I'd like to thank you for all your help thus far, you've honestly been a great help. Also, if there is any book or file that you may recommend which covers the stuff which I have bugged you with thus far that would be a great help. Again, thank you 
 

with(tensor): #import package in order to compute required symbols

coord:=[t,r,theta,phi]:

g_compts:= array(symmetric,sparse, 1..4,1..4):

g_compts[1,1]:=1:

g_compts[2,2]:=-(a(t)^2)/(1-k*r^2):

g_compts[3,3]:= -a(t)^2 *r^2:

g_compts[4,4]:= -a(t)^2*r^2*sin(theta)^2:

g :=create([-1,-1], eval(g_compts)):

ginv := invert(g, 'detg'):

e_compts:= array(symmetric, sparse,1..4,1..4):

e_compts[1,1]:= 1:

e_compts[2,2]:=a(t)/sqrt(1-k*r^2):

e_compts[3,3]:=a(t)*r:

e_compts[4,4]:=a(t)*r*sin(theta):

e:= create([-1,1],eval(e_compts)):

einv:= invert(e, 'dete'):

eta_compts:=array(symmetric, sparse, 1..4,1..4):

eta_compts[1,1]:=1:

eta_compts[2,2]:= -1:

eta_compts[3,3]:= -1:

eta_compts[4,4]:= -1:

eta:=create([-1,-1],eval(eta_compts)):

eval(einv);

table([compts = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = sqrt(-k*r^2+1)/a(t), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1/(a(t)*r), (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1/(a(t)*r*sin(theta))})), index_char = [1, -1]])

(1)

D1g:= d1metric(g, coord):

Cf1:= Christoffel1 (D1g):

`tensor/Christoffel2/simp`:= proc(x)
simplify(x, trig) end proc:

Cf2 := Christoffel2(ginv, Cf1):

 

D2g := d2metric(D1g, coord):

RMN := Riemann(ginv, D2g, Cf1):

RICCI := Ricci(ginv, RMN):

RS := Ricciscalar(ginv, RICCI);

table( [( compts ) = 6*(a(t)*(diff(diff(a(t), t), t))+(diff(a(t), t))^2+k)/a(t)^2, ( index_char ) = [] ] )

(2)

latex('RS'):

\mbox {\tt table}([{\it compts}=6\,{\frac {a \left( t \right) {\frac {

{\rm d}^{2}}{{\rm d}{t}^{2}}}a \left( t \right) + \left( {\frac
{\rm d}{{\rm d}t}}a \left( t \right)  \right) ^{2}+k}{ \left( a
 \left( t \right)  \right) ^{2}}},{\it index\_char}=[]])

 

 

Cf2local := prod(Cf2, e, [1,1]):

first := prod(Cf2local, einv, [1,1]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = ((diff(a(t), t))*r), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = ((diff(a(t), t))/a(t)), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (-k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (1/r), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = ((diff(a(t), t))/(-k*r^2+1)^(1/2)), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = ((diff(a(t), t))/a(t)), ( 4, 1, 4 ) = ((diff(a(t), t))*r*sin(theta)), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (-(diff(a(t), t))*(-k*r^2+1)^(1/2)/(k*r^2-1)), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = ((diff(a(t), t))*r*sin(theta)), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (-cos(theta)), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (sin(theta)*(-k*r^2+1)^(1/2)), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = ((diff(a(t), t))/a(t)), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (1/r), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = ((-k*r^2+1)^(1/2)), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = ((diff(a(t), t))*r), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = ((k*r^2-1)*sin(theta)/(-k*r^2+1)^(1/2)), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = ((k*r^2-1)/(-k*r^2+1)^(1/2)), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (cos(theta)/sin(theta)), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (cos(theta)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [-1, 1, -1] ] )

(3)

 

part_einv := partial_diff(einv, coord);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (-(diff(a(t), t))/(a(t)^2*r)), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (0), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (-k*r/(a(t)*(-k*r^2+1)^(1/2))), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (0), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (-(-k*r^2+1)^(1/2)*(diff(a(t), t))/a(t)^2), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (0), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (-(diff(a(t), t))/(a(t)^2*r*sin(theta))), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (-1/(a(t)*r^2*sin(theta))), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (0), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (0), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (-1/(a(t)*r^2)), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (0), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (-cos(theta)/(a(t)*r*sin(theta)^2)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [1, -1, -1] ] )

(4)

second := prod(e, part_einv, [1,1]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (-(diff(a(t), t))/a(t)), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (0), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (0), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (-(diff(a(t), t))/a(t)), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (0), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (-(diff(a(t), t))/a(t)), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (-1/r), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (0), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (0), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (-1/r), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (0), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (-cos(theta)/sin(theta)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [1, -1, -1] ] )

(5)

permutesecond := permute_indices(second, [3,1,2]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (0), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (-(diff(a(t), t))/a(t)), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (-1/r), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (0), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (-(diff(a(t), t))/a(t)), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (0), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (0), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (-(diff(a(t), t))/a(t)), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (-1/r), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (0), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (-cos(theta)/sin(theta)), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (0), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [-1, 1, -1] ] )

(6)

 

omega := lin_com(first, permutesecond):

omegalower := lower(eta, omega, 2):

simplomegalower := simplify(omegalower, 'symbolic'):

omegalocal := prod(einv, simplomegalower, [1,1]):

latex('omegalocal')

\mbox {\tt table}([{\it index\_char}=[-1,-1,-1],{\it compts}=\mbox {
\tt array}([{1,1,4}=0,{4,2,1}=0,{4,2,3}=0,{1,1,2}=0,{1,2,4}=0,{3,3,1}=
-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t \right) }{a \left( t

 \right) }},{1,2,3}=0,{2,2,3}=0,{1,1,3}=0,{3,4,2}=0,{3,4,1}=0,{1,3,1}=0
,{2,3,1}=0,{4,4,1}=-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t
 \right) }{a \left( t \right) }},{2,1,3}=0,{3,2,1}=0,{4,2,2}=0,{2,1,1}
=0,{4,3,3}=0,{2,3,4}=0,{3,3,2}=-{\frac {\sqrt {-k{r}^{2}+1}}{a \left(
t \right) r}},{2,2,1}=-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t
 \right) }{a \left( t \right) }},{2,4,2}=0,{3,3,3}=0,{4,4,3}=-{\frac {
\cos \left( \theta \right) }{a \left( t \right) r\sin \left( \theta
 \right) }},{1,4,2}=0,{2,1,4}=0,{3,4,4}=0,{3,2,2}=0,{3,3,4}=0,{4,1,2}=0
,{1,3,4}=0,{3,2,4}=0,{4,1,4}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }},{4,3,2}=0,{4,3,4}={\frac {
\cos \left( \theta \right) }{a \left( t \right) r\sin \left( \theta
 \right) }},{1,4,3}=0,{2,3,2}=0,{2,2,2}=0,{1,3,3}=0,{1,4,4}=0,{2,3,3}=0
,{3,1,4}=0,{4,1,1}=0,{2,4,1}=0,{4,4,2}=-{\frac {\sqrt {-k{r}^{2}+1}}{a
 \left( t \right) r}},{3,1,2}=0,{3,2,3}={\frac {\sqrt {-k{r}^{2}+1}}{a
 \left( t \right) r}},{1,4,1}=0,{4,1,3}=0,{4,3,1}=0,{2,2,4}=0,{3,1,1}=0
,{1,2,1}=0,{4,2,4}={\frac {\sqrt {-k{r}^{2}+1}}{a \left( t \right) r}}
,{1,1,1}=0,{2,4,3}=0,{2,1,2}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }},{3,4,3}=0,{1,3,2}=0,{1,2,2}=0
,{2,4,4}=0,{4,4,4}=0,{3,1,3}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }}])])

 

 


 

Download Maple_old_code.mw
 

with(tensor): #import package in order to compute required symbols

coord:=[t,r,theta,phi]:

g_compts:= array(symmetric,sparse, 1..4,1..4):

g_compts[1,1]:=1:

g_compts[2,2]:=-(a(t)^2)/(1-k*r^2):

g_compts[3,3]:= -a(t)^2 *r^2:

g_compts[4,4]:= -a(t)^2*r^2*sin(theta)^2:

g :=create([-1,-1], eval(g_compts)):

ginv := invert(g, 'detg'):

e_compts:= array(symmetric, sparse,1..4,1..4):

e_compts[1,1]:= 1:

e_compts[2,2]:=a(t)/sqrt(1-k*r^2):

e_compts[3,3]:=a(t)*r:

e_compts[4,4]:=a(t)*r*sin(theta):

e:= create([-1,1],eval(e_compts)):

einv:= invert(e, 'dete'):

eta_compts:=array(symmetric, sparse, 1..4,1..4):

eta_compts[1,1]:=1:

eta_compts[2,2]:= -1:

eta_compts[3,3]:= -1:

eta_compts[4,4]:= -1:

eta:=create([-1,-1],eval(eta_compts)):

eval(einv);

table([compts = (Matrix(4, 4, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = sqrt(-k*r^2+1)/a(t), (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1/(a(t)*r), (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1/(a(t)*r*sin(theta))})), index_char = [1, -1]])

(1)

D1g:= d1metric(g, coord):

Cf1:= Christoffel1 (D1g):

`tensor/Christoffel2/simp`:= proc(x)
simplify(x, trig) end proc:

Cf2 := Christoffel2(ginv, Cf1):

 

D2g := d2metric(D1g, coord):

RMN := Riemann(ginv, D2g, Cf1):

RICCI := Ricci(ginv, RMN):

RS := Ricciscalar(ginv, RICCI);

table( [( compts ) = 6*(a(t)*(diff(diff(a(t), t), t))+(diff(a(t), t))^2+k)/a(t)^2, ( index_char ) = [] ] )

(2)

latex('RS'):

\mbox {\tt table}([{\it compts}=6\,{\frac {a \left( t \right) {\frac {

{\rm d}^{2}}{{\rm d}{t}^{2}}}a \left( t \right) + \left( {\frac
{\rm d}{{\rm d}t}}a \left( t \right)  \right) ^{2}+k}{ \left( a
 \left( t \right)  \right) ^{2}}},{\it index\_char}=[]])

 

 

Cf2local := prod(Cf2, e, [1,1]):

first := prod(Cf2local, einv, [1,1]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = ((diff(a(t), t))*r), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = ((diff(a(t), t))/a(t)), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (-k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (1/r), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = ((diff(a(t), t))/(-k*r^2+1)^(1/2)), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = ((diff(a(t), t))/a(t)), ( 4, 1, 4 ) = ((diff(a(t), t))*r*sin(theta)), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (-(diff(a(t), t))*(-k*r^2+1)^(1/2)/(k*r^2-1)), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = ((diff(a(t), t))*r*sin(theta)), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (-cos(theta)), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (sin(theta)*(-k*r^2+1)^(1/2)), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = ((diff(a(t), t))/a(t)), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (1/r), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = ((-k*r^2+1)^(1/2)), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = ((diff(a(t), t))*r), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = ((k*r^2-1)*sin(theta)/(-k*r^2+1)^(1/2)), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = ((k*r^2-1)/(-k*r^2+1)^(1/2)), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (cos(theta)/sin(theta)), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (cos(theta)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [-1, 1, -1] ] )

(3)

 

part_einv := partial_diff(einv, coord);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (-(diff(a(t), t))/(a(t)^2*r)), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (0), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (-k*r/(a(t)*(-k*r^2+1)^(1/2))), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (0), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (-(-k*r^2+1)^(1/2)*(diff(a(t), t))/a(t)^2), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (0), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (-(diff(a(t), t))/(a(t)^2*r*sin(theta))), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (-1/(a(t)*r^2*sin(theta))), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (0), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (0), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (-1/(a(t)*r^2)), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (0), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (-cos(theta)/(a(t)*r*sin(theta)^2)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [1, -1, -1] ] )

(4)

second := prod(e, part_einv, [1,1]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (-(diff(a(t), t))/a(t)), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (0), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (0), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (-(diff(a(t), t))/a(t)), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (0), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (-(diff(a(t), t))/a(t)), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (-1/r), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (0), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (0), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (-1/r), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (0), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (-cos(theta)/sin(theta)), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [1, -1, -1] ] )

(5)

permutesecond := permute_indices(second, [3,1,2]);

table( [( compts ) = array( 1 .. 4, 1 .. 4, 1 .. 4, [( 1, 4, 1 ) = (0), ( 3, 3, 1 ) = (0), ( 3, 1, 2 ) = (0), ( 1, 2, 2 ) = (-(diff(a(t), t))/a(t)), ( 2, 2, 4 ) = (0), ( 2, 4, 2 ) = (0), ( 1, 3, 4 ) = (0), ( 3, 2, 2 ) = (0), ( 2, 2, 2 ) = (k*r/(k*r^2-1)), ( 3, 4, 2 ) = (0), ( 3, 2, 1 ) = (0), ( 1, 1, 2 ) = (0), ( 1, 4, 3 ) = (0), ( 2, 4, 4 ) = (-1/r), ( 3, 2, 4 ) = (0), ( 2, 3, 1 ) = (0), ( 2, 2, 1 ) = (0), ( 1, 2, 4 ) = (0), ( 1, 4, 4 ) = (-(diff(a(t), t))/a(t)), ( 4, 1, 4 ) = (0), ( 3, 4, 3 ) = (0), ( 1, 4, 2 ) = (0), ( 2, 1, 2 ) = (0), ( 1, 1, 3 ) = (0), ( 1, 2, 3 ) = (0), ( 1, 1, 4 ) = (0), ( 4, 1, 3 ) = (0), ( 4, 4, 1 ) = (0), ( 4, 2, 1 ) = (0), ( 4, 3, 4 ) = (0), ( 1, 2, 1 ) = (0), ( 4, 3, 3 ) = (0), ( 4, 4, 2 ) = (0), ( 3, 4, 1 ) = (0), ( 1, 3, 3 ) = (-(diff(a(t), t))/a(t)), ( 3, 1, 4 ) = (0), ( 2, 3, 3 ) = (-1/r), ( 2, 4, 3 ) = (0), ( 2, 2, 3 ) = (0), ( 3, 3, 2 ) = (0), ( 2, 1, 4 ) = (0), ( 4, 3, 2 ) = (0), ( 3, 1, 3 ) = (0), ( 1, 3, 1 ) = (0), ( 4, 3, 1 ) = (0), ( 3, 3, 3 ) = (0), ( 2, 1, 3 ) = (0), ( 4, 2, 2 ) = (0), ( 2, 3, 2 ) = (0), ( 4, 2, 4 ) = (0), ( 2, 3, 4 ) = (0), ( 3, 2, 3 ) = (0), ( 4, 2, 3 ) = (0), ( 4, 4, 4 ) = (0), ( 3, 4, 4 ) = (-cos(theta)/sin(theta)), ( 4, 1, 1 ) = (0), ( 2, 1, 1 ) = (0), ( 4, 4, 3 ) = (0), ( 3, 1, 1 ) = (0), ( 1, 3, 2 ) = (0), ( 3, 3, 4 ) = (0), ( 2, 4, 1 ) = (0), ( 1, 1, 1 ) = (0), ( 4, 1, 2 ) = (0)  ] ), ( index_char ) = [-1, 1, -1] ] )

(6)

 

omega := lin_com(first, permutesecond):

omegalower := lower(eta, omega, 2):

simplomegalower := simplify(omegalower, 'symbolic'):

omegalocal := prod(einv, simplomegalower, [1,1]):

latex('omegalocal')

\mbox {\tt table}([{\it index\_char}=[-1,-1,-1],{\it compts}=\mbox {
\tt array}([{1,1,4}=0,{4,2,1}=0,{4,2,3}=0,{1,1,2}=0,{1,2,4}=0,{3,3,1}=
-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t \right) }{a \left( t

 \right) }},{1,2,3}=0,{2,2,3}=0,{1,1,3}=0,{3,4,2}=0,{3,4,1}=0,{1,3,1}=0
,{2,3,1}=0,{4,4,1}=-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t
 \right) }{a \left( t \right) }},{2,1,3}=0,{3,2,1}=0,{4,2,2}=0,{2,1,1}
=0,{4,3,3}=0,{2,3,4}=0,{3,3,2}=-{\frac {\sqrt {-k{r}^{2}+1}}{a \left(
t \right) r}},{2,2,1}=-{\frac {{\frac {\rm d}{{\rm d}t}}a \left( t
 \right) }{a \left( t \right) }},{2,4,2}=0,{3,3,3}=0,{4,4,3}=-{\frac {
\cos \left( \theta \right) }{a \left( t \right) r\sin \left( \theta
 \right) }},{1,4,2}=0,{2,1,4}=0,{3,4,4}=0,{3,2,2}=0,{3,3,4}=0,{4,1,2}=0
,{1,3,4}=0,{3,2,4}=0,{4,1,4}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }},{4,3,2}=0,{4,3,4}={\frac {
\cos \left( \theta \right) }{a \left( t \right) r\sin \left( \theta
 \right) }},{1,4,3}=0,{2,3,2}=0,{2,2,2}=0,{1,3,3}=0,{1,4,4}=0,{2,3,3}=0
,{3,1,4}=0,{4,1,1}=0,{2,4,1}=0,{4,4,2}=-{\frac {\sqrt {-k{r}^{2}+1}}{a
 \left( t \right) r}},{3,1,2}=0,{3,2,3}={\frac {\sqrt {-k{r}^{2}+1}}{a
 \left( t \right) r}},{1,4,1}=0,{4,1,3}=0,{4,3,1}=0,{2,2,4}=0,{3,1,1}=0
,{1,2,1}=0,{4,2,4}={\frac {\sqrt {-k{r}^{2}+1}}{a \left( t \right) r}}
,{1,1,1}=0,{2,4,3}=0,{2,1,2}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }},{3,4,3}=0,{1,3,2}=0,{1,2,2}=0
,{2,4,4}=0,{4,4,4}=0,{3,1,3}={\frac {{\frac {\rm d}{{\rm d}t}}a
 \left( t \right) }{a \left( t \right) }}])])

 

 


 

Download Maple_old_code.mw

 

 

@ecterrab 

Thank you so very much this was a great help, I found that the frst suggestion didn't work well, but thankfully the second and third worked swell. Since you've helped me this far I was wondering if perhaps you may be able to assist me for what will truly be the last time concerning this manner. Like I had previously mentioned above, I wanted to take a linear combination of two tensors that I had previously defined, which I did and everything worked amazingly. Nonetheless, I wanted to take one last inner product with a new tensor I had developed. So this is my build up to that inner product. After defining j and k as tensors I went ahead and permuted the indices of k as follows, 

Define(k[sigma, ~mu, nu] = TensorArray(k[~mu, nu, sigma])) 

After which, using the previously defined j, I took the linear combination and defined a new tensor. 

k[sigma, ~mu, nu] + j[sigma, ~mu, nu];      (30)
l[sigma, ~mu, nu] = ((30));      (31)
Define(31); 

I then define the Minkowskian metric with signature `---+`, i.e. 

n[mu, nu] = Matrix(4, {(1, 1) = -1, (2, 2) = -1, (3, 3) = -1, (4, 4) = 1}, fill = 0);    (37)
Define(37);

I then proceed to lower the second index of 

l[sigma, ~mu, nu]

and define it as a new tensor 

(n[mu, beta]) . (l[sigma, ~mu, nu]);    (39)
h[sigma, beta, nu] = (39);     (40)
Define((40))

which is swell. The resulting tensor has an antisymmetry in the first two indices and is beautiful, agrees with calculations. The problem arises when I attempt to take a final inner product with the previously defined mixed tensor f, such that 

(f[~mu, nu]) . (h[mu, beta, alpha]);               (43)
w[nu, beta, alpha] = (43);              (44)
Define(44);

From here I find that I no longer have an antisymmetry in the first two indices, since if I were to choose, for example, the elements w(1,2,2) and w(2,1,2), I have two disinct answers 

w(1,2,2) = (-kr^2+1)/(a(t))   and w(2,1,2) = -sqrt(-kr^2+1)/(a(t)*r)

as you can see these two values differ greatly. Another specific example I would like to point to is the following calculation for w(2,3,3) and w(3,2,3), namely,

w(2,3,3) = cos(theta)/(a(t)*r)  and w(3,2,3)= -cos(theta)/(a(t)*r*sin(theta))

notice that here the antisymmetry returns but I am missing a sin(theta) value in the first term. I believe that the error was coming from the f[~mu,nu] tensor since I hadn't defined it as symmetric so I simply added that part, such that 

f[~mu, nu] = Matrix(4, {(1, 1) = sqrt(1 - k*r^2)*1/a(t), (2, 2) = 1/a(t)*1/r, (3, 3) = 1/a(t)*1/r*1/sin(theta), (4, 4) = 1}, fill = 0, shape = symmetric)

But my problem remains. Did I define the inner prodcut incorrectly or did I lower the indices incorrectly, as in did I need to use a calling sequence, since previously you had to use the "lower" calling sequence? I should probably mention that inner product was done for the first two indices, as in "old" Maple it reads 

omega := lin_com(first, permutesecond);
omegalower := lower(eta, omega, 2):
simplomegalower := simplify(omegalower, 'symbolic');
omegalocal := prod(einv, simplomegalower, [1,1]);

where "first" and "permutesecond" are the j and permuted k mixed tensors, respectively. Thank you

@ecterrab 

Thank you so much for your response. Thanks to this I was able to continue my calculations. Nonetheless, I was wondering if perhaps you could shed some light in one more question that I have. After calculating the inner product above, I went ahead and defined the answer as a new tensor, rather a mixed tensor of the form 

j[sigma, ~mu, nu] = ((10))

After which I was able to furhter my calculations and performed a second inner product, whose result I defined as a new tensor of the form 

(e[mu, ~alpha]) . (d_[rho](f[~mu, beta], [X])) :  (18)
TensorArray((18));     (19)
k[~mu, nu, sigma] = ((19));        (20)
Define((20));
j[sigma, ~mu, nu] = ((10));      (22)  
Define ((22));

I would like to take the linear combination of these two tensors, nonetheless, they have disintinct indices. Hence, I need to permute the indices of k[], such that it reads 

k[sigma, ~mu, nu]

Which I know using the "old" Maple (i.e. without the Physics package) I would use the calling sequence

permute_indices(k, [3,1,2])

since, I want sigma to move to the first index, mu to the second, and nu to the third. How would I go about accomplishing this in the Physics package. Thank you again 

Page 1 of 1