Gravifer/ Einstoff

Wolfram-native tensor-axis notation for reshaping, reducing, mapping, contracting, broadcasting, joining and splitting arrays

Contributed by: Gravifer

Einstoff provides a Wolfram-native, declarative notation for rearranging, reducing, mapping, contracting, broadcasting, joining, and splitting tensor axes. Shape descriptions use familiar Wolfram Language pattern forms at the surface and compile to a private staged representation before execution.

Installation Instructions

To install this paclet in your Wolfram Language environment, evaluate this code:
PacletInstall["Gravifer/Einstoff"]


To load the code after installation, evaluate this code:
Needs["Gravifer`Einstoff`"]

Details

Canonical descriptions use RuleDelayed to separate input-shape constraints from declarative output-shape derivation.
Targeted axes select reductions, mapped blocks, and contraction roles; untargeted axes are carried or broadcast according to the operation.
Einstoff is experimental. The public API is usable, while the supported notation and diagnostics may continue to evolve before a stable release.

Paclet Guide

Examples

Basic Examples (3) 

Rearrange an array by naming and reordering its axes:

In[1]:=
array = ArrayReshape[Range[24], {2, 3, 4}]; Dimensions[
 Einstoff[ArrayReshape][{{a_, b_, c_}} :> {{c, a, b}}, {array}]]
Out[1]=

Reduce a targeted axis while carrying the untargeted axis:

In[2]:=
Einstoff[ArrayReduce][
  Total][{{a_, #b}} :> {{a}}, {ArrayReshape[Range[6], {2, 3}]}]
Out[2]=

Contract a named axis shared by two tensors:

In[3]:=
Einstoff[
  Dot][{{a_, k_}, {k_, b_}} :> {{a, b}}, {ArrayReshape[
   Range[6], {2, 3}], ArrayReshape[Range[12], {3, 4}]}]
Out[3]=

Publisher

Gravifer

Compatibility

Wolfram Language Version 15.0

Version History

  • 0.2.0 – 15 August 2026

License Information

GNU General Public License v3.0 or later

Paclet Source

Source Metadata