# \#tensoroperations

**URL:** https://discourse.julialang.org/tag/tensoroperations/1099.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [\[ANN\] LowLevelFEM.jl – Engineering-oriented FEM in pure Julia](https://discourse.julialang.org/t/ann-lowlevelfem-jl-engineering-oriented-fem-in-pure-julia/133561)

<div class="topic-metadata">

**Author:** [@perebalazs](https://discourse.julialang.org/u/perebalazs)\
**Replies:** 0\
**Last updated:** [October 30, 2025, 6:12pm UTC](https://discourse.julialang.org/t/ann-lowlevelfem-jl-engineering-oriented-fem-in-pure-julia/133561 "2025-10-30T18:12:40Z")

</div>

LowLevelFEM.jl is a lightweight finite element toolbox written entirely in Julia. It focuses on engineering-oriented workflows — boundary conditions, meshing with Gmsh, mechanical and thermo-mechanical analyses, and di…

---

## [\[ANN\] Einops.jl: Concise, declarative tensor operations](https://discourse.julialang.org/t/ann-einops-jl-concise-declarative-tensor-operations/130792)

<div class="topic-metadata">

**Author:** [@AntonOresten](https://discourse.julialang.org/u/AntonOresten)\
**Replies:** 4\
**Last updated:** [July 17, 2025, 7:40am UTC](https://discourse.julialang.org/t/ann-einops-jl-concise-declarative-tensor-operations/130792 "2025-07-17T07:40:16Z")

</div>

I’m excited to share that I’ve been working on Einops.jl, bringing the popular einops tensor manipulation syntax to Julia. While Julia’s array interface is already excellent thanks to multiple dispatch, there’s still val…

---

## [Outer product of each row of a matrix](https://discourse.julialang.org/t/outer-product-of-each-row-of-a-matrix/121764)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 5\
**Last updated:** [October 26, 2024, 2:44pm UTC](https://discourse.julialang.org/t/outer-product-of-each-row-of-a-matrix/121764 "2024-10-26T14:44:12Z")

</div>

I’m looking for an efficient way to take the outer product of each row of a matrix, e.g.: julia\> A = \[1 2;4 8\] 2×2 Matrix{Int64}: 1 2 4 8 julia\> cat(\[r \* r' for r in eachrow(A)\]..., dims=3) 2×2×2 Array{Int64, 3}: \[…

---

## [How to measure the time taken by a part of the code excluding the disk operations](https://discourse.julialang.org/t/how-to-measure-the-time-taken-by-a-part-of-the-code-excluding-the-disk-operations/117469)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 5\
**Last updated:** [July 26, 2024, 9:30am UTC](https://discourse.julialang.org/t/how-to-measure-the-time-taken-by-a-part-of-the-code-excluding-the-disk-operations/117469 "2024-07-26T09:30:33Z")

</div>

I am trying to write a code that deals with repeated deserialization of tensors followed by contracting them and storing the result in another tensor. Here is an example of how the code looks like : I\_vvoo = zeros(F…

---

## [\[ANN\] TensorOperations v5](https://discourse.julialang.org/t/ann-tensoroperations-v5/117091)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 0\
**Last updated:** [July 16, 2024, 8:35am UTC](https://discourse.julialang.org/t/ann-tensoroperations-v5/117091 "2024-07-16T08:35:11Z")

</div>

Together with @lkdvos , we are pleased to announce v5 of TensorOperations. In this version, we have further improved the AD support and further extended the support for different backends and allocation strategies to de…

---

## [How to convert contractions from TensorOperations to ITensor?](https://discourse.julialang.org/t/how-to-convert-contractions-from-tensoroperations-to-itensor/115750)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 1\
**Last updated:** [June 17, 2024, 2:16pm UTC](https://discourse.julialang.org/t/how-to-convert-contractions-from-tensoroperations-to-itensor/115750 "2024-06-17T14:16:58Z")

</div>

I am trying to write a code for an iterative solver of a set of non linear equations. Doing this needs computation of a lot of Tensor Contractions which I had been doing using TensorOperations.jl . My code is running fin…

---

## [How to initialize a tensor with permutational symmetry?](https://discourse.julialang.org/t/how-to-initialize-a-tensor-with-permutational-symmetry/115390)

<div class="topic-metadata">

**Author:** [@Uranium238](https://discourse.julialang.org/u/Uranium238)\
**Replies:** 1\
**Last updated:** [June 9, 2024, 1:52pm UTC](https://discourse.julialang.org/t/how-to-initialize-a-tensor-with-permutational-symmetry/115390 "2024-06-09T13:52:44Z")

</div>

I am working on a iterative solver for non linear Coupled Cluster equations that would require a computation of lot of tensor elements via tensor contractions. For now, I am using the TensorOperations.jl for this purpose…

---

## [Custom reshape() function for specific usage](https://discourse.julialang.org/t/custom-reshape-function-for-specific-usage/113382)

<div class="topic-metadata">

**Author:** [@Harrykjg-physics](https://discourse.julialang.org/u/Harrykjg-physics)\
**Replies:** 3\
**Last updated:** [April 25, 2024, 9:14am UTC](https://discourse.julialang.org/t/custom-reshape-function-for-specific-usage/113382 "2024-04-25T09:14:10Z")

</div>

Hi there ! Is there any way to minimize the memory usage of the following custom function graded\_reshape() ( Or even achieve the same performance as the Julia reshape function ) ? Suppose we have a usual Julia reshape…

---

## [How do I implement the fastest tensor contractions](https://discourse.julialang.org/t/how-do-i-implement-the-fastest-tensor-contractions/111007)

<div class="topic-metadata">

**Author:** [@Laura](https://discourse.julialang.org/u/Laura)\
**Replies:** 11\
**Last updated:** [April 18, 2024, 1:40pm UTC](https://discourse.julialang.org/t/how-do-i-implement-the-fastest-tensor-contractions/111007 "2024-04-18T13:40:53Z")

</div>

I am writing a program which has a tensor contraction with a 4d symmetrical tensor at it’s core. Needless to say, since it will be used inside a non linear problem solver in the future, I need this tensor contraction to …

---

## [Using TensorOperations.jl when contracting tensors not following strict Einstein summation convention](https://discourse.julialang.org/t/using-tensoroperations-jl-when-contracting-tensors-not-following-strict-einstein-summation-convention/113034)

<div class="topic-metadata">

**Author:** [@Gattu\_Mytraya](https://discourse.julialang.org/u/Gattu_Mytraya)\
**Replies:** 8\
**Last updated:** [April 17, 2024, 12:47pm UTC](https://discourse.julialang.org/t/using-tensoroperations-jl-when-contracting-tensors-not-following-strict-einstein-summation-convention/113034 "2024-04-17T12:47:46Z")

</div>

I am trying to implement the following computation on a GPU. @tensor S\[i,j\] = A\[a1,j\]\*F\[a1,i,a2\]\*B\[a2,j\] As per the strict Einstein summation convention, this is not a valid expression as the index j appears twice on t…

---

## [Adding the result of a tensor contraction to a preallocated array](https://discourse.julialang.org/t/adding-the-result-of-a-tensor-contraction-to-a-preallocated-array/110789)

<div class="topic-metadata">

**Author:** [@paulp](https://discourse.julialang.org/u/paulp)\
**Replies:** 0\
**Last updated:** [February 26, 2024, 4:19pm UTC](https://discourse.julialang.org/t/adding-the-result-of-a-tensor-contraction-to-a-preallocated-array/110789 "2024-02-26T16:19:40Z")

</div>

Hi all, I’d like to perform an arbitrary contraction between two tensors and add the result to an existing array, without allocating an additional array. Tullio has the operation that I want, here is a simple example: u…

---

## [Take the automatic differentiation with tensor contraction](https://discourse.julialang.org/t/take-the-automatic-differentiation-with-tensor-contraction/106995)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 2\
**Last updated:** [December 19, 2023, 1:04pm UTC](https://discourse.julialang.org/t/take-the-automatic-differentiation-with-tensor-contraction/106995 "2023-12-19T13:04:02Z")

</div>

When I was doing the automatic differentiation operation encountered some problems, let’s look at my examples firstly: Julia Version 1.9.3 julia\> using TensorRules julia\> using Zygote julia\> using TensorOperations ju…

---

## [Tullio broadcasting issue](https://discourse.julialang.org/t/tullio-broadcasting-issue/107321)

<div class="topic-metadata">

**Author:** [@swanchristmas](https://discourse.julialang.org/u/swanchristmas)\
**Replies:** 4\
**Last updated:** [December 9, 2023, 11:46am UTC](https://discourse.julialang.org/t/tullio-broadcasting-issue/107321 "2023-12-09T11:46:28Z")

</div>

@tensor tmp1\[m,s,n,p\] := -λ\[l,m,s\]\*ω\[l,k\]\*λ\[k,n,p\] + λ\[l,m,s\]\*g\[l,n\]\*ones(2)\[p\]) @tullio tmp2\[m,s,n,p\] := -λ\[l,m,s\]\*ω\[l,k\]\*λ\[k,n,p\] + λ\[l,m,s\]\*g\[l,n\] tmp1 turns out to be different from tmp2. It seems that @tullio perfo…

---

## [TensorOperations.jl v4](https://discourse.julialang.org/t/tensoroperations-jl-v4/101839)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 0\
**Last updated:** [July 20, 2023, 1:26pm UTC](https://discourse.julialang.org/t/tensoroperations-jl-v4/101839 "2023-07-20T13:26:19Z")

</div>

Together with @lkdvos and @maarten\_van\_damme , I am pleased to announce version 4 of TensorOperations.jl. As a user, the main functionality provided @tensor remains mostly unchanged, but there are quite a few exciting b…

---

## [Tensor operation in Julia](https://discourse.julialang.org/t/tensor-operation-in-julia/99154)

<div class="topic-metadata">

**Author:** [@Javad\_Vahedi](https://discourse.julialang.org/u/Javad_Vahedi)\
**Replies:** 3\
**Last updated:** [May 20, 2023, 9:57am UTC](https://discourse.julialang.org/t/tensor-operation-in-julia/99154 "2023-05-20T09:57:13Z")

</div>

Dear Julia, What is the best way to rewrite the following code from Python to Julia? def ctwa(U, B, J, F): # B shape, (n,m) # U shape, (n,m) # J shape, (n,n,m,m) # F shape, (m,m,m) BUF = np.einsum(‘jb,jc,abc-\>ja’…

---

## [Does TensorOperations.jl not support Zygote.jl?](https://discourse.julialang.org/t/does-tensoroperations-jl-not-support-zygote-jl/89174)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 1\
**Last updated:** [November 1, 2022, 3:11pm UTC](https://discourse.julialang.org/t/does-tensoroperations-jl-not-support-zygote-jl/89174 "2022-11-01T15:11:50Z")

</div>

julia\> using Zygote julia\> using TensorOperations julia\> function f(x) @tensor b\[i,k\] := x\[i,j\]\*x\[j,k\] sum(b) end f (generic function with 1 method) julia\> a=rand(10,10); julia\> gradient(f,a)…

---

## [Related or linked structures](https://discourse.julialang.org/t/related-or-linked-structures/85463)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 0\
**Last updated:** [August 8, 2022, 7:45am UTC](https://discourse.julialang.org/t/related-or-linked-structures/85463 "2022-08-08T07:45:46Z")

</div>

Is it possible to connect data structures, similar to Primary-Key Foreign-Key connections in a relational database? One way could be to have a type similar to enum that would limit a field to a given set of values. Usi…

---

## [TensorsOperations, lookups and functions](https://discourse.julialang.org/t/tensorsoperations-lookups-and-functions/85140)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 2\
**Last updated:** [August 2, 2022, 6:00am UTC](https://discourse.julialang.org/t/tensorsoperations-lookups-and-functions/85140 "2022-08-02T06:00:17Z")

</div>

is there functionality like TensorOperations that supports functions and named lookups? I have an array of deals. Each specifies a curve, and needs to be valued over many simulated iterations of the curve. I’d like to w…
