Question: Powerset of a hashmset

How can I get the correct multiset power set of a hashmset in Maple? For example for the following hasmset s I have two different answers in Maple and MuPad. I need to compute MuPad like answer in Maple:

>s := hashmset:-new( [ a, 4 ], [ c,3 ] );
                  s := table(sparse, [a = 4, c = 3])

> combinat:-powerset(entries(s));

              [[], [[a, 4]], [[c, 3]], [[c, 3], [a, 4]]]

Whereas in MuPad I got the correct answer as follow:

  {{}, {[a, 1], [c, 2]}, {[c, 2]}, {[a, 1]}, {[c, 2], [a, 2]},

        {[a, 1], [c, 3]}, {[a, 2], [c, 3]}, {[a, 3], [c, 1]},

        {[c, 1], [a, 4]}, {[c, 2], [a, 3]}, {[c, 2], [a, 4]},

        {[a, 3], [c, 3]}, {[c, 3], [a, 4]}, {[c, 1], [a, 2]},

        {[c, 3]}, {[a, 3]}, {[a, 4]}, {[a, 1], [c, 1]}, {[c, 1]},

        {[a, 2]}}

thanks

Please Wait...