Ask Your Question
0

Why does implicit multiplication not work in the Sage Cell Server?

asked 2020-06-17 22:37:41 +0100

dsejas gravatar image

Hello, Sage Community!

Is there any reason for implicit_multiplication(True) not having any effect in SageCell? Is there any way of solving this?

Thanks in advance for your answers!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-06-18 02:08:40 +0100

tmonteil gravatar image

updated 2020-06-18 02:38:43 +0100

I think this is not specific to SageCell. It is the same in jupyter. implicit_multiplication changes the behaviour of the preparser, but the whole cell is preparsed according to the previous state of the preparser.

If, in a single cell, you write:

implicit_multiplication(True)
2x

You will get an error. But if you put the two lines in different cells, then it will work.

To take another example, you can do:

preparser(False)
type(1)

You will get <class 'sage.rings.integer.Integer'> because the whole cell was preparsed before the preparser is turned off. If you put the two lines in two different cells, you will get <class 'int'>, because the second line will not be preparsed anymore.

About the Sage preparser, see https://doc.sagemath.org/html/en/refe...

The sagecell works like a single jupyter cell.

edit flag offensive delete link more

Comments

Hello, @tmonteil! I see. Is there any possible tweak for using implicit multiplication in Sage Cell? Or is this a definitive unavoidable behavior?

dsejas gravatar imagedsejas ( 2020-06-22 18:46:12 +0100 )edit

I doubt there is an easy way without modifying sagecell (or running your own).

tmonteil gravatar imagetmonteil ( 2020-06-23 12:45:24 +0100 )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

1 follower

Stats

Asked: 2020-06-17 22:37:41 +0100

Seen: 392 times

Last updated: Jun 18 '20