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

537 questions
Filter by
Sorted by
Tagged with
74 views

### Why is solving for a 2x2x2 tensor with specific conditions so slow?

I am trying to find the space of all 2x2x2 tensors such that on each dimension the sub tensors are orthogonal. I ran the following wolfram desktop code: ...
• 101
42 views

### Dot product between chosen indices for high-rank tensors

I am doing computations with multilinear maps and representing them with tensors. For example, I have an operator $O : V_1 \otimes V_2 \to W$, where $\dim(V_1) = \dim(V_2) = 5$ and $\dim(W)=3$ that I ...
1 vote
46 views

### Calculate and transfrom the metric to the orthonormal frame

Let's suppose, the line element is like this: $$ds^2 = -a^2(1+2\psi)d\tau^2 - 2a^2 B_idx^i d\tau + a^2(1-2\phi)(dx^2 + dy^2 + dz^2)$$ I like to get the output of the metric components from it, ...
• 149
1 vote
43 views

• 101
44 views

### Christoffel symbol of 2nd kind [duplicate]

How to calculate Christoffel symbol of 2nd kind for a given metric tensor in Mathematica ? I tried a few programming but I'm not getting desired output .
1 vote
65 views

### NonCommutativeMultiply in Matrix Multiplication

Is there a way to preserve the order of elements in the multiplication of matrices when the elements themselves are matrices? For example, if I have: ...
83 views

### A problem with indices in tensor

I want to create a tensor similar to the one shown in the first picture, but I'm encountering some issues with indices. Could anybody assist me? Here's my code: ...
78 views

101 views

### Make the * operation the Kronecker product by default for Kets?

So given two "Ket" objects, u = Ket[{-1/2}]; d = Ket[{1/2}]; Is there a way to define multiplication, *, so that by ...
• 131
57 views

### Optimized and compact code for tensor product

I am calculating products like in mathematica. In the given relations eta's are four vectors, $\gamma$'s are the Dirac matrices, $\sigma^{\mu\nu}$ is the anticommutation of the gamma matrices and ...
• 111
65 views

### Permute subsystems of a matrix?

Suppose I have a matrix $M$ acts on the space $\mathbb C^4\otimes \mathbb C^2\otimes \mathbb C^4\otimes \mathbb C^3$. Is there a method to permute the 2nd subsystem of $M$ and the 4th subsystem of $M$?...
• 381
123 views

### How to calculate this covariant derivative?

I try to calculate the covariant derivative: $\nabla_\beta \partial_\alpha~ \phi = \partial_\beta \partial_\alpha~ \phi + \Gamma^\sigma_{\beta\alpha} ~\partial_\sigma~ \phi$ Where $\phi$ is a ...
• 287
174 views

### Using ChatGPT to write Mathematica code with the Ricci package [closed]

I generally use ChatGPT to write mathematica code for me. However, now I want to use a Mathematica package called Ricci. Whenever I try to ask ChatGPT to write me mathematica code using that package, ...
• 39
1 vote
101 views

### Metric tensor coordinate transformation with off-diagonal components

I know there is already an answer for this type of question given here: Computing the metric tensor under a coordinate transformation but the answer is not satisfactory as it is not clear to me how I ...
• 123
103 views

### Adding a symbolic tensor and a specific one

I need to add a symbolic tensor and a specific one, but it seems the symbolic tensor is always treated as a number and is added in very components of the specific tensor. Firsts I give assumptions <...
• 111
169 views

### A code to calculate Einstein tensor [duplicate]

I use the following MA code to calculate Einstein’s tensor. I’m asking about the zero component of the Einstein’s tensor, is it correct? Because I think $G_{00}$ should contains the terms in the zero ...
• 287
53 views

• 287
90 views

### How to create a vector as a tensor object for different euclidean bases?

The components of a tensor are always displayed with respect to one or multiple basis vectors. For a tensor of rank 1, a vector, in 3D-euclidean space, we resort to three orthonormal basis vectors. ...
• 45
74 views

### Calculating the strength tensor of a vector field

I'm trying to calculate $$T_{ab} = g_{ab}F_{gd}F^{gd} - F_a^g F_{bg},$$ where $$F_{ab} = \partial_a A_b-\partial_b A_a$$ So I define $F_{ab}$ by: ...
• 287
205 views

### Is there a good package for solving the Einstein field equations given a metric tensor?

I have a very simple metric tensor. I've built a notebook to calculate the EFE solutions based on this metric. Does anyone know of a good package in the Mathematica library that takes a metric tensor ...
136 views

### Metric pertubation in xAct

I start to learn xAct. Following this thread: expanding-the-riemann-tensor-perturbation I noticed that xAct set a default perturbation to the metric by: ...
• 287
1 vote