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.
4
votes
2answers
130 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
194 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. ...
2
votes
0answers
70 views
Prevent Suppression of Superscript 1 in Print
I'm trying to print Christoffel symbols of the second kind for a surface in $\mathbb R^3$. I currently am using something along the lines of
...
3
votes
3answers
90 views
Matrix multiplication that includes a tensor
How would I best express the following in Mathematica:
$\begin{pmatrix}2 & 4\end{pmatrix}
\begin{pmatrix}r_1 & r_2\\r_3 & r_4\end{pmatrix}
\begin{pmatrix}6 \\ 8\end{pmatrix}$, where $r_i$ ...
4
votes
1answer
74 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 ...
8
votes
3answers
210 views
Reduce the output from tuples by including symmetry?
I need all the possible 3x3 binary tensors, but I'd like to have this account for symmetries. I've started by using the Tuples command.
Tuples[{1, 0}, {3, 3}]
...
4
votes
1answer
327 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
...
6
votes
1answer
330 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, ...
9
votes
1answer
116 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$?
...
5
votes
1answer
111 views
Summing tensors in mathematica
How do I perform the following summation in mathematica?
\begin{equation}
\Sigma_{m=1}^5 e_{ijklm}A^{mn}
\end{equation}
I have the $e_{ijklm}$ tensor of rank 5 in 5 dimension as a array and $A^{mn}$ ...
5
votes
3answers
361 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
...
5
votes
3answers
154 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 + ...
2
votes
0answers
89 views
Smooth Max and Abs
I'm trying to implement smooth approximations of Max and Abs functions. Moreover I want the functions to map element-wise on tensors. Here's my code.
...
2
votes
0answers
187 views
how to associate a metric for tensor contraction operations?
I see that Version 9 now has some built in tensor support (which was missing back when previously asked How to represent and manipulate abstract indexed vector (or tensor) expressions?). The docs ...
8
votes
1answer
163 views
Verifying and deriving basic (block) matrix identities
How can I use the new symbolic matrix/tensor capabilities to verify matrix identities, such as
(1)
or
(2)
Even better, how can I ask Mathematica to derive expressions for X, Y, Z, and U like ...
7
votes
1answer
171 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 ...
5
votes
1answer
208 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$ ...
8
votes
4answers
2k 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. ...
5
votes
3answers
234 views
Multidimensional array reduction through summation over one of its dimensions
1. Introduction
I am using an array of dimension 3 (might become more) to store some values. I would like to implement a function that takes as argument the array and a couple of numbers smaller than ...
6
votes
1answer
360 views
Higher order SVD
Does anyone know how to do a higher order SVD in Mathematica ? A good reference seems to be here http://csmr.ca.sandia.gov/~tgkolda/pubs/bibtgkfiles/TensorReview.pdf but I don't understand their ...
5
votes
1answer
154 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 ...
10
votes
1answer
368 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 ...
33
votes
2answers
1k views
Internal`Bag inside Compile
Since Internal`Bag, Internal`StuffBag and Internal`BagPart can be compiled down, it is a ...
13
votes
2answers
799 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) ...
