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

4
votes
1answer
91 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 ...
4
votes
0answers
68 views

Can I use symbolic tensors for simple linear algebra and calculus?

As an example, I'd like to calculate this symbolic derivative: $\frac{\partial}{\partial b}(x-A.b)^{\mathsf{T}}.(x-A.b)$ where $x$ and $b$ are vectors and $A$ is a matrix. What I tried is this: ...
0
votes
0answers
38 views

Tensor product involving Levi Civita symbol [duplicate]

I'm working with xAct package. I've defined the tensor component values and my issue is that I want an expression involving Levi Civita symbols and tensor components, I don't know how to deal with it. ...
0
votes
0answers
31 views

Get rid of external library dependency

I am trying to generate C code for some functions, which I do not post in full because they are a few hundred lines long. The functions do nothing too fancy: a bunch of dot products, powers and roots. ...
6
votes
2answers
184 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 ...
3
votes
3answers
77 views

How to select elements in a tensor conditional upon their indices

I have a tensor, u, of rank one, meaning that I have a matrix whose elements are themselves matrices. I would like to select, and make a list of, only those sub-matrices whose indices comply with the ...
1
vote
2answers
59 views

Defining tensor components generally

I would like to define a tensor according to its components, something like the following: [F(x)]_i,j = Integrate[f(x,y)A_i(y)B_j(y),y] where i and j are ...
1
vote
1answer
99 views

Matrix/tensor addition behaving funny under replacement?

I have two matrices I want to add, and one of the matrices is a tensor product of two vectors. I've used a SetDelayed to define the summed matrix, because I want to evaluate it for different values of ...
0
votes
0answers
81 views

Symbolic tensor product calculation

I am trying to calculate the symbolic tensor product $\langle \nabla f\otimes f,\nabla g\otimes g\rangle ^2+(\langle \nabla f\otimes g,\nabla f\otimes g\rangle +\langle \nabla g\otimes f,\nabla ...
4
votes
1answer
136 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 ...
1
vote
1answer
83 views

Mathematica does not respect tensor order?

I'm trying to verify an identity involving symmetric traceless tensors over the reals. What I tried was: ...
2
votes
1answer
96 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 ...
0
votes
1answer
43 views

Error while transponsing a tensor [closed]

I am trying to execute following: TensorTranspose[Outer[D, metric, x], {2, 3}]. And Mathematica says me ...
1
vote
2answers
235 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 ...
0
votes
0answers
46 views

g00 (metric tensor) not explicitly evaluated in FeynCalc

I am learning Mathematica and FeynCalc by doing some basic cross section calculations. I have an issue with trace calculations: When I plug in for instance the ...
1
vote
1answer
417 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
0answers
34 views

How do I define a tensor from another tensor with summations? [duplicate]

Let's say we have a rank 2 tensor $g_{ij}$. This is basically a list with a Depth of 2. Now I'd like to calculate another tensor ...
9
votes
2answers
209 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 ...
1
vote
1answer
73 views

Why TensorReduce not working here?

I would like to use TensorReduce to work on the tensor contraction $y_{ib}y_{ia}$ (where index $i$ is summed). However, ...
0
votes
1answer
90 views

How to faster map density matrix element to make differential equations

I have a time dependent matrix $M(t)$ of $L^n \times L^n$ size and want to write differential equations like D[M[i,j][t],t] = H[i,j][t] Here is my code: ...
1
vote
1answer
49 views

Evaluating the tensor product many times for a given list

I need to evaluate the tensor product 10 times in a given list( {g,e,r}) Here I have evaluated for 3 times... ...
0
votes
1answer
50 views

Why the tensor product of list of variable change the subscript position in products

{Subscript[g, 1],Subscript[e, 1]}\[TensorProduct]{Subscript[g, 2],Subscript[e, 2]}\[TensorProduct]{Subscript[g, 3],Subscript[e, 3]} I am expecting answer like ... ...
1
vote
0answers
66 views

How does TensorReduce use assumptions?

I would like to use TensorReduce by assuming that certain patterns of functions are tensors. From documentation of TensorReduce: ...
6
votes
1answer
177 views

Computations in the exterior algebra

I want to be able to compute with explicit exterior algebras of vector spaces. For example, given a real vector space $V$ of $3 \times 3$ matrices, I want to consider expressions of the form $v\wedge ...
-4
votes
1answer
110 views

Programming Multipolar Expansions in Spherical Tensors

We have that a density matrix can be written in a basis of spherical tensors: $\rho =\sum _{K=0}^S\sum_{q=-K}^K \rho _{\text{Kq}}^{(S)} T_{\text{Kq}}^{(S)}$ for example for a 3x3 matrix, $S=1$, ...
3
votes
2answers
342 views

How to solve a “tensor equation”?

I am trying to solve equations which looks like this: $$ T_{ab} - T_{bc} = a_1 T_{ab} + a_2 T_{ac} + a_3 T_{bc}, $$ where $T_{xy}$ are tensors. I want to get the $a_i$'s (in this simple example ...
1
vote
1answer
134 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 some Mathematica package or some review that can help me?
0
votes
1answer
125 views

How to apply a tensor to a list of arguments

The problem I have is the following: Let C be a list of coordinates, say, C = {x1, x2, ..., xn} and ...
2
votes
0answers
85 views

How to solve system of differential equations of arbitrary order (symbolic tensors)?

I am interested in solving systems of ODEs symbolicly, keeping things with arbitrary dimensions for clarity. For example, assume that $x, f(x) \in R^N$ and $A \in R^{N \times N}$, how do I solve ...
5
votes
1answer
220 views

Symbolic linear algebra

I would like to know how I can ask Mathematica to expand (and simplify) such an expression : $$ (\alpha A + \beta B)^\top (\alpha A + \beta B) $$ where $\alpha,\beta$ are two real numbers and $A,B$ ...
3
votes
2answers
176 views

Mixed product identity between tensors in Mathematica 9

How can we simplify tensor expressions in Mathematica 9 using the mixed-product identity $(A\otimes B)(C \otimes D) \equiv AC \otimes BD$ ? Is it possible to implement this kind of evaluations using ...
3
votes
1answer
287 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 ...
3
votes
0answers
135 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 ...
10
votes
3answers
304 views

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

I would like to make the following matrix: ...
4
votes
2answers
246 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
275 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
107 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
191 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$ ...
5
votes
1answer
116 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
267 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}] ...
6
votes
1answer
487 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 ...
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, ...
8
votes
1answer
185 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
179 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}$ ...
6
votes
3answers
798 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
5answers
381 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
113 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
379 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 ...