How to manage tensors #761
EmilyBourne
started this conversation in
Ideas
Replies: 3 comments 5 replies
-
cc: @tpadioleau @jbigot |
Beta Was this translation helpful? Give feedback.
0 replies
-
What kind of operation you want to support ? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I worked a lot on this topic in my project https://blegouix.github.io/similie/tensor_module.html |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure if this is out of scope for DDC or not.
I need to add tensors to my code (e.g. metric tensor, gradient vector). Doing this cleanly requires several of the concepts that DDC introduces. However this work is not about discontinuous dimensions hence why it may be out of scope.
I think this could be managed with a
Tensor
type. E.g:I am happy to provide a PoC for this if you think it is in scope.
It may be helpful to bring
TypeSeq
out ofdetail/
in order to implement this.In the places where I would use this type I would also be interested in typing my dimensions depending on whether they are covariant/contravariant. This could probably be avoided in DDC if it is out of scope but I mention it already as it will play a much more important role in any implementation of a
tensor_mul
function.E.g. a dot product may be implemented like this:
Therefore if co/contravariant concepts are not added along with tensor concepts any
tensor_mul
functions may be unusable.This addition wouldn't necessarily force all users to care about co/contravariance.
For codes that don't care about co/contravariance (e.g. because they use cartesian coordinates) it is possible to write:
Beta Was this translation helpful? Give feedback.
All reactions