Ask Your Question

parametric_plot gives "IndexError: list index out of range" in SageMath 8.1-11 on Arch Linux

asked 2018-04-09 18:28:05 -0500

cookchar gravatar image

updated 2018-04-10 08:56:58 -0500

slelievre gravatar image

I've been attempting to plot a parabola, but I keep running into an error from the "" file as an "index out of range" error. Help? My OS is Arch Linux, using the Cinnamon DE, and version 8.1-11 of Sagemath. Attempted code:

sage: var('t')
sage: parametric_plot((t,t^2),(t,-4,4))

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 10, in <module>
    exec compile(u'open("","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGFyYW1ldHJpY19wbG90KCh0LHReMiksKHQsLTQsNCkp"),globals())+"\\n"); execfile(os.path.abspath(""))
  File "", line 1, in <module>

  File "/tmp/tmpwjIIYE/", line 3, in <module>
    exec compile(u'parametric_plot((t,t**_sage_const_2 ),(t,-_sage_const_4 ,_sage_const_4 ))
  File "", line 1, in <module>

  File "/usr/lib/python2.7/site-packages/sage/misc/", line 564, in wrapper
    return func(*args, **options)
  File "/usr/lib/python2.7/site-packages/sage/plot/", line 2621, in parametric_plot
    return plot(funcs, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/sage/misc/", line 564, in wrapper
    return func(*args, **options)
  File "/usr/lib/python2.7/site-packages/sage/plot/", line 1950, in plot
    G = _plot(funcs, *args, **kwds)
  File "/usr/lib/python2.7/site-packages/sage/plot/", line 2067, in _plot
    funcs, ranges = setup_for_eval_on_grid(funcs, [xrange], options['plot_points'])
  File "/usr/lib/python2.7/site-packages/sage/plot/", line 150, in setup_for_eval_on_grid
    return fast_float(funcs, *vars,**options), [tuple(range+[range_step]) for range,range_step in zip(ranges, range_steps)]
  File "sage/ext/fast_eval.pyx", line 1384, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11037)
  File "sage/ext/fast_eval.pyx", line 1399, in sage.ext.fast_eval.fast_float (build/cythonized/sage/ext/fast_eval.c:11258)
  File "sage/ext/fast_callable.pyx", line 465, in sage.ext.fast_callable.fast_callable (build/cythonized/sage/ext/fast_callable.c:4634)
  File "sage/symbolic/expression.pyx", line 11679, in sage.symbolic.expression.Expression._fast_callable_ (build/cythonized/sage/symbolic/expression.cpp:66334)
  File "/usr/lib/python2.7/site-packages/sage/symbolic/", line 1757, in fast_callable
    return FastCallableConverter(ex, etb)()
  File "/usr/lib/python2.7/site-packages/sage/symbolic/", line 218, in __call__
    return self.arithmetic(ex, operator)
  File "/usr/lib/python2.7/site-packages/sage/symbolic/", line 1670, in arithmetic
    exponent = operands[1]
IndexError: list index out of range
edit retag flag offensive close merge delete


Welcome to Ask Sage! Thank you for your question!

slelievre gravatar imageslelievre ( 2018-04-10 00:40:02 -0500 )edit

Strange; the command in the question should work without problem... Can you try as follows?

sage: parametric_plot((lambda t: t, lambda t: t^2), (-4, 4))
slelievre gravatar imageslelievre ( 2018-04-10 00:41:45 -0500 )edit

WorksForMe (TM) on version 8.2.beta8 running on Debian testing.

If you have access to another machine with a different platform, it might be worth testing it on that platform. It might be specific to your binary. Did you built it yourself, or was it packaged in Arch ?

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2018-04-10 03:21:42 -0500 )edit

It works for me as well, both with Sage 8.1 and Sage 8.2.rc1 (OS: Ubuntu 16.04).

eric_g gravatar imageeric_g ( 2018-04-10 06:18:02 -0500 )edit

@cookchar: if the answer by @arojas solves your question, please accept it by clicking the "accept" (tick mark) button next to it! This will mark your question as solved and the answer as accepted.

slelievre gravatar imageslelievre ( 2018-04-17 10:51:19 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-04-10 09:43:12 -0500

arojas gravatar image

Please test 8.1-12, 8.1-11 was broken due to a pynac upgrade.

edit flag offensive delete link more


Thank you @arojas for your answer and for maintaining the ArchLinux distribution of SageMath!

slelievre gravatar imageslelievre ( 2018-04-11 04:08:57 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2018-04-09 18:28:05 -0500

Seen: 44 times

Last updated: Apr 10