# 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.

70 views

### Tensors constructed using KroneckerDelta's - and/or displaying KroneckerDelta as a matrix

I am doing some work in elasticity and as a result am working with tensors. In particular, I would like to calculate the contraction of a fourth order tensor (the stiffness tensor) with a second order ...
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 ...
43 views

### Efficient implementation of tensorial Rayleigh product

I am interested in the tensor product $\hat{B} = A \star B$ (which at least I know as Rayleigh product), defined with components \hat{B}_{i_1 i_2 ... i_ n} = \sum_{j_1 = 1}^d \sum_{...
63 views

### Scalar from tensor contraction

I'm trying to calculate the Kretschmann scalar in mathematica, it is given by: $c = R^{abcd} R_{abcd}$ Where $R^{abcd}$ is the Riemann tensor. I'm following this MSE post so I modified it to ...
58 views

### How to multiply two tensor with arbitrary ranks, on one index only (like GR)?

I am writing a function which take two tensors with the same dimensions but with arbitrary ranks and multiplies them over one index, just like this example from GR: See, I couldn't use ...
22 views

### Dynamically constructing symbolic tensors

Is there any way to construct tensor of any given dimension d and rank r with symbolic entries? i.e., instead of manually constructing one as Table[T[i,j,k],{i,1,10},{i,1,10},{i,1,10}] for d=3 and r=...
53 views

### Constructing tensors with arbitrary rank and dimension [closed]

How can I create a tensor with arbitrary rank n and m components in each dimension? I am looking for a command in which I insert n and m and it spits out the corresponding tensor with random entries (...
100 views

### Output the tensor product of two matrix as a matrix

How do I output the matrix form like the RHS without the tensor product sign remaining $\otimes$? I need it for display purpose where I can see easily what the form of the whole product matrix is.
77 views

150 views

### The fastest way of raising indices of high rank tensor

I have some high dimensional high rank tensors, let's say $$F_{ijkl}$$ and I need to find $$F^{abcd}=g^{ai}g^{bj}g^{ck}g^{dl}F_{ijkl}.$$ Here $g^{ij}$ is the contravariant metric. Simple summation ...
83 views

### Is there a package that can calculate the Ricci tensor from a numerically given metric?

There are many packages about general relativity or differential geometry, and they can calculate the Ricci tensor from a symbolically given metric, for example, $g_{tt}=-f(r)$, $g_{rr}=h(r)$, etc. ...
146 views

### How to swap tensor indices without permutation?

Say I have a tensor of rank R, How to swap $i^{th}$ and $j^{th}$ tensor index? I do not want to use TensorTranspose because it requires to write down the entire permutation, i.e. TensorTranspose[T,{1,...
100 views

### Fast construction and reshaping of large tensors

I'm trying to construct a large matrix which is derived from some higher rank tensor (the rank of interest to me changes case by case, so it needs to be a general method). Currently, the process of ...
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? ...
252 views

### Tensors with mixed symmetry

I want to work with tensors of mixed symmetry, for example with a rank 3 tensor $A_{ijk}$ that is symmetric under the exchange of $i$ and $j$ and antisymmetric with respect to $i$ and $k$. I was ...
84 views

### Abstract iterator in Do

I'm trying to write a module. Its input is a matrix (tensor), the module should return new tensor with increased rank with 1. The new tensor is defined as  O \Rightarrow N_{\alpha \beta \ldots \...
61 views

### Atlas 2 For Mathematica. Need to calculate Riemann tensor, etc [duplicate]

Is anyone familiar with Atlas 2 for Mathematica to calculate the Riemann Tensor, Ricci Tensor, and scalar I have a metric that I need to calculate these things for. Can anyone help? I'm not too up on ...
### Finding basis of isotropic tensors of rank $n$
I am looking for a way to obtain a basis of isotropic tensors of rank $n$. Actually I am mostly interested in rank $8$ isotropic tensors but maybe you know already a simple algorithm in order to ...