Hello,
I'm new to sage devel so I'll focus on my problem description.

What I need is to work with a "subsets quotient".

X = (in most cases finite) set

Y = P(X) power set of X

G subgroup of the permutation group over the elements of X

For g in G and x in X we know gx, the action of g over x.

I have to define the action of g over y in this way:

for y={y_1,\dots,y_k} in Y gy={gy_1,\dots,gy_k}.

I have also to take care of two structure over Y:

B=(Y,union,intersection) is a Boolean algebra, but for now I don't need it. 

P=(Y,inclusion as <=) is a poset.

Over the set of orbits G//Y I have this partial order: o<=o' iff exists 
y,y' s.t. y in o, y' in o' and y <= y'.

P is a poset, G//Y is a poset, I will call G//Y the "quotient of P", and I 
will write P/G.

#Now we arrive to Sage#

I'm wonder if I can define, for a general group G, a class from combinat 
that take care of my P/G structure. I need to work with representative 
elements of P/G, I need the structure of poset (in particular I need all 
work with chains in P/G).

Tanks to 
http://thales.math.uqam.ca/~saliola/sage/SienaLectures/worksheets/pdf/Worksheet_9__Combinatorics__Iterators_Generators_.pdf
 
(p.9), I tried to define this simple class (in which G=Z/nZ and I have 
troubles in __iter__ because in my second "if" in the "for" is wrong):

class Quotient(CombinatorialClass):
    def __init__(self,n):
        """
        The quotient class
        """
        self._n = n
        self._S = Subsets(range(self._n))

    def SumSet(self,s,k):
        if s == set([]):
            return set([])
        else:
            return set([ Mod(x+k,self._n) for x in s ])

    def __iter__(self):
        for s in self._S:
            if self._S.next(s) == None:
                yield s
            else:
                if any([ set(self._S.next(s)) == self.SumSet(t,k+1) for t 
in self._S for k in range(self._n-1) ]):
                    continue
                else:
                    yield s

    def __repr__(self):
        return "Quotient for %s" % self._n

I think that with a good definition of my action of G over Y in Sage, I can 
solve my problem but I'm not capable to do this kind of stuff alone :)

P.S.

For now I use gap.eval like this:

e=gap.eval('G := Group((1,2,3,4))')

e=gap.eval('s := Combinations([1,2,3,4])')

e=gap.eval("list := Orbits(G,s,OnSets)")

# in list I have all the orbits

M=FiniteSetMaps(list,[ l[1] for l in list])

def EstractRep(l):
    return l[1]

f = M(EstractRep)

dictionary = f.fibers()

# in dictionary I have the 1-1 relation between an orbit and one of its 
representative elements

# for chains extraction I''ll use some "for" with tests like this

gap.eval("IsSubset([1,2],[1])")

# I have some trouble with the following

gap.eval("IsSubset([[2,3],[1,2]],[1])")


Thank you very much,

Giulio. 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-combinat-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-combinat-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-combinat-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to