ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 05 Jun 2017 20:30:47 +0200Why is assume() so slow?https://ask.sagemath.org/question/37744/why-is-assume-so-slow/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-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!Tue, 30 May 2017 23:39:08 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/Comment by kcrisman for <p>Declaring assumptions using <code>assume()</code> takes an awful lot of time, e.g.:</p>
<pre><code>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]])
</code></pre>
<p>The same applies to declaring variables with the <code>domain</code> option, e.g. <code>var('a', domain='positive')</code>.
See also <a href="https://cocalc.com/projects/34b4b62a-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb">https://cocalc.com/projects/34b4b62a-...</a> for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!</p>
https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37746#post-id-37746This should only take long the *first* time, because it starts up Maxima to handle assumptions. After that it wouldn't be slow, in principle.Wed, 31 May 2017 02:55:53 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37746#post-id-37746Comment by stan for <p>Declaring assumptions using <code>assume()</code> takes an awful lot of time, e.g.:</p>
<pre><code>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]])
</code></pre>
<p>The same applies to declaring variables with the <code>domain</code> option, e.g. <code>var('a', domain='positive')</code>.
See also <a href="https://cocalc.com/projects/34b4b62a-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb">https://cocalc.com/projects/34b4b62a-...</a> for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!</p>
https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37762#post-id-37762Thanks, 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.Fri, 02 Jun 2017 13:44:20 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37762#post-id-37762Comment by kcrisman for <p>Declaring assumptions using <code>assume()</code> takes an awful lot of time, e.g.:</p>
<pre><code>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]])
</code></pre>
<p>The same applies to declaring variables with the <code>domain</code> option, e.g. <code>var('a', domain='positive')</code>.
See also <a href="https://cocalc.com/projects/34b4b62a-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb">https://cocalc.com/projects/34b4b62a-...</a> for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!</p>
https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37763#post-id-37763Hmm, that is weird. I can't answer further but hopefully someone else can!Fri, 02 Jun 2017 15:37:38 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37763#post-id-37763Answer by stan for <p>Declaring assumptions using <code>assume()</code> takes an awful lot of time, e.g.:</p>
<pre><code>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]])
</code></pre>
<p>The same applies to declaring variables with the <code>domain</code> option, e.g. <code>var('a', domain='positive')</code>.
See also <a href="https://cocalc.com/projects/34b4b62a-2621-47c8-9bda-cde3a855f995/files/test_assumptions.ipynb">https://cocalc.com/projects/34b4b62a-...</a> for an example. Does anyone know why this takes so much time and/or how this could be made faster? Thanks a lot!</p>
https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?answer=37793#post-id-37793On 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/#!topic/sage-devel/jN6inWPyElM). This is now Ticket https://trac.sagemath.org/ticket/23138#ticket. Sun, 04 Jun 2017 22:36:13 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?answer=37793#post-id-37793Comment by kcrisman for <p>On sage-devel, it was suggested that this is due to inconsistencies in the assumptions data base and excessive calls to Maxima (<a href="https://groups.google.com/forum/#!topic/sage-devel/jN6inWPyElM">https://groups.google.com/forum/#!top...</a>). This is now Ticket <a href="https://trac.sagemath.org/ticket/23138#ticket">https://trac.sagemath.org/ticket/2313...</a>. </p>
https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37800#post-id-37800Thanks, I should have realized that but hadn't looked at that code for years - good for opening the ticket!Mon, 05 Jun 2017 20:30:47 +0200https://ask.sagemath.org/question/37744/why-is-assume-so-slow/?comment=37800#post-id-37800