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.

learn more… | top users | synonyms

41
votes
2answers
2k views

Internal`Bag inside Compile

Since Internal`Bag, Internal`StuffBag and Internal`BagPart can be compiled down, it is a ...
16
votes
4answers
6k 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. ...
2
votes
1answer
675 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 ...
1
vote
2answers
299 views

Using the epsilon tensor in Mathematica

I'm having a great deal of trouble getting started on a weekly homework assignment in Mathematica. The assignment requires we use the epsilon tensor which is apparently built into Mathematica as ...
14
votes
2answers
2k views

How to represent and manipulate abstract indexed vector (or tensor) expressions?

I have a couple abstract indexed quantities, both differential elements $dx = dx^\mu e_\mu + x^\mu de_\mu$ $du = du^\mu e_\mu + u^\mu de_\mu$ I can compute the expression $(dx + du) \cdot (dx + du) ...
7
votes
1answer
1k views

Tensor analysis

Has anybody used tensors in Mathematica? How to properly work with them? I find Mathematica not very friendly in this field, as I am defining my own functions for lowering & raising indices, ...
5
votes
5answers
444 views

Elementwise join

I have two tensors of arbitrary but equal rank n (and equal dimensions): A and B, and I want to get a third tensor of rank n + ...
10
votes
1answer
659 views

Nesting Parallel processes

I just attempted to run code that had nested ParallelMap[] functions. It generates the error message: ParallelMap::subpar: Parallel computations cannot be nested; proceeding with sequential ...
6
votes
3answers
922 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 ...
10
votes
3answers
315 views

Looking for an elegant way to construct this tensor-product-ish list

I would like to make the following matrix: ...
10
votes
2answers
263 views

How to take derivative of parameterized coordinate?

Suppose I have a vector in $\mathbb{R}^n$ but $n$ is not known in advance. I want to be able to write functions which operate on the components of that vector, and then I'd like to be able to take ...
6
votes
1answer
157 views

Symbolic tensor simplifications and the identity matrix

How can I get Mathematica to simplify the following expressions, with $Assumptions including Element[n,Integers], n > 0, and ...
5
votes
1answer
126 views

How to read off coefficients of tensor-like expression in a speedy way?

I am considering identities involving t[a, b, c, d, ...], where number of indices is fixed. t has the cyclic property so that ...
7
votes
1answer
260 views

Compiling Map over expression that yields a ragged array

I'm trying to speed up a function that looks in the neighborhood of each 3D point in a large dataset and finds all the points within 1 unit in each direction, x, y, z. I've started by using ...
7
votes
1answer
520 views

TensorContract of inverse matrix

Matrix inverse in mathematica If $A$ is an invertible $n \times n$ matrix, then $A\cdot A^{-1} = I$. To get this statement in Mathematica, you need the assumption ...
13
votes
2answers
811 views

Higher order SVD

Does anyone know how to do a higher order SVD in Mathematica ? A good reference seems to be here http://www.sandia.gov/~tgkolda/pubs/pubfiles/SAND2007-6702.pdf but I don't understand their formalism ...
3
votes
1answer
304 views

How can I get Mathematica to recognize equality of symbolic matrix expressions?

I have two matrix expressions: X.Transpose[T].Transpose[X] and X.T.Transpose[X] I want Mathematica to recognize that ...
6
votes
1answer
348 views

Solving antisymmetric tensorial equation

Assume we have the following Tensor objects: \begin{equation} F_{i}{}^{j}\;and\;S_{ij}{}^{k}, \end{equation} where the components of $F$ are known, and we would like to solve for the components of $S$ ...
4
votes
2answers
262 views

Simplifying the trace of a matrix expression

I have a long expression involving matrices that I derived using the NCAlgebra package. Can I simplify the trace of the expression? For example, say b is a scalar ...
1
vote
2answers
281 views

Doing vector manipulations on Mathematica

This is hopefully a simpler version of this previous unanswered question of mine. Let me just focus on the two expressions $F_2^{(s)}$ and $F_3^{(s)}$ given in A.3 and A.4 of page 19 of this paper. ...