ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 17 Aug 2018 06:39:08 -0500Installing 8.3http://ask.sagemath.org/question/43398/installing-83/I'm using SageMath 8.2 on a Windows 10 Native with Jupyter Notebook.
I uninstalled SageMath 8.2 and installed SageMath 8.3. in a different folder.
There is still a lot of garbage left in the SageMath 8.2 folder, can I delete it?
Daniel
danielvolinskiFri, 17 Aug 2018 06:39:08 -0500http://ask.sagemath.org/question/43398/How can I compute the orbits of an automorphism group?http://ask.sagemath.org/question/43283/how-can-i-compute-the-orbits-of-an-automorphism-group/ I am new on automorphisms, need to know how to compute the orbits of an automorphism group in Sage.HPWed, 08 Aug 2018 03:31:56 -0500http://ask.sagemath.org/question/43283/Sage could be even more clever - How to force the use of 'sympy' backend for simplifying symbolic integrals?http://ask.sagemath.org/question/43392/sage-could-be-even-more-clever-how-to-force-the-use-of-sympy-backend-for-simplifying-symbolic-integrals/Hi there,
I have noticed the following problem:
sage: f = function('f')(x)
sage: var('h')
sage: integrate(exp(h)*exp(x)*f(x),x)
integrate(e^(h + x)*f(x), x)
The workaround seems to be using the `sympy` backend for symbolic integration
sage: integrate(exp(h)*exp(x)*f(x),x,algorithm='sympy')
e^h*integrate(e^x*f(x), x)
which always seems to be a good idea as I learned from @Emmanuel Charpentier over
[here](https://ask.sagemath.org/question/43287/solved-why-does-integratepsiyfyy-return-an-error-but-integratepsityftyy-works/?answer=43297#post-id-43297).
Now I would like to force the use of `algorith='sympy'` for simplifying these `integrate(...)` expressions globally.
Unfortunately, the `simplify()` command does not allow to set this option.
sage: integrate(exp(h)*exp(x)*f(x),x)
integrate(e^(h + x)*f(x), x)
sage: _.simplify()
integrate(e^(h + x)*f(x), x)
**TL;DR** How can I force sage to pull out these type of exponential constants from the integral with the `simplify()` command?
hausdorffThu, 16 Aug 2018 11:54:20 -0500http://ask.sagemath.org/question/43392/Solved: Why does integrate(psi(y)*f(y),y) return an error but integrate(psi(t,y)*f(t,y),y) works?http://ask.sagemath.org/question/43287/solved-why-does-integratepsiyfyy-return-an-error-but-integratepsityftyy-works/Hi there,
I am trying get an symbolic expression for the convolution
$$ (\psi \star f)(x) := \int\limits_{\mathbb{R}} \psi(x-y) f(y) {d y} $$
of two functions
$
f, \psi: \mathbb{R} \to \mathbb{R}
$
as follows:
<code>
var('y') <br>
psi = function('psi')(y) <br>
f = function('f')(y) <br>
integrate(psi(x-y)*f(y),y)
</code>
upon which I get the error message
> RuntimeError: ECL says: Error executing code in Maxima:
If I add an extra argument to the two functions and define them as
$$ f, \psi : \mathbb{R} \times \mathbb{R} \to \mathbb{R} $$
as follows:
<code>
var('t') <br>
psi = function('psi')(t,y) <br>
f = function('f')(t,y) <br>
integrate(psi(t,x-y)*f(t,y),y)
</code>
there is a surprise, *it suddenly works!*
I get the desired symbolic expression on which I can run diff(..,x) and all the other built-in functions.
**TL;DR**
Why does <code>integrate(psi(y)*f(y),y)</code> return an error?
**Solution**
Use sympy backend for symbolic integration as in
<code>integrate(psi(x-y)*f(y),y, algorithm="sympy")</code>hausdorffWed, 08 Aug 2018 06:41:12 -0500http://ask.sagemath.org/question/43287/How could I notice that a SAGE program is running?http://ask.sagemath.org/question/43021/how-could-i-notice-that-a-sage-program-is-running/ I am new on SAGE. When I run a time consuming algorithm using sage on Jupyter, there is no sign on Jupyter command window showing the program is still running. I only should wait until the results appear on the Jupyter command line.
Is there a way I could be noticed if something is still running by sage or not? HPSun, 15 Jul 2018 06:20:48 -0500http://ask.sagemath.org/question/43021/Microsoft Internet Explorer Version 9 or abovehttp://ask.sagemath.org/question/43383/microsoft-internet-explorer-version-9-or-above/How can I use sage without Microsoft Internet Explorer Version 9 or above? Because this is the system requirement of sage.
I ask this question only for a friend, but I hope someone could give me some suggestions.
Thanks! :)pizzaWed, 15 Aug 2018 02:01:33 -0500http://ask.sagemath.org/question/43383/When will a Windows cygwin version be available/stablehttp://ask.sagemath.org/question/8312/when-will-a-windows-cygwin-version-be-availablestable/I apologise if this question is not suitable for this site.
As the subject line suggests, I'm looking for any information on when people think a cygwin version of sage which can run on Windows in a reasonably stable way may be available. Any slightly-educated guesses would be much appreciated!!
I've been trying to find a CAS to call home for some time now (after trying Maxima, Octave, Sympy/Scipy in Pythonxy, Spacetime... you get the idea :) ). For my needs, SAGE is superior to all of these in many ways, but the lack of a native port is a significant hurdle, and I've been tossing up buying a student version of Mathematica, which of course I wouldn't want to do if a SAGE port of sorts is around the corner.
Thanks!
Tom26Fri, 09 Sep 2011 01:09:29 -0500http://ask.sagemath.org/question/8312/div, grad and curl once againhttp://ask.sagemath.org/question/40792/div-grad-and-curl-once-again/ HI, and sorry to badger people who are all working to give us a terrific maths tool for no cost, but there's a big need for div, grad and curl in many applications, such as electromagnetics, quantum theory, fluid flow, etc.
Specifically, my wish list would be, if s is a scalar field, and v a vector one,
grad (s) in cartesians, polars, cylindricals and sphericals
div (v) over the same coordinate systems
curl (v) over the same coordinate systems
and
grad(grad(s)) over these four systems, the spherical one being quite tricky anyway
Is there any cance of some kind person implementing (and documenting) these?
quantum_leopardFri, 26 Jan 2018 15:24:04 -0600http://ask.sagemath.org/question/40792/Solving a differential equation - From SageManifoldhttp://ask.sagemath.org/question/43370/solving-a-differential-equation-from-sagemanifold/ I'm interested in solving a differential equation obtained from a calculation from `sagemanifold`. I'll give a simple example, but the reason is that in general the equations **are not** as simple and one can introduce errors copying the equations.
I'd like to solve the equation given by the Ricci flat condition (for a certain affine connection).
reset()
M = Manifold(4, 'M', latex_name=r"\mathcal{M}")
U.<t,r,th,ph> = M.chart(r't r:(0,+oo) th:(0,pi):\theta ph:(0,2*pi):\phi')
nab = M.affine_connection('nabla', r'\nabla'); nab
k = var('k', latex_name=r'\kappa')
s = sqrt(1 - k * r**2)
f = function('f')(t)
g = function('g')(t)
h = function('h')(t)
nab[0,0,0] = f
nab[0,1,1] = g / (1 - k * r**2)
nab[0,2,2] = r**2 * g
nab[0,3,3] = r**2 * sin(th)**2 * g
nab[1,0,1] = h
nab[1,1,0] = h
nab[1,1,1] = k * r / (1 - k * r**2)
nab[1,2,2] = k * r**3 - r
nab[1,3,3] = (k * r **3 - r) * sin(th)**2
nab[2,0,2] = h
nab[2,1,2] = 1 / r
nab[2,2,0] = h
nab[2,2,1] = 1 / r
nab[2,3,3] = - cos(th) * sin(th)
nab[3,0,3] = h
nab[3,1,3] = 1 / r
nab[3,2,3] = cos(th) / sin(th)
nab[3,3,0] = h
nab[3,3,1] = 1 / r
nab[3,3,2] = cos(th) / sin(th)
nab.display()
Ric = M.tensor_field(0,2, 'R', latex_name=r'R')
Ric = nab.ricci()
print("Ricci tensor")
Ric.display_comp()
Now, the `Ric[0,0]` component yield a simple equation, and can be solved by the command
desolve(diff(h,t) + h**2 - f*h, h, ivar=t, contrib_ode=True)
However, I'd like to be able of telling *Sage* the following
desolve( Ric[0,0], h, ivar=t, contrib_ode=True)
but it seems that there is an incompatibility of types here...
type(diff(h,t) + h**2 - f*h)
returns `<ππ’ππ'ππππ.ππ’ππππππ.ππ‘ππππππππ.π΄π‘ππππππππ'>`, while
type(Ric[0,0])
returns `<πππππ'ππππ.πππππππππ.πππππβ―ππππ.π²πππππ΅πππππππππππβ―π πππβ―ππππππππ’.πππππππβ―πππππ'>`
------
**Question:**
What can I do to use the results from `sagemanifolds` to solve the differential equation?DoxMon, 13 Aug 2018 13:05:22 -0500http://ask.sagemath.org/question/43370/How to solve and plot y' = x^2 + y^3http://ask.sagemath.org/question/43369/how-to-solve-and-plot-y-x2-y3/Hi.
My first post!
I am trying to complete this exercise:
12. Although it might not be obvious from the differential equation, its solution could βbehave badlyβ near a point x at which we wish to approximate y(x). Numerical procedures may give widely differing results near this point. Let y(x) be the solution of the initial-value problem y' = x^2 + y^3, y(1) = 1.
(a) Use a numerical solver to graph the solution on the interval [1, 1.4].
(b) Using the step size h = 0.1, compare the results obtained from Eulerβs method with the results from the improved Eulerβs method in the approximation of y(1.4).
Please help?
THANK YOU!RobertWebbMon, 13 Aug 2018 12:41:49 -0500http://ask.sagemath.org/question/43369/Is there a way to start a Sage session from a session of its Python interpreter ?http://ask.sagemath.org/question/43258/is-there-a-way-to-start-a-sage-session-from-a-session-of-its-python-interpreter/Yes, I know its sounds silly. But there *is* a point...
The R library [reticulate](https://github.com/rstudio/reticulate) allows to use a *persistent* Python session from a R session. One of its main uses is to allow to use Python code as well as R code in the creation of reports or papers. This is really useful for everyday statistics use...
One can do similar things with Sage and SageTeX, but using R and R objects is a bit awkward. Furthermore, the R tools offer abilities not easily emulated from within Sage. One *can* create composite documents using R facilities for R code (`knitr`) and SageTeX (or PythonTeX, better maintained nowadays) for supporting Sage code ; but usng such composite documents is a bit awkward : passing from the source to the compiled document entails :
* `knit` the R code of the `.Rnw` file, getting a `.tex` file ;
* `\LaTeX` the `.tex` file at least once ;
* `sage` (or `pythontex`) the resultant file
* re-`\LaTeX` the `.tex` file at least once.
This is a bit hard to automate... The same thing applies with aggravation to Markdown texts : the Sage chunks have to be wrapped in \LaTeX-only chunks, and the sage steps have to be done manually from the command line (or from emacs, which amounts to the same thing).
The availability of a persistent Sage session would solve the problem.
A small trial using Sage's R (launched by `sage -R`) shows that this is *almost* possible :
> library(reticulate)
> use_python("/usr/local/sage-8/sage") ## This is the main Sage script file
> repl_python()
Python 2.7.15 (/usr/local/sage-8/sage)
Reticulate 1.10 REPL -- A Python interpreter in R.
>>> 2^3
1
We are in python, no preparsing takes place.
>>> arctan
NameError: name 'arctan' is not defined
`arctan` is not defined : noting Sage-specific is known.
>>> from sage.all import *
>>> arctan
arctan
The import succeeded.
>>> x
NameError: name 'x' is not defined
But the (default) definition of x as a symbolic variable has not been done.
>>> var("x")
x
>>> x
x
>>> foo=arctan(x).integrate(x)
>>> exit
We are back to R, from which we can access toplevel objects in the Python session :
> py$foo
x*arctan(x) - 1/2*log(x^2 + 1)
> py$latex(py$foo)
x \arctan\left(x\right) - \frac{1}{2} \, \log\left(x^{2} + 1\right)
> py_to_r(py$latex(py$foo))
x \arctan\left(x\right) - \frac{1}{2} \, \log\left(x^{2} + 1\right)
Not a "standard" R characer vector :
> class(py_to_r(py$latex(py$foo)))
[1] "sage.misc.latex.LatexExpr" "python.builtin.str"
[3] "python.builtin.basestring" "python.builtin.object"
But it can be used as such :
> paste("** ",py$latex(py$foo)," **", sep="")
[1] "** x \\arctan\\left(x\\right) - \\frac{1}{2} \\, \\log\\left(x^{2} + 1\\right) **"
Now, it is possible to insert the loading of a *Python* module *before* the launch of the Python REPL : From the doc of `repl_python` :
module: An (optional) Python module to be imported before the REPL is
launched.
So the question is : is it possible to write a module correctly importing `sage.all` **AND** whose `__init__` function would ***replace*** Python's REPL by Sage's ?
ISTR that a few years ago, before the introduction of Sage's Jupyter notebook, such tricks were used in Jupyter to start a Sage session (complete with preparser) from an "ordinary" Jupyter notebook. But for the life of me, I haven't been able to retrieve the relevant pages...
Any thoughts ?
**EDIT :** A bit of googling using the former name "IPython notebook" led me to this StackOverflow [question](https://stackoverflow.com/questions/23384070/taking-advantage-of-sage-and-ipython-notebook-in-the-same-page-or-rather-combi), whose first answer, by no other than William Stein, tells the user that using `%load_ext sage` would start Sage from a (conventient) IPython session. Indeed :
charpent@asus16-ec:~$ sage -ipython
Python 2.7.15 (default, May 19 2018, 18:46:27)
Type "copyright", "credits" or "license" for more information.
IPython 5.5.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: 2^3
Out[1]: 1
So we are in Python, no preprocessing
In [2]: x
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-2-6fcf9dfbd479> in <module>()
----> 1 x
NameError: name 'x' is not defined
x not defined.
In [3]: %load_ext sage
In [4]: 2^3
Out[4]: 8
We are in Sage !
In [5]: x
Out[5]: x
x has been defined
In [6]: quit()
Exiting Sage (CPU time 0m0.13s, Wall time 0m14.53s).
So this `sage` notebook extension to IPython still exists, and does what I want. Its dissection should give me what I need to write my helper module.
But for the life of me, I have been unable to divine its source. what is it, and where is it ?
**EDIT on 2018-08-13 :** that source is in `$SAGE_ROOT/src/sage/repl/ipython_extension.py`, but is insufficient (to me !) to build a solution. Question re-asked on [sage-devel](https://groups.google.com/forum/#!topic/sage-devel/xGbk8FD-3LA) in order to reach new eyeballs...Emmanuel CharpentierSun, 05 Aug 2018 14:11:20 -0500http://ask.sagemath.org/question/43258/Cocalc in problem - files disappearinghttp://ask.sagemath.org/question/43366/cocalc-in-problem-files-disappearing/Just now I was working on cocalc and several files suddenly disappeared.
Could anyone tell me what is happening?
I don't need quite a certain answer, I just want some advice.pizzaMon, 13 Aug 2018 12:08:34 -0500http://ask.sagemath.org/question/43366/How can I calculate this sum? (accept both sage(cocalc) and by hand)http://ask.sagemath.org/question/43364/how-can-i-calculate-this-sum-accept-both-sagecocalc-and-by-hand/ How can I calculate this sum?
1/1-(x+x^2)^2
* This is the sum of infinity formula : a/1-r, while a=1 and r=(x+x^2)^2
Please also confirm if my formula is right.pizzaMon, 13 Aug 2018 11:24:41 -0500http://ask.sagemath.org/question/43364/Error when running a commandhttp://ask.sagemath.org/question/43337/error-when-running-a-command/Why does sage say that there is an error when I type a command and run it? (even I run 1+1, the error appear)
Here is how sage says:
ERROR: 'closed'
Communication with the Sage server is failing.
Here are some actions you could try to resolve this problem:
- check your internet connection,
- run this cell again,
- close and reopen this file,
- restart the project (in project settings, wrench icon),
- reload the browser tab or even restart your browser,
- delete some of the content in the project's ~/.local directory,
(locally installed Python libraries might interfere with running this worksheet)
pizzaSat, 11 Aug 2018 09:48:34 -0500http://ask.sagemath.org/question/43337/Typing in a command of an adding-to-infinity sumhttp://ask.sagemath.org/question/43339/typing-in-a-command-of-an-adding-to-infinity-sum/1/1-x = x^0+x^1+x^2+...
How can I type in such a command of an adding-to-infinity sum?
Urgent! If anyone have any answer or suggestion, please type in here! Thanks!pizzaSat, 11 Aug 2018 10:14:11 -0500http://ask.sagemath.org/question/43339/Latest development version not on AUR Arch Linux repositoryhttp://ask.sagemath.org/question/43356/latest-development-version-not-on-aur-arch-linux-repository/I use Linux Manjaro, because its package manager allows one to install latest development of sagemath very easily by just clicking a button.
The package manager builds latest development sagematch from sources from AUR (ArchLinux User repository):
https://aur.archlinux.org/packages/sagemath-git/
And it used to be that AUR is updated at same time as a new version of sagemath shows up on this page
http://mirrors-usa.go-parts.com/sage/sagemath/devel/index.html
But it has been more than one week and AUR is still showing older 8.3.rc3, while sagemath is now at sage-8.4.beta0
Any one knows how this process works, and why this time the latest development version does not show on AUR?NasserMon, 13 Aug 2018 03:04:26 -0500http://ask.sagemath.org/question/43356/Elliptic curve secp-224r1http://ask.sagemath.org/question/43353/elliptic-curve-secp-224r1/ p=2^224-2^96+1
A=-3#(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFE)
B=(0xB4050A850C04B3ABF541325650440B7D7BFD8BA270B39432355FFB4)
F=GF(p)
E = EllipticCurve( F, [A,B] );E
G=E(0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21,0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34);G
the above domain parameter (p,A,B,G) taken from SEC2(standard for efficient cryptography) Recommended Elliptic curve.
But when i run the code the error is the point G coordinate do not define point on elliptic curve.santoshiMon, 13 Aug 2018 01:16:29 -0500http://ask.sagemath.org/question/43353/How can compute minimal polynomial on a tower of a finite filed?http://ask.sagemath.org/question/43349/how-can-compute-minimal-polynomial-on-a-tower-of-a-finite-filed/ I have two extension field $E=K(d)$ and $K=F(a)$ where $F=GF(p)$ for a prime $p$. How can I compute the minimal polynomial of $d$ over $F$.
There is a command "absolute_minpoly" that works for number fields and not extension fields of finite fields. I want a command like that. RuhollaSat, 11 Aug 2018 19:18:49 -0500http://ask.sagemath.org/question/43349/How to simplify complicated expressionshttp://ask.sagemath.org/question/43321/how-to-simplify-complicated-expressions/Hello,
This complicated expression would be a zero function, but I can't achive to simplify it. I think I've run into lots of expressions like this one, but I've never come up with a solution.
This is mi code:
var('R d',domain='positive')
var('p',domain='real')
var('t',domain='real',latex_name="\\theta")
f=(R*cos(t) - d)*p/(-2*R*d*cos(t) + R^2 + d^2)^(3/2) + (R*cos(t) -R^2/d)*R^3*p/((-2*R^3*cos(t)/d + R^2 + R^4/d^2)^(3/2)*d^3) +R*p/(sqrt(-2*R^3*cos(t)/d + R^2 + R^4/d^2)*d^2macavemaFri, 10 Aug 2018 16:38:52 -0500http://ask.sagemath.org/question/43321/Algorithm for computing Class Group and Class Number?http://ask.sagemath.org/question/43310/algorithm-for-computing-class-group-and-class-number/I wanted to know what procedure does SAGE use for computing class numbers. I typed
sage : K = NumberField(x^2 + x + 1)
sage : K.class_number?
After that I got the documentation and further I opened this file
~/SageMath/local/lib/python2.7/site-packages/sage/rings/number_field/**number_field.py**
In that I looked for the place where I can find the class number snippet. It turns out that sage returns the order of class group, so I looked for class group snippet.
proof = proof_flag(proof)
try:
return self.__class_group[proof, names]
except KeyError:
pass
except AttributeError:
self.__class_group = {}
k = self.pari_bnf(proof)
cycle_structure = tuple( ZZ(c) for c in k.bnf_get_cyc() )
# Gens is a list of ideals (the generators)
gens = tuple( self.ideal(hnf) for hnf in k.bnf_get_gen() )
G = ClassGroup(cycle_structure, names, self, gens, proof=proof)
self.__class_group[proof, names] = G
return G
But I couldn't understand where is the implementation of algorithm. Can anyone help me from here to reach where I can get the algorithm?mathjainFri, 10 Aug 2018 08:54:14 -0500http://ask.sagemath.org/question/43310/How can I find the sum of first 20 positive perfect square?http://ask.sagemath.org/question/43311/how-can-i-find-the-sum-of-first-20-positive-perfect-square/When I type " k^2 for k in [1..20] ",
it says
" k**Integer(2) for k in (ellipsis_range(Integer(1),Ellipsis,Integer(20)))
^
SyntaxError: invalid syntax "
What can I type?
βpizzaFri, 10 Aug 2018 08:57:42 -0500http://ask.sagemath.org/question/43311/generating the ring for schoof's division polynomialshttp://ask.sagemath.org/question/43301/generating-the-ring-for-schoofs-division-polynomials/ hello,
i want to generate the ring $F_p[x,y]/(y^2-x^3-ax-b)$, which is necessary to compute the division polynomials in schoof's algorithm to compute the amount of elements of a elliptic curve of the form $y^2=x^3+ax+b$ over $F_p$.
I already tried this:
R.<x,y>=PolynomialRing(Zmod(p))
F=R.quo(y^2-x^3-ax-b)
x,y=F.gens()
When i computed some division polynomials in the generated F and matched them with division polynomials which sage computed by this:
F=Zmod(p)
E=EllipticCurve(F,[a,b])
E.division_polynomial()
i saw that my computed division polynomials must be wrong. Does anyone have an idea for generating the Ring $F_p[x,y]/(y^2-x^3-ax-b)$ or generating a "pseudo" elliptic curve in sage, because this code
F=Zmod(p)
E=EllipticCurve(F,[a,b])
E.division_polynomial()
doesn't work if $p$ isn't prime of course.
gebertlukiThu, 09 Aug 2018 18:42:18 -0500http://ask.sagemath.org/question/43301/NameError: name 'Integer' is not definedhttp://ask.sagemath.org/question/35506/nameerror-name-integer-is-not-defined/ Hi,
all of a sudden, I'm experiencing a strange error and cannot find any solution for it.
Sage itself works fine, but as soon as I try to load any .sage file, the application can't start. Inside sage I can do any calculation/operation as usual, but if I for example load an application that contains:
a=1
b=2
sage returns:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-1-496f9e9073df> in <module>()
----> 1 load("u.sage")
sage/structure/sage_object.pyx in sage.structure.sage_object.load (/build/sagemath/src/sage-7.4/src/src/build/cythonized/sage/structure/sage_object.c:12333)()
/usr/lib/python2.7/site-packages/sage/repl/load.pyc in load(filename, globals, attach)
245 if attach:
246 add_attached_file(fpath)
--> 247 exec(preparse_file(open(fpath).read()) + "\n", globals)
248 elif ext == '.spyx' or ext == '.pyx':
249 if attach:
/usr/lib/python2.7/site-packages/sage/structure/sage_object.so in <module>()
NameError: name 'Integer' is not defined
Yesterday everything was working fine. I hadn't done any system upgrades and the error appears on programs written and working yesterday and on new written programs.
Does anyone know how to solve this error or where it suddenly comes from? A restart didn't change anything...0x22Thu, 10 Nov 2016 08:25:50 -0600http://ask.sagemath.org/question/35506/How to fix "IOError: decoder jpeg not available"http://ask.sagemath.org/question/43298/how-to-fix-ioerror-decoder-jpeg-not-available/I have stuck when I compile these code in SageNotebook:
from PIL import Image
img=Image.open("/home/pmath/Music/im1.jpg")
img2=img.convert("L")
img2.save("/home/pmath/Music/secretimage.pgm")
img=Image.open("/home/pmath/Music/secretimage.pgm")
pix=img.load()
print pix
The following errors occur :
Traceback (click to the left of this block for traceback)
...
IOError: decoder jpeg not available
But when I compile these codes with python on the same OS(ubuntu32bit 16.04) it works well. The problems occur only on Sage. How can i fix this issue?math.mks@yandex.comThu, 09 Aug 2018 06:08:18 -0500http://ask.sagemath.org/question/43298/How do I upgrade from 8.2 to 8.3 on Windows without loosing my worksheets?http://ask.sagemath.org/question/43290/how-do-i-upgrade-from-82-to-83-on-windows-without-loosing-my-worksheets/ How do I upgrade from 8.2 to 8.3 on Windows without loosing my worksheets? Please answer for a non-OS savy, casual SageMath user. Thank you.Mark SzlazakWed, 08 Aug 2018 16:15:53 -0500http://ask.sagemath.org/question/43290/arrange an expression in powers of a variablehttp://ask.sagemath.org/question/43282/arrange-an-expression-in-powers-of-a-variable/I have the following code:
f0 = function('f0')(x)
f1 = function('f1')(x)
var('ep')
y = f0+ep*f1
de=ep*diff(y,x,2)+diff(y,x)
expand(de)
which gives the output:
ep^2*diff(f1(x), x, x) + ep*diff(f0(x), x, x) + ep*diff(f1(x), x) + diff(f0(x), x)
How can I rearrange this expression in powers of "ep" parameter? i.e
ep^2*diff(f1(x), x, x) + ep*( diff(f0(x), x, x) + diff(f1(x), x) ) + diff(f0(x), x)
Then I want to get the coefficient for each power (which is a differential eq) and then pass it to the desolve.aliWed, 08 Aug 2018 03:20:08 -0500http://ask.sagemath.org/question/43282/No module named coin_backendhttp://ask.sagemath.org/question/43277/no-module-named-coin_backend/Please help me, When I run Present.sage file content as a new notebook on SageMath 8.1, an error message appears with the phrase "No module named coin_backend". Even though I installed the package cbc, it still remains a problem. So where is the problem? Can someone tell me how I could to add the module? mohammadhariziTue, 07 Aug 2018 00:08:15 -0500http://ask.sagemath.org/question/43277/does sagemath support fresnels function?http://ask.sagemath.org/question/43237/does-sagemath-support-fresnels-function/ I am trying to run integration on file that contains problems using fresnels functions.
I am not even able to load the file, since sagemath complains that it does not know fresnels.
This function is there in sympy
http://docs.sympy.org/latest/modules/functions/special.html?highlight=fresnel#sympy.functions.special.error_functions.fresnels
>python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
>>> from sympy import *
>>> fresnels(x)
fresnels(x)
But in Sagemath
sage: var('x')
x
sage: fresnels(x)
NameError Traceback (most recent call last)
<ipython-input-10-08120c00ce46> in <module>()
----> 1 fresnels(x)
NameError: name 'fresnels' is not defined
It is no problem for this to fail, as I can capture the exception. But the problem is that I can't even load the file itself to begin with. The sage script I have starts by reading a plain text file, which contains a list of the problems. Like this
var('a b c d e m n x ')
lst=[[x^7*fresnels(b*x),x,6,],
[x^6*fresnels(b*x),x,6,],
[x^5*fresnels(b*x),x,5,],
[x^4*fresnels(b*x),x,5,]]
The sage script does this
load(currentTestFile)
Where the `currentTestFile` is as shown above.
And once loaded, it iterates over each integral in the list and run it. But it seems sage parses the file during loading:
>./build_giac.sage
Test starting.....
load(currentTestName) #read the problems. This also contains the var('') statement.
File "sage/misc/persist.pyx", line 136, in sage.misc.persist.load (build/cythonized/sage/misc/persist.c:2440)
File "/usr/lib/python2.7/site-packages/sage/repl/load.py", line 263, in load
exec(preparse_file(f.read()) + "\n", globals)
File "<string>", line 3, in <module>
NameError: name 'fresnels' is not defined
So I am not able to even load the file. If I can even load the file, then if the integral fails afterwords, it is OK, since I can trap the exception, mark it as failed, and go to the next integral.
First question is: Does Sagemath have no support for fresnels?
And in this case, how could one bypass this error during reading of the input file to give me a change to run the integrals?
Using SageMath version 8.3.rc2, Release Date: 2018-07-22
Thank you
--Nasser
NasserWed, 01 Aug 2018 20:50:46 -0500http://ask.sagemath.org/question/43237/No module named coin_backendhttp://ask.sagemath.org/question/43266/no-module-named-coin_backend/Please help me,
When I run Present.sage file content as a new notebook on SageMath 8.1, an error message appears with the phrase "No module named coin_backend". Can someone tell me how I could to add the module? mohammadhariziMon, 06 Aug 2018 08:03:40 -0500http://ask.sagemath.org/question/43266/Help with graphshttp://ask.sagemath.org/question/43261/help-with-graphs/ I am trying to find the set of (surjective) homomorphic images of the Groetzsch Graph - G. I have two ideas, but I am stuck at both. Help with either would be very much appreciated.
1.I try narrowing down the candidate homomorphic images to graphs with chromatic number at least 4 and number of vertices at most 10 in house of graphs. Then i get a graph6 file and try to check if each of those graphs is a homomorphic image of G. This doesn't work because I don't know how exactly to import the graph6 file into sage.
2. Find the independent sets of G and find all the ways I can combine them into homomorphic images. I' ve heard that this is possible, but seems like a rather daunting task for me because I am very new with sage.glavunchoMon, 06 Aug 2018 02:45:32 -0500http://ask.sagemath.org/question/43261/