1
0
Fork
You've already forked Einstoff.wl
0
A Wolfram eDSL for n-D array massaging
  • Wolfram Language 98.5%
  • Python 1.5%
2026年07月10日 00:35:31 +08:00
.agents feat(dot): lower named sequence zip products 2026年07月07日 23:25:22 +08:00
.claude fix(parsing): #️⃣ centralize axis-name resolution to unify namespacing (`Context`s) 2026年06月30日 16:43:41 +08:00
.codex docs(agents): add note on Python cross-validation flakiness 2026年07月04日 00:33:48 +08:00
.vscode chore(vscode): add notebook generation task 2026年07月06日 15:53:31 +08:00
agent-explore feat(map): 👔 make the targeting closer to built-in semantics 2026年07月05日 23:21:41 +08:00
docs feat(map): split operate from generalized map 2026年07月07日 19:47:30 +08:00
Einstoff refactor(kernel): group core and operator sources 2026年07月08日 00:48:23 +08:00
scripts feat(test): render wlt comments as notebook text 2026年07月05日 09:19:27 +08:00
tests feat(dot): lower named sequence zip products 2026年07月07日 23:25:22 +08:00
.editorconfig chore(config): refine editorconfig conventions 2026年07月06日 15:59:21 +08:00
.gitignore chore: build paclet archive 2026年07月08日 00:34:38 +08:00
.python-version
agent-explore.wl fix(parse): 🐛 remove anonymous function from matchAll 2026年06月27日 21:37:24 +08:00
AGENTS.md docs(repo): draft forge readiness files 2026年07月06日 15:47:53 +08:00
CHANGELOG.md docs(repo): draft forge readiness files 2026年07月06日 15:47:53 +08:00
CLAUDE.md docs(repo): draft forge readiness files 2026年07月06日 15:47:53 +08:00
CONTRIBUTING.md docs(repo): clarify local test expectations 2026年07月06日 20:17:51 +08:00
cspell.json
human-explore.nb chore: build paclet archive 2026年07月08日 00:34:38 +08:00
LICENSE docs(repo): draft forge readiness files 2026年07月06日 15:47:53 +08:00
pyproject.toml build: add wolframclient 2026年06月28日 15:16:59 +08:00
README.md docs(credit): attribute to einx in the README 2026年07月06日 22:44:02 +08:00
uv.lock build: add wolframclient 2026年06月28日 15:16:59 +08:00
wc-post-09Jul2026.nb chore: get the post notebook to work in cloud 2026年07月10日 00:35:31 +08:00

Einstoff

Einstoff is an experimental Wolfram Language package for writing tensor and array-axis transformations as Wolfram expressions instead of string mini-languages. It uses native pattern objects such as a_, _, __, ___, CircleTimes (), CirclePlus (), Slot, Highlighted, and Framed as the shape description AST.

The planned destination is ResourceFunction["Einstoff"]. For now this repository is an unreleased development tree.

What It Does

Inspired by einx, Einstoff covers a growing subset of ein-style array notation:

  • Einstoff[ArrayReshape] for bijective rearrange/reshape operations.
  • Einstoff["Massage"] for the permissive single-tensor structural engine, including repetition, direct sums, and pairwise within-tensor contraction.
  • Einstoff[ArrayReduce][f] for targeted reductions.
  • Einstoff[Map][f] for shape-preserving targeted block maps.
  • Einstoff[Dot] and Einstoff[Inner][mul, add] for cross-tensor contractions.
  • Einstoff[Join] and Einstoff[Split] for structural direct sums.
  • Einstoff["einsum"] for the implemented pairwise einsum-style subset.

The primary user reference is docs/Einstoff.en.md. The developer and agent-facing design notes live under .agents/.

Example

PacletDirectoryLoad[Directory[]];Needs["Einstoff`"];x=ArrayReshape[Range[2*3*4],{2,3,4}];Einstoff[ArrayReshape][{{a_,b_,c_}}:>{{c,a,b}},{x}]

The shape description above says: infer axes a, b, and c from the input, then return the same data with axes ordered as c, a, b.

Targeted axes use Wolfram wrappers rather than einx's bracket syntax:

Einstoff[ArrayReduce][Total][{{a_,Slot["b"]}}:>{{a}},{ArrayReshape[Range[6],{2,3}]}]

Repository Layout

  • Einstoff/ contains the Wolfram paclet-style package sources.
  • docs/Einstoff.en.md is the public reference documentation draft.
  • tests/*.wlt are the source unit tests.
  • tests/python/*.wlt are opt-in cross-validation tests against einx, einops, and NumPy where applicable.
  • tests/EinstoffTestSuite.nb is generated from the .wlt tests for maintainer use.
  • .agents/agents.md, .agents/SPEC.md, and .agents/plans/ are developer and coding agent materials.

Getting Started

Have your own Wolfram Language system ready. Einstoff currently targets Wolfram Language 14.0 or newer, and the test suite runs through wolframscript.

Python is used only for the optional cross-validation harness:

uv sync

Run the default Wolfram-only suite from the repository root:

wolframscript -script scripts/run-tests.wls -q

Run optional Python cross-validation:

wolframscript -script scripts/run-tests.wls python -q

The Python tests use ExternalEvaluate and ZMQ; on some Windows/sandboxed setups, Python session startup can be flaky even when the Wolfram-only suite is healthy.

See CONTRIBUTING.md for more details.

Status

Einstoff is pre-release. Public APIs, messages, and documentation may still change. The changelog will stay under Unreleased until the project is packaged and published.

License

Einstoff is licensed under the GNU General Public License v3.0 or later. See LICENSE.