[sage-devel] Re: A Sage interface for FGb (Gröbner bases)

2018-11-23 Thread Markus Wageringel
Thanks for the feedback everyone.

Am Donnerstag, 22. November 2018 09:53:43 UTC+1 schrieb parisse:
>
> Did you make some comparisons with Giac ?
>
> Some benchmarks from Roman Pearce and my own tests, about 2 years old.
>

I have not done any comparisons, mainly because I cannot do anything about 
the performance of FGb anyway. Moreover, to my knowledge, Giac does not 
support elimination orders (at least the Sage interface does not), which 
made it less suitable for my use cases.

I remember having seen those benchmarks before, but I cannot find them 
anymore. If you send a copy of the polynomial systems, I can make some 
rough comparisons of the options available within Sage.

Markus

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: how to use a singular lib

2018-11-23 Thread Daniel Krenn
On 2018-11-23 20:49, Simon King wrote:
> Hi Daniel,
> 
> On 2018-11-23, Daniel Krenn  wrote:
>> Singular is shipped with symodstd.lib (it contains an algorithm for
>> computing a Groebner basis in a special case).
>> How can I access it from within Sage?
>>
>> I looked up the code and coming from an ideal's groebner_basis method,
>> it is somehow clear how to extend this, but how do I make the actual
>> call to one of the library's functions? (I seems just straight forward
>> to call something in Singular's standard library.)
>>
>> Is there any code that calls some function from a Singular-library that
>> I can look up?
> 
> How do you plan to use singular? Via pexpect or via libsingular?

No idea; my first plan was to extend the existing groebner-basis code to
accept a new algorithm, namely the one from symodstd.
At the moment it seems that libsingular provides the functionality to do
some experimenting, which is fine :)

Thanks

Daniel

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: how to use a singular lib

2018-11-23 Thread Daniel Krenn
On 2018-11-23 21:18, 'Martin R. Albrecht' via sage-devel wrote:
> Indeed, this should work:
> 
> _ = sage.libs.singular.function.lib("symodstd.lib")
> syModStd = sage.libs.singular.function.singular_function("syModStd")

Oh, this is easy. Thanks :)

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: how to use a singular lib

2018-11-23 Thread 'Martin R. Albrecht' via sage-devel
Indeed, this should work:

_ = sage.libs.singular.function.lib("symodstd.lib")
syModStd = sage.libs.singular.function.singular_function("syModStd")


Simon King  writes:
> Hi Daniel,
>
> On 2018-11-23, Daniel Krenn  wrote:
>> Singular is shipped with symodstd.lib (it contains an algorithm for
>> computing a Groebner basis in a special case).
>> How can I access it from within Sage?
>>
>> I looked up the code and coming from an ideal's groebner_basis method,
>> it is somehow clear how to extend this, but how do I make the actual
>> call to one of the library's functions? (I seems just straight forward
>> to call something in Singular's standard library.)
>>
>> Is there any code that calls some function from a Singular-library that
>> I can look up?
>
> How do you plan to use singular? Via pexpect or via libsingular?
>
> For the former, there is code in
> src/sage/groups/matrix_gps/finitely_generated.py (where Singular's
> finvar.lib is used).
>
> For the latter, I am not so sure. However, there is
> sage.libs.singular.function.SingularLibraryFunction. I am guessing that
> its documentation will explain how to use a function from one of
> Singular's libraries.
>
> Best regards,
> Simon


-- 

_pgp: https://keybase.io/martinralbrecht
_www: https://martinralbrecht.wordpress.com
_jab: martinralbre...@jabber.ccc.de
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: how to use a singular lib

2018-11-23 Thread Simon King
Hi Daniel,

On 2018-11-23, Daniel Krenn  wrote:
> Singular is shipped with symodstd.lib (it contains an algorithm for
> computing a Groebner basis in a special case).
> How can I access it from within Sage?
>
> I looked up the code and coming from an ideal's groebner_basis method,
> it is somehow clear how to extend this, but how do I make the actual
> call to one of the library's functions? (I seems just straight forward
> to call something in Singular's standard library.)
>
> Is there any code that calls some function from a Singular-library that
> I can look up?

How do you plan to use singular? Via pexpect or via libsingular?

For the former, there is code in
src/sage/groups/matrix_gps/finitely_generated.py (where Singular's
finvar.lib is used).

For the latter, I am not so sure. However, there is
sage.libs.singular.function.SingularLibraryFunction. I am guessing that
its documentation will explain how to use a function from one of
Singular's libraries.

Best regards,
Simon

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] how to use a singular lib

2018-11-23 Thread Daniel Krenn
Singular is shipped with symodstd.lib (it contains an algorithm for
computing a Groebner basis in a special case).
How can I access it from within Sage?

I looked up the code and coming from an ideal's groebner_basis method,
it is somehow clear how to extend this, but how do I make the actual
call to one of the library's functions? (I seems just straight forward
to call something in Singular's standard library.)

Is there any code that calls some function from a Singular-library that
I can look up?

Best

Daniel

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: doctest quality and patchbots

2018-11-23 Thread 'Martin R' via sage-devel
> In such a setup, doctest framework will need to keep a record of the 
particular order, and output it for each failure. otherwise things are not 
reproducible...

I think that this would be great, but at least in the cases I looked at, 
the reason is that the reason for failure is different order of elements or 
the like.

Should I open a meta-ticket?

Martin

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: Implementing rings of coordinates

2018-11-23 Thread VulK
There is now a ticket (#26741) ready for review in which the changes have 
been implemented. I decided not to refactor __call__ because the number of 
failing doctest was quite big. Maybe this is a project for a separate ticket.


I have no idea on how to test reliably if the changes introduced any 
measurable slowdown. Can anyone chime in on how to do it?

Thanks
S.



* Nils Bruin  [2018-11-22 11:10:11]:


Pay attention, though. There may be all kinds of guidelines about how to
write sage code "appropriately", but in classes where performance is very
important there may be shortcuts that violate the guidelines. That may very
well be intentional. It may also be that it's legacy code and that
rewriting it according to the latest trends does not particularly affect
performance negatively.

On Thursday, November 22, 2018 at 9:48:41 AM UTC-8, Salvatore Stella wrote:


After a more accurate inspection, it appears that MPolynomialRing_polydict
is
in quite a bad shape. First of all it redefines __call__ which, if I read
[1]
correctly, should not be done. Second, within the many cases in __call__
one
can find:

{{{
510 elif isinstance(x, dict):
511 K = self.base_ring()
512 return MPolynomial_polydict(self, {i: K(a) for i, a in
iteritems(x)})
}}}

and few lines below

{{{
561 if isinstance(x, dict):
562 return MPolynomial_polydict(self, x)
}}}

Clearly some housekeeping is in order. I'll try to do something about it
and
then post again. Any input is welcome
S.

[1]
http://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html#coercion-the-basics




* Simon King > [2018-11-22 14:10:14]:

>On 2018-11-22, Simon King > wrote:
>> However, I believe it is bad usage to hard-code a certain class as
>> output of arithmetic errors.
>
>Oops. "errors" is an error, it should be "operations".
>
>--
>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+...@googlegroups.com .
>To post to this group, send email to sage-...@googlegroups.com
.
>Visit this group at https://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 https://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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Re: doctest quality and patchbots

2018-11-23 Thread Dima Pasechnik
In such a setup, doctest framework will need to keep a record of the
particular order, and output it for each failure. otherwise things are not
reproducible...

On Fri, 23 Nov 2018 15:23 Simon King  Hi Jeroen,
>
> On 2018-11-23, Jeroen Demeyer  wrote:
> > On 2018-11-22 18:45, 'Martin R' via sage-devel wrote:
> >> 1) would it be easy and desirable to make the patchbots run tests in
> >> random order?
> >
> > Easy: yes
> > Desirable: no, it would create a lot of doctest failures
>
> ... whose fixing is likely to make Sage run more stably. Afte all,
> doctests that fail when being executed in a different order mean that
> there are side-effects. And side-effects imply instability.
>
> So, I'd tend to believe that it is desirable.
>
> Best regards,
> Simon
>
> --
> 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 https://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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Re: doctest quality and patchbots

2018-11-23 Thread Simon King
Hi Jeroen,

On 2018-11-23, Jeroen Demeyer  wrote:
> On 2018-11-22 18:45, 'Martin R' via sage-devel wrote:
>> 1) would it be easy and desirable to make the patchbots run tests in
>> random order?
>
> Easy: yes
> Desirable: no, it would create a lot of doctest failures

... whose fixing is likely to make Sage run more stably. Afte all,
doctests that fail when being executed in a different order mean that
there are side-effects. And side-effects imply instability.

So, I'd tend to believe that it is desirable.

Best regards,
Simon

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] @rename_keyword without ticket number

2018-11-23 Thread Jori Mäntysalo
There are, in 21 different files, 31 @rename_keyword statements without a 
trac number.


Could we fix them, and if so, is it possible to always require the ticket 
number, i.e. deprecation-parameter?


--
Jori Mäntysalo


Re: [sage-devel] A Sage interface for FGb (Gröbner bases)

2018-11-23 Thread 'Martin R. Albrecht' via sage-devel



parisse  writes:
> Le jeudi 22 novembre 2018 10:11:39 UTC+1, Thierry (sage-googlesucks@xxx) a 
> écrit :
>>
>> Hi, 
>>
>>
>> It was on my todo list for a while too, since our implementations are very 
>> slow. Here "very" means "prohibitively", since some systems can not be 
>> solved with Sage in decent time (via Singular), while FGb could solve them 
>> quickly. 
>
>
> That's not correct, Sage has a wrapper to Giac which has fast GB code and 
> is also open-source. I really wonder why it seems to be ignored.

Hi,

speaking of Giac (sorry, if this should rather be on sage-support or off-list):

Can I get the degree reached during the computation and the sizes of the 
matrices considered out somehow?

Rationale: In crypto, we usually want to see if the system under consideration 
behaves like a random-system despite not being one. One way of testing this is 
to compute the degree of semi-regularity for a semi-regular sequence and 
compare with the degree reached during a GB computation of an actual instance.

Cheers,
Martin


-- 

_pgp: https://keybase.io/martinralbrecht
_www: https://martinralbrecht.wordpress.com
_jab: martinralbre...@jabber.ccc.de
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF

-- 
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] doctest quality and patchbots

2018-11-23 Thread Jeroen Demeyer

On 2018-11-22 18:45, 'Martin R' via sage-devel wrote:

1) would it be easy and desirable to make the patchbots run tests in
random order?


Easy: yes
Desirable: no, it would create a lot of doctest failures


2) concerning https://trac.sagemath.org/ticket/26586, is it desirable to
define comparison for `CartesianProduct`?


Absolutely. If you do that, you should open a new ticket.


3) at first I thought that it is good practise to sort output whose
order is essentially random


I agree.


5) would it be a good idea to have `__repr__` use a "sorted output" for
objects that are sets from a mathematical perspective?


I would say yes, but this wouldn't really solve the problem since the 
function returns a list, which is not sorted.


It's important to note that such sorting should be restricted to 
__repr__. For example, the method Poset.upper_covers() should not sort, 
for 2 reasons:


(a) not all objects can be sorted, this is in particular a problem in 
Python 3 (see graphs for a bad example)

(b) performance: most of the time, you don't care about ordering

--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] doctest quality and patchbots

2018-11-23 Thread Jeroen Demeyer

On 2018-11-22 18:45, 'Martin R' via sage-devel wrote:

  * The tests of individual functions within a single file are ALL
executed in the same environment.


Same "environment" in the sense of same Python process (there is one 
process for each file to be tested). But global variables are reset for 
each doctest block.



  * The tests of the individual functions within a single file are
executed in random order.


This is false. Tests are run in order.

--
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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.