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


one can assign integers 0 to d to indices a,b,c,d with the command


How can we assign a set of integers, say, (0,1,5,6) to the indices? I tried


but I got a Kernel crash. Thanks :)

in General questions by (700 points)

1 Answer

+2 votes
Best answer

Good one; not possible right now, I'll put it on the list. However, you can assign such sets to Indices for the purposes of evaluate: you can do

ex:= A_{a} A_{a};
rl:= [ A_{1} = 3, A_{5} = 6 ];
evaluate(ex, rl);

to get '45'.

(Note: evaluate currently only looks at the values argument of Indices, not at any Integer property attached to the indices).

by (76.2k points)
selected by

Thanks for your helpful comments, Kasper!