Changeset 8381:8af290b3f48d


Ignore:
Timestamp:
12/11/07 15:19:03 (5 years ago)
Author:
jvoight@…
Branch:
default
Message:

merge

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sage/rings/number_field/totallyreal.py

    r8376 r8381  
    4747    This function returns the unconditional Odlyzko bound for the root 
    4848    discriminant of a totally real number field of degree n. 
    49      
     49 
    5050    NOTE: 
    5151    The bounds for n > 50 are not necessarily optimal. 
     
    5353    INPUT: 
    5454    n -- integer, the degree 
    55   
     55 
    5656    OUTPUT: 
    5757    a lower bound on the root discriminant 
     
    8787def enumerate_totallyreal_fields(n, B, a = [], verbose=0, return_seqs=False, phc=False, keep_fields=False): 
    8888    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$ 
    9292    corresponds to a polynomial by 
    9393        $$ 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. 
    9595    If verbose == 1 (or 2), then print to the screen (really) verbosely; if 
    9696    verbose is a string, then print verbosely to the file specified by verbose. 
    9797    If return_seqs, then return the polynomials as sequences (for easier 
    9898    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 
    100100    an integer, then keep fields up to that integer. 
    101101 
    102     NOTE:  
     102    NOTE: 
    103103    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. 
    105105 
    106106    INPUT: 
     
    112112 
    113113    OUTPUT: 
    114     the list of fields with entries [d,f], where  
     114    the list of fields with entries [d,f], where 
    115115      d is the discriminant and f is a defining polynomial, 
    116116    sorted by discriminant. 
     
    155155 
    156156    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 
    158158    modifications due to Takeuchi [T] and the author (not yet published). 
    159159 
     
    163163    then given a[n-1] and a[n-2], one can recursively compute bounds on 
    164164    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 
    166166    Rolle's theorem!  See [T] for more details. 
    167167 
    168168        REFERENCES: 
    169             [C] Henri Cohen, Advanced topics in computational number  
     169            [C] Henri Cohen, Advanced topics in computational number 
    170170                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 
    173173                degree 9 with small discriminant, Saitama Math. J. 
    174174                17 (1999), 63--85 (2000). 
     
    185185    if (n < 1): 
    186186        raise ValueError, "n must be at least 1." 
    187      
     187 
    188188    # Initialize 
    189189    T = tr_data(n,B,a) 
     
    212212            sys.stdout = fsock 
    213213        # Else, print to screen 
     214 
    214215    f_out = [0]*n + [1] 
     216 
    215217    if verbose == 2: 
    216218        T.incr(f_out,verbose,phc=phc) 
     
    222224            print "==>", f_out, 
    223225 
    224         nf = pari(str(f_out)).Polrev() 
     226        nf = pari(f_out).Polrev() 
    225227        d = nf.poldisc() 
    226228        counts[0] += 1 
    227         if d > 0: 
     229        if d > 0 and nf.polsturm_full() == n: 
    228230            da = int_has_small_square_divisor(Integer(d)) 
    229231            if d > dB or d <= B*da: 
     
    375377def __selberg_zograf_bound(n, g): 
    376378    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 
    378380    totally real field of degree n which gives rise to an arithmetic 
    379381    Fuchsian group of genus g.  The bound is: 
     
    395397    """ 
    396398    return ((16./3)*(g+1))**(2./(3*n))*(2*3.1415926535897931)**(4./3) 
     399 
  • sage/rings/number_field/totallyreal_dsage.py

    r8378 r8381  
    160160                self.jobs.append([a,job]) 
    161161 
     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 
    162175    def load_jobs(self, A, split=False): 
    163176        self.init_jobs(self.n, self.B, A, split) 
     
    220233            if type(self.jobs[i][1]) <> str: 
    221234                # 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] 
    224238 
    225239                    # Add the timings. 
     
    251265 
    252266                    fsock.close() 
     267                    self.jobs.pop(i) 
    253268 
    254269                # Otherwise, continue.   
  • setup.py

    r8380 r8381  
    776776    Extension('sage.rings.number_field.totallyreal_data', 
    777777              ['sage/rings/number_field/totallyreal_data.pyx'], 
    778               libraries = ['gmp']), 
     778              libraries = ['gmp']), \ 
    779779 
    780780    Extension('sage.rings.morphism', 
    781               sources = ['sage/rings/morphism.pyx']), 
     781              sources = ['sage/rings/morphism.pyx']), \ 
    782782 
    783783    Extension('sage.structure.wrapper_parent', 
Note: See TracChangeset for help on using the changeset viewer.