def orbit_decomposition( L, cyc_act ):
    """
    Returns the orbit decomposition of L by the action of cyc_act

    INPUT:

    - L -- list

    - cyc_act -- function taking an element of L and returning an element of L (must define a bijection on L)

    OUTPUT:

    - a list of lists, the orbits under the cyc_act acting on L

    EXAMPLES::

        sage: from sage.combinat.cyclic_sieving_phenomenon import *
        sage: S42 = [ Set(S) for S in subsets([1,2,3,4]) if len(S) == 2 ]; S42
        [{1, 2}, {1, 3}, {2, 3}, {1, 4}, {2, 4}, {3, 4}]
        sage: cyc_act = lambda S: Set( i.mod(4)+1 for i in S)
        sage: cyc_act([1,3])
        {2, 4}
        sage: cyc_act([1,4])
        {1, 2}
        sage: orbit_decomposition( S42, cyc_act )
        [[{2, 4}, {1, 3}], [{1, 2}, {2, 3}, {3, 4}, {1, 4}]]
    """
    orbits = []
    L_prime = set(L)
    while L_prime != set():
        obj = L_prime.pop()
        orbit = [obj]
        obj = cyc_act( obj )
        while obj in L_prime:
            orbit.append( obj )
            L_prime.remove( obj )
            obj = cyc_act( obj )
        orbits.append( orbit )
    return orbits