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.Thu, 08 Oct 2020 22:20:07 +0200Trouble Using QEPCADhttps://ask.sagemath.org/question/53768/trouble-using-qepcad/I'm having trouble doing even relatively basic (at least, it seems relatively basic) simplification in QEPCAD.
For instance, when I try to run the following line of code:
sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
(with `k`, `m` already set as variables), the computation goes on for much longer than I want it to, and in fact I have yet to see it finish. I'm not really sure why this is the case, or if problems like this just take a long time for QEPCAD (I know that Wolfram Alpha does these very quickly). Really what I want is just to find one integer solution to the above inequality (i.e. k = m = 0) and more generally, I want to be able to take n of these kind of inequalities (I would prefer being able to do higher degrees as well, but I think just quadratic would be fine) and find integers k, m which satisfy all of them, or have the program tell me no such k, m exist. So if there's a different approach I should be taking then please let me know, or if I need to give more information on anything just say so. I have absolutely no experience programming, I'm just trying to write up a calculator for something I'm working on for my math PhD.Wed, 07 Oct 2020 21:02:05 +0200https://ask.sagemath.org/question/53768/trouble-using-qepcad/Answer by Emmanuel Charpentier for <p>I'm having trouble doing even relatively basic (at least, it seems relatively basic) simplification in QEPCAD.</p>
<p>For instance, when I try to run the following line of code:</p>
<pre><code>sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
</code></pre>
<p>(with <code>k</code>, <code>m</code> already set as variables), the computation goes on for much longer than I want it to, and in fact I have yet to see it finish. I'm not really sure why this is the case, or if problems like this just take a long time for QEPCAD (I know that Wolfram Alpha does these very quickly). Really what I want is just to find one integer solution to the above inequality (i.e. k = m = 0) and more generally, I want to be able to take n of these kind of inequalities (I would prefer being able to do higher degrees as well, but I think just quadratic would be fine) and find integers k, m which satisfy all of them, or have the program tell me no such k, m exist. So if there's a different approach I should be taking then please let me know, or if I need to give more information on anything just say so. I have absolutely no experience programming, I'm just trying to write up a calculator for something I'm working on for my math PhD.</p>
https://ask.sagemath.org/question/53768/trouble-using-qepcad/?answer=53784#post-id-53784WorksForMe(TM) on 9.2.rc0 and a freshly installed `qepcad`:
sage: %time qepcad(-k^2+6*k*m-9*m^2+1>0)
CPU times: user 8.24 ms, sys: 15.8 ms, total: 24 ms
Wall time: 73.4 ms
3 m - k - 1 < 0 /\ 3 m - k + 1 > 0
However, *pasting*what you have posted :
sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
File "<ipython-input-28-63512fea48a6>", line 1
qepcad(-k**Integer(2) + Integer(6)*k*m - Integer(9)*m**Integer(2) + Integer(1) > Integer(0))
^
SyntaxError: invalid character in identifier
Isn't there an invisible typo ? (Thank Unicode for all those exotic character indiscernible from honest-to-god ASCII to the naked eye...). `emacs` shows me a zero-width character after the final "1" of the left hand side of your formula. Eliminating it allows to compute the (same) result...Thu, 08 Oct 2020 12:37:19 +0200https://ask.sagemath.org/question/53768/trouble-using-qepcad/?answer=53784#post-id-53784Comment by nkauf for <p>WorksForMe(TM) on 9.2.rc0 and a freshly installed <code>qepcad</code>:</p>
<pre><code>sage: %time qepcad(-k^2+6*k*m-9*m^2+1>0)
CPU times: user 8.24 ms, sys: 15.8 ms, total: 24 ms
Wall time: 73.4 ms
3 m - k - 1 < 0 /\ 3 m - k + 1 > 0
</code></pre>
<p>However, <em>pasting</em>what you have posted :</p>
<pre><code>sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
File "<ipython-input-28-63512fea48a6>", line 1
qepcad(-k**Integer(2) + Integer(6)*k*m - Integer(9)*m**Integer(2) + Integer(1) > Integer(0))
^
SyntaxError: invalid character in identifier
</code></pre>
<p>Isn't there an invisible typo ? (Thank Unicode for all those exotic character indiscernible from honest-to-god ASCII to the naked eye...). <code>emacs</code> shows me a zero-width character after the final "1" of the left hand side of your formula. Eliminating it allows to compute the (same) result...</p>
https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53785#post-id-53785I think the invisible typo comes from copying this from an email sent to my advisor, I just double checked by both copy/pasting what you have as well as manually typing in this particular inequality and it still doesn't work for me. But I guess it is a good start to know that the problem is not with QEPCAD's capabilities but rather with mine. I don't really know what extra info would be helpful here, but I'm doing this on a Jupyter notebook with Sagemath 9.1 as the kernel. There's also an error message I get when I interrupt the kernel that starts with "Keyboard Interrupt Traceback (most recent call last)", would that be helpful to post?Thu, 08 Oct 2020 14:36:36 +0200https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53785#post-id-53785Comment by Emmanuel Charpentier for <p>WorksForMe(TM) on 9.2.rc0 and a freshly installed <code>qepcad</code>:</p>
<pre><code>sage: %time qepcad(-k^2+6*k*m-9*m^2+1>0)
CPU times: user 8.24 ms, sys: 15.8 ms, total: 24 ms
Wall time: 73.4 ms
3 m - k - 1 < 0 /\ 3 m - k + 1 > 0
</code></pre>
<p>However, <em>pasting</em>what you have posted :</p>
<pre><code>sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
File "<ipython-input-28-63512fea48a6>", line 1
qepcad(-k**Integer(2) + Integer(6)*k*m - Integer(9)*m**Integer(2) + Integer(1) > Integer(0))
^
SyntaxError: invalid character in identifier
</code></pre>
<p>Isn't there an invisible typo ? (Thank Unicode for all those exotic character indiscernible from honest-to-god ASCII to the naked eye...). <code>emacs</code> shows me a zero-width character after the final "1" of the left hand side of your formula. Eliminating it allows to compute the (same) result...</p>
https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53788#post-id-53788A couple remarks :
- The Sage version might be relevant : 9.2 has got tons of fixes (see [this post](https://ask.sagemath.org/question/53776/solve-in-inequalities-return-two-separate-solutions-could-they-be-gathered/) for a good example). Your `qepcad` problem might be another.
- The error message you get when interrupting the Sage kernel is normal and expected : it just tells you that *you* are the reason of not getting your expected result : in other words : "Hey, boss ! I stopped because you told me so...".
- Check your `qepcad` installation log (under `$SAGE_ROOT/logs/pkgs/`). Did the install went smoothly ?
- Can you try some simple `qepcad` examples (manually typed) ? There are some on the original QEPCAD [web site](https://www.usna.edu/CS/qepcadweb/B/QEPCAD.html),Thu, 08 Oct 2020 19:03:22 +0200https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53788#post-id-53788Comment by nkauf for <p>WorksForMe(TM) on 9.2.rc0 and a freshly installed <code>qepcad</code>:</p>
<pre><code>sage: %time qepcad(-k^2+6*k*m-9*m^2+1>0)
CPU times: user 8.24 ms, sys: 15.8 ms, total: 24 ms
Wall time: 73.4 ms
3 m - k - 1 < 0 /\ 3 m - k + 1 > 0
</code></pre>
<p>However, <em>pasting</em>what you have posted :</p>
<pre><code>sage: qepcad(-k**2 + 6*k*m - 9*m**2 + 1 > 0)
File "<ipython-input-28-63512fea48a6>", line 1
qepcad(-k**Integer(2) + Integer(6)*k*m - Integer(9)*m**Integer(2) + Integer(1) > Integer(0))
^
SyntaxError: invalid character in identifier
</code></pre>
<p>Isn't there an invisible typo ? (Thank Unicode for all those exotic character indiscernible from honest-to-god ASCII to the naked eye...). <code>emacs</code> shows me a zero-width character after the final "1" of the left hand side of your formula. Eliminating it allows to compute the (same) result...</p>
https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53790#post-id-53790When I try to check the log in the Jupyter notebook, I get an invalid syntax error. Same thing if I try putting "sage:" in front.
In terms of examples, for some reason when I copy/pasted an example from the sage: ?qepcad thing, "sage: qepcad('[a x + b > 0]', vars='(a,b,x)')" the program runs (it goes on to the next line, but does not output the answer), whereas if I put "sage: qepcad('[a*x + b > 0]', vars='(a,b,x)')", for some reason it gets stuck again. I have no idea if this narrows anything down. Maybe another thing that factors into it is that I'm using the notebook in my browser rather than downloading anything. I'm sure there's something really basic somewhere that I'm just missing, but I really don't know enough about programming to know what it would be.Thu, 08 Oct 2020 22:20:07 +0200https://ask.sagemath.org/question/53768/trouble-using-qepcad/?comment=53790#post-id-53790