Questions tagged [tensors]

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.

Filter by
Sorted by
Tagged with
2
votes
1answer
26 views

Fancy Indexing of a 4D array (tensor)

I'm trying to mimic the CoefficientArrays function, which I can't get to work for my symbolic equations. The CoefficientList ...
3
votes
2answers
71 views

Klein-Gordon Equation on mathatica: how can I write the summation?

I would like to write a program that gives me the Klein Gordon Equations given a metric. I will explain. My code is in the following: I) Standard Quantities I have no doubt here the first part is ...
5
votes
1answer
96 views
+50

How is Grad defined for array particularly in non-Cartesian coordinates?

This question can be viewed as a follow-up of What is the definition of Curl in Mathematica? First argument of Grad can be an array, but what definition does ...
0
votes
1answer
32 views

Building an array of T NxM matrices where one item in each matrix changes

As I do not use Mathematica often enough, I am a bit rusty. I need to work on an array of T matrices and each of those NxM matrices has the following pattern: $$ \begin{equation} A(t):= \left( ...
1
vote
1answer
60 views

Tensorial functions

I need to solve a system of ODEs for a function that has a complicated tensorial structure. I believe that NDSolve can deal with this scenario since version 9. Yet, ...
2
votes
1answer
67 views

How to identify specific Christoffel symbols and Riemann Tensor components from a general solution [closed]

I want to learn how to identify specific Christoffel Symbols and Riemman Tensor components from the general solution provided by Mathematica. Let us work out an example to see what I mean clearly. ...
4
votes
1answer
107 views

Computing Christoffel symbols of the second kind [duplicate]

I want to compute the Christoffel-symbol for a given metric. I am using the code here, but I am missing something. The Chrisfoffel-symbol formula is $\Gamma^{\mu}_{\phantom{\mu}\nu\sigma}=\frac{1}{2}g^...
2
votes
1answer
58 views

Best way to work with Tensor Networks

I have to write a script in which I have to work with a very simple tensor network but I can't find a nice scalable way to make this work. The basic object I am working with is a tensor more or less ...
1
vote
0answers
52 views

LeviCivitaTensor contraction indices

My computer has problems when I try to perform a calculation with TensorContract. In particular, with the second answer to my previous question Contracting indices ...
2
votes
0answers
26 views

Optimising tensor operations under memory constraints

Let riem is a free variable with riem ∈ Arrays[{4, 4, 4, 4} as assumption. Let: ...
6
votes
2answers
171 views

Contracting indices in lists

Using an answer to this question (Working with Dirac Gamma Matrices using FeynCalc - A simple problem), I defined ...
2
votes
1answer
58 views

Expanding Determinant as Multilinear Alternating Function

I am working with the expression $$\det\big{|}f(-kx), f(-(k-1)x),\cdots,f(0),\cdots, f((k-1)x), f(kx), g(x)\big{|},$$ where $f,g\colon\mathbb{R}\mapsto \mathbb{R}^{2k+2}$, and want to use the Taylor ...
0
votes
0answers
44 views

Does Solve work with symbolic tensors?

I am considering the usefulness of Mathematica's symbolic tensors to handle algebra which I encounter in acoustics of solids. Is there a way to solve equations written in symbolic tensors? This is ...
2
votes
1answer
31 views

How to state nontrivial tensor symmetry assumptions?

For example dddg, the third derivative of the metric tensor, in dimension $4$. I need to state that it is symmetric in the first two indices and symmetric in the ...
0
votes
1answer
27 views

Hypothetical aplication of rules/restricting rules to a given context?

I have the code TensorDimensions[TensorContract[c, {{1, 2}}]]. It is in normal form. But if I add the rules: ...
0
votes
1answer
47 views

Correct syntax for tensor operators?

So I have an operator $A_0$ whose matrix representation is given by $$A_0 = \begin{pmatrix} 0 & -i \\ -i & 0\end{pmatrix},$$ and I also have two vector states $|0\rangle$ and $|1\rangle$ ...
5
votes
1answer
138 views

Fourth Order Tensor rotation [duplicate]

What is the easiest way to perform Rotation for Higher Order Tensors in Mathematica ? For Instance 4th order tensor $C_{ijkl} = \lambda_{im}\lambda_{jn}\lambda_{ko}\lambda_{lp} C_{mnop}$
5
votes
0answers
48 views

speed up tensor expand

I am using the following code ...
5
votes
1answer
70 views

A simple problem on TensorTranspose

In the "Applications" part of TensorTranspose, it is given an example on the calculation of Christoffel according to metrics. I am confused about the definition of <...
0
votes
1answer
269 views

How to reproduce this tensor calculation with Mathematica [closed]

The tensor operation shown in the red box is used in the textbook(P117-P120) to prove that there are only 9 independent constants for orthotropic materials: I want to use MMA to reproduce the ...
0
votes
1answer
192 views

How to use Mathematica to show why engineering strain is not a tensor [closed]

One of the most classical examples in the mechanics of materials is that engineering strain is not tensor. I want to use Mathematica to show why it doesn't meet the tensor requirements. ...
6
votes
3answers
485 views

How to implement Einstein summation convention with differential operators

Statement of this problem: In the textbook, the following differential equilibrium equations can be expressed by tensors: Using Einstein's summation convention, the formula in the figure above can be ...
2
votes
4answers
118 views

Calculate dot product of two tensor products in mathematica as tensorproduct

I would like to calculate $$(\mathbb{1} \otimes \mathbb{1} \otimes \sigma^+)(\mathbb{1} \otimes \mathbb{1} \otimes \sigma^-) = (\mathbb{1} \otimes \mathbb{1} \otimes \left( \begin{array} \\ 1 &0 ...
1
vote
0answers
28 views

What should I do to get a fourth-order tensor with only two independent components

I see this example in help SymmetrizedIndependentComponents, We can see that matrix A has only four independent components: <...
1
vote
0answers
69 views

How to prove that isotropic materials have only two independent constants by tensor operation rules [duplicate]

I want to use tensor method to prove that there are only two independent elastic constants for isotropic materials. But I can' t get two independent results after reading related posts. The following ...
1
vote
0answers
50 views

Determinant of the tensor matrix in Mathematica? [closed]

I have a data: As an example, it looks like this: Then, when I try to take Det[]: How we can find determinant value of these kind of matrices ?
3
votes
0answers
151 views

Spin Connection using Mathematica

Hello I want to use Mathematica in order to calculate the spin connection of a metric, specifically of the metric \begin{equation} \left(\begin{array}{cccc} -1 & 0 & 0 & 0 \\ 0 & \...
2
votes
2answers
89 views

Tensor contraction

How do I let mathematica compute a tensor contraction like $\delta_{ab}\delta_{bc}$ with an output $\delta_{ac}$ efficiently? I tried TensorContract and TensorReduce but they were not helpful. ...
0
votes
0answers
49 views

How do I apply assumptions to a table of functions

I have a table, really its a tensor but anyways I would like to apply an assumption to it, i.e. 1 - 2 phi[t,x,y,z] == 1 and have it print the tensor after it has ...
0
votes
0answers
51 views

Use Mathematica to draw a tensor-like network

What are the Mathematica ways to draw this seemly delicate figure? Such that we can output a PDF file in the end.
2
votes
1answer
50 views

xAct working with an unspecified function

I am trying to use xCoba with a diagonal metric depending on an unspecified function f[r], but I get the errors: CTensor::...
4
votes
2answers
139 views

How to understand the symmetry of MMA's tensor

tensor = {{{2, 9}, {9, 2}}, {{9, 2}, {2, 4}}}; TensorDimensions[tensor] TensorSymmetry[tensor] How can I understand the symmetry of the output ...
1
vote
0answers
90 views

3d plot of young's modulus for anisotropic material

can anyone can help me in plotting 3d plot of young's modulus for anisotropic material. For input i have 6*6 stiffness tensor matrix and hydrostatic pressure value. I am trying with the following ...
1
vote
1answer
46 views

The Matrix formula of this hamilton is different from that found in the paper

I am trying to rewrite the following Hamiltonian in the matrix form, but I get different results. In this article, the Hamiltonian that represents a three-qubit Heisenberg spin chain and its matrix ...
2
votes
1answer
91 views

Defining a tensor from an expression of other tensors in xAct

There's been a number of people asking how to set a tensor-valued variable in xAct; equivalently, how to define a new tensor from an expression of existing tensors. For example, a very simple ...
2
votes
1answer
118 views

How to compute functional derivative against vector in xAct, xTensor or xTras?

I want to compute the functional derivative against vectors. For example, I have an object that looks like this $R = h_{ijkl}a^i a^j a^k a^l$ I need to compute $\frac{\delta R}{\delta a^p}= 4 h_{...
0
votes
1answer
71 views

How does Indexed work in terms of sparse array

I want to use indexed given that s is an element [0,500] but I am unsure how to write that without getting a format error or a tensor error. ...
0
votes
1answer
61 views

How to make a tensor product into matrix?

TensorProduct[PauliMatrix[1], DiagonalMatrix[{1, 1}]] // TableForm created a tensor, which could be flatten to table form. However, how to make the tensor into a ...
2
votes
1answer
122 views

Kretschmann scalar in xTensor and xCoba

How do I calculate the Kretschmann scalar $K=R_{abcd}R^{abcd}$ with xTensor and xCoba? I have found the functions Kretschmann and ...
2
votes
2answers
114 views

Speeding up the evaluation of a product of 64 matrices, each 16x16, which takes 30 minutes

I need to calculate a very large product of matrices, (64 terms, each a 16x16 matrix). Specifically, ...
2
votes
0answers
47 views

Parallelize and tensor calculus

Is it possible to use Parallelize with tensor calculus functions like TensorContract and ...
3
votes
1answer
64 views

Rewriting a large product of 42 (13x13) matrices with MatrixExp

I am trying to perform a product of a large number of terms of the form MaxtrixExp[...], for example, something like this ...
0
votes
1answer
58 views

Trying to find the double dot product of a Rank 4 and Rank 2 tensor

I understand this question has been asked before, or something very similar to what I'm trying to accomplish at the very least, however I didn't understand much of what was happening in the other ...
6
votes
2answers
429 views

Speeding up sums involving 16x16 matrices and 16x16x16x16 antisymmetric tensor

I need to perform the following contraction involving four 16x16 matrices and a tensor $\theta$ that is 16x16x16x16. ...
4
votes
1answer
121 views

TensorContract and TensorProduct problem

I am trying the calculate the Kretschmann scalar $K$ of a metric $$K=R^{abcd}R_{abcd}$$ where $R$ is the Riemann tensor. If I do ...
0
votes
1answer
49 views

How can I take the divergence of a symbolic vector? [duplicate]

I would like to compute expressions that have the following form: $$\left(\partial_{p_1} - \partial_{p_2}\right)^2 \left(\partial_{p_1} - \partial_{p_2}\right)^2 \frac{(p_1-p_2)\cdot(p_3-p_4)}{p_1^...
1
vote
1answer
107 views

How to work with Levi civita tensor in xAxt?

Is there any command to work with the Levici vita tensor? In fact, I found LeviCivitaTensor, however, in calculations it doesn't seem practical. see the example: <...
2
votes
1answer
125 views

How to flatten a tensor product

Say I have a tensor product of four two dimensional spaces $\Lambda = S\otimes S\otimes S\otimes S$. The basis of $S$ is CB={{1,0},{0,1}} . I generate the ...
3
votes
1answer
50 views

unexpected `False` for `SymmetricMatrixQ`

Why does the following evaluate to False? ...
1
vote
0answers
27 views

Derivatives with dummy indices not commutative after 3d derivative?

Recently I've encountered the following issue in xAct. I've defined the Manifold and tensors in the following manner Then consider the following expressions. In the case where there are 2 ...

1
2 3 4 5
7