Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread Ben Hutz
On Friday, September 8, 2017 at 12:37:46 PM UTC-5, David Roe wrote: > > > > On Fri, Sep 8, 2017 at 11:54 AM, Ben Hutz > > wrote: > > Since the consensus is that P(0) etc. is too ambiguous a choice, that is >> now #23806. >> > > I don't think anyone was saying that we should change P(0), just th

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread David Roe
On Fri, Sep 8, 2017 at 11:54 AM, Ben Hutz wrote: > Adding coercion for scheme points is now #23805. This just address adding > coercion through _coerce_map_from_ and does *not* allow P(0) == 0. This > ticket does not address P(0) itself. > Cool; I've added some comments there. Since the conse

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread Ben Hutz
Adding coercion for scheme points is now #23805. This just address adding coercion through _coerce_map_from_ and does *not* allow P(0) == 0. This ticket does not address P(0) itself. Since the consensus is that P(0) etc. is too ambiguous a choice, that is now #23806. The bug about different

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread Eric Gourgoulhon
Le vendredi 8 septembre 2017 11:15:10 UTC+2, Jeroen Demeyer a écrit : > > (I am starting to wonder if I should write a blog post explaining this, > it's not the first time that somebody asks this). > Yes please ! Thank you. Eric. -- You received this message because you are subscribed to th

Re: [sage-devel] Re: From SageNB to jupyter

2017-09-08 Thread kcrisman
On Friday, September 8, 2017 at 2:04:24 AM UTC-4, Jori Mäntysalo wrote: > > On Thu, 7 Sep 2017, Volker Braun wrote: > > > You can share worksheets just by uploading them to github, for example: > > Isn't that publishing worksheet, not sharing? > Yeah, that's really quite different and more in

[sage-devel] Re: From SageNB to jupyter

2017-09-08 Thread kcrisman
On Thursday, September 7, 2017 at 11:16:14 AM UTC-4, Dima Pasechnik wrote: > > did you see this: > https://benjamin-hackl.at/2016/01/16/jupyterhub-with-sagemath-kernel/ > > It seems that all of the requirements you list are there... > This seems very interesting, especially if it could be packag

Re: [sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Jeroen Demeyer
On 2017-09-08 14:55, Simon King wrote: sage: cython(""" : #!clib gap : from sage.libs.gap.gap_includes cimport * : from sage.libs.gap.element cimport GapElement_FiniteField : from sage.libs.gap.libgap import libgap : def test(x): : libgap_enter() : cdef GapElem

[sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Simon King
On 2017-09-08, Simon King wrote: > Hi Vincent, > > On 2017-09-08, Vincent Delecroix <20100.delecr...@gmail.com> wrote: >> In the above code you are *not* calling the C API. Just avoid the >> libgap_enter / libgap_exit. > > I know. But part of my question was whether it is safe to have > python ca

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread Ben Hutz
Thanks for the additional responses. The non-equality of the hash functions is enough to convince me that P(0) == 0 is not worth the "convenience" of this type of coercion. However, just to point out another inconsistency. It seems that coercion is currently violating this hash equality in othe

[sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Simon King
Hi Vincent, On 2017-09-08, Vincent Delecroix <20100.delecr...@gmail.com> wrote: > In the above code you are *not* calling the C API. Just avoid the > libgap_enter / libgap_exit. I know. But part of my question was whether it is safe to have python calls inside a libgap_enter/exit pair. Apparentl

Re: [sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Vincent Delecroix
On 08/09/2017 08:55, Simon King wrote: On 2017-09-08, Simon King wrote: When I do libgap_enter() and then cdef GapElement_FiniteField zero = libgap(F.zero()) (where F=GF(2)), I get a crash. I am about to test whether I can make up a minimal example from it. Voilà : sage: cython(""" ...

[sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Simon King
On 2017-09-08, Simon King wrote: > When I do libgap_enter() and then >cdef GapElement_FiniteField zero = libgap(F.zero()) > (where F=GF(2)), I get a crash. I am about to test whether I can make > up a minimal example from it. Voilà : sage: cython(""" : #!clib gap : from sage.libs.gap

[sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Simon King
On 2017-09-07, Simon King wrote: > I expected a crash when *not* using libgap_enter/exit. But actually I am > getting the crash when I *do* use it. I see the message > sig_error() without sig_on() > followed by a lng gdb backtrace. > > So, does one need sig_on()/sig_off() in addition to l

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread John Cremona
On 8 September 2017 at 12:42, John Cremona wrote: > On 8 September 2017 at 12:28, Jeroen Demeyer wrote: >> On 2017-09-08 11:31, John Cremona wrote: >>> >>> What does that look like in terms of (a,b,c)? >> >> >> Totally crazy. The obvious thing gives a very complicated polynomial. The >> problem o

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread John Cremona
On 8 September 2017 at 12:28, Jeroen Demeyer wrote: > On 2017-09-08 11:31, John Cremona wrote: >> >> What does that look like in terms of (a,b,c)? > > > Totally crazy. The obvious thing gives a very complicated polynomial. The > problem of course is that everything is defined modulo the equation f

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread Jeroen Demeyer
On 2017-09-08 11:31, John Cremona wrote: What does that look like in terms of (a,b,c)? Totally crazy. The obvious thing gives a very complicated polynomial. The problem of course is that everything is defined modulo the equation f(x,y,z) = 0. So you need to find a simple representative in the

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread John Cremona
On 8 September 2017 at 09:59, Jeroen Demeyer wrote: > For completeness: > > We should also consider negatives. But it turns out that going from P to -P > simply turns (a,b,c) in (b,a,c). > > There is also a torsion point T = (56 : 728 : 1) > > Adding that point gives genuinely different solutions.

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread Dima Pasechnik
We can add this as another answer there on Quora. On Friday, September 8, 2017 at 9:47:28 AM UTC+1, John Cremona wrote: > > Yes, it is a nice example. Pity he does not mention Sage: > > sage: P2. = ProjectiveSpace(QQ,2) > sage: f = x*(x+y)*(x+z) + y*(y+x)*(y+z) + z*(z+x)*(z+y) - > 4*(x+y)*(y+z

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread Jeroen Demeyer
On 2017-09-07 19:11, Ben Hutz wrote: There does not appear to be an __eq__() operator implemented for scheme points, but it does show up in tab completion in the notebook, but can't tell me where the code is from. Is this an artifact of starting to transition the code to python3. Or this just br

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread Jeroen Demeyer
For completeness: We should also consider negatives. But it turns out that going from P to -P simply turns (a,b,c) in (b,a,c). There is also a torsion point T = (56 : 728 : 1) Adding that point gives genuinely different solutions. With the torsion point, the first solution is psi(13*P + T).

Re: [sage-devel] fun quora post using Sage/CC

2017-09-08 Thread John Cremona
Yes, it is a nice example. Pity he does not mention Sage: sage: P2. = ProjectiveSpace(QQ,2) sage: f = x*(x+y)*(x+z) + y*(y+x)*(y+z) + z*(z+x)*(z+y) - 4*(x+y)*(y+z)*(z+x) sage: phi = EllipticCurve_from_cubic(f,(-1,1,0)); phi Scheme morphism: From: Closed subscheme of Projective Space of dimensi

Re: [sage-devel] _richcmp_ versus __eq__ for scheme points

2017-09-08 Thread John Cremona
On 7 September 2017 at 23:34, Nils Bruin wrote: > > What is the argument that makes PP(0) == 0 bad? If PP(0) is allowed, I don't > see how PP(0) == 0 is particularly worse. > > Because PP(AA(0)) and PP(BB(0)) should be different points, so it's not so > clear which one should have precedence. PP(0

Re: [sage-devel] Re: From SageNB to jupyter

2017-09-08 Thread Dima Pasechnik
well, in principle you can put it in a private repo, and control access to it the github way. Although I agree this is not very easy as opposed to sagenb or SMC worksheet sharing. On Friday, September 8, 2017 at 7:04:24 AM UTC+1, Jori Mäntysalo wrote: > > On Thu, 7 Sep 2017, Volker Braun wrote:

[sage-devel] Re: Question about libgap_enter/exit

2017-09-08 Thread Volker Braun
On Friday, September 8, 2017 at 6:00:31 AM UTC+2, Nils Bruin wrote: > > On Thursday, September 7, 2017 at 9:49:33 AM UTC-7, Volker Braun wrote: >> >> First question: The GAP garbage collector might delete objects, or it >> might move existing objects around in memory (it is a compacting garbage >

Re: [sage-devel] hash issue in python3 experimental branch

2017-09-08 Thread Erik Bray
On Thu, Sep 7, 2017 at 11:46 AM, Erik Bray wrote: > On Thu, Sep 7, 2017 at 11:06 AM, Jeroen Demeyer > wrote: >> On 2017-09-06 17:24, Erik Bray wrote: >>> >>> Interpreting >>> "str" as "bytes" is the only way it can be if language_level=2. >> >> >> I think you are misunderstanding. You didn't pos