[sage-devel] Re: Allowing correct upstream acknowledgement by default ?

2018-07-06 Thread Volker Braun
The attribution mechanism works by running the session in a profiler in 
order to trace the execution. Since profiling incurrs a significant runtime 
overhead it must be off by default. 

On Friday, July 6, 2018 at 9:28:10 AM UTC+2, Simon King wrote:
>
> Hi Thierry,
>
> could it be that you misunderstood the purpose of SAGE_PROFILE? It is not 
> about "citing" upstream in the sense of "giving proper credit to when 
> writing a paper". According to the installation manual: "SAGE_PROFILE - 
> controls profiling support. If this is set to yes, profiling support is 
> enabled where possible."
>
> In other words, it is about "profiling" upstream, in the sense of "certain 
> profilers will be able to tell exactly in which lines of upstream code 
> computation time is spent."
>
> If I understand correctly, enabling this by default would slow all 
> computations down.
>
> Best regards,
> Simon
>
> Am Freitag, 6. Juli 2018 02:02:26 UTC+2 schrieb Thierry 
> (sage-googlesucks@xxx):
>>
>> Hi, 
>>
>> the installation manual explains that if we want correct citations of 
>> upstream code, we have to: 
>>
>> export SAGE_PROFILE=yes 
>>
>> before building Sage's Cython files. 
>>
>> Is there a reason why this is not the default ? 
>>
>> IMHO, we should promote the citation of upsream libraries, which includes 
>> having ``get_systems`` being functional and imported at startup. 
>>
>> Ciao, 
>> Thierry 
>>
>>

-- 
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: Method Resolution Order

2018-07-06 Thread Nils Bruin
On Friday, July 6, 2018 at 9:40:16 AM UTC-7, Friedrich Wiemer wrote:
>
> So why is the _repr_() method from the matrix class called and not from 
> LinearLayerGeneric?
>
> It is not. The special python method is __repr__. In various places in 
sage, __repr__ delegates to _repr_, but that is a sage-local convention as 
far as I can tell. You can check that the __repr__ you're inheriting is 
sage.matrix.matrix0.Matrix.__repr__. It does not delegate to _repr_.

-- 
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: adding cython/C code in top level of sagelib

2018-07-06 Thread Dima Pasechnik


On Friday, July 6, 2018 at 4:15:55 PM UTC+2, Jeroen Demeyer wrote:
>
> On 2018-07-06 16:08, John H Palmieri wrote: 
> > It’s already documented in the developer’s guide: 
> http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list
>  
> > 
> >John 
> > 
>
> But don't use "libraries=", it's better to use "# distutils" directives 
> at the top of your Cython file. 
>

Really? Any reason for this? It's really much cleaner, IMHO, to have it all 
in Python code, easily inspect-able, rather than
in an obscure comments with obscure syntax somewhere you have no means to 
inspect from Python...


  

-- 
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: adding cython/C code in top level of sagelib

2018-07-06 Thread Dima Pasechnik


On Friday, July 6, 2018 at 4:08:46 PM UTC+2, John H Palmieri wrote:
>
> It’s already documented in the developer’s guide: 
> http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list
>  
>
>
the bottom line is that it's possible to miss this, especially as
the section heading  
http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list#writing-cython-code-in-sage

rather than something like "Extending Sage's Sagelib". And the latter 
should also say something about pure Python code, not just Cython.

 

>   John 
>

-- 
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: Compiling Sage stops at PPL

2018-07-06 Thread Dima Pasechnik
your log says:

checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.


Did you run ./configure before running make?


So this indicated that something got broken earlier. Check that there were no 
errors while installing

MPIR package (which normally provides a replacement for GMP, unless you 
configured it to actually use GMP, not MPIR)

(and in this case Sage should have built its oven copy of GMP)





On Friday, July 6, 2018 at 5:53:00 PM UTC+2, Odile wrote:
>
> Hi 
>
> I downloaded 
> http://www-ftp.lip6.fr/pub/math/sagemath/src/sage-8.2.tar.gz 
>
> I installed all the dependencies, including gcc and gfortran 
>
> I attach ppl.log and my PPL config.log 
>
> Thanks 
>
> -- 
> Odile 
> Open Dream Kit http://www.opendreamkit.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 https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


[sage-devel] Method Resolution Order

2018-07-06 Thread Friedrich Wiemer
With this code (follow up of 
https://groups.google.com/forum/#!topic/sage-devel/4uxI1XVtoDs):
from sage.matrix.matrix_mod2_dense import Matrix_mod2_dense
from sage.matrix.matrix_gf2e_dense import Matrix_gf2e_dense


class LinearLayerGeneric:
def _repr_(self):
return "LinearLayer of dimension %d x %d represented by\n%s" \
% (self.dimensions() + (self.parent(self),))


def LinearLayer(L):
parent = L.parent()
return type("LinearLayerGF2", (LinearLayerGeneric, Matrix_mod2_dense), 
{})(parent, L)


ll = LinearLayer(matrix(GF(2), 2, 2, [1, 0, 0, 1]))

I would expect to see
sage: ll
LinearLayer of dimension 2 x 2 represented by
[1 0]
[0 1]

But what I instead get, is this
sage: ascii_art(ll, "  vs  ", ll._repr_())
   LinearLayer of dimension 2 x 2 represented by
[1 0]  [1 0]
[0 1]  vs  [0 1]

So why is the _repr_() method from the matrix class called and not from 
LinearLayerGeneric?

The LinearLayer class is also listed first in the __mro__:
sage: ll.__class__.__mro__
(,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 )

-- 
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] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Well, this seems to be due to another part of the file, I got a MWE to 
work, so I guess I will figure it out.

-- 
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: adding cython/C code in top level of sagelib

2018-07-06 Thread Jeroen Demeyer

On 2018-07-06 16:08, John H Palmieri wrote:

It’s already documented in the developer’s guide: 
http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list

   John



But don't use "libraries=", it's better to use "# distutils" directives 
at the top of your Cython file.


--
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: adding cython/C code in top level of sagelib

2018-07-06 Thread John H Palmieri
It’s already documented in the developer’s guide: 
http://doc.sagemath.org/html/en/developer/coding_in_cython.html?highlight=module_list

  John

-- 
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] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Ah, this looks good!

Interestingly, while this works in the sage notebook, changing it in the 
module results in an
sage: from sage.crypto.linearlayer import LinearLayerFactory
sage: LinearLayerFactory(GF(2))(MatrixSpace(GF(2), 2, 2), [1,0,0,1])
---
TypeError Traceback (most recent call last)
 in ()
> 1 LinearLayerFactory(GF(Integer(2)))(MatrixSpace(GF(Integer(2)), 
Integer(2), Integer(2)), [Integer(1),Integer(0),Integer(0),Integer(1)])

/home/asante/werkstatt/werkbank/sage/local/lib/python2.7/site-packages/sage/
crypto/linearlayer.pyc in LinearLayerFactory(K)
 53 def LinearLayerFactory(K):
 54 if K.characteristic() == 2 and K.degree() == 1:
---> 55 return type("LinearLayerGF2", (LinearLayer, 
Matrix_mod2_dense), {})
 56 if K.characteristic() == 2 and K.degree() >= 1:
 57 return type("LinearLayerGF2E", (LinearLayer, 
Matrix_gf2e_dense), {})

TypeError: metaclass conflict: the metaclass of a derived class must be a (
non-strict) subclass of the metaclasses of all its bases

-- 
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] SageMath devel branch fails to build on Linux Mint 19; ntl, setuptools, ecl and givaro build failure

2018-07-06 Thread Erik Bray
Regardless it's clear from the screenshot that this is just
https://trac.sagemath.org/ticket/25731


On Fri, Jul 6, 2018, 13:55 BJH2017  wrote:

> Sorry, here be the logs, didn't realize I could attach them.
>
> On Friday, 6 July 2018 21:49:35 UTC+10, Jeroen Demeyer wrote:
>>
>> On 2018-07-06 13:43, BJH2017 wrote:
>> > Have you tried clicking "Raw"?
>> >
>> > <
>> https://lh3.googleusercontent.com/-9mb0IoXlFRU/Wz9VrcohUVI/BMY/vl6MH0PjLU8M_cpvgVYj6DNlft9LLr2VgCLcBGAs/s1600/Screenshot_%2522opensuse-tumbleweed%2522_20180706_213630-labelled.png>
>>
>> >
>> > it should show you the full log.
>>
>> Yes, I clicked Raw and saw truncated logs.
>>
> --
> 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] Representation of LinearLayers in the crypto module

2018-07-06 Thread 'Martin R. Albrecht' via sage-devel
Hi Friedrich,

I was thinking maybe something like this:

from sage.matrix.matrix_mod2_dense import Matrix_mod2_dense, 
from sage.matrix.matrix_gf2e_dense import Matrix_gf2e_dense

class LinearLayer:
def foo(self):
return self[0, 1]

def LinearLayerFactory(K):
if K.characteristic() == 2 and K.degree() == 1:
return type("LinearLayerGF2", (Matrix_mod2_dense, LinearLayer), {})
if K.characteristic() == 2 and K.degree() == 1:
return type("LinearLayerGF2E", (Matrix_gf2e_dense, LinearLayer), {})
else:
raise NotImplementedError

T = LinearLayerFactory(GF(2))

T(MatrixSpace(GF(2), 2, 2), [0, 1, 2, 3], False, False).foo()

Cheers,
Martin


Friedrich Wiemer  writes:
> Hi,
>
> I worked on an implementation of linear layers (basically a matrix over
> GF(2) or GF(2^n) with some special methods) in the crypto module during
> the sage days 94 and came up with this: #25735.
>
> Martin commented that it might make sense to just inherit from an
> appropriate matrix class, to avoid another layer of indirection. Seems a
> totally valid point for me, so I'm now trying to find out, what would be
> the appropriate inheritance. As we only need matrices over GF(2) or
> GF(2^n), I assume the correct super class would be their common super
> class Matrix_dense. But when I implement it, e.g. like this:
>
> %%cython
> cimport sage.matrix.matrix_dense as matrix_dense
> from sage.matrix.constructor import matrix
> cdef class LinearLayer(matrix_dense.Matrix_dense):
>   cdef public object _m
>  
>   def __init__(self, parent, entries=None):
> m = matrix(parent, entries)
> self._m = m
>
> the matrix self._m "forgets" that it was a Matrix_mod2_dense or
> Matrix_gf2e_dense before:
>
> test_m = random_matrix(GF(2**4), 4, 4)
> test_m.__class__.__mro__
> (,
> ,
> ,
> ,
> ,
> ,
> ,
> ,
> ,
> )
> LinearLayer(test_m.parent(), test_m)
> test1._m.__class__.__mro__
> (,
> ,
> ,
> ,
> ,
> ,
> ,
> ,
> ,
> )
>
> Thus operations which are specialised in Matrix_mod2_dense or 
> Matrix_gf2e_dense are not available anymore.
> Am I misunderstanding some concept here?
>
> Thanks in advance for your help,
> Friedrich


-- 

_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] SageMath devel branch fails to build on Linux Mint 19; ntl, setuptools, ecl and givaro build failure

2018-07-06 Thread Jeroen Demeyer

On 2018-07-06 13:43, BJH2017 wrote:

Have you tried clicking "Raw"?



it should show you the full log.


Yes, I clicked Raw and saw truncated logs.

--
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] SageMath devel branch fails to build on Linux Mint 19; ntl, setuptools, ecl and givaro build failure

2018-07-06 Thread BJH2017
Have you tried clicking "Raw"? 


it should show you the full log. 


On Friday, 6 July 2018 21:34:28 UTC+10, Jeroen Demeyer wrote:
>
> On 2018-07-06 01:33, BJH2017 wrote: 
> > The logs for these dependencies are in this gist: 
> > https://gist.github.com/fusion809/cd1b666ce7530bfa376f2397ca5a498a. 
>
> They seem to be truncated, hence useless. 
>
>

-- 
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] SageMath devel branch fails to build on Linux Mint 19; ntl, setuptools, ecl and givaro build failure

2018-07-06 Thread Jeroen Demeyer

On 2018-07-06 01:33, BJH2017 wrote:

The logs for these dependencies are in this gist:
https://gist.github.com/fusion809/cd1b666ce7530bfa376f2397ca5a498a.


They seem to be truncated, hence useless.

--
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: Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Am Freitag, 6. Juli 2018 12:57:39 UTC+2 schrieb Friedrich Wiemer: 

> LinearLayer(test_m.parent(), test_m)
> test1._m.__class__.__mro__
>

this should of course be
test1 = LinearLayer(test_m.parent(), test_m)
test1._m.__class__.__mro__

-- 
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] Representation of LinearLayers in the crypto module

2018-07-06 Thread Friedrich Wiemer
Hi,

I worked on an implementation of linear layers (basically a matrix over 
GF(2) or GF(2^n) with some special methods) in the crypto module during the 
sage days 94 and came up with this: #25735.

Martin commented that it might make sense to just inherit from an 
appropriate matrix class, to avoid another layer of indirection. Seems a 
totally valid point for me, so I'm now trying to find out, what would be 
the appropriate inheritance. As we only need matrices over GF(2) or 
GF(2^n), I assume the correct super class would be their common super class 
Matrix_dense. But when I implement it, e.g. like this:

%%cython
cimport sage.matrix.matrix_dense as matrix_dense
from sage.matrix.constructor import matrix

cdef class LinearLayer(matrix_dense.Matrix_dense):
cdef public object _m

def __init__(self, parent, entries=None):
m = matrix(parent, entries)
self._m = m

the matrix self._m "forgets" that it was a Matrix_mod2_dense or 
Matrix_gf2e_dense before:

test_m = random_matrix(GF(2**4), 4, 4)
test_m.__class__.__mro__
(,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 )

LinearLayer(test_m.parent(), test_m)
test1._m.__class__.__mro__
(,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 ,
 )


Thus operations which are specialised in Matrix_mod2_dense or Matrix_gf2e_dense 
are not available anymore.
Am I misunderstanding some concept here?

Thanks in advance for your help,
Friedrich

-- 
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: Allowing correct upstream acknowledgement by default ?

2018-07-06 Thread Simon King
Hi Thierry,

could it be that you misunderstood the purpose of SAGE_PROFILE? It is not 
about "citing" upstream in the sense of "giving proper credit to when 
writing a paper". According to the installation manual: "SAGE_PROFILE - 
controls profiling support. If this is set to yes, profiling support is 
enabled where possible."

In other words, it is about "profiling" upstream, in the sense of "certain 
profilers will be able to tell exactly in which lines of upstream code 
computation time is spent."

If I understand correctly, enabling this by default would slow all 
computations down.

Best regards,
Simon

Am Freitag, 6. Juli 2018 02:02:26 UTC+2 schrieb Thierry 
(sage-googlesucks@xxx):
>
> Hi, 
>
> the installation manual explains that if we want correct citations of 
> upstream code, we have to: 
>
> export SAGE_PROFILE=yes 
>
> before building Sage's Cython files. 
>
> Is there a reason why this is not the default ? 
>
> IMHO, we should promote the citation of upsream libraries, which includes 
> having ``get_systems`` being functional and imported at startup. 
>
> Ciao, 
> Thierry 
>
>

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