From 960ff4376a370e5bf8413d0dd5b4957e10121c46 Mon Sep 17 00:00:00 2001 From: Mason Protter Date: Sat, 9 Dec 2023 12:43:04 +0100 Subject: [PATCH] Add note about reduction scope --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index fc2a420..dc114dc 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,17 @@ dbl!(M, S) @test all(M[r,c] == 2*S[1,c] for r ∈ 1:3, c ∈ 1:7) ``` +**Note:** + +Unlike most other einstein summation convections, Tullio will wrap the entire right hand side in a reduction, and will not attempt to do term-wise contractions. +Hence, writing expressions like +```juia +@tullio D[i, j] := A[i, k] * B[k, j] + c[i] +``` +is *not* the same as $D_{ij} = \sum_{k}(A_{ik} B_{kj}) + c_i$ but instead $D_{ij} = \sum_{k}(A_{ik} B_{kj} + c_i)$. This is a natural consequence of Tullio attempting to support general reductions over general code. + +____________ + More complicated examples: ```julia