Skip to content

various quality of life attempts for Muscle #59

Draft
starsfordummies wants to merge 15 commits intomasterfrom
ste/MuscleQOL
Draft

various quality of life attempts for Muscle #59
starsfordummies wants to merge 15 commits intomasterfrom
ste/MuscleQOL

Conversation

@starsfordummies
Copy link
Contributor

Based on the remove permutedims() PR (#58 ) so finalize that one first

Changes are all in QOL.jl for simplicity, can cherry pick.

  • Shorthand * for binary_einsum

  • Add helper function contract(::Tensor, ::Tensor, inds) to contract tensors over specified indices

  • More human printing for tensors, instead of printing all values focus on their indices, in my experience works best for debugging algorithms

  • Various helper functions to make all the rest work

@jofrevalles
Copy link
Member

Great! Have you seen speed-ups with these changes?

@starsfordummies
Copy link
Contributor Author

the only performance gain is with removing the permutedims of #58 - the rest is just helper functions, they don't need to be public or anything but I find that they make programming much less tedious

the idea is that if we have two tensors a[i,j,k] and b[j,l,m] we can compute (a*b)[i,k,l,m] by writing a*b and that's it (similar to what other libraries do..) .

With contract(), if we have two tensors like a[i,j,k] and b[l,m,n] and we want to contract the legs k and m, we do contract(a,b, :k, :m) and it does all the relabelling and contracting for us, returning ab[i,j,l,m]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants