fp.py 744 B

1234567891011121314151617181920212223242526272829303132333435
  1. var('tau')
  2. def C_int(dx,dy):
  3. return -1/pi*integral(1/tau*(1-((tau-I)/(tau+I))**(dx-dy)*((tau-1)/(tau+1))**(dx+dy)),tau,0,infinity)
  4. def C_diag(m):
  5. return -2/pi*(harmonic_number((2*m-1)/2)+log(4))
  6. var('c1','c2','c3','c4','c5')
  7. var('x')
  8. l=[0,c1,c2,c3,c4,c5]
  9. l=[0,-4*x,-4*x*(1+1/3),-4*x*(1+1/3+1/5),-4*x*(1+1/3+1/5+1/7)]
  10. def c(i,j):
  11. if i>j:
  12. return c(j,i)
  13. if (i,j)==(0,1):
  14. return -1
  15. if i==j:
  16. return l[i]
  17. if i==0:
  18. return 4*c(0,j-1)-c(0,j-2)-2*c(1,j-1)
  19. if i==j-1:
  20. return 2*c(j-1,j-1)-2*c(j-2,j)
  21. return 4*c(i,j-1)-c(i,j-2)-c(i-1,j-1)-c(i+1,j-1)
  22. var('k')
  23. def d(i,j):
  24. if i>j:
  25. return d(j,i)
  26. r=1
  27. for k in range(j):
  28. r=r*(2*k+1)
  29. return r*c(i,j)