Tag Info

New answers tagged

1

For instance: varD[f1_ f2_, x_] := varD[f1, x] f2 + f1 varD[f2, x]; varD[f1_ + f2_, x_] := varD[f1, x] + varD[f2, x]; varD[c_?NumericQ, x_] := 0; varD[delta[a_, b_], x_] := 0; varD[S[a_, b_], S[c_, d_]] := delta[a, c] delta[b, d] Now you can do In[]:= varD[7 S[a, b] S[c, d], S[e, f]] Out[]= 7 (delta[c, e] delta[d, f] S[a, b] + delta[a, e] delta[b, f] ...


0

You can do it as follows: X = Array[x, {3, 3, 3}]; A = Array[a, {3, 3}]; TensorContract[TensorProduct[A, A, A, X], {{2, 7}, {4, 8}, {6, 9}}] Look at your expression A[i,l] A[j,m] A[k,n] X[l,m,n], count positions of repeated indices and you will see that each contraction pair corresponds to a repeated index. However, there is a problem there: ...


0

I used the ideas from this post, Ways to compute inner products of tensors, to help in obtaining a solution. The main idea here is to transpose the tensor so that the indices in the original expression for $\chi^{\prime}_{ijk}$ are near each other then use the inner product. In Mathematica, use the transpose function to exchange the indices. The proper ...


1

As I see no clear pattern to the errors caused by TensorExpand, we can not pick out the special cases that case this error and just avoid them. So instead I choose to implement my own function TensorReduceContract to reduce tensor contractions. It is used like this: tp = TensorProduct; $Assumptions = {m ∈ Arrays[ {3, 3, 3, 3, 3, 3, 3, 3}, Reals], n ∈ ...


1

Given a matrix: eta = ({{1, 0}, {0, -1}}); one can decompose this into three matrices in the following way: {u, w, v} = SingularValueDecomposition[eta]; (* Where the original eta is defined by: *) u.w.Transpose[v] (* = eta *) Another way, which more appropriately addresses your problem is to use Schur decomposition. eta = ({{1, 0}, {0, -1}}); {q, t} ...



Top 50 recent answers are included