Пример #1
0
 def maximal_isotropic_subgroup(self):
     r"""
     Returns the maximal isotropic subgroup of self. 
     """
     S=list()
     for a in self._D:
         if(self.Q(a)==0 and a<>0):
             S.append(a)
     # S is now a list of all isotropic elements except 0
     PS=list(powerset(S))
     PS.reverse()
     # PS now contains all subsets of isotropic elements (except 0)
     # with decreasing sizes. We now need to find the first, which together with 0
     # is a group.
     #print "PS=",PS
     for A in PS:
         A.append(0)
         #print "Test the isotropic set: S=",A
         ok=True
         for x in A:
             for y in A:
                 z=red_mod1(x+y)
                 if(not z in A):
                     #print "S was not a subgroup!"
                     ok=False
         if(ok):
             A.sort()
             return A
     raise ArithmeticError, "Could not find maximal isotropic subgroup!"
Пример #2
0
 def maximal_isotropic_subgroup(self):
     r"""
     Returns the maximal isotropic subgroup of self. 
     """
     S=list()
     for a in self._D:
         if self.Q(a) == 0 and a != 0:
             S.append(a)
     # S is now a list of all isotropic elements except 0
     PS=list(powerset(S))
     PS.reverse()
     # PS now contains all subsets of isotropic elements (except 0)
     # with decreasing sizes. We now need to find the first, which together with 0
     # is a group.
     #print "PS=",PS
     for A in PS:
         A.append(0)
         #print "Test the isotropic set: S=",A
         ok=True
         for x in A:
             for y in A:
                 z=red_mod1(x+y)
                 if(not z in A):
                     #print "S was not a subgroup!"
                     ok=False
         if(ok):
             A.sort()
             return A
     raise ArithmeticError("Could not find maximal isotropic subgroup!")
Пример #3
0
 def invariant_trace_field_generators(self):
     gens = self.generators()
     if min([abs(self(g).trace()) for g in gens]) < 0.001:
         raise ValueError(
             "Algorithm fails when a generator has trace 0, see page 125 of ML"
         )
     gens = [2 * g for g in gens]
     enough_elts = [
         ''.join(sorted(s)) for s in powerset(gens) if len(s) > 0
     ]
     return [self(w).trace() for w in enough_elts]
Пример #4
0
 def trace_field_generators(self):
     gens = self.generators()
     enough_elts = [
         ''.join(sorted(s)) for s in powerset(gens) if len(s) > 0
     ]
     return [self(w).trace() for w in enough_elts]