# Tagged Questions

Use this tag for questions that involve tensors. Tensors are fundamental tools for linear computations, generalizing vectors and matrices to higher ranks. Mathematica 9 introduces powerful methods to algebraically manipulate tensors with any rank and symmetry.

2answers
3k views

### InternalBag inside Compile

Since InternalBag, InternalStuffBag and InternalBagPart can be compiled down, it is a ...
4answers
11k views

### How to calculate scalar curvature Ricci tensor and Christoffel symbols in Mathematica?

I am seeking a convenient and effective way to calculate such geometric quantities. I've used packages like TensoriaCalc, but they don't work at all time. Sometimes,...
2answers
3k views

1answer
291 views

### inverse of abstract matrix

If you assume the matrix $A$ is invertible, then $A^{-1} \cdot A = I$. Is there an assumption for invertibility in Mathematica 9? How can one make the following evaluate to the identity matrix $I_3$? ...
0answers
165 views

### Efficient way to flatten or transpose-arrayreshape tensors

I have a tensor of dimensions $(2, 100, 100, 2, 100, 100)$ and I want to reshape it to a form of $(2*100*100,2*100*100)$, e.g. Flatten[A,{{1,5,6},{4,2,3}}]. If I ...
2answers
368 views

### How to get rid of nested matrices

If I type into Mathematica TensorProduct[IdentityMatrix[2],IdentityMatrix[2]] It gives me a result that has nested matrices. How do I turn that into a normal ...
2answers
1k views

### Perturbation theory in general relativity using xAct

I'm trying to use the xAct Mathematica package for manipulating tensors, and I'd like to plug in a metric into the perturbation equations to first order in general relativity, and have everything ...
1answer
262 views

3answers
270 views

### How to simplify symbolic expressions with KroneckerProduct

Having $X,Y$ being symbols for matrices, I was wondering if there is a way to simplify expressions like KroneckerProduct[X, X] + KroneckerProduct[-X, X] to ...
1answer
73 views

1answer
2k views

### Contracting with Levi-Civita (totally antisymmetric) tensor

I have an array $v_{ijk}$ which is effectively a rank-$3$ tensor with dimensions $3\times3\times3$, and I need to contract it with $e^{ijk}$, i.e. evaluate $v_{ijk} e^{ijk}$ (see Einstein convention)....
1answer
508 views

### Linearized Einstein Equations with Mathematica

I need to compute the linearised Einstein Equations around a fixed metric $g_{\mu \nu}$ which is not the flat metric. Someone knows any Mathematica package or a review that can help me?
1answer
247 views

### Summing tensors in mathematica

How do I perform the following summation in mathematica? $$\Sigma_{m=1}^5 e_{ijklm}A^{mn}$$ I have the $e_{ijklm}$ tensor of rank 5 in 5 dimension as a array and $A^{mn}$ ...
1answer
259 views

### Problems with CircleTimes and infix notation

I am trying to create a function called TensorBasis that takes as input a list (thought of as a list of names of basis vectors of a vector space) and an integer <...
1answer
69 views

### Creating a tensor from matrices

I have 3 nxn matrices that I'd like to combine into a nxnx3 tensor. Basically, I want a new nxn matrix where each element is a 3 tuple of the elements of the other 3 matrices at that same position. ...
2answers
154 views

### Using LeviCivitaTensor

I have 2 questions about using LeviCivitaTensor, based on the following session: The signs for the cross product seems to come out "opposite" of what I expected. Why is that? Did I miss anything? ...
1answer
113 views

### TensorReduce not simplifying transpose for symmetric matrix?

I know Mathematica is not very good with symbolic manipulation of matrix expressions, but I was surprised to find that it can't reduce the following expression: ...
1answer
293 views

### How to put the tensor product of two operators onto two variables?

I am trying to make an intuitive Mathemtaica program to show the principle of quantum walking. The idea of quantum walking is very simple and direct, but when I try to transfer it into Mathemitca ...
1answer
392 views

### Mathematica package for supergravity and superstring theory

I am looking for a Mathematica package that can manipulate tensors for supergravity, string theory or M-theory. I am particularly looking for a package that can do spinor and Clifford algebra ...
1answer
219 views

### On elegant use of Inner and Outer on tensors

I have a collection of 5-element vectors each of which corresponds to an {x,y} location from a (20 x 21) grid. Because of that I represent that data as a (5 x 20 x 21)-sized tensor called ...
1answer
42 views

### What do I need to know about simplifying expressions involving Symbolic Tensors?

I want to use Mathematica to show that the inner product of a vector with itself is equal to the square of its norm. This is what I tried: ...
1answer
84 views

### Subscripted (or superscripted) variables in Mathematica

When I first learned of Mathematica and started to use it, I soon discovered that Mathematica supported subscripted and superscripted variables such as $M_{i j}$. Naively, I first thought that I ...
0answers
75 views

### How to write Coordinate Chart in Xcoba in index form?

I am using xCoba for manipulating tensors. I do the usual, defining my metric, manifold, chart etc. ...
1answer
618 views

### Covariant derivative for symbolic tensors

I want to define a "prefix" (D_i) covariant derivative operator CD[] for symbolic tensors in form of a function, i.e. for ...
1answer
271 views

...