RepositoryJulia
Ferrite-FEM

Ferrite-FEM/Tensors.jl

Efficient computations with symmetric and non-symmetric tensors with support for automatic differentiation.

182stars
41forks
26issues
4views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: finite-elements

#1 Repository of the month

1
TINIX TRENDING·Topic: symmetric-tensors

#1 Repository of the month

1
TINIX TRENDING·Topic: tensor

#1 Repository of the month

Tensors.jl

Efficient computations with symmetric and non-symmetric tensors with support for automatic differentiation.

DocumentationBuild Status

Introduction

This Julia package provides fast operations with symmetric and non-symmetric tensors of order 1, 2 and 4. The tensors are allocated on the stack which means that there is no need to preallocate output results for performance. Unicode infix operators are provided such that the tensor expression in the source code is similar to the one written with mathematical notation. When possible, symmetry of tensors is exploited for better performance. Supports Automatic Differentiation to easily compute first and second order derivatives of tensorial functions.

Installation

The package can be installed with the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:

pkg> add Tensors

Or, equivalently, via the Pkg API:

julia> import Pkg; Pkg.add("Tensors")

Documentation

  • STABLE — most recently tagged version of the documentation.

Project Status

The package is tested against Julia 1.X on Linux, macOS, and Windows.

Contributing and Questions

Contributions are very welcome, as are feature requests and suggestions. Please open an issue if you encounter any problems.

Things to work on

If you are interested in contributing to Tensors.jl, here are a few topics that can get you started:

  • Implement support for third order tensors. These are more rarely used than first, second and fourth order tensors but are still useful in some applications. It would be good to support this.
  • Find a way to reduce code duplication without sacrificing performance or compilation time. Currently, there is quite a lot of code duplication in the implementation of different operators. It should be possible to have a higher level code generation framework that generates optimized functions from pretty much only the Einstein summation notation for the operation.
  • Tensors.jl has been developed with mostly the application to continuum mechanics in mind. For other fields, perhaps other tensor operations are useful. Implement these in a well performant manner and give good test coverage and documentation for the new functionalities.

Citing Tensors.jl

If you use Tensors.jl for research and publication, please cite the following article

@article{Tensors.jl,
  title = {Tensors.jl -- Tensor Computations in Julia},
  author = {Carlsson, Kristoffer and Ekre, Fredrik},
  year = {2019},
  journal = {Journal of Open Research Software},
  doi = {10.5334/jors.182},
}

Both the packages below provide a convenience macro to provide einstein summation notation for standard Julia Array's:

Similar Projects

Discover other similar projects and AI models.

RepositoryJulia
chakravala/Grassmann.jl

⟨Grassmann-Clifford-Hodge⟩ differential geometric algebra

521
Nov 14, 2026
RepositoryPython
tumaer/JAXFLUIDS

Differentiable Fluid Dynamics Package

679
Aug 28, 2026
RepositoryRust
raskr/rust-autograd

Tensors and differentiable operations (like TensorFlow) in Rust

503
Jun 2, 2026
RepositoryC++
roastduck/FreeTensor

A language and compiler for irregular tensor programs.

153
Sep 18, 2026
RepositoryJulia
FluxML/Zygote.jl

21st century AD

1.6k
Nov 26, 2026
RepositoryJulia
JuliaDiff/ForwardDiff.jl

Forward Mode Automatic Differentiation for Julia

1.0k
Nov 16, 2026
RepositoryJulia
gridap/Gridap.jl

Grid-based approximation of partial differential equations in Julia

891
Dec 1, 2026
RepositoryJulia
SciML/Optimization.jl

Mathematical Optimization in Julia. Local, global, gradient-based and derivative-free. Linear, Quadratic, Convex, Mixed-Integer, and Nonlinear Optimization in one simple, fast, and differentiable interface.

852
Dec 1, 2026
RepositoryJulia
EnzymeAD/Enzyme.jl

Julia bindings for the Enzyme automatic differentiator

595
Nov 29, 2026