I have the following question:
Let $a,b,c,d$ be four natural numbers with $a \leq b$ and $c\leq d$.
I have written a program that produces a list, which has as entries all 2-tuples $(x,y)$ with $x\in [a..b]$ and $y \in [c..d]$.
Now, I have a new list, let's call it list_1. It consists of elements indexed by the $(x,y)$.
For example, let a=3, b=4, c=7, d=8.
Then my programm produces list=[[3,7],[3,8],[4,7],[4,8]].
Now, my list_1 is [M_{3,7},M_{3,8},M_{4,7},M_{4,8}].
Then I take the direct sum of all modules in list_1 and call this direct sum $M$.
I would like to have a new list, call it list_2, which has exactly all direct summands of $M$ as entries.
In our example, list_2 looks like this:
$[(M_{3,7}),(M_{3,8}),(M_{4,7}),(M_{4,8}), (M_{3,7}\oplus M_{3,8}),(M_{3,7} \oplus M_{4,7}),(M_{3,7} \oplus M_{4,8}),(M_{3,8} \oplus M_{4,7}),(M_{3,8} \oplus M_{4,8}),(M_{4,7} \oplus M_{4,8}), (M_{3,7} \oplus M_{3,8} \oplus M_{4,7}),(M_{3,7} \oplus M_{3,8} \oplus M_{4,8}),(M_{3,7} \oplus M_{4,7} \oplus M_{4,8}),(M_{3,8} \oplus M_{4,7} \oplus M_{4,8}),(M_{3,7}\oplus M_{3,8} \oplus M_{4,7} \oplus M_{4,8})]$.
I would like to have this in general for arbitrary natural numbers $a,b,c,d$ with $a \leq b$ and $c\leq d$.
I would be very grateful, if somebody was able to send me a pseudo-code. I would like to implement this in GAP, or, more specifically, with the GAP package qpa.
Thanks for the help!
Expanding my former comment, first we create a cartesian product of ranges:
Then we may enumerate all non-empty combinations of
kelements oflist1as follows:Hope it should be now easy to adapt this code to perform calculations that you have in mind.