Re: [sage-support] add sage-coding-the...@googlegroups.com ?

2019-01-22 Thread Dima Pasechnik
David,
just do a pull request to https://github.com/sagemath/website

On Tue, Jan 22, 2019 at 10:10 PM David Joyner  wrote:
>
> Hi:
>
> Can someone with access to the website please add
> sage-coding-the...@googlegroups.com
> to http://www.sagemath.org/development-groups.html?
>
> Thanks!
> David Joyner
>
> --
> 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] add sage-coding-the...@googlegroups.com ?

2019-01-22 Thread David Joyner
Hi:

Can someone with access to the website please add
sage-coding-the...@googlegroups.com
to http://www.sagemath.org/development-groups.html?

Thanks!
David Joyner

-- 
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: Loading heavy computations

2019-01-22 Thread Nils Bruin
See:

https://trac.sagemath.org/ticket/27091

Balanced summing (which you are basically doing) already makes a bit of a 
difference. If that's indeed the issue then using a balanced summing 
strategy already gives a better order on the algorithm.

-- 
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: Loading heavy computations

2019-01-22 Thread Nils Bruin
Thank you for such a detailed description. I think this is a good basis for 
an enhancement ticket. I don't think there is a fundamental reason why 
polynomial construction from a dictionary shouldn't do something efficient 
itself already. As an example of the kind of code we can benchmark on:

sage: R.=QQ[]
sage: f=(x+y+z)^20
sage: D=f.dict()
sage: L=[{k:v} for k,v in D.items()]
sage: %timeit R(D)
1000 loops, best of 3: 244 µs per loop
sage: %timeit sum(R(t) for t in L)
1000 loops, best of 3: 1.32 ms per loop

clearly you found that if f has sufficiently many terms, the time for R(D) 
gets out of control, whereas the second construction should remain 
reasonable (or perhaps things need to be chunked a little bigger that 
term-by-term). Drilling down on where that happens should show how to 
improve the libsingular interface. There's a clear reason to optimize this 
path: pickle uses it and that should be the method of choice to store the 
result of very  large results.


-- 
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] algorithme

2019-01-22 Thread henri girard

two other books (tutorial) in english about sage very good :)

http://www.people.vcu.edu/~clarson/bard-sage-for-undergraduates-2014.pdf

http://www.math.usm.edu/dont_panic/draft12.pdf

Le 22/01/2019 à 09:49, Emmanuel Charpentier a écrit :


s/recommandé/recommander


Le mardi 22 janvier 2019 09:47:21 UTC+1, Emmanuel Charpentier a écrit :

Le dimanche 20 janvier 2019 02:23:14 UTC+1, Anton Sherwood a écrit :

On 2019-1-19 15:52, MAMANE DJAMILOU Salissou Dango wrote:
> Bonjour,
> je suis un tous nouveau utilisateur de sagemath. Je maîtrise
les
> opérations indépendantes. Mon souci se trouve au nivaux des
algorithmes.
> je n'arrive, jusque là pas à comprendre comment programmer
avec sageMath
> (voir les ''screenshots'').
> merci de m'aider à démarrer.


Vous devriez tenter de comminuquer en anglais, qui est la langue
comprise par le plus grad nombre (de loin) de lecteurs du groupe.
Après tout :
sage: r.library("fortunes")
sage: r('fortune("Bad English")')

Bad English is the language of science.
   -- Jan de Leeuw
      JSS mailing list (February 2005)

Cela dit, je ne saurais trop recommandé la lecture du remarquable
manuel collectif "Calcul mathématique avec Sage
", qui décrit (en français, s'il
vous plaît...) une version un peu ancienne de Sage, sa traduction
anglaise , qui
utilise une version plus récente, pouvant également vous servir de
pierre de Rosette ...

Vous aurez aussi besoin d'un manuel pour Python, pour lequel je ne
me sens pas apte à faire une recommandation. Notez que Sage
utilise actuellement Python 2 (en voie d'obsolescence), mais
migrera prochainement vers Python 3.

--
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] Re: Loading heavy computations

2019-01-22 Thread Enrique Artal
The answer is very helpful. I saw a way to solve the specific problem using 
other techniques but I tried to see anyway how to recover the computation. 
The key of the problem was a polynomial with more that 16 millions of 
monomials. I made the following approaches:

   1. Save the object in a sobj file, load it in other session. The action 
   of loading was stopped after more than one day of computation.
   2. Compute the dictionnary and save it in a sobj file (less than 400Mb). 
   In a new session, loading the dictionnary took less than 4 minutes. But as 
   it was pointed in the previous message, this was not the point. Recovering  
   the polynomial took too long, stopped after one day.
   3. Compute the dictionnary and save it as text in a sage file (around 
   800Mb). In a new session, loading the dictionnary  produced some errors 
   about memory problems (I could reproduce it if necessary).
   4. Save the polynomial as a chain in a sage file (around 700Mb). In a 
   new session, reading this file produced other memory problems and stopped 
   the session.
   5. With the sobj file in 2, I broke the dictionnary in around 1600 
   dictionnaries with 1 terms. This was very short time. Computing the 
   1600 polynomials of 1 monomials took 12 minutes and summing them, 24 
   minutes.

The last option takes around 40 minutes and It may exist better partitions 
to do this. I wonder if this approach could be made automatic.

El viernes, 18 de enero de 2019, 4:50:09 (UTC+1), Nils Bruin escribió:
>
> On Thursday, January 17, 2019 at 3:37:36 PM UTC-8, Enrique Artal wrote:
>>
>> I made some computations, I skip the details for now, but the result was 
>> a rational function with rational coefficients and 13 indeterminates. The 
>> computation took around three hours and used a lot of memory so I made it 
>> using a script. The first time I saved the rational function in a pickle 
>> file, the second time in a sobj file.
>>
>
> Both are actually pickles, but the standard python "pickle" defaults to an 
> older version of the protocol. Sage's "sobj" wrappers select a more modern 
> version of the protocol and a more compact (binary) file representation.
>  
>
>> The first one was 1.2Gb, the second one around 300Mb. The main issue is 
>> that opening a sage session (or using a script) takes much more time than 
>> computing (with pickle more than 12 hours, I stopped it, with sobj 10 hours 
>> and counting).
>>
>
> The pickle format basically consists of a simple programming language with 
> instructions to build data structures. To get an idea what it does, you can 
> use, for instance,
>
> sage: R.=QQ[]
> sage: f=(x^2+y^2)/x
> sage: import pickletools
> sage: pickletools.dis(sage.misc.explainpickle.comp.decompress(dumps(f)))
>
> or, to get a more or less equivalent piece of sage code:
>
> sage: explain_pickle(dumps(f))
>  
>
>> I did not try a text file, but I wonder which is the best strategy to 
>> save a heavy result and being able to load it using less time than the 
>> actual computation.
>>
>  
> The main thing you learn from the above exercise is that pickle in 
> principle does something fairly sensible for rational functions: It 
> constructs numerator and denominator via a dictionary.
>
> It may be that this happens with a lot of overhead, so perhaps you can 
> gain something if you do it via another route, but it may well be that the 
> bottleneck is in the sage-to-libsingular interface, and other construction 
> methods won't get around that. 
>
> It's not always the case that reconstructing something from a file store 
> is faster than computing it. A silly example:
>
> a=2**(10**10)
>
> completes quite quickly, but writing the bit representation to a file and 
> reading it in will be considerable work.
>
> It's unlikely your example is as extreme as the one above, but your 
> experience indicates that the size of the polynomials involved in your case 
> (the size of the "sobj" file is a poor measure for that) is beyond what 
> sage has been tested with regularly. It looks like there's significant room 
> for improvement here. Pickle really should be able to do this.
>
>> Ideas would be appreciated. Thanks, Enrique Artal.
>>
>

-- 
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] algorithme

2019-01-22 Thread Emmanuel Charpentier

s/recommandé/recommander


Le mardi 22 janvier 2019 09:47:21 UTC+1, Emmanuel Charpentier a écrit :
>
> Le dimanche 20 janvier 2019 02:23:14 UTC+1, Anton Sherwood a écrit :
>>
>> On 2019-1-19 15:52, MAMANE DJAMILOU Salissou Dango wrote: 
>> > Bonjour, 
>> > je suis un tous nouveau utilisateur de sagemath. Je maîtrise les 
>> > opérations indépendantes. Mon souci se trouve au nivaux des 
>> algorithmes. 
>> > je n'arrive, jusque là pas à comprendre comment programmer avec 
>> sageMath 
>> > (voir les ''screenshots''). 
>> > merci de m'aider à démarrer. 
>>
>
> Vous devriez tenter de comminuquer en anglais, qui est la langue comprise 
> par le plus grad nombre (de loin) de lecteurs du groupe.
> Après tout :
> sage: r.library("fortunes")
> sage: r('fortune("Bad English")')
>
> Bad English is the language of science.
>-- Jan de Leeuw
>   JSS mailing list (February 2005)
>
> Cela dit, je ne saurais trop recommandé la lecture du remarquable manuel 
> collectif "Calcul mathématique avec Sage 
> ", qui décrit (en français, s'il vous 
> plaît...) une version un peu ancienne de Sage, sa traduction anglaise 
> , qui utilise une version 
> plus récente, pouvant également vous servir de pierre de Rosette 
> ...
>
> Vous aurez aussi besoin d'un manuel pour Python, pour lequel je ne me sens 
> pas apte à faire une recommandation. Notez que Sage utilise actuellement 
> Python 2 (en voie d'obsolescence), mais migrera prochainement vers Python 3.
>
>  
>

-- 
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] algorithme

2019-01-22 Thread Emmanuel Charpentier
Le dimanche 20 janvier 2019 02:23:14 UTC+1, Anton Sherwood a écrit :
>
> On 2019-1-19 15:52, MAMANE DJAMILOU Salissou Dango wrote: 
> > Bonjour, 
> > je suis un tous nouveau utilisateur de sagemath. Je maîtrise les 
> > opérations indépendantes. Mon souci se trouve au nivaux des algorithmes. 
> > je n'arrive, jusque là pas à comprendre comment programmer avec sageMath 
> > (voir les ''screenshots''). 
> > merci de m'aider à démarrer. 
>

Vous devriez tenter de comminuquer en anglais, qui est la langue comprise 
par le plus grad nombre (de loin) de lecteurs du groupe.
Après tout :
sage: r.library("fortunes")
sage: r('fortune("Bad English")')

Bad English is the language of science.
   -- Jan de Leeuw
  JSS mailing list (February 2005)

Cela dit, je ne saurais trop recommandé la lecture du remarquable manuel 
collectif "Calcul mathématique avec Sage ", 
qui décrit (en français, s'il vous plaît...) une version un peu ancienne de 
Sage, sa traduction anglaise , 
qui utilise une version plus récente, pouvant également vous servir de pierre 
de Rosette ...

Vous aurez aussi besoin d'un manuel pour Python, pour lequel je ne me sens 
pas apte à faire une recommandation. Notez que Sage utilise actuellement 
Python 2 (en voie d'obsolescence), mais migrera prochainement vers Python 3.

 

-- 
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.