Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
And if anyone has language issue it surely is OP. hijack vs shut up, which one 
is more serious? Accusing someone hijacking something is a very serious 
accusation.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
*can't

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
If one don't have an authority to dictate, why can't he told to be shut up? 
Instead ask him to continue to dictate? What kind of community is this?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Snd if someone say something trying to dictate what can or cannot be asked 
without backing up with an authority to dictate (such as a guideline), he 
should really shut up literally and I wonder why this is a 'language issue". 
Did you guys not literally means shut up when you say shut up? Do you guys use 
shut up as foul language like you don't mean it? (I wonder why guys will say 
f**k up to guys if they are not gay, you know, like they don't mean it.)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
And do point out where's the guideline saying I can ask follow up questions 
like this.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Do ban me if you think "shut up" is language issue. It must be a joke.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
How's your behavior so good? you are a selfish guy that only want to consumea 
others time and ask question and cannot stand people asking following up 
question on the same piece of code. You should really have shutted up and may 
be mark it as spam but not speak up.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
"shut up" is language issue? You dont know whats bad language.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
And if anyone is dictating this, that one is surely not you, even if you're 
the OP. Shut up.

On Monday, November 19, 2018 at 4:43:44 AM UTC-8, Peter Luschny wrote:
>
> > Hi, I’m trying to translate this Sage syntax to Python syntax (i.e. 
> using sage as a Python library.) But I got stuck even on the first command.
>
> Why do you hijack this thread with a completely different topic?
>
> I'm sure that your question and the answers of the experts are of 
> interest to many, but they will not expect them under this subject.
>
> Please open in the future new threads for your questions!  Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Because I use exactly the code shown here as an example. And I did open a 
thread posting a direct question on how to use sage as a library but the 
question is too general. So I figure I should use an example and so happen 
I saw this thread with an interesting example.

So this is not hijack. And not a completely different topic. The piece of 
code is exactly the same.

On Monday, November 19, 2018 at 4:43:44 AM UTC-8, Peter Luschny wrote:
>
> > Hi, I’m trying to translate this Sage syntax to Python syntax (i.e. 
> using sage as a Python library.) But I got stuck even on the first command.
>
> Why do you hijack this thread with a completely different topic?
>
> I'm sure that your question and the answers of the experts are of 
> interest to many, but they will not expect them under this subject.
>
> Please open in the future new threads for your questions!  Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
Thanks. This answer my question and I put the tip 
in https://groups.google.com/d/msg/sage-support/NFtI5XqjQWg/sz5WPcFMAgAJ

On Monday, November 19, 2018 at 3:58:50 AM UTC-8, John Cremona wrote:
>
> I recommend importing anything you need from sage.all since the details of 
> where everything is might change in time.  This works perfectly well:
>
> $ sage -python  # so we use Sage's python not my system-wide one
> Python 2.7.15 (default, Nov  2 2018, 14:32:42) 
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from sage.all import PolynomialRing, QQ
> >>> R = PolynomialRing(QQ,'x')
> >>> x = R.gen()
> >>> f = x^3+1 # no good as no preparser
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "sage/structure/element.pyx", line 944, in 
> sage.structure.element.Element.__xor__ 
> (build/cythonized/sage/structure/element.c:9006)
> RuntimeError: Use ** for exponentiation, not '^', which means xor
> in Python, and has the wrong precedence.
>
> # Now we can work with this:
>
> >>> f = x**3+1  # that's better
> >>> f.factor()
> (x + 1) * (x^2 - x + 1)
>
> Another thing I do is to put my commands into a .py file and run pyflakes 
> on it, as that reveals what things need to be imported.  Then import them 
> all from sage.all.
>
> John Cremona
>
> On Mon, 19 Nov 2018 at 11:48, Kolen Cheung  > wrote:
>
>> Thank you both for the answers. However, I’m still stuck:
>>
>> Focusing on just translating the first line: R. = QQ[]
>>
>> In sage,
>>
>> >>> preparse("R. = QQ[]")"R = QQ['x']; (x,) = R._first_ngens(1)">>> 
>> >>> import_statements(QQ)# ** Warning **: several names for that object: Q, 
>> >>> QQfrom sage.rings.rational_field import Q>>> import_statements(R)from 
>> >>> sage.rings.qqbar import QQx
>>
>> Immediately I have a question: how come the import_statements of QQ is ... 
>> import Q, and the import statement of R is ... import QQx? In either 
>> case the namespace in question is not imported. Does it mean ... import 
>> Q as QQ and ... import QQx as R respectively?
>>
>> Then I’ve a problem: In sage, I can import them using these import 
>> statements. But when entering these 2 import statements in Python,
>>
>> >>> from sage.rings.rational_field import Q
>> ---
>> ImportError   Traceback (most recent call last)
>>  in ()
>> > 1 from sage.rings.rational_field import Q
>>
>> /usr/lib/python2.7/site-packages/sage/rings/rational_field.py in ()
>>  62 _long_type = int
>>  63 
>> ---> 64 from .rational import Rational
>>  65 from .integer import Integer
>>  66 
>>
>> /usr/lib/python2.7/site-packages/sage/rings/rational.pyx in init 
>> sage.rings.rational (build/cythonized/sage/rings/rational.c:40976)()
>>  94 
>>  95 
>> ---> 96 import sage.rings.real_mpfr
>>  97 import sage.rings.real_double
>>  98 from libc.stdint cimport uint64_t
>>
>> /usr/lib/python2.7/site-packages/sage/rings/real_mpfr.pyx in init 
>> sage.rings.real_mpfr (build/cythonized/sage/rings/real_mpfr.c:44298)()
>> > 1 r"""
>>   2 Arbitrary Precision Real Numbers
>>   3 
>>   4 AUTHORS:
>>   5 
>>
>> /usr/lib/python2.7/site-packages/sage/rings/complex_number.pxd in init 
>> sage.libs.mpmath.utils (build/cythonized/sage/libs/mpmath/utils.c:8831)()
>>   4 from .real_mpfr cimport RealNumber
>>   5 
>> > 6 cdef class ComplexNumber(sage.structure.element.FieldElement):
>>   7 cdef mpfr_t __re
>>   8 cdef mpfr_t __im
>>
>> /usr/lib/python2.7/site-packages/sage/rings/complex_double.pxd in init 
>> sage.rings.complex_number 
>> (build/cythonized/sage/rings/complex_number.c:24212)()
>>   8 
>>   9 
>> ---> 10 cdef class ComplexDoubleField_class(sage.rings.ring.Field):
>>  11 pass
>>  12 
>>
>> /usr/lib/python2.7/site-packages/sage/rings/complex_double.pyx in init 
>> sage.rings.complex_double 
>> (build/cythonized/sage/rings/complex_double.c:24230)()
>>  96 from cypari2.convert cimport new_gen_from_double, 
>> new_t_COMPLEX_from_double
>>  97 
>> ---> 98 from . import comple

[sage-support] Re: Documentation on using sage as a library?

2018-11-19 Thread Kolen Cheung


Here’s the way to translate any Sage program to Python. From 
https://groups.google.com/d/msg/sage-support/ZtlmX3zE0b8/cdecLnbUAwAJ:

The key are these:

from sage.all import *
def sage_parse(expr):
'''exec a sage expression in globals
'''
expr_str = preparse(expr)
# print to show what's run
print(expr_str)
exec(expr_str, globals())

Example (taken from 
https://groups.google.com/d/msg/sage-support/ZtlmX3zE0b8/mqmG5KuiEgAJ):

Sage program:

R. = QQ[]
K = R.fraction_field()
H. = QuaternionAlgebra(K, -1, -1)def Q(a, b, c, d): return H(a + b*i + 
c*j + d*k)@cached_functiondef P(n):
return Q(x+1,1,1,1)*P(n-1) if n > 0 else Q(1,0,0,0)def p(n): return 
P(n)[0].numerator().list()for n in (0..20): print [n], p(n)

Python translation: (grey boxes are the stdouts)

from sage.all import *
def sage_parse(expr):
'''exec a sage expression in globals
'''
expr_str = preparse(expr)
# print to show what's run
print(expr_str)
exec(expr_str, globals())

sage_parse('R. = QQ[]')

R = QQ['x']; (x,) = R._first_ngens(1)

K = R.fraction_field()

sage_parse('H. = QuaternionAlgebra(K, -1, -1)')

H = QuaternionAlgebra(K, -Integer(1), -Integer(1), names=('i', 'j', 'k',)); (i, 
j, k,) = H._first_ngens(3)

def Q(a, b, c, d):
return H(a + b * i + c * j + d * k)

@cached_functiondef P(n):
return Q(x + 1, 1, 1, 1) * P(n - 1) if n > 0 else Q(1, 0, 0, 0)

def p(n):
return P(n)[0].numerator().list()

for n in range(21):
print [n], p(n)

[0] [1]
[1] [1, 1]
[2] [-2, 2, 1]
[3] [-8, -6, 3, 1]
[4] [-8, -32, -12, 4, 1]
[5] [16, -40, -80, -20, 5, 1]
[6] [64, 96, -120, -160, -30, 6, 1]
[7] [64, 448, 336, -280, -280, -42, 7, 1]
[8] [-128, 512, 1792, 896, -560, -448, -56, 8, 1]
[9] [-512, -1152, 2304, 5376, 2016, -1008, -672, -72, 9, 1]
[10] [-512, -5120, -5760, 7680, 13440, 4032, -1680, -960, -90, 10, 1]
[11] [1024, -5632, -28160, -21120, 21120, 29568, 7392, -2640, -1320, -110, 11, 
1]
[12] [4096, 12288, -33792, -112640, -63360, 50688, 59136, 12672, -3960, -1760, 
-132, 12, 1]
[13] [4096, 53248, 79872, -146432, -366080, -164736, 109824, 109824, 20592, 
-5720, -2288, -156, 13, 1]
[14] [-8192, 57344, 372736, 372736, -512512, -1025024, -384384, 219648, 192192, 
32032, -8008, -2912, -182, 14, 1]
[15] [-32768, -122880, 430080, 1863680, 1397760, -1537536, -2562560, -823680, 
411840, 320320, 48048, -10920, -3640, -210, 15, 1]
[16] [-32768, -524288, -983040, 2293760, 7454720, 4472832, -4100096, -5857280, 
-1647360, 732160, 512512, 69888, -14560, -4480, -240, 16, 1]
[17] [65536, -557056, -4456448, -5570560, 9748480, 25346048, 12673024, 
-9957376, -12446720, -3111680, 1244672, 792064, 99008, -19040, -5440, -272, 17, 
1]
[18] [262144, 1179648, -5013504, -26738688, -25067520, 35094528, 76038144, 
32587776, -22404096, -24893440, -5601024, 2036736, 1188096, 137088, -24480, 
-6528, -306, 18, 1]
[19] [262144, 4980736, 11206656, -31752192, -127008768, -95256576, 32672, 
206389248, 77395968, -47297536, -47297536, -9674496, 3224832, 1736448, 186048, 
-31008, -7752, -342, 19, 1]
[20] [-524288, 5242880, 49807360, 74711040, -158760960, -508035072, -317521920, 
317521920, 515973120, 171991040, -94595072, -85995520, -16124160, 4961280, 
2480640, 248064, -38760, -9120, -380, 20, 1]

Interested in adding this to the documentation / FAQ? It just wasn’t very 
clear in the FAQ.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung


I wonder why for me the result is

>>> import_statements(QQ)
# ** Warning **: several names for that object: Q, QQ from 
sage.rings.rational_field import Q

On Monday, November 19, 2018 at 4:05:55 AM UTC-8, Dima Pasechnik wrote:

On Mon, Nov 19, 2018 at 11:58 AM John Cremona  > wrote: 
> > 
> > I recommend importing anything you need from sage.all since the details 
> of where everything is might change in time.  This works perfectly well: 
> > 
> > $ sage -python  # so we use Sage's python not my system-wide one 
> > Python 2.7.15 (default, Nov  2 2018, 14:32:42) 
> > [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux2 
> > Type "help", "copyright", "credits" or "license" for more information. 
> > >>> from sage.all import PolynomialRing, QQ 
> > >>> R = PolynomialRing(QQ,'x') 
> > >>> x = R.gen() 
> > >>> f = x^3+1 # no good as no preparser 
> > Traceback (most recent call last): 
> >   File "", line 1, in  
> >   File "sage/structure/element.pyx", line 944, in 
> sage.structure.element.Element.__xor__ 
> (build/cythonized/sage/structure/element.c:9006) 
> > RuntimeError: Use ** for exponentiation, not '^', which means xor 
> > in Python, and has the wrong precedence. 
> > 
> > # Now we can work with this: 
> > 
> > >>> f = x**3+1  # that's better 
> > >>> f.factor() 
> > (x + 1) * (x^2 - x + 1) 
> > 
> > Another thing I do is to put my commands into a .py file and run 
> pyflakes on it, as that reveals what things need to be imported.  Then 
> import them all from sage.all. 
>
> you can also find out exactly what you need to import: 
>
> sage: import_statements("QQ") 
> from sage.rings.rational_field import QQ 
>
>
> > 
> > John Cremona 
> > 
> > On Mon, 19 Nov 2018 at 11:48, Kolen Cheung  > wrote: 
> >> 
> >> Thank you both for the answers. However, I’m still stuck: 
> >> 
> >> Focusing on just translating the first line: R. = QQ[] 
> >> 
> >> In sage, 
> >> 
> >> >>> preparse("R. = QQ[]") 
> >> "R = QQ['x']; (x,) = R._first_ngens(1)" 
> >> >>> import_statements(QQ) 
> >> # ** Warning **: several names for that object: Q, QQ 
> >> from sage.rings.rational_field import Q 
> >> >>> import_statements(R) 
> >> from sage.rings.qqbar import QQx 
> >> 
> >> Immediately I have a question: how come the import_statements of QQ is 
> ... import Q, and the import statement of R is ... import QQx? In either 
> case the namespace in question is not imported. Does it mean ... import Q 
> as QQ and ... import QQx as R respectively? 
> >> 
> >> Then I’ve a problem: In sage, I can import them using these import 
> statements. But when entering these 2 import statements in Python, 
> >> 
> >> >>> from sage.rings.rational_field import Q 
> >> 
> --- 
> >> ImportError   Traceback (most recent call 
> last) 
> >>  in () 
> >> > 1 from sage.rings.rational_field import Q 
> >> 
> >> /usr/lib/python2.7/site-packages/sage/rings/rational_field.py in 
> () 
> >>  62 _long_type = int 
> >>  63 
> >> ---> 64 from .rational import Rational 
> >>  65 from .integer import Integer 
> >>  66 
> >> 
> >> /usr/lib/python2.7/site-packages/sage/rings/rational.pyx in init 
> sage.rings.rational (build/cythonized/sage/rings/rational.c:40976)() 
> >>  94 
> >>  95 
> >> ---> 96 import sage.rings.real_mpfr 
> >>  97 import sage.rings.real_double 
> >>  98 from libc.stdint cimport uint64_t 
> >> 
> >> /usr/lib/python2.7/site-packages/sage/rings/real_mpfr.pyx in init 
> sage.rings.real_mpfr (build/cythonized/sage/rings/real_mpfr.c:44298)() 
> >> > 1 r""" 
> >>   2 Arbitrary Precision Real Numbers 
> >>   3 
> >>   4 AUTHORS: 
> >>   5 
> >> 
> >> /usr/lib/python2.7/site-packages/sage/rings/complex_number.pxd in init 
> sage.libs.mpmath.utils (build/cythonized/sage/libs/mpmath/utils.c:8831)() 
> >>   4 from .real_mpfr cimport RealNumber 
> >>   5 
> >> > 6 cdef class ComplexNumber(sage.structure.element.FieldElement): 
> >>   7 cdef mpfr_t __re 
> >>

Re: [sage-support] Sage Crash Report

2018-11-19 Thread Kolen Cheung


Thanks. This is it. I’m glad we discussed about the channel priority (if 
you noticed my original attachment sage-environment.yml, conda-forge is 
last.)

I’m curious why this ABI incompatibility are allowed when satisfying the 
dependencies. I don’t know if the conda forge formula is written 
incorrectly or if this is a deficiency of conda. My original hope is to 
prioritize the intel channel so I can get libraries such as numpy and scipy 
from intel which is built using MKL instead of openblas. The bigger picture 
is to use sage together with the existing stack of libraries I already am 
using (where most are from intel then defaults).

For others’ reference, this is the minimal example to install sage in conda:

name: sage
channels:
  # this must be the first
  - conda-forge
  - intel
  - defaults
dependencies:
  # or just sage if you don't care versions
  - sage=8.3=py36_3

Save it as env-sage.yml, then run

conda env create -f ~/Dropbox/env-sage.yml
. activate sage

​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-19 Thread Kolen Cheung


Thanks all for the comments. In the end I choose this temporary fix 
plot3d(sin(pi 
* sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 5), 
viewer='threejs', online=True). I prefer to stick to jupyterlab hub and 
using conda to manage it so I didn’t try symlink those from sage in the 
jupyterlab environment.

Regarding the three.js shipped by Arch, may be it didn’t work. But it isn’t 
the original of the problem I’m experiencing since in the browser’s console 
it clearly indicates the three.js cannot be found. I tried to install 
three.js the “jupyter way”, i.e. jupyter labextension install 
jupyter-threejs, but it didn’t work for both jupyterlab and jupyter 
notebook.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung


Thank you both for the answers. However, I’m still stuck:

Focusing on just translating the first line: R. = QQ[]

In sage,

>>> preparse("R. = QQ[]")"R = QQ['x']; (x,) = R._first_ngens(1)">>> 
>>> import_statements(QQ)# ** Warning **: several names for that object: Q, 
>>> QQfrom sage.rings.rational_field import Q>>> import_statements(R)from 
>>> sage.rings.qqbar import QQx

Immediately I have a question: how come the import_statements of QQ is ... 
import Q, and the import statement of R is ... import QQx? In either case 
the namespace in question is not imported. Does it mean ... import Q as QQ 
and ... import QQx as R respectively?

Then I’ve a problem: In sage, I can import them using these import 
statements. But when entering these 2 import statements in Python,

>>> from sage.rings.rational_field import Q
---
ImportError   Traceback (most recent call last)
 in ()
> 1 from sage.rings.rational_field import Q

/usr/lib/python2.7/site-packages/sage/rings/rational_field.py in ()
 62 _long_type = int
 63 
---> 64 from .rational import Rational
 65 from .integer import Integer
 66 

/usr/lib/python2.7/site-packages/sage/rings/rational.pyx in init 
sage.rings.rational (build/cythonized/sage/rings/rational.c:40976)()
 94 
 95 
---> 96 import sage.rings.real_mpfr
 97 import sage.rings.real_double
 98 from libc.stdint cimport uint64_t

/usr/lib/python2.7/site-packages/sage/rings/real_mpfr.pyx in init 
sage.rings.real_mpfr (build/cythonized/sage/rings/real_mpfr.c:44298)()
> 1 r"""
  2 Arbitrary Precision Real Numbers
  3 
  4 AUTHORS:
  5 

/usr/lib/python2.7/site-packages/sage/rings/complex_number.pxd in init 
sage.libs.mpmath.utils (build/cythonized/sage/libs/mpmath/utils.c:8831)()
  4 from .real_mpfr cimport RealNumber
  5 
> 6 cdef class ComplexNumber(sage.structure.element.FieldElement):
  7 cdef mpfr_t __re
  8 cdef mpfr_t __im

/usr/lib/python2.7/site-packages/sage/rings/complex_double.pxd in init 
sage.rings.complex_number (build/cythonized/sage/rings/complex_number.c:24212)()
  8 
  9 
---> 10 cdef class ComplexDoubleField_class(sage.rings.ring.Field):
 11 pass
 12 

/usr/lib/python2.7/site-packages/sage/rings/complex_double.pyx in init 
sage.rings.complex_double (build/cythonized/sage/rings/complex_double.c:24230)()
 96 from cypari2.convert cimport new_gen_from_double, 
new_t_COMPLEX_from_double
 97 
---> 98 from . import complex_number
 99 
100 from .complex_field import ComplexField

ImportError: cannot import name complex_number
>>> from sage.rings.qqbar import QQx
---
ImportError   Traceback (most recent call last)
 in ()
> 1 from sage.rings.qqbar import QQx

/usr/lib/python2.7/site-packages/sage/rings/qqbar.py in ()
512 rich_to_bool, richcmp_not_equal,
513 op_EQ, op_NE)
--> 514 from sage.rings.real_mpfr import RR
515 from sage.rings.real_mpfi import RealIntervalField, RIF, 
is_RealIntervalFieldElement, RealIntervalField_class
516 from sage.rings.complex_field import ComplexField

/usr/lib/python2.7/site-packages/sage/rings/real_mpfr.pyx in init 
sage.rings.real_mpfr (build/cythonized/sage/rings/real_mpfr.c:44298)()
> 1 r"""
  2 Arbitrary Precision Real Numbers
  3 
  4 AUTHORS:
  5 

/usr/lib/python2.7/site-packages/sage/rings/complex_number.pxd in init 
sage.libs.mpmath.utils (build/cythonized/sage/libs/mpmath/utils.c:8831)()
  4 from .real_mpfr cimport RealNumber
  5 
> 6 cdef class ComplexNumber(sage.structure.element.FieldElement):
  7 cdef mpfr_t __re
  8 cdef mpfr_t __im

/usr/lib/python2.7/site-packages/sage/rings/complex_double.pxd in init 
sage.rings.complex_number (build/cythonized/sage/rings/complex_number.c:24212)()
  8 
  9 
---> 10 cdef class ComplexDoubleField_class(sage.rings.ring.Field):
 11 pass
 12 

/usr/lib/python2.7/site-packages/sage/rings/complex_double.pyx in init 
sage.rings.complex_double (build/cythonized/sage/rings/complex_double.c:24230)()
 96 from cypari2.convert cimport new_gen_from_double, 
new_t_COMPLEX_from_double
 97 
---> 98 from . import complex_number
 99 
100 from .complex_field import ComplexField

ImportError: cannot import name complex_number

Thanks. 
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit 

Re: [sage-support] Quaternions, how to speed up computation

2018-11-19 Thread Kolen Cheung
But if you're reading carefully this isn't what I'm asking.

On Monday, November 19, 2018 at 12:30:22 AM UTC-8, Dima Pasechnik wrote:
>
> Sage uses a preparer to translate things like R.=QQ[] into usual Python 
> R=PolynomialRing(...).
>
> In the library code the preparer is not used.
>
>
> On Mon, 19 Nov 2018 03:13 Kolen Cheung  
> wrote:
>
>> Hi, I’m trying to translate this Sage syntax to Python syntax (i.e. using 
>> sage as a Python library.) But I got stuck even on the first command.
>>
>> In Sage,
>>
>> >>> R. = QQ[]>>> type(R)
>>
>> > 'sage.rings.polynomial.polynomial_ring.PolynomialRing_field_with_category'>
>>
>> Then I thought I can import it in Python like this:
>>
>> import sage.rings
>> # OK
>>
>> sage.rings.polynomial.polynomial_ring.PolynomialRing_field
>> # AttributeError
>>
>> sage.rings.polynomial.polynomial_ring.PolynomialRing_field_with_category
>>
>> How would you write the same program in Python using sage as a library? 
>> And in general I see many unfamiliar syntax (from Python’s point of view) 
>> like R., QQ[], (0..20), etc. Do you think it is realistic to use sage 
>> as a Python library and completely not using sage (as an interpreter) 
>> itself?
>>
>> c.f. Documentation on using sage as a library? 
>> <https://groups.google.com/d/msg/sage-support/NFtI5XqjQWg/qsW54OzeAQAJ>
>>
>> Thanks.
>> ​
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-support" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-support...@googlegroups.com .
>> To post to this group, send email to sage-s...@googlegroups.com 
>> .
>> Visit this group at https://groups.google.com/group/sage-support.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Quaternions, how to speed up computation

2018-11-18 Thread Kolen Cheung


Hi, I’m trying to translate this Sage syntax to Python syntax (i.e. using 
sage as a Python library.) But I got stuck even on the first command.

In Sage,

>>> R. = QQ[]>>> type(R)



Then I thought I can import it in Python like this:

import sage.rings
# OK

sage.rings.polynomial.polynomial_ring.PolynomialRing_field
# AttributeError

sage.rings.polynomial.polynomial_ring.PolynomialRing_field_with_category

How would you write the same program in Python using sage as a library? And 
in general I see many unfamiliar syntax (from Python’s point of view) like 
R., QQ[], (0..20), etc. Do you think it is realistic to use sage as a 
Python library and completely not using sage (as an interpreter) itself?

c.f. Documentation on using sage as a library? 


Thanks.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Kolen Cheung


I tried to install threejs by jupyter labextension install jupyter-threejs 
but it still doesn’t work. I tried on both jupyter and jupyterlab. I didn’t 
tried symlinking the directories you mentioned though, because I don’t want 
to mess up the virtual environments created by conda (my jupyterlab 
environment is created using conda.)
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-18 Thread Kolen Cheung


sage: y = var('y')
sage: plot3d(x * y, (x, -1, 1), (y, -1, 1), viewer='threejs')
Launched html viewer for Graphics3d Object

I didn’t see anything since I’m remote ssh. I tried both ssh -X and ssh -Y 
but they doesn’t work.

I don’t have a local machine that has a working sage yet. So can’t test 
that.

Thanks.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage Crash Report

2018-11-18 Thread Kolen Cheung


Interesting, it failed.

sage ❯❯❯ conda env create -f env.yml
Solving environment: failed

ResolvePackageNotFound: 
  - sagenb==1.0.3=py_0

Searching it on https://anaconda.org/conda-forge/sagenb/files shows it 
doesn’t exist. Has it been removed?

Another question, I noticed that you prioritize conda-forge over defaults, 
why?

Thanks.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung
I have the command line tool. I use `brew cask install sage` and it finishes 
download without proceeding. It is possible the formula in caskroom need to be 
updated though.

But the problem is that I can't get it work even on the Linux installation 
where everything else' fine so far, except plot3d.

Regards,
Kolen
On Nov 17, 2018, 10:34 PM -0800, John H Palmieri , 
wrote:
>
>
> On Saturday, November 17, 2018 at 7:24:58 PM UTC-8, Kolen Cheung wrote:
> > I couldn't install sage on macOS Mojave, I'm guessing it isn't compatible 
> > with Mojave yet.
>
> My message said that I had installed it on OS X 10.14.1, which is Mojave. You 
> need to have Xcode installed with the command line tools, or at least the 
> command line tools. Try searching the google group sage-devel for information 
> about installing with Mojave.
>
> >
> > Currently it's like this: on an ArchLinux machine, install sage through 
> > pacman, and install the sagemath kernel to my jupyterlab hub. And then 
> > through the jupyterlab-hub I remote it and use the sagemath kernel and 
> > typed the above commands.
> >
> > I'm guessing it requires some widgets to be installed in jupyter for them 
> > to work. Since I'm not using the Sage notebook interface but a 
> > Jupyterlab-hub instance that has the sagemath kernel installed.
> >
> > On Saturday, November 17, 2018 at 7:21:02 PM UTC-8, John H Palmieri wrote:
> > > This is on OS X? How did you install Sage? (It works for me with Sage 
> > > built from scratch on both OS X 10.13.6 and OS X 10.14.1.)
> > >
> > >   John
> > >
> > >
> > > On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
> > > > I tried both
> > > > plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, 
> > > > -5, 5), viewer='threejs')
> > > > ...
> > > > p1 = sphere(color='red', opacity='.5')
> > > > p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
> > > > p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
> > > > show(p1 + p2 + p3, viewer='threejs')
> > > > Again on both jupyter notebook and jupyterlab, on both Safari and 
> > > > Chrome. Are you sure there isn’t other dependencies?
> > > > I checked the HTML console and found this:
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (preact.min.js.map, line 0)
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (index.js.map, line 0)
> > > > [Error] Failed to load resource: the server responded with a status of 
> > > > 404 (Not Found) (preact-compat.min.js.map, line 0)
> > > > Are there any jupyter widgets that I should install?
> > > >
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung
I couldn't install sage on macOS Mojave, I'm guessing it isn't compatible 
with Mojave yet.

Currently it's like this: on an ArchLinux machine, install sage through 
pacman, and install the sagemath kernel to my jupyterlab hub. And then 
through the jupyterlab-hub I remote it and use the sagemath kernel and 
typed the above commands.

I'm guessing it requires some widgets to be installed in jupyter for them 
to work. Since I'm not using the Sage notebook interface but a 
Jupyterlab-hub instance that has the sagemath kernel installed.

On Saturday, November 17, 2018 at 7:21:02 PM UTC-8, John H Palmieri wrote:
>
> This is on OS X? How did you install Sage? (It works for me with Sage 
> built from scratch on both OS X 10.13.6 and OS X 10.14.1.)
>
>   John
>
>
> On Saturday, November 17, 2018 at 5:32:34 PM UTC-8, Kolen Cheung wrote:
>>
>> I tried both
>>
>> plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 
>> 5), viewer='threejs')
>> ...
>> p1 = sphere(color='red', opacity='.5')
>> p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
>> p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
>> show(p1 + p2 + p3, viewer='threejs')
>>
>> Again on both jupyter notebook and jupyterlab, on both Safari and Chrome. 
>> Are you sure there isn’t other dependencies?
>>
>> I checked the HTML console and found this:
>>
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (preact.min.js.map, line 0)
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (index.js.map, line 0)
>> [Error] Failed to load resource: the server responded with a status of 404 
>> (Not Found) (preact-compat.min.js.map, line 0)
>>
>> Are there any jupyter widgets that I should install?
>> ​
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Documentation on using sage as a library?

2018-11-17 Thread Kolen Cheung


Hi, many of the texts and documentations assume one is using the SageMath 
kernel. So far I see one FAQ address using sage as a library.

But using sage as a library would certainly has a different behavior with 
sage itself. e.g. Rational('3 / 2') rather than 3 / 2, and displaying in 
latex seems more indirect:

from sage.misc.latex import MathJaxfrom IPython.display import HTML

MATHJAX = MathJax()
def print_latex(expression, engine=MATHJAX):
return HTML(str(engine(expression)))

However I couldn’t find a way to show plots. e.g. plot results in Graphics 
object consisting of 1 graphics primitive and plot3d results in Graphics3d 
Object. How should these graphic objects be shown as images? The closet I 
got is .dumps or .matplotlib methods but they didn’t work.

In general, are there documentations for using sage as a python library, 
and are there any materials that help Python programmers to pick up sage? 
i.e. assuming one knows Python already, used to “Pythonism”, and the common 
Python stacks such as Matplotlib, etc.

Thanks.
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage Crash Report

2018-11-17 Thread Kolen Cheung


sage ~ ❯❯❯ ls -alh 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../libgd.so.3
lrwxrwxrwx 1 sage sage 14 Nov 17 17:34 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../libgd.so.3
 -> libgd.so.3.0.5
sage ~ ❯❯❯ ldd 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../libgd.so.3
linux-vdso.so.1 (0x7ffd5f589000)
libm.so.6 => /usr/lib/libm.so.6 (0x7f0a078fe000)
libpng16.so.16 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libpng16.so.16
 (0x7f0a076c3000)
libz.so.1 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libz.so.1
 (0x7f0a074a8000)
libfontconfig.so.1 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libfontconfig.so.1
 (0x7f0a07263000)
libfreetype.so.6 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libfreetype.so.6
 (0x7f0a06f87000)
libjpeg.so.9 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libjpeg.so.9
 (0x7f0a06d49000)
libtiff.so.5 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libtiff.so.5
 (0x7f0a06acf000)
libwebp.so.6 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././libwebp.so.6
 (0x7f0a06831000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x7f0a0681)
libc.so.6 => /usr/lib/libc.so.6 (0x7f0a0664c000)
/usr/lib64/ld-linux-x86-64.so.2 (0x7f0a07d04000)
libxml2.so.2 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../././libxml2.so.2
 (0x7f0a062e5000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x7f0a062de000)
libicui18n.so.58 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../././libicui18n.so.58
 (0x7f0a05e69000)
libicuuc.so.58 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../././libicuuc.so.58
 (0x7f0a05abb000)
libicudata.so.58 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../././libicudata.so.58
 (0x7f0a03fbb000)
liblzma.so.5 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../././liblzma.so.5
 (0x7f0a03d8d000)
librt.so.1 => /usr/lib/librt.so.1 (0x7f0a03d83000)
libstdc++.so.6 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././././libstdc++.so.6
 (0x7f0a03c4)
libgcc_s.so.1 => 
/home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../.././././libgcc_s.so.1
 (0x7f0a03c2b000)

​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung


I tried both

plot3d(sin(pi * sqrt(x**2 + y**2)) / sqrt(x**2 + y**2), (x, -5, 5), (y, -5, 5), 
viewer='threejs')
...
p1 = sphere(color='red', opacity='.5')
p2 = sphere((-1,-1,1), color='cyan', opacity='.3')
p3 = sphere((1,-1,-1), color='yellow', opacity='.7')
show(p1 + p2 + p3, viewer='threejs')

Again on both jupyter notebook and jupyterlab, on both Safari and Chrome. 
Are you sure there isn’t other dependencies?

I checked the HTML console and found this:

[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (preact.min.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (index.js.map, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not 
Found) (preact-compat.min.js.map, line 0)

Are there any jupyter widgets that I should install?
​

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage Crash Report

2018-11-17 Thread Kolen Cheung
I tried. the problem is libiconv is already there. conda install that shows 
it's fulfilled.

you can try to conda crete from the yml file to replicate the exact conda 
environment to reproduce this problem.

Regards,
Kolen
On Nov 17, 2018, 3:30 PM -0800, Dima Pasechnik , wrote:
> It looks like Sage installed via conda-forge, and
>
>
> ImportError: 
> /home/sage/.conda/envs/sage/lib/python3.6/site-packages/sage/matrix/../../../../libgd.so.3:
> undefined symbol: libiconv
>
> seems to indicate that libiconv is missing in the environment. I don't
> know much about conda, but it seems that you need to run something
> like
>
> conda install -c conda-forge libiconv
>
> and try running sage again...
>
>
>
> On Sat, Nov 17, 2018 at 11:22 PM Kolen Cheung  
> wrote:
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sage-support" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to sage-support+unsubscr...@googlegroups.com.
> > To post to this group, send email to sage-support@googlegroups.com.
> > Visit this group at https://groups.google.com/group/sage-support.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] plot3d doesn't work in jupyterlab / jupyter notebook

2018-11-17 Thread Kolen Cheung
Hi,

I'm running SageMath 8.4 kernel in jupyterlab and also jupyter notebook. 
But running `plot3d(x * y, (x, -1, 1), (y, -1, 1))` gives me a blank space. 
Is there a command I first need to run before it shows? I tried 
`%matplotlib inline` but it doesn't help.

`plot` works though.

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Sage Crash Report

2018-11-17 Thread Kolen Cheung


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


sage-environment.yml
Description: Binary data
***

IPython post-mortem report

{'commit_hash': '033ab93c7',
 'commit_source': 'installation',
 'default_encoding': 'UTF-8',
 'ipython_path': 
'/home/sage/.conda/envs/sage/lib/python3.6/site-packages/IPython',
 'ipython_version': '5.8.0',
 'os_name': 'posix',
 'platform': 'Linux-4.18.16-arch1-1-ARCH-x86_64-with-arch',
 'sys_executable': '/home/sage/.conda/envs/sage/bin/sage-python23',
 'sys_platform': 'linux',
 'sys_version': '3.6.5 |Intel Corporation| (default, Aug  3 2018, 14:28:11) \n'
'[GCC 4.8.2 20140120 (Red Hat 4.8.2-15)]'}

***



***

Crash traceback:

---
---
ImportErrorPython 3.6.5: /home/sage/.conda/envs/sage/bin/sage-python23
   Sat Nov 17 14:57:11 2018
A problem occurred executing Python code.  Here is the sequence of function
calls leading up to the error, with the most recent (innermost) call last.
/home/sage/.conda/envs/sage/bin/sage-ipython in ()
  1 #!/usr/bin/env sage-python23
  2 # -*- coding: utf-8 -*-
  3 """
  4 Sage IPython startup script.
  5 """
  6 
  7 # Display startup banner. Do this before anything else to give the user
  8 # early feedback that Sage is starting.
  9 from sage.misc.banner import banner
 10 banner()
 11 
 12 from sage.repl.interpreter import SageTerminalApp
 13 
 14 app = SageTerminalApp.instance()
---> 15 app.initialize()
global app.initialize = >
 16 app.start()

 in initialize(self=, argv=None)

/home/sage/.conda/envs/sage/lib/python3.6/site-packages/traitlets/config/application.py
 in catch_config_error(method=, 
app=, *args=(None,), **kwargs={})
 72 TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR = False
 73 else:
 74 raise ValueError("Unsupported value for environment variable: 
'TRAITLETS_APPLICATION_RAISE_CONFIG_FILE_ERROR' is set to '%s' which is none of 
 {'0', '1', 'false', 'true', ''}."% _envvar )
 75 
 76 
 77 @decorator
 78 def catch_config_error(method, app, *args, **kwargs):
 79 """Method decorator for catching invalid config 
(Trait/ArgumentErrors) during init.
 80 
 81 On a TraitError (generally caused by bad config), this will print 
the trait's
 82 message, and exit the app.
 83 
 84 For use on init methods, to prevent invoking excepthook on invalid 
input.
 85 """
 86 try:
---> 87 return method(app, *args, **kwargs)
method = 
app = 
args = (None,)
kwargs = {}
 88 except (TraitError, ArgumentError) as e:
 89 app.print_help()
 90 app.log.fatal("Bad config encountered during initialization:")
 91 app.log.fatal(str(e))
 92 app.log.debug("Config at the time: %s", app.config)
 93 app.exit(1)
 94 
 95 
 96 class ApplicationError(Exception):
 97 pass
 98 
 99 
100 class LevelFormatter(logging.Formatter):
101 """Formatter with additional `highlevel` record
102 

/home/sage/.conda/envs/sage/lib/python3.6/site-packages/IPython/terminal/ipapp.py
 in initialize(self=, argv=None)
301 
302 return super(TerminalIPythonApp, self).parse_command_line(argv)
303 
304 @catch_config_error
305 def initialize(self, argv=None):
306 """Do actions after construct, but before starting the app."""
307 super(TerminalIPythonApp, self).initialize(argv)
308 if self.subapp is not None:
309 # don't bother initializing further, starting subapp
310 return
311 # print self.extra_args
312 if self.extra_args and not self.something_to_run:
313 self.file_to_run = self.extra_args[0]
314 self.init_path()
315 # create the shell
--> 316 self.init_shell()
self.init_shell = >
317 # and draw the banner
318 self.init_banner()
319 # Now a variety of things that happen after the banner is 
printed.
320 self.init_gui_pylab()
321 self.init_extensions()
322