Ask Your Question
0

Why is assume() so slow?

asked 7 years ago

stan gravatar image

Declaring assumptions using assume() takes an awful lot of time, e.g.:

var('a b c d e f g h i')
assume([(var1, 'real') for var1 in [a, b, c, d, e, f, g, h, i]])

The same applies to declaring variables with the domain option, e.g. var('a', domain='positive'). See also https://cocalc.com/projects/34b4b62a-... for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!

Preview: (hide)

Comments

This should only take long the first time, because it starts up Maxima to handle assumptions. After that it wouldn't be slow, in principle.

kcrisman gravatar imagekcrisman ( 7 years ago )

Thanks, but it seems to take equally long every time. Actually, if I increase the number of variables, the time needed increases more than proportionally. I updated the above worksheet to illustrate this.

stan gravatar imagestan ( 7 years ago )

Hmm, that is weird. I can't answer further but hopefully someone else can!

kcrisman gravatar imagekcrisman ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
1

answered 7 years ago

stan gravatar image

On sage-devel, it was suggested that this is due to inconsistencies in the assumptions data base and excessive calls to Maxima (https://groups.google.com/forum/#!top...). This is now Ticket https://trac.sagemath.org/ticket/2313....

Preview: (hide)
link

Comments

Thanks, I should have realized that but hadn't looked at that code for years - good for opening the ticket!

kcrisman gravatar imagekcrisman ( 7 years ago )

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: 7 years ago

Seen: 487 times

Last updated: Jun 04 '17