want to play around with Sage built using Python3 with minimal effort?

212 views
Skip to first unread message

William Stein

unread,
Oct 8, 2018, 9:49:15 AM10/8/18
to sage-devel
Hi,

If you want to play around with a copy of Sage built using Python3
instead of Python2 (so 'export SAGE_PYTHON3="was"') without having to
build or install anything, send me an email (wst...@gmail.com) and
I'll add you to a CoCalc project [1] that has Sage built that way.

See how long until it breaks for you on your favorite Sage commands.
For me, it broke pretty quickly:

sage: print(2,3)
2 3
sage: range(10)
range(0, 10)
sage: {'a', 'b'}
{'a', 'b'}
sage: M = ModularSymbols(23)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-6-b5f2062004dc> in <module>()
----> 1 M = ModularSymbols(Integer(23))

/home/user/sage/local/lib/python3.6/site-packages/sage/modular/modsym/modsym.py
in ModularSymbols(group, weight, sign, base_ring, use_cache,
custom_init)
346 key = canonical_parameters(group, weight, sign, base_ring)
347
--> 348 if use_cache and key in _cache:
349 M = _cache[key]()
350 if not (M is None): return M

TypeError: unhashable type: 'Gamma0_class_with_category'

-- William


[1] https://cocalc.com/projects/d282680a-dda9-486c-87fe-d7f4331bbf53/files/README.md?session=default
--
William (http://wstein.org)

John Cremona

unread,
Oct 8, 2018, 9:55:10 AM10/8/18
to SAGE devel
I'm not sure that many Sage user will try ModularSymbols() as their 4th Sage command....!

John

--
You received this message because you are subscribed to the Google Groups "sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
To post to this group, send email to sage-...@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Erik Bray

unread,
Oct 8, 2018, 10:59:59 AM10/8/18
to sage-devel
I have no idea what modular symbols are, and wikipedia is not much
help beyond it having something to do with modular forms, though I
found an interesting book [1] on the subject. But it seems to work in
8.4.beta7:

$ ./sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.4.beta7, Release Date: 2018-09-30 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: import sys; sys.version_info
sys.version_info(major=3, minor=6, micro=6, releaselevel='final', serial=0)
sage: M = ModularSymbols(23)
sage: M
Modular Symbols space of dimension 5 for Gamma_0(23) of weight 2 with
sign 0 over Rational Field
sage: M.basis()
((1,0), (1,17), (1,19), (1,20), (1,21))

This also works:

$ ./sage -t --long src/sage/modular/modsym/modsym.py
too many failed tests, not using stored timings
Running doctests with ID 2018-10-08-14-56-32-a2ba44a9.
Git branch: develop
Using --optional=dochtml,meataxe,memlimit,mpir,python2,sage
Doctesting 1 file.
sage -t --long src/sage/modular/modsym/modsym.py
[80 tests, 2.39 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 2.5 seconds
cpu time: 2.4 seconds
cumulative wall time: 2.4 seconds


Though some of the tests for other modules in sage.modular.modsym are
still failing.



[1] https://wstein.org/books/modform/modform/modular_symbols.html

John Cremona

unread,
Oct 8, 2018, 11:55:54 AM10/8/18
to SAGE devel
On Mon, 8 Oct 2018 at 15:59, Erik Bray <erik....@gmail.com> wrote:
I have no idea what modular symbols are, and wikipedia is not much
help beyond it having something to do with modular forms, though I
found an interesting book [1] on the subject.  But it seems to work in

The online version of the book omits the picture of William on the back cover and other extras: see http://homepages.warwick.ac.uk/staff/J.E.Cremona/20181008_164334.jpg
(and for real enthusiasts, a relic from before the days of TeX (or the internet or even desktop PCs): http://homepages.warwick.ac.uk/staff/J.E.Cremona/theses/JCthesis-scan.pdf

Frédéric Chapoton

unread,
Oct 8, 2018, 3:06:02 PM10/8/18
to sage-devel
Could you please update to the latest beta release (8.4.rc0) so that people can enjoy the recent progress ?

William Stein

unread,
Oct 8, 2018, 3:58:13 PM10/8/18
to sage-devel
Nice -- updating it now.
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



--
William (http://wstein.org)

Samuel Lelievre

unread,
Oct 9, 2018, 12:44:49 PM10/9/18
to sage-devel
William, thanks for sharing this project!

Samuel Lelievre

unread,
Oct 9, 2018, 1:14:38 PM10/9/18
to sage-devel


Mon 2018-10-08 15:49:15 UTC+2, William:
>
> If you want to play around with a copy of Sage built using Python3
> instead of Python2 (so 'export SAGE_PYTHON3="was"') without having to 

I'm sure some autorespeller kicked in and that was supposed to be

    export SAGE_PYTHON3='yes'

By the way, what's the difference between

    export SAGE_PYTHON3='yes'
    make build

and

    make configure
    ./configure --with-python=3
    make build

?

Frédéric Chapoton

unread,
Oct 9, 2018, 2:06:11 PM10/9/18
to sage-devel
One should use the later way (with configure). The former was the previous manner, now obsolete.


Le mardi 9 octobre 2018 19:14:38 UTC+2, Samuel Lelievre a écrit :


Mon 2018-10-08 15:49:15 UTC+2, William:
>
> If you want to play around with a copy of Sage built using Python3
> instead of P ython2 (so 'export SAGE_PYTHON3="was"') without having to 
Reply all
Reply to author
Forward
0 new messages