Skip to main content

Questions tagged [tensor]

For questions involving computational modeling with tensors. The most common definitions of a tensor are a multilinear map or simply a multilinear array.

1 vote
0 answers
44 views

Mathematica Package for validating effective string theory solution

I am asking for Mathematica package that given an input of: symmetric matrix $G_{\mu\nu}$, antisymmetric matrix $B_{\mu\nu}$ and a scalar function $\Phi$ will check whether it is a solution to the one-...
Daniel Vainshtein's user avatar
1 vote
1 answer
49 views

Difference of tensors to construct a higher dimensional tensor in pytorch

Suppose I have two tensors $A_{i_1,\ldots,i_M}$ and $B_{j_1,\ldots,j_N}$ where $M \neq N$ in general. We can define a tensor $C_{i_1,\ldots,i_M,j_1,\ldots,j_N}$ by $$ C_{i_1,\ldots,i_M,j_1,\ldots,j_N} ...
user8469759's user avatar
3 votes
3 answers
111 views

How to implement the following operation in pytorch (tensor by equating indices)

I wasn't sure if I should post this on stackoverflow rather than here, but because I have to construct a specific tensor I think here is more suitable. I have 2 tensors, $x \in \mathbb{R}^{M \times N \...
user8469759's user avatar
0 votes
0 answers
36 views

Numerical Divergence of a Tensor Field in Spherical Coordinates

I want to calculate the divergence of a rank-2 tensor field $$\nabla \cdot T$$ defined on the surface of a sphere in spherical coordinates. As an example, let the field be given as follows : ...
haricash's user avatar
11 votes
1 answer
343 views

Is it possible to express an arbitrary tensor contraction in terms of BLAS routines?

I noticed that libraries like numpy and pytorch are able to perform arbitrary tensor contractions at speeds similar to comparably sized matrix multiplications. This leads me to believe that underneath ...
ilya's user avatar
  • 121
3 votes
1 answer
94 views

Apply 3D Operator to Matrix and get new Matrix

Hopefully this question makes sense. I know I can formulate an operator for a vector as a matrix, then apply that matrix to my vector to get a new vector. For example, if I define a left shift ...
Nukesub's user avatar
  • 163
3 votes
0 answers
159 views

Numerical integration in Fourier space over 3D grid

I am attempting to implement a model outlined in this paper: General magnetostatic shape–shape interactions Background This model allows the calculation of magnetostatic interaction energies between ...
JasonC's user avatar
  • 43
0 votes
2 answers
171 views

Rotation of Higher order Tensors

I have a $D$-way tensor of dimensions $n\times n \times \dots \times n$ $(D)$- times. I want to sum the First vectors in all directions. For example, let $\boldsymbol{H}$ is 3-way tensor of dimensions ...
Neuling's user avatar
  • 35
1 vote
0 answers
37 views

Normalisation in tensor networks

I am trying to implement the iTEBD algorithm for the $PXP$ model, i.e, the hamiltonian is $$H = \sum_iP_{i-1}X_iP_{i+1}.$$ Here $P$ is the projector onto the ground state and $X$ is the usual pauli x ...
Souroy's user avatar
  • 11
1 vote
1 answer
67 views

Computing material derivated of tensor quantity

I would like to compute the material derivated of a tensor quantity, in the context of the finite volume method (FVM): The equation is: $$ \frac{\mathrm{d} \textbf{T}}{\mathrm{d} t} = \frac{\partial \...
user avatar
1 vote
1 answer
118 views

Converting a 4 rank matrix to 2 rank matrix after using tensorproduct

Let's say I have a 2x2 matrix (with symbols) called 'A'. Now, if do B = sympy.tensorproduct(A,A) print(sympy.shape(B)) I get, ...
Shashank Saumya's user avatar
1 vote
1 answer
268 views

Confusion about bilinear form for elasticity equation in deal.ii tutorial

I'm learning how to solve vector-valued problems with deal.II library. In particular, I'm looking at the following introduction from the official website https://www.dealii.org/current/doxygen/deal.II/...
FEGirl's user avatar
  • 405
1 vote
0 answers
218 views

3D Matrix (Tensor) Operating On a 1D Vector

Say you have a tensor $T$ and the components are represented by a 3 by 3 by 3 matrix. And you want to use that tensor to map a vector $u$ into a new vector $s$, both of which are 3 by 1 column vectors....
Nukesub's user avatar
  • 163
2 votes
0 answers
38 views

Scaling tensor approximation by symmetric tensor decomposition with SciPy's L-BFGS-B

I am trying to approximate a symmetric tensor of which the values are in the range of [1e-7,1e-4], by a symmetric tensor decomposition of lower rank. For this I am using the L-BFGS-B method in SciPy's ...
Jules's user avatar
  • 21
7 votes
1 answer
3k views

4th order tensor rotation - sources to refer

I am trying to model a linear elastic material in Abaqus using a UMAT. For my application, I need to rotate the 6x6 compliance matrix for a given set of eigenvectors (or a rotation matrix). I came ...
Sagar Shah's user avatar

15 30 50 per page