Changeset 8381:8af290b3f48d
- Timestamp:
- 12/11/07 15:19:03 (5 years ago)
- Branch:
- default
- Files:
-
- 3 edited
-
sage/rings/number_field/totallyreal.py (modified) (11 diffs)
-
sage/rings/number_field/totallyreal_dsage.py (modified) (3 diffs)
-
setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/rings/number_field/totallyreal.py
r8376 r8381 47 47 This function returns the unconditional Odlyzko bound for the root 48 48 discriminant of a totally real number field of degree n. 49 49 50 50 NOTE: 51 51 The bounds for n > 50 are not necessarily optimal. … … 53 53 INPUT: 54 54 n -- integer, the degree 55 55 56 56 OUTPUT: 57 57 a lower bound on the root discriminant … … 87 87 def enumerate_totallyreal_fields(n, B, a = [], verbose=0, return_seqs=False, phc=False, keep_fields=False): 88 88 r""" 89 This function enumerates (primitive) totally real fields of 90 degree $n>1$ with discriminant $d \leq B$; optionally one can 91 specify the first few coefficients, where the sequence $a$ 89 This function enumerates (primitive) totally real fields of 90 degree $n>1$ with discriminant $d \leq B$; optionally one can 91 specify the first few coefficients, where the sequence $a$ 92 92 corresponds to a polynomial by 93 93 $$ a[d]*x^n + ... + a[0]*x^(n-d) $$ 94 if length(a) = d+1, so in particular always a[d] = 1. 94 if length(a) = d+1, so in particular always a[d] = 1. 95 95 If verbose == 1 (or 2), then print to the screen (really) verbosely; if 96 96 verbose is a string, then print verbosely to the file specified by verbose. 97 97 If return_seqs, then return the polynomials as sequences (for easier 98 98 exporting to a file). 99 If keep_fields, then keep fields up to B*log(B); if keep_fields is 99 If keep_fields, then keep fields up to B*log(B); if keep_fields is 100 100 an integer, then keep fields up to that integer. 101 101 102 NOTE: 102 NOTE: 103 103 This is guaranteed to give all primitive such fields, and 104 seems in practice to give many imprimitive ones. 104 seems in practice to give many imprimitive ones. 105 105 106 106 INPUT: … … 112 112 113 113 OUTPUT: 114 the list of fields with entries [d,f], where 114 the list of fields with entries [d,f], where 115 115 d is the discriminant and f is a defining polynomial, 116 116 sorted by discriminant. … … 155 155 156 156 NOTES: 157 This function uses Hunter's algorithm [C, Section 9.3] and 157 This function uses Hunter's algorithm [C, Section 9.3] and 158 158 modifications due to Takeuchi [T] and the author (not yet published). 159 159 … … 163 163 then given a[n-1] and a[n-2], one can recursively compute bounds on 164 164 a[n-3], ..., a[0] using the fact that the polynomial is totally real 165 by looking at the zeros of successive derivatives and applying 165 by looking at the zeros of successive derivatives and applying 166 166 Rolle's theorem! See [T] for more details. 167 167 168 168 REFERENCES: 169 [C] Henri Cohen, Advanced topics in computational number 169 [C] Henri Cohen, Advanced topics in computational number 170 170 theory, Graduate Texts in Mathematics, vol. 193, 171 Springer-Verlag, New York, 2000. 172 [T] Kisao Takeuchi, Totally real algebraic number fields of 171 Springer-Verlag, New York, 2000. 172 [T] Kisao Takeuchi, Totally real algebraic number fields of 173 173 degree 9 with small discriminant, Saitama Math. J. 174 174 17 (1999), 63--85 (2000). … … 185 185 if (n < 1): 186 186 raise ValueError, "n must be at least 1." 187 187 188 188 # Initialize 189 189 T = tr_data(n,B,a) … … 212 212 sys.stdout = fsock 213 213 # Else, print to screen 214 214 215 f_out = [0]*n + [1] 216 215 217 if verbose == 2: 216 218 T.incr(f_out,verbose,phc=phc) … … 222 224 print "==>", f_out, 223 225 224 nf = pari( str(f_out)).Polrev()226 nf = pari(f_out).Polrev() 225 227 d = nf.poldisc() 226 228 counts[0] += 1 227 if d > 0 :229 if d > 0 and nf.polsturm_full() == n: 228 230 da = int_has_small_square_divisor(Integer(d)) 229 231 if d > dB or d <= B*da: … … 375 377 def __selberg_zograf_bound(n, g): 376 378 r""" 377 Returns an upper bound on the possible root discriminant of a 379 Returns an upper bound on the possible root discriminant of a 378 380 totally real field of degree n which gives rise to an arithmetic 379 381 Fuchsian group of genus g. The bound is: … … 395 397 """ 396 398 return ((16./3)*(g+1))**(2./(3*n))*(2*3.1415926535897931)**(4./3) 399 -
sage/rings/number_field/totallyreal_dsage.py
r8378 r8381 160 160 self.jobs.append([a,job]) 161 161 162 def recover(self): 163 jobs = self.D.get_my_jobs(True) 164 find_str = '(' + str(self.n) + ',' + str(self.B) 165 jobs_v = [j[0] for j in self.jobs] 166 for i in range(len(jobs)): 167 jc = jobs[i].code 168 try: 169 jc.index(find_str) 170 v = eval(jc[jc.find('['):jc.find(']')+1]) 171 self.jobs[jobs_v.index(v)][1] = jobs[i] 172 except ValueError: 173 v = [] 174 162 175 def load_jobs(self, A, split=False): 163 176 self.init_jobs(self.n, self.B, A, split) … … 220 233 if type(self.jobs[i][1]) <> str: 221 234 # self.jobs[i][1].get_job() 222 if self.jobs[i][1].status == 'completed' and self.jobs[i][1].result <> 'None': 223 job = self.jobs.pop(i) 235 if self.jobs[i][1].status == 'completed' and not self.jobs[i][1].result in ['None', '']: 236 print "Compiling job", i, "with", self.jobs[i][0] 237 job = self.jobs[i] 224 238 225 239 # Add the timings. … … 251 265 252 266 fsock.close() 267 self.jobs.pop(i) 253 268 254 269 # Otherwise, continue. -
setup.py
r8380 r8381 776 776 Extension('sage.rings.number_field.totallyreal_data', 777 777 ['sage/rings/number_field/totallyreal_data.pyx'], 778 libraries = ['gmp']), 778 libraries = ['gmp']), \ 779 779 780 780 Extension('sage.rings.morphism', 781 sources = ['sage/rings/morphism.pyx']), 781 sources = ['sage/rings/morphism.pyx']), \ 782 782 783 783 Extension('sage.structure.wrapper_parent',
Note: See TracChangeset
for help on using the changeset viewer.
