/* compute all the coefficients of j-invariant q expansion. These are integers, and j is an "elliptic modular function". Purpose of this code is to see what it looks like, somehow. */ #include #include "bigfloat.h" #include "multipoly.h" extern RAMDATA ram_block[]; extern FLOAT P2; #define gridsize 512 /* compute first two terms of j(tau) sequence j ~ 1/q + 744 returns q = exp(2*i*PI*tau) as well as j. */ void firstj( COMPLEX *tau, COMPLEX *q, COMPLEX *j) { COMPLEX top, ipi; null_cmplx( &ipi); copy( &P2, &ipi.imag); ipi.imag.expnt += 2; multiply_cmplx( &ipi, tau, q); exp_cmplx( q, q); null_cmplx( &top); one( &top.real); divide_cmplx( &top, q, j); int_to_float( 744, &top.real); add_cmplx( &top, j, j); } main() { FLOAT o1, dcubed, n, *offset; INDEX i, j, k, limit; MULTIPOLY sigma3; MULTIPOLY q24, tau1, tau2; MULTIPOLY joftop, jofbot, joftau; FLOAT *coef, *tsubj, *tnew, *prevc; FLOAT bctop, bcbottom; int shift, maxstore; MULTIPOLY cheb[100]; struct { ELEMENT x, y; COMPLEX start, jt; } datablock; FILE *svplot; COMPLEX tau, jtau, arc[512], q, qn; FLOAT theta, dtheta; COMPLEX temp; limit = 50; maxstore = limit+5; init_ram_space(); init_float(); /* create table of sigma_3(n) (sum of cube of all factors of n). */ sigma3.degree = limit; if( !get_space( &sigma3)) { printf("no space for that much data\n"); exit(0); } one( &o1); null( &n); for( i=1; i maxstore) continue; for( j=0; j<= k*24; j++) { if( j + shift > maxstore) continue; tsubj = Address( tau1) + j; tnew = Address( tau2) + j + shift; multiply( tsubj, coef, &bctop); add( &bctop, tnew, tnew); round( tnew, tnew); } } k++; /* now flip things over and go back to tau 1 */ if( k>maxstore) break; prevc = Address( tau2); tnew = Address( tau1); multi_copy( maxstore, prevc, tnew); for( i=1; i<=24; i++) { coef = Address(q24) + i; shift = k*i; if( shift > maxstore) continue; for( j=0; j<= k*24; j++) { if( j + shift > maxstore) continue; tsubj = Address( tau2) + j; tnew = Address( tau1) + j + shift; multiply( tsubj, coef, &bctop); add( &bctop, tnew, tnew); round( tnew, tnew); } } k++; } /* compute top polynomial of joftau (1 + 240*sum(sigma3(n)*q^n))^3 */ multi_dup( sigma3, &joftop); coef = Address( joftop); int_to_float( 1, coef); int_to_float( 240, &bctop); for( i=1; i