Einsum.jl
Einsum.jl copied to clipboard
Einstein summation notation in Julia
MWE: ``` using DynamicPolynomials julia> using Einsum julia> @ncpolyvar a[1:2,1:2] (PolyVar{false}[a₁₋₁ a₁₋₂; a₂₋₁ a₂₋₂],) julia> @ncpolyvar b[1:2,1:2] (PolyVar{false}[b₁₋₁ b₁₋₂; b₂₋₁ b₂₋₂],) julia> @einsum c[x,y] := a[x,z]*b[z,y] ERROR: InexactError: convert(PolyVar{false}, a[1,1]*b[1,1]...
Heya, I have some issues taking the trace of a matrix or other _complete reductions_. I assumed this should work: ```julialang julia> using Einsum; julia> a = [1 0; 0...
If, say, `params` is a struct, it should be possible to write: `@einsum params.x[i,j,k] = params.y[i,j]*params.z[j, k]` This does seem to work in `TensorOperations.jl`
Suppose I have the following case ```julia julia> using Einsum; julia> a = [1, 2]; julia> b = [1 2; 3 4]; julia> c = a+b*a # what I would...
Compared to `numpy.einsum`, `Einsum.jl` seems to be quite slow. I wonder if there is some room for improvements on this side: ### numpy ``` python import numpy as np import...
During work on tensor differentiation, I've found that derivative `dC/dA` of matrix multiplication `C = A * B` may be expressed as: ``` dCdA[i, j, m, n] = (i ==...
This introduces additional capabilities for handling multiple different offsets for RHS index expressions as well as a modified convention for un-allocated negative indices.
Hi, for my use-cases (quantum dynamics solvers) it would be super useful to be able to specify integer offsets in the indices. As an example ``` E.g., A = zeros(10);...
For example, I have the following sum rule: ```julia @einsum T′[i, j] := T[k, l] * Q[i, k] * Q[j, l] ``` and the macro-expanded code for above is: ```julia...