Welcome to Cadabra Q&A, where you can ask questions and receive answers from other members of the community.
+1 vote

It is possible to split sums based on dummy indices:

{m,n,p,q,r}::Indices(space1, parent=full).
{a,b,c,d,e}::Indices(space2, parent=full).

ex:=A_{M d Q R} B_{M p Q R};
split_index(_, $M,m,a$);

Can something like this be used for free indices too?

For example, I want:

ex := A_{m p} + A_{a p};

This should split the tensor into two tensors. Graphically, this would split the matrix into two smaller matrices based on their columns, and missing values will be set to zero.

This can be extended for more complicated splits. In this case, one would have to somehow specify splits based on subgroups of indices.

For example, one might want to split a tensor based on an arbitrary set of indices. I.e. given tensor A_{x1 x2 ... xN}, get some specific indices {x1 x2 ... xN} into one tensor, and the rest in another tensor.

in Feature requests by


I wanted to ask if you figured out how to do this since I also need to use it for my code. Thanks.

Please log in or register to answer this question.