Ticket #6857: trac_6857.patch

File trac_6857.patch, 1.7 KB (added by rlm, 12 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User Robert L. Miller <rlm@rlmiller.org>
    # Date 1251853207 25200
    # Node ID 47ce1b6758ba76c83aca53afdc5708e46c7eca72
    # Parent  684eea91ff224e5bc6259ca19f1576c4c082b9d3
    Graphs: aut_gp orbits=True doesn't translate vertices back
    
    diff -r 684eea91ff22 -r 47ce1b6758ba sage/graphs/graph.py
    a b  
    83058305            sage: G.automorphism_group(return_group=False, order=True)
    83068306            120
    83078307       
    8308         Or, just the orbits (recall the Petersen graph is transitive!)
     8308        Or, just the orbits (note that each graph here is vertex transitive)
    83098309       
    83108310        ::
    83118311       
     
    83148314            [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]]
    83158315            sage: G.automorphism_group(partition=[[0],range(1,10)], return_group=False, orbits=True)
    83168316            [[0], [2, 3, 6, 7, 8, 9], [1, 4, 5]]
     8317            sage: C = graphs.CubeGraph(3)
     8318            sage: C.automorphism_group(orbits=True, return_group=False)
     8319            [['000', '001', '010', '011', '100', '101', '110', '111']]
    83178320
    83188321        """
    83198322        from sage.groups.perm_gps.partn_ref.refinement_graphs import perm_group_elt, search_tree
     
    84508453        if order:
    84518454            output.append(c)
    84528455        if orbits:
     8456            G_from = {}
     8457            for v in G_to:
     8458                G_from[G_to[v]] = v
    84538459            from sage.groups.perm_gps.partn_ref.refinement_graphs import get_orbits
    8454             output.append(get_orbits(a, self.num_verts()))
     8460            output.append([[G_from[v] for v in W] for W in get_orbits(a, self.num_verts())])
    84558461
    84568462        # A Python switch statement!
    84578463        return { 0: None,