Tensorial.jl

Introduction

Tensorial.jl provides statically sized Tensor type that is compatible with AbstractArray, similar to SArray from StaticArrays.jl. In addition to supporting basic AbstractArray operations, the package offers a tensorial interface and several advanced features:

  • Contraction, tensor product (), and a flexible @einsum macro for Einstein summation convention
  • A @Symmetry macro to define the tensor symmetries, eliminating unnecessary calculations
  • Automatic differentiation via gradient and hessian functions, leveraging ForwardDiff.jl
  • Performance comparable to SArray (see benchmarks)

Installation

pkg> add Tensorial

Other tensor packages

Inspiration

Some functionalities are inspired from the following packages: