Attachment 'approximation_of_integral.sage'

Download

   1 def CompApprox(E, tau, l = 0, an=None):
   2    
   3    # delta determines how close we would like to get to our answer
   4    delta = E.period_lattice().basis()[0] / (2 * E.torsion_order() )
   5    print 'delta: ',delta
   6    if l == 0:
   7        epsilon = imag_part(tau)
   8    else:
   9        epsilon = l * imag_part(tau)
  10       
  11    # How far we need to sum given delta (and epsilon)
  12    M = ceil((-1/(2*pi*epsilon))*ln(delta*9999/10000*(1-exp(-2*pi*epsilon))))
  13    print 'M: ',M
  14    if M>10^9:
  15        print 'Warning: M large'
  16       
  17    # Given delta and M, let's determine the bits of precision necessary
  18    # to carry out the computations to our wanted degree of accuracy.
  19   
  20    b=max(ceil(log(2*pi*M,2) - log(log(1+delta/10000 / M),2)), 20)
  21    CC=ComplexField(b)
  22    tau = CC(tau)
  23    print 'bits: ',CC(b)
  24    if an==None or len(an) < M+1:
  25        an = E.anlist(M)
  26    print 'length of an: ',len(an)
  27 
  28    #Speeding things up for large M
  29    partialSum = list()
  30    partialSum.append((an[0]/1)*exp(2*CC.pi()*CC(I)*1*tau))
  31 
  32    n=1
  33    while n < M+1:
  34        partialSum.append((an[n]/n)*exp(2*CC.pi()*CC(I)*n*tau) + partialSum[n-1])
  35        n+=1  
  36   
  37    #Give us our result   
  38    return partialSum[n-1]

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2010-07-02 04:07:31, 1.7 KB) [[attachment:Teich-twist.sage]]
  • [get | view] (2010-07-01 03:45:20, 1.2 KB) [[attachment:abelian_field_dirichlet_group.sage]]
  • [get | view] (2010-06-29 16:42:10, 1.1 KB) [[attachment:approximation_of_integral.sage]]
  • [get | view] (2010-07-01 03:48:17, 3.6 KB) [[attachment:computing_modular_symbols_via_complex_integration.sage]]
  • [get | view] (2010-06-29 06:10:26, 1.3 KB) [[attachment:find_gamma.sage]]
  • [get | view] (2010-07-01 05:45:56, 3.3 KB) [[attachment:iwasawa_invariants.sage]]
  • [get | view] (2010-06-30 05:36:30, 1.5 KB) [[attachment:lp_teichmuller.sage]]
  • [get | view] (2010-06-29 00:30:16, 21.9 KB) [[attachment:lseries.m]]
  • [get | view] (2010-06-29 22:37:11, 573.6 KB) [[attachment:modular_symbols_and_padic_lfunctions.pdf]]
  • [get | view] (2010-06-29 00:29:47, 33.9 KB) [[attachment:pLseries.m]]
  • [get | view] (2010-06-29 22:35:43, 265.9 KB) [[attachment:padic_bsd.pdf]]
  • [get | view] (2010-07-02 04:06:18, 3.4 KB) [[attachment:prime5.txt]]
  • [get | view] (2010-07-02 04:06:47, 3.5 KB) [[attachment:prime7.txt]]
  • [get | view] (2010-07-01 07:10:40, 64.1 KB) [[attachment:sha_data_3_11a1_10000.txt]]
  • [get | view] (2010-07-01 07:10:58, 8.5 KB) [[attachment:sha_data_3_11a3_1000.txt]]
  • [get | view] (2010-07-01 07:11:20, 63.9 KB) [[attachment:sha_data_3_42a1_10000.txt]]
  • [get | view] (2010-06-29 00:29:16, 5.3 KB) [[attachment:sha_fast.sage]]
  • [get | view] (2010-07-01 07:18:18, 8.1 KB) [[attachment:sha_v2.sage]]
  • [get | view] (2010-07-01 22:23:54, 1.8 KB) [[attachment:teich_twist.sage]]
  • [get | view] (2010-06-29 04:02:51, 0.7 KB) [[attachment:test.sage]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.