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

72 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 ...
85 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 ...
231 views

### SymmetrizedArray of stiffness/compliance tensor

The stiffness and compliance tensors of a material are 3x3x3x3 tensors relating stress and strain. ...
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_{...
84 views

### 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 ...
101 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.
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 (...
77 views

74 views

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 ...
2k views

### Ways to compute inner products of tensors

One way to evaluate the following sums is combining Table and Sum: $u_{abcd} = \sum_{e=1}^3 v_{aeb}w_{ced}$ $q_{ab} = \sum_{d,e=1}^3 v_{d e a}w_{deb}$ It will look like ...
409 views

### Compute a double dot product between two tensors of rank 3 and 2

I would need help to calculate a double dot product between a rank 3 tensor A and a rank 2 tensor B (A:B) using mathematica. Does someone know how to do that? Thank you for your help!
59 views

### Simplifying symbolic expressions using TensorExpand

Following my previous question I have this issue using TensorExpand: KroneckerProduct[x, y].(KroneckerProduct[2 z, w]) // TensorExpand results in ...
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. ...
98 views

### Choosing Minkowski metric in Feyncalc

This is related to the Mathematica package FeynCalc. Is there a way to simplify the metric? I mean in the sense that when I evaluate something and I get a long expression involving lots of $$g^{12}$$...
111 views

### Curl of a second-order tensor

In Mathematica 9.0, the documentation for the Curl function states that in n-dimensions "the resulting curl is an array with depth n-k-1 of dimensions". Accordingly, if a 2-dimensional array is feeded ...
57 views

### Arrays with two different types of indices

Is there a way of having arrays which have, so to speak, two different depths $m,n$? From the point of view of memory usage, it would be the same as an array of depth $m+n$, but I would like to ...
44 views

### Simplifying nested KroneckerProducts

Any suggestion how to bring a nested KroneckerProduct form into just one? I mean some how converting ...
60 views

### Continuous integration of a tensor function using discrete density values

Hei, I am wondering is it possible to implement continuous integration using Integrate() of a fourth order tensor with discrete density values. ...
241 views

### Nearest Kronecker Product

Some people (see The ubiquitous Kronecker product by Van Loan) have worked on finding two matrices $\mathbf A$,$\mathbf B$ of specified size whose tensor product $\mathbf A\otimes\mathbf B$ is closest ...
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 ...
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 ...