Ask Your Question

brandonrayhaun's profile - activity

2020-08-25 00:11:06 +0200 received badge  Famous Question (source)
2018-04-16 02:25:00 +0200 received badge  Notable Question (source)
2016-08-06 05:52:28 +0200 received badge  Popular Question (source)
2014-09-20 02:17:27 +0200 received badge  Scholar (source)
2014-09-20 01:52:37 +0200 asked a question Trouble verifying modularity properties

Hey all,

I'm having a bit of trouble doing some numerical things with modular forms, and I simply can't figure out where I'm going wrong.

The $j$ function should satisfy $j(\gamma \tau) = j(\tau)$ for every $\tau$ in the upper half plane and every $\gamma\in SL_2(\mathbb{Z})$. I wrote some code to numerically compute some values of the $j$ function (there may be a better way to do it for the $j$ function, but I hope to eventually migrate this code to work for other modular forms which I define). Here it is below.

## Starts Laurent series in q
R.<q> = LaurentSeriesRing(QQ)

I = CC.0 # imaginary unit

precision = 75

##evaluates a function using its q-expansion
def evaluate(f,z):
    result = 0
    coeffs = f.coefficients()
    exps   = f.exponents()
    for i in range(0,len(coeffs)):
        result = result + coeffs[i]*z^(exps[i])
    return result

## computes the action of a member of the modular group on tau in the upper half plane
def action(gamma,tau):
    return ((gamma[0]*tau + gamma[1])/(gamma[2]*tau + gamma[3]))

## Produce Eisenstein series with specified weight and precision of q-expansion
def eis(weight,precision):
    t = EisensteinForms(1,weight)
    t.set_precision(precision)
    t = t.eisenstein_series()
    e = t[0].q_expansion()
    return e*(1/e.list()[0])

## gives you q which corresponds to tau 
def qt(tau):
    return exp(2*pi*I*tau)

## Defining delta cusp form
delta = CuspForms(1,12).0
delta = delta.q_expansion(precision)

# Computes j function
g2 = 60*eis(4,precision)/240
j = 1728*g2^3/(27*delta)

Now when I run the following code:

tau = 1+I
gamma = [3,-1,4,-1]
print(evaluate(j,qt(tau)).n()) #j(tau)
print(evaluate(j,qt(action(gamma,tau))).n()) #j(gamma tau)

the values $j(\tau)$ and $j(\gamma\tau)$ are not equal! I would appreciate any help.

2014-07-11 01:08:05 +0200 commented answer Trouble running Sage in terminal

Yes, I tried to do this but when I click there nothing happens. I think I might not have enough reputation to upvote.

2014-07-10 23:33:59 +0200 commented answer Trouble running Sage in terminal

It turned out to be the first file you mentioned. I uninstalled Enthought and everything works great now. Thanks so much. I would like to upvote your answer but am not sure how to.

2014-07-10 23:24:45 +0200 commented answer Trouble running Sage in terminal

Thank you very much for your help. With regards to the second file, I'm looking at the directory in Finder (I'm on a Mac) and I cannot see a file named vector_real_double_dense.pyx. Very strange! With regards to the first file, I think I had downloaded something like Enthought for a class once. I'll try to go and get that off my machine.

2014-07-10 22:57:58 +0200 received badge  Editor (source)
2014-07-10 22:53:38 +0200 asked a question Trouble running Sage in terminal

Hi all,

So I start up Sage using the command:

'/Applications/Sage-6.2.app/Contents/Resources/sage'/sage

I'm trying to load this file:

#mod.sage
precision = 30

m = ModularForms(Gamma0(12),10,prec = precision)

p = m.basis()

Unfortunately I get a very large error when I run the following command: attach("mod.sage") However when I comment out the line p = m.basis(), the error goes away. I'm attaching the text from the error message below. Any ideas on how to fix this would be greatly appreciated. Sorry for the sloppy formatting!

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-2-909b5a17cf48> in <module>()
----> 1 sage.misc.preparser.load(sage.misc.preparser.base64.b64decode("bW9kLnNhZ2U="),globals(),True)

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/misc/preparser.pyc in load(filename, globals, attach)
   1753         else:
   1754             raise IOError('did not find file %r in load / attach search path' \
-> 1755                 % filename)
   1756 
   1757     if fpath.endswith('.py'):

IOError: did not find file 'mod.sage' in load / attach search path
sage: cd /Users/brandonrayhaun/Desktop/Code/Sage
/Users/brandonrayhaun/Desktop/Code/Sage
sage: attach("mod.sage")
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-4-909b5a17cf48> in <module>()
----> 1 sage.misc.preparser.load(sage.misc.preparser.base64.b64decode("bW9kLnNhZ2U="),globals(),True)

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/misc/preparser.pyc in load(filename, globals, attach)
   1767             # See Trac 11812.
   1768             exec_file_is(fpath)
-> 1769             execfile(preparse_file_named(fpath), globals)
   1770         else:
   1771             # Preparse in memory only for speed.

/Users/brandonrayhaun/.sage/temp/anlwl151-059.wl.anl.gov/13637/mod.sageZRRz8A.py in <module>()
      6 precision = _sage_const_30
      7 
----> 8 m = ModularForms(Gamma0(_sage_const_12 ),_sage_const_10 ,prec = precision)
      9 # p = m.basis()

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/modular/modform/constructor.pyc in ModularForms(group, weight, base_ring, use_cache, prec)
    317     M = None
    318     if arithgroup.is_Gamma0(group):
--> 319         M = ambient_g0.ModularFormsAmbient_g0_Q(group.level(), weight)
    320         if base_ring != rings.QQ:
    321             M = ambient_R.ModularFormsAmbient_R(M, base_ring)

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/modular/modform/ambient_g0.pyc in __init__(self, level, weight)
     41             <class 'sage.modular.modform.ambient_g0.ModularFormsAmbient_g0_Q_with_category'>
     42         """
---> 43         ambient.ModularFormsAmbient.__init__(self, arithgroup.Gamma0(level), weight, rings.QQ)
     44 
     45     ####################################################################

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/modular/modform/ambient.pyc in __init__(self, group, weight, base_ring, character)
    110 
    111         if character is None and arithgroup.is_Gamma0(group):
--> 112             character = dirichlet.TrivialCharacter(group.level(), base_ring)
    113 
    114         space.ModularFormsSpace.__init__(self, group, weight, character, base_ring)

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/modular/dirichlet.pyc in trivial_character(N, base_ring)
    100         Ring of integers modulo 3
    101     """
--> 102     return DirichletGroup(N, base_ring)(1)
    103 
    104 TrivialCharacter = trivial_character

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/structure/factory.so in sage.structure.factory.UniqueFactory.__call__ (sage/structure/factory.c:1308)()

/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib ...
(more)
2014-07-07 07:49:14 +0200 asked a question Modular forms in Sage

Hi all,

I'm new to Sage and have a question about how to implement and manipulate modular forms in the language. I only need to do some simple things.

$1$) Can I define my own custom q-expansion? For instance, how would I store $$f(q) = 1 + 2q^2 + 2q^3 + O(q^4)$$ in the same way that modular forms are stored in Sage?

2) Is there any program written to take the Rankin-Cohen bracket of two modular forms? If not, is it possible to write a program in Sage that implements complex differentiation of these modular forms?

Thanks for your help. I've tried consulting the documentation, but just when I think I've read all of it, new stuff pops up (unfortunately, none of it relevant to what I'm trying to do).