Re: [sage-devel] Re: How to simplify square roots

2014-06-29 Thread John Cremona
Be careful though:

sage: (sqrt(-2)*sqrt(-3)).simplify_radical()
-sqrt(3)*sqrt(2)

i.e. you cannot use sqrt(a)*sqrt(b)=sqrt(a*b) everywhere without
reaching a contradiction.

sage: bool( (sqrt(-2)*sqrt(-3)) == sqrt(2)*sqrt(3) )
False

On 30 June 2014 04:31, Volker Braun  wrote:
> sage: sqrt(3)/sqrt(15)
> 1/15*sqrt(15)*sqrt(3)
> sage: _.radical_simplify()
> 1/5*sqrt(5)
>
>
> On Sunday, June 29, 2014 11:22:50 PM UTC-4, Ondřej Čertík wrote:
>>
>> Hi,
>>
>> How do I simplify the following:
>>
>> sage: sqrt(3)/sqrt(15)
>> 1/15*sqrt(15)*sqrt(3)
>> sage: simplify(_)
>> 1/15*sqrt(15)*sqrt(3)
>>
>> With sympy one gets:
>>
>> >>> sqrt(3)/sqrt(15)
>> sqrt(5)/5
>>
>> The reason I am asking is that we are designing a very fast core in
>> C++ (https://github.com/sympy/csympy) and so far we can't figure out a
>> fast way to do the full SymPy like simplification. The rule for Sage
>> (GiNaC?) simplification seems to be: convert expressions of the form
>> 1/sqrt(2), 1/sqrt(15) into 1/2*sqrt(2), 1/15*sqrt(15), then collect
>> all integers, and leave the square roots as is, i.e. do not attempt
>> any integer factorization (in or outside of the square root). This we
>> know how to implement fast I think.
>>
>> So I would like to know which function you can later use to do the
>> full simplification.
>> And also if you run into any issues with the current Sage behavior (I
>> used Sage Version 6.2.rc2, Release Date: 2014-05-04).
>>
>> Many thanks for any feedback,
>> Ondrej
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

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


[sage-devel] Re: How to simplify square roots

2014-06-29 Thread Volker Braun
sage: sqrt(3)/sqrt(15) 
1/15*sqrt(15)*sqrt(3)
sage: _.radical_simplify()
1/5*sqrt(5)


On Sunday, June 29, 2014 11:22:50 PM UTC-4, Ondřej Čertík wrote:
>
> Hi, 
>
> How do I simplify the following: 
>
> sage: sqrt(3)/sqrt(15) 
> 1/15*sqrt(15)*sqrt(3) 
> sage: simplify(_) 
> 1/15*sqrt(15)*sqrt(3) 
>
> With sympy one gets: 
>
> >>> sqrt(3)/sqrt(15) 
> sqrt(5)/5 
>
> The reason I am asking is that we are designing a very fast core in 
> C++ (https://github.com/sympy/csympy) and so far we can't figure out a 
> fast way to do the full SymPy like simplification. The rule for Sage 
> (GiNaC?) simplification seems to be: convert expressions of the form 
> 1/sqrt(2), 1/sqrt(15) into 1/2*sqrt(2), 1/15*sqrt(15), then collect 
> all integers, and leave the square roots as is, i.e. do not attempt 
> any integer factorization (in or outside of the square root). This we 
> know how to implement fast I think. 
>
> So I would like to know which function you can later use to do the 
> full simplification. 
> And also if you run into any issues with the current Sage behavior (I 
> used Sage Version 6.2.rc2, Release Date: 2014-05-04). 
>
> Many thanks for any feedback, 
> Ondrej 
>

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


[sage-devel] How to simplify square roots

2014-06-29 Thread Ondřej Čertík
Hi,

How do I simplify the following:

sage: sqrt(3)/sqrt(15)
1/15*sqrt(15)*sqrt(3)
sage: simplify(_)
1/15*sqrt(15)*sqrt(3)

With sympy one gets:

>>> sqrt(3)/sqrt(15)
sqrt(5)/5

The reason I am asking is that we are designing a very fast core in
C++ (https://github.com/sympy/csympy) and so far we can't figure out a
fast way to do the full SymPy like simplification. The rule for Sage
(GiNaC?) simplification seems to be: convert expressions of the form
1/sqrt(2), 1/sqrt(15) into 1/2*sqrt(2), 1/15*sqrt(15), then collect
all integers, and leave the square roots as is, i.e. do not attempt
any integer factorization (in or outside of the square root). This we
know how to implement fast I think.

So I would like to know which function you can later use to do the
full simplification.
And also if you run into any issues with the current Sage behavior (I
used Sage Version 6.2.rc2, Release Date: 2014-05-04).

Many thanks for any feedback,
Ondrej

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


[sage-devel] content of polynomials

2014-06-29 Thread Vincent Delecroix
Hello,

While reviewing #16516 I bumped into the following bug
{{{
sage: R. = PolynomialRing(ZZ, sparse=True)
sage: (3*x^5 + 3).content()
Principal ideal (3) of Integer Ring
sage: R. = PolynomialRing(ZZ, sparse=False)
sage: (3*x^5 + 3).content()
3
}}}
It is documented in the corresponding methods but it prevents anybody
to write generic code for integer polynomials.

I would suggest to have ".content()" always returning an ideal (which
is defined over any ring) and having ".content_gen()" to be working
over PID.

Does anybody has objections or suggestions related to that?

Best
Vincent

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


Re: [sage-devel] ask.sagemath.org

2014-06-29 Thread Vincent Delecroix
2014-06-29 17:17 UTC+02:00, William Stein :
> On Sun, Jun 29, 2014 at 6:01 AM, Vincent Delecroix
> <20100.delecr...@gmail.com> wrote:
>> By the way, could we remove the captcha for users with 100+ karma?
>
> The admin page setting already has that it should be removed for users
> with 10+ karma, as far as I can tell:
>
>Become approved Approved users bypass moderation and skip recaptcha
>Default value: 10
>
> I guess the turn-captcha-off functionality is broken, because I just
> got very frustrated trying to answer a captcha (which took me several
> tries) and I have way more than 10 karma, and am an admin.

Too bad. Can I have access to the machine where it is installed? I
would like to debug it as it is *very* annoying!

Vincent

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


Re: [sage-devel] ask.sagemath.org

2014-06-29 Thread William Stein
On Sun, Jun 29, 2014 at 6:01 AM, Vincent Delecroix
<20100.delecr...@gmail.com> wrote:
> By the way, could we remove the captcha for users with 100+ karma?

The admin page setting already has that it should be removed for users
with 10+ karma, as far as I can tell:

   Become approved Approved users bypass moderation and skip recaptcha
   Default value: 10

I guess the turn-captcha-off functionality is broken, because I just
got very frustrated trying to answer a captcha (which took me several
tries) and I have way more than 10 karma, and am an admin.

William


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



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

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


Re: [sage-devel] ask.sagemath.org

2014-06-29 Thread Vincent Delecroix
By the way, could we remove the captcha for users with 100+ karma?

Vincent

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


Re: [sage-devel] ask.sagemath.org

2014-06-29 Thread Vincent Delecroix
Hi,

Thanks for the work! It is cool to have it back!

- Do the e-mailing feature now work?
- Who are admins (i.e. have access to the admin interface of django)?
Is it possible to become one to do maintainance (i.e. merge the
keywords, find possible duplicates, etc)?
- What happend to the VM that Niles was opening at his university?

Best,
Vincent

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