# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1363731554 3600
# Node ID c3b2b152c65064ab245e4ad7d9d108b66161e427
# Parent 2e980ea8d962d06b92cb2170a5965cd65d6fefcf
Orbits of tuples and sets  documentation
diff git a/sage/groups/perm_gps/permgroup.py b/sage/groups/perm_gps/permgroup.py
a

b


1068  1068  return [[self._domain_from_gap[x] for x in orbit] for orbit in 
1069  1069  self._gap_().Orbits(self._domain_gap()).sage()] 
1070  1070  
1071   supported_actions = ["OnPoints", "OnTuples", "OnSets", "OnPairs", "OnSetsSets", 
 1071  supported_actions = ["OnPoints", "OnTuples", "OnSets", "OnPairs", "OnSetsSets", 
1072  1072  "OnSetsDisjointSets", "OnSetsTuples", "OnTuplesSets", "OnTuplesTuples"] 
1073  1073  
1074  1074  @cached_method 
1075  1075  def orbit(self, point, action = "OnPoints"): 
1076  1076  """ 
1077   Return the orbit of a point under the group action in the list 
1078   `self.supported_actions`. 
1079   These are taken from `http://www.gapsystem.org/Manuals/doc/ref/chap41.html`_. 
 1077  Return the orbit of a point under a group action. 
 1078  
 1079  All actions available through this method can be obtained from 
 1080  `self.supported_actions`. They are taken from GAP's list 
 1081  `http://www.gapsystem.org/Manuals/doc/ref/chap41.html`_. 
1080  1082  
1081  1083  INPUT: 
1082  1084  
… 
… 

1085  1087  members must be sorted w.r.t. to the default order on them. 
1086  1088  
1087  1089   ``action`` (string)  if ``point`` is a tuple (of tuples) of points, this 
1088   variable describes how the group is acting. The list of possibilites is 
 1090  variable describes how the group is acting. The list of possibilites is 
1089  1091  is given by `self.supported_actions`. 
1090  1092  It is set to ``"OnPoints"`` by default. See below for examples. 
1091  1093  
… 
… 

1111  1113  
1112  1114  sage: S3.orbit((1,2), action = "OnTuples") 
1113  1115  [[1, 2], [2, 3], [2, 1], [3, 1], [1, 3], [3, 2]] 
1114   
 1116  
1115  1117  Action of `S_4` on sets of disjoint sets:: 
1116  1118  
1117  1119  sage: S4 = groups.permutation.Symmetric(4) 
… 
… 

1137  1139  else: 
1138  1140  points = [[self._domain_to_gap[x] for x in p] for p in point] 
1139  1141  orbits = self._gap_().Orbit(points, action).sage() 
1140   return [[[self._domain_from_gap[x] for x in p] for p in o] 
 1142  return [[[self._domain_from_gap[x] for x in p] for p in o] 
1141  1143  for o in orbits] 
1142  1144  
1143  1145  else: 
… 
… 

1147  1149  def action(self, domain, action = "OnPoints"): 
1148  1150  """ 
1149  1151  Return the permutation group induced by self acting on domain. 
1150   
 1152  
 1153  All actions available through this method can be obtained from 
 1154  `self.supported_actions`. They are taken from GAP's list 
 1155  `http://www.gapsystem.org/Manuals/doc/ref/chap41.html`_. 
 1156  
1151  1157  INPUT: 
1152  1158  
1153  1159   ``domain``  the list of things for which GAP knows how to compute 
1154  1160  the action of the permutation group. For instance it can be obtained by 
1155   calling :meth:`orbit`. 
1156   
1157    ``action`` (string)  the action on domain. Need not be limited to 
 1161  calling :meth:`orbit`. 
 1162  
 1163   ``action`` (string)  the action on domain. Need not be limited to 
1158  1164  `self.supported_actions`. 
1159  1165  It is set to ``"OnPoints"`` by default. See below for examples. 
1160  1166  
1161   EXAMPLES:: 
1162   
1163   Action of `S_5` on 2subsets:: 
 1167  EXAMPLES: 
 1168  
 1169  Action of `S_5` on 2subsets:: 
1164  1170  
1165  1171  sage: S5 = groups.permutation.Symmetric(5) 
1166  1172  sage: o10 = S5.orbit((1,2), action = "OnSets") 
1167  1173  sage: S5_10 = S5.action(o10, action = "OnSets"); S5_10 
1168  1174  Permutation Group with generators [(2,4)(6,9)(7,10), (1,2,3,5,7)(4,6,8,9,10)] 
1169   
1170   Nonfaithful action of `S_4` on sets of disjoint sets:: 
 1175  
 1176  Nonfaithful action of `S_4` on sets of disjoint sets:: 
1171  1177  
1172  1178  sage: S4 = groups.permutation.Symmetric(4) 
1173  1179  sage: o3 = S4.orbit(((1,2),(3,4)), action = "OnSetsDisjointSets") 