Also available:

## calculating a tensorial term ...

Hi guys ,

i computed a tensorial term with respect to a metric and i think i made mistake !! what do you think ?

problem.mw

Best Regards

## Metric and Kronecker delta...

This might be considered nit-picking, but nonetheless I think there is an issue: The metric tensor and its inverse are types (0,2) and (2,0) tensors, respectively. When once contracted with each other, the result is the Kronecker delta, which is then (necessarily) a tensor of type (1,1). I am therefore surprised to find that in Maple, this Kronecker delta is implemented as a type (0,2) tensor, via the command KroneckerDelta:

KroneckerDelta[mu,nu];

I don't think this makes any proper sense. I think that such an object of type (0,2) is, in fact, the metric itself. On a similar note, the (mixed tensor type) objects g_[mu,~nu] and g_[~mu,nu] are actually both Kronecker deltas, because they correspond to the metric having one index raised by contraction with the inverse metric itself. But, nonetheless, the following is the case:

g_[ mu,~nu],
g_[~mu, nu];

Relatedly, consider the following single contraction of the metric with its own inverse:

SumOverRepeatedIndices(g_[mu,nu]*g_[~nu,~sigma]);

Although this sum is formally quite correct, I think it should be given as just a Kronecker delta (of the correct mixed tensor type, that is).

## indices mistake Chiristoffel symbol...

A lot of efforts I performed to obtained the right results, somehow I remain sucessful but the results are not exactly same as expected. I request you to kindly see at the christoffel symbol. I also sent the right results.

some_mistakes_in_christoffel.mw

you can see the right results in the given below attachment

right_christoffel_symbols.pdf

as you can comprare the results of both file. the obtain crystoffel are not same as the requied.

## how to compute Ricci tensor of a metric involving ...

How can we find ricci tensor of a metric attaced in given file that involve two unknown functions phi(r) and nu(r).metric.mw

## complex tensor expression with Pauli matrices...

I attempt to understand is it possible whether to calculate the next expression by means of mathematica:

where

{,}- anti-communicator;

a=0,1,2,3;

\tau^{0}-unity matrix; \tau^{i} - Pauli matrix;

and:

finally - Levi-Civita symbol; -Hermitian conjugation.

Thank you for your kind replies .

## transfer between maple and grtensor...

Dear All

I calculate something with gr tensor, for example Ricciscalar. How can I save it in maple memory? As you know, in this situation you can not use your calculation directly and it seems that it saved in grtensor memory not maple memory. For example, if you want to plot Ricciscalar, you should save it as a new definition in maple and then plot it.

Thank you.

## bizarre bug in Physics tensor manipulation...

Here's a short tensor manipulation which goes totally bananas. Basically I have a metric, and I define a vector k, and right at the end I calcualte the covariant derivative of it. In the metric and elsewhere I have a constant epsilon, a function of time a(t), and 2 functions of all coords, Phi and psi. Then at the end it gives the covariant derivative of k, but now with epsilon and a as functions of all coordinates.

Any idea what's going on??

code:

restart;
with(Physics);with(PDEtools):
Setup(coordinatesystems=spherical);

ds2:=expand(a(t)^2*(-(1+2*epsilon*Phi(r,theta,phi,t))*dt^2+(1-2*epsilon*psi(r,theta,phi,t))*(dr^2+r^2*dtheta^2+r^2*sin(theta)^2*dphi^2)));
declare(%,(H)(t),(k0,k1,k2,k3)(X));
Setup(metric = ds2);

Define(k[~mu]=[-1/a(t)^2+epsilon*k1(X),epsilon*k2(X),epsilon*k3(X),1/a(t)^2+epsilon*k0(X)]);

Define(NullGDE[nu]=(k[~mu](X)*D_[mu](k[nu](X))),OpticalDeformationMatrix[mu,nu]=(D_[mu](k[nu](X))));

(OpticalDeformationMatrix[1,1,nonzero]);

the final output is Matrix(1, 1, [[(-(2*((diff(epsilon(X), r))*(psi(X))(X))+2*epsilon(X)*(diff((psi(X))(X), r)))*(epsilon(X)*(k1(X))(X)*((a(t))(X)^2)-1)*a(t)-(2*epsilon(X)*(psi(X))(X)-1)*((diff(epsilon(X), r))*(k1(X))(X)*((a(t))(X)^2)+epsilon(X)*((diff((k1(X))(X), r))*((a(t))(X)^2))+2*epsilon(X)*(k1(X))(X)*(a(t))(X)*(diff((a(t))(X), r)))*a(t)+epsilon*psi[r]*(epsilon*k1(X)*(a(t)^2)-1)*a(t)-epsilon^2*psi[theta]*(a(t)^3)*k2(X)-epsilon^2*psi[phi]*(a(t)^3)*k3(X)-(2*(diff(a(t), t))*psi(X)*epsilon+psi[t]*a(t)*epsilon-(diff(a(t), t)))*(epsilon*k0(X)*(a(t)^2)+1))*(1/a(t))]])

where epsilon is now a function!

## Levi-Civita symbol and inverse of matrix...

Hi

We know determinant of a square matrix A[ij] (i,j ∈ {1,2,3}) is equal to the following expression

det(A) = 1/6 * e[ijk] * e[pqr] * A[ip] * A[jq] * A[kr]

in which e[ijk] is a third order Tensor (Permutation notation or Levi-Civita symbol) and has a simple form as follows:

e[mnr] = 1/2 * (m-n) * (n-r) * (r-m).

The (i,j) minor of A, denoted Mij, is the determinant of the (n − 1)×(n − 1) matrix that results from deleting row i and column j of A. The cofactor matrix of A is the n×n matrix C whose (i, j) entry is the (i, j) cofactor of A,

C[ij]= -1 i+j * M[ij]

A-1=CT/det(A)

The general form of Levi-Civita symbol is as bellow:

I want to write a program for finding inverse of (NxN) matrix:

N=2 →

restart;
N := 2:
with(LinearAlgebra):
f := (1/2)*(sum(sum(sum(sum((m-n)*(p-q)*A[m, p]*A[n, q], q = 1 .. 2), p = 1 .. 2), n = 1 .. 2), m = 1 .. 2)):
A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((37*i^2+j^3)/(2*i+4*j)) end proc):
f/Determinant(A);

N=3 →

restart;
N := 3:
with(LinearAlgebra):
f := (1/24)*(sum(sum(sum(sum(sum(sum((m-n)*(n-r)*(r-m)*(p-q)*(q-z)*(z-p)*A[m, p]*A[n, q]*A[r, z], m = 1 .. N), n = 1 .. N), r = 1 .. N), p = 1 .. N), q = 1 .. N), z = 1 .. N)):
A := Matrix(N, N, proc (i, j) options operator, arrow; 10*i^2/(20*i+j) end proc):
f/Determinant(A);

The results of above programs are equal to 1 and validation of method is observed.

If we can write the general form of determinant then we can find the inverse of any square non-singular matrices.

Now I try to write the mentioned program.

restart;
with(linalg):
N := 7:
Digits := 40:
e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N):
ML := product(A[a[k], b[k]], k = 1 .. N):
s[0] := e*subs($(a[q] = b[q], q = 1 .. N), e)*ML: for i to N do s[i] := sum(sum(s[i-1], a[i] = 1 .. N), b[i] = 1 .. N) end do: A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((3*i+j)/(i+2*j)) end proc): # arbitrary matrix CN:=simplify(s[N]/det(A)); Therefore det(A)= CN-1 * e[a1,a2,..an] * e [b1,b2,.., bn] * A[a1,b1] * A[a2,b2] * ... * A[an,bn]. The correction coefficient is CN(for N)/CN(for N-1) = N!/(N-1)! =N. restart: with(linalg): N := 4: Digits := 20: e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N): ML := product(A[a[k], b[k]], k = 1 .. N): s[0] := e*subs($(a[q] = b[q], q = 1 .. N), e)*ML:
for r to N do s[r] := sum(sum(s[r-1], a[r] = 1 .. N), b[r] = 1 .. N) end do:
A := Matrix(N, N, proc (i, j) options operator, arrow; evalf((3*i+2*j)/(i+2*j)) end proc):
DET:=S[N]:
for x to N do for y to N do
e := product(product(signum(a[j]-a[i]), j = i+1 .. N-1), i = 1 .. N-1):
ML := product(AA[a[k], b[k]], k = 1 .. N-1):
S[0, x, y] := e*subs($(a[q] = b[q], q = 1 .. N-1), e)*ML: for r to N-1 do S[r, x, y] := sum(sum(S[r-1, x, y], a[r] = 1 .. N-1), b[r] = 1 .. N-1) end do: f[y, x] := (-1)^(x+y)*subs(seq(seq(AA[t, u] = delrows(delcols(A, y .. y), x .. x)[t, u], t = 1 .. N-1), u = 1 .. N-1), S[N-1, x, y]) end do: end do: Matrix(N, N, f)/(DET)*(24/6); A^(-1); CN for N=4 and N=3 is 24 and 6 respectively i.e. CN(4)/CN(3)=24/6. When I use bellow procedure the error "(in S) bad index into Matrix" is occurred. Please help me to write this algorithm by using procedure. Thank you restart; with(linalg): Digits := 40: n := 7: S := proc (N) local e, ML, s, i: e := product(product(signum(a[j]-a[i]), j = i+1 .. N), i = 1 .. N): ML := product(A[a[k], b[k]], k = 1 .. N): s[0] := e*subs($(a[q] = b[q], q = 1 .. N), e)*ML:
for i to N do s[i] := sum(sum(s[i-1], a[i] = 1 .. N), b[i] = 1 .. N) end do
end proc:
A := Matrix(n, n, proc (i, j) options operator, arrow; evalf((3*i+j)/(i+2*j)) end proc): # arbitrary matrix
CN := simplify(S(n)/det(A))

## Creating of symmetric n-rank tensor ...

I need to create n-order tensor filled with any symbolic variable, for exemple 'x', but "symbol" option works only on vectors and matrix, so i don't know how to do that on n-order array.

X := Vector(3, symbol = x);#------ Work
Matrix(3, 3, symbol = x);#------ Work

Array(1 .. 3, 1 .. 3, 1 .. 3, symbol = x);
Error, argument symbol = x is incorrect or out of order

And 2nd problem thet globaly i need to create symmetric n-order tensor with symmitry for any pair of index and with contraction for any couple of indexes equal to zero. As i understend i need to create a big list of equations for every individual pair of index and 2 conditions (contraction and symmitry) and solve it to get a match and combination of independent index and paste values in them?

## Energy momentum tensor from metric ...

greatings all,

I want to calculate energy momentum tensor for a given metric. is it possible to calculate it in the physics package?
thanks.

## Problem with tensor in Maple V R5...

hello dear,

was working with tensor package using debever formalism in maple v release 5 and got this problem,
Error, (in factor) expecting a polynomial over an algebraic number field. would u tell me how to deal with this error in maple v release 5. aprl12.mws
thanks,
suresh

I need to calculate Weyl scalar for a metric using null tetrad using debever package in maple 13. However, I am stuck at the defination of h (representing the covariant complex null tetrad). Is it the product of covariant null tetrad? I have worked it out by using covariant, contravariant and both covariant and contravariant null tetrad (like l_a*l_a, l^a*l^a, l_a*l^a), however, i am not getting the right result not even for the example given in the maple help for plane wave. please help me out that how should i define this h.

thanks,
suresh

## How to realize this model?...

Hi,

what i have to calculate in Maple for q=Mises-Stress and the third invariant of deviatoric stress as r???

It is for:

http://www.egr.msu.edu/software/abaqus/Documentation/docs/v6.7/books/stm/default.htm?startat=ch04s04ath116.html

I am trying to use the Define() funtion for the tetrad form of the Ricci Tensor. I use the Setup() function to define the tetradmetric and the tetrad labels. However, the function continues do some strange things with the d_ . It should be just a simple sum over the repeated indices, but I am getting imaginary terms.

 (1)

 (2)

 (3)

 (4)

## For-loop seems to affect the Defined tensor expres...

 (1)

 (2)

 (3)

Now, if I type the RicciT from (3) it displays the same result. However,......

 (4)

If I type a different RicciT, then ...

The for loop is changing the tetrad definition of RicciT.