I have defined two CTensor (h and H),

h = CTensor[{{1 + ϵ ψ[], a[] ϵ VarD[x[]][α[]], a[]  ϵ VarD[y[]][α[]], a[] ϵ  VarD[z[]][α[]]},
             {ϵ VarD[x[]][α[]], a[] (1 - ϵ ϕ[]), a[] ϵ β1[], a[] ϵ β2[]},
             {ϵ VarD[y[]][α[]], -a[] ϵ β1[], a[] (1 - ϵ ϕ[]), a[] ϵ β3[]},
             {ϵ VarD[z[]][α[]], -a[] ϵ β2[], -a[] ϵ \ β3[], a[] (1 - ϵ ϕ[])}}, {-ℬ, ℬ}];


H = CTensor[{{1 - ϵ ψ[], -ϵ VarD[x[]][α[]], -ϵ VarD[y[]][α[]], -ϵ VarD[z[]][α[]]},
             {-ϵ VarD[x[]][α[]]/a[], (1 + ϵ ϕ[])/ a[], ϵ β1[]/a[], ϵ β2[]/a[]},
             {-ϵ VarD[y[]][α[]]/a[], -ϵ β1[]/ a[], (1 + ϵ ϕ[])/a[], ϵ β3[]/ a[]},
             {-ϵ VarD[z[]][α[]]/a[], - ϵ β2[]/ a[], -ϵ β3[]/a[], (1 + ϵ ϕ[])/ a[]}}, {-ℬ, ℬ}];

then using these CTensors and their covariant derivatives I have defined a new tensor. But the final it can not calculate the their components.

DefTensor[T[γ, -δ, -ζ], M];
IndexSet[T[γ_, -δ_, -ζ_], (H[-σ, γ]* CD[-δ]@h[-ζ, σ] -  H[-σ, γ]*CD[-ζ] @ h[-δ, σ])];

But when I use

T[{1, ℬ}, {1, -ℬ}, {2, -ℬ}]

I get


The pattern T[γ_, -δ_, -ζ_] only accepts abstract indices in the second and third indices, because something like {1, -ℬ} does not match a pattern like -δ_. Hence use something like

T[γ, -δ, -ζ] Basis[-γ, {1, ℬ}] Basis[{1, -ℬ}, δ] Basis[{2, -ℬ}, ζ] // ContractBasis

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.