Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread William Stein
On Jan 11, 2012 9:45 PM, "Julien Puydt"  wrote:
>
> Le 12/01/2012 05:10, William Stein a écrit :
>>
>>
>>
>> On Wednesday, January 11, 2012, Michael Orlitzky > > wrote:
>>  > On 01/11/2012 03:40 AM, Jeroen Demeyer wrote:
>>  >>
>>  >> True, but we're talking a different order of magnitude here.
 Speeding
>>  >> up the atlas installation by just 5% would save more time than
removing
>>  >> both bzip2 and patch.
>>  >>
>>  >
>>  > If we want to be sure that the user has bzip2 installed, we should
>> just bzip the source tarballs =)
>>  >
>>
>> We also *need* the bzip2 devel library and headers so that the Python
>> bzip2 module gets built.
>
>
> Ah, ha! So there is an hidden dependency of the python spkg on the bzip2
spkg!
>
> Would the sage maintainers accept a patch making that explicit?

Nice - good point.  Yes please submit a patch.  Thanks!

> Snark
>
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread Julien Puydt

Le 12/01/2012 05:10, William Stein a écrit :



On Wednesday, January 11, 2012, Michael Orlitzky mailto:mich...@orlitzky.com>> wrote:
 > On 01/11/2012 03:40 AM, Jeroen Demeyer wrote:
 >>
 >> True, but we're talking a different order of magnitude here.  Speeding
 >> up the atlas installation by just 5% would save more time than removing
 >> both bzip2 and patch.
 >>
 >
 > If we want to be sure that the user has bzip2 installed, we should
just bzip the source tarballs =)
 >

We also *need* the bzip2 devel library and headers so that the Python
bzip2 module gets built.


Ah, ha! So there is an hidden dependency of the python spkg on the bzip2 
spkg!


Would the sage maintainers accept a patch making that explicit?

Snark

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread William Stein
On Wednesday, January 11, 2012, Michael Orlitzky 
wrote:
> On 01/11/2012 03:40 AM, Jeroen Demeyer wrote:
>>
>> True, but we're talking a different order of magnitude here.  Speeding
>> up the atlas installation by just 5% would save more time than removing
>> both bzip2 and patch.
>>
>
> If we want to be sure that the user has bzip2 installed, we should just
bzip the source tarballs =)
>

We also *need* the bzip2 devel library and headers so that the Python bzip2
module gets built.


> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread R. Andrew Ohana
On Wed, Jan 11, 2012 at 19:23, Dima Pasechnik  wrote:
> it's a good point. I never understood why the source tarballs are not
> compressed.

Well there is virtually no benefit to compressing the source tarballs
since the vast majority of the sage source is bundled in spkgs, which
are already compressed.

>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org



-- 
Andrew

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread Dima Pasechnik
it's a good point. I never understood why the source tarballs are not 
compressed.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: VirtualBox

2012-01-11 Thread Dima Pasechnik


On Thursday, 12 January 2012 04:48:39 UTC+8, Volker Braun wrote:
>
> On Wed, Jan 11, 2012 at 10:22 AM, Dima Pasechnik  wrote:
> > Somehow, I expected I could run the notebook server in the VM and 
> connect to
> > it from the host system, but I don't see a way to do it.
>
> You should be able to connect from the host to the guest port  t(ssh 
> into the virtual machine) and port 8000 (the notebook browser).
>

OK, this works. What are the login/password for ssh?

Also, it's not clear why after minimizing the browser window which pops up 
in the VM, I don't see anything there, just the blank black window.
Does this indicate that something is wrong with the X11 setup on the VM?

If you can't then there is something wrong with networking either in the 
> virtual machine or with the host firewall.
>
> On Wed, Jan 11, 2012 at 1:27 PM, William Stein  wrote:
> > With VMware (and Parallels) the default standard network connection
> > somehow does both NAT and "host only" networking at the same time,
> > which is much, much less confusing and user friendly.
>
> I don't understand what you mean. In VirtualBox, the difference between 
> NAT and Host only is that the packets do not / do go through the host 
> loopback interface. So with Host only different VMs can communicate and you 
> can sniff the traffic, and thats about it.
>
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Volker Braun
It works for me. Since it doesn't work for everybody I'm assuming that 
VirtualBox presents different bios names for the nic, perhaps depending on 
the version. I'll change the VM to fix that.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread mmarco
In fact, i get that only the lo interface is up in the guest system. I
think that explains the problem.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread mmarco
Volker, can you access the sage notebook from the host using your last
VM? I can't.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread Michael Orlitzky

On 01/11/2012 03:40 AM, Jeroen Demeyer wrote:

True, but we're talking a different order of magnitude here.  Speeding
up the atlas installation by just 5% would save more time than removing
both bzip2 and patch.



If we want to be sure that the user has bzip2 installed, we should just 
bzip the source tarballs =)


--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] New termcap spkg (#12282) needs review

2012-01-11 Thread Jeroen Demeyer
This is now the very last ticket needing review for sage-4.8 (at least,
as far as we know):

On 2012-01-09 14:21, Jeroen Demeyer wrote:
> Please review *blocker* ticket #12282.  It fixes a segmentation fault in
> the termcap library, triggered by the new readline spkg at #11970.  The
> problem was that strcmp() was called with a NULL argument.  The fix is
> easy: check whether the argument is NULL.
> 
> See http://trac.sagemath.org/sage_trac/ticket/12282
> 
> Thanks,
> Jeroen.
> 

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Volker Braun
On Wednesday, January 11, 2012 3:52:37 PM UTC-5, William wrote:
>
> To make sure we are on the same page:  have you used VMware much?
>

I haven't. Whenever I wanted to give it a try I eventually found out that 
my kernel is too new for VMware.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread William Stein
On Wednesday, January 11, 2012, Volker Braun  wrote:
> On Wed, Jan 11, 2012 at 10:22 AM, Dima Pasechnik 
wrote:
>> Somehow, I expected I could run the notebook server in the VM and
connect to
>> it from the host system, but I don't see a way to do it.
> You should be able to connect from the host to the guest port  t(ssh
into the virtual machine) and port 8000 (the notebook browser). If you
can't then there is something wrong with networking either in the virtual
machine or with the host firewall.
> On Wed, Jan 11, 2012 at 1:27 PM, William Stein  wrote:
>> With VMware (and Parallels) the default standard network connection
>> somehow does both NAT and "host only" networking at the same time,
>> which is much, much less confusing and user friendly.
> I don't understand what you mean. In VirtualBox, the difference between
NAT and Host only is that the packets do not / do go through the host
loopback interface. So with Host only different VMs can communicate and you
can sniff the traffic, and thats about it.
>

To make sure we are on the same page:  have you used VMware much?

> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

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

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: VirtualBox

2012-01-11 Thread Volker Braun
On Wed, Jan 11, 2012 at 10:22 AM, Dima Pasechnik  wrote:
> Somehow, I expected I could run the notebook server in the VM and connect 
to
> it from the host system, but I don't see a way to do it.

You should be able to connect from the host to the guest port  t(ssh 
into the virtual machine) and port 8000 (the notebook browser). If you 
can't then there is something wrong with networking either in the virtual 
machine or with the host firewall.

On Wed, Jan 11, 2012 at 1:27 PM, William Stein  wrote:
> With VMware (and Parallels) the default standard network connection
> somehow does both NAT and "host only" networking at the same time,
> which is much, much less confusing and user friendly.

I don't understand what you mean. In VirtualBox, the difference between NAT 
and Host only is that the packets do not / do go through the host loopback 
interface. So with Host only different VMs can communicate and you can 
sniff the traffic, and thats about it.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread mmarco
The port forwarding seems to be well configured in Volker's VM (the
same configuration works fine in otyher VM's), but i don't know why it
does not work. Maybe something isn't right in the guest system?

Volker, are you sure that your guets system is listening to ssh
connections, and that it accepts http connections from the host
system?

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: F.Khoshnam

2012-01-11 Thread William Stein
On Wed, Jan 11, 2012 at 10:33 AM, FOAD KHOSHNAM  wrote:
> Dear Prof. Stein
> I appreciate very much if you run this program in magma for me and give me
> an output from that program.
> By the way, I must mention that   I haven't access to Magma  here.
> Thank you.
> Your Truly

No.  I started Sage 7 years ago exactly so that people like you who
don't have access to Magma (or other commercial systems) could still
carry out computational research mathematics.Please use Sage, or
improve it so that it can do your computation (which just involves
basic arithmetic in the Jacobian of a hyperelliptic curve).

 -- William




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

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


cp2m.tex
Description: TeX document


Re: [sage-devel] Re: VirtualBox

2012-01-11 Thread William Stein
On Wed, Jan 11, 2012 at 10:22 AM, Dima Pasechnik  wrote:
> Settings->System->Acceleration way worked (I also needed to set the # of
> CPUs to 1). (For BIOS settings I need to go the the office and attach a
> monitor to the box :-))
>
> Somehow, I expected I could run the notebook server in the VM and connect to
> it from the host system, but I don't see a way to do it.

That should be possible, but with VirtualBox you either have to use
port forwarding (as I recently learned in this thread!) or setup an
*additional* "host only" network interface.

With VMware (and Parallels) the default standard network connection
somehow does both NAT and "host only" networking at the same time,
which is much, much less confusing and user friendly.  I guess the
VirtualBox developers never figured out how to do this, or (more
likely) have philosophical objections.   Anyway, that could be the
source of your confusion.

 -- William

>
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org



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

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Dima Pasechnik
Settings->System->Acceleration way worked (I also needed to set the # of 
CPUs to 1). (For BIOS settings I need to go the the office and attach a 
monitor to the box :-))

Somehow, I expected I could run the notebook server in the VM and connect 
to it from the host system, but I don't see a way to do it.


-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Sage-Combinat Days at Cernay

2012-01-11 Thread Nathann Cohen
Hellooo !!!

If that is fine with you I will join you on sunday afternoon until the end 
of the week ! It looks more than enough to deal with long due work like 
static graph backends and perhaps rewriting the current ones. And also put 
my nose in other people's work of course :-)

Nathann

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Emil Widmann
On 11 Jan., 16:56, Volker Braun  wrote:
> The virtual machine has hardware virtualization support enabled. You can
> probably switch on HW virtualization in the BIOS of your computer, which is
> recommended if you do any virtualization. You can also disable it in the
> settings of the virtual machine (Settings->System->Acceleration) at a
> slight performance cost.

I think the default settings for a 32-bit VM should support the
broadest possible range of
machines - so I would suggest a sage compiled with "FAT_BINARIES" and
HW Acceleration off.

There could be of course a possible sage windows control center gui,
where it is possible to enable HW accelaration (among possible other
customizations and with link to documentation).

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Volker Braun
The virtual machine has hardware virtualization support enabled. You can 
probably switch on HW virtualization in the BIOS of your computer, which is 
recommended if you do any virtualization. You can also disable it in the 
settings of the virtual machine (Settings->System->Acceleration) at a 
slight performance cost.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread Dima Pasechnik
I tried running this on a Windows 7 (64-bits), using Virtual Box 4.1.8.
I imported the ova file with the default settings, but the thing fails to 
start, 
saying 
"Failed to open a session for VM...,
 VT-x features locked on unavailable in MSR
(VERR_VMX_MSR_LOCKED_OR_DISABLED)"

What am I doing wrong?

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] pexpect troubles

2012-01-11 Thread Jeroen Demeyer
On 2012-01-11 00:34, William Stein wrote:
> I should take a look...
There is also
http://trac.sagemath.org/sage_trac/ticket/12294

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Simon King
Hi!

#12290 is now ready for review.

For reference, the ticket contains one not-totally-finished patch that
only improves the hash.
However, the patch that is supposed to be reviewed goes beyond and
introduces UniqueRepresentation as a base class of matrix spaces.

First feature: All tests pass, the hash problem is fixed and in
addition the hash is even faster than with the old patch.

Second feature: Coercion of matrices is a lot nicer now, IMHO!!

Namely, in unpatched sage, the parent of the sum of a dense and a
sparse matrix implicitly depends on the summation order:
  sage: M = MatrixSpace(ZZ, 10)
  sage: N = MatrixSpace(ZZ, 10,sparse=True)
  sage: a = M.random_element()
  sage: b = N.random_element()
  sage: (a+b).parent()
  Full MatrixSpace of 10 by 10 dense matrices over Integer Ring
  sage: (b+a).parent()
  Full MatrixSpace of 10 by 10 sparse matrices over Integer Ring

With my patch, the parent of b+a is the same as the parent of a+b.

Cheers,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Simon King
Hi Marco,

On 11 Jan., 13:30, Marco Streng  wrote:
> I'm not sure what you mean by ``making the coercion model use containers
> that compare by "is" and not by "=="'',

If you have a dictionary D with keys A and B such that "A==B" but "A
is not B", then you will always have "D[A] is D[B]" -- of course
unless you screw that hash functions of A and B, which currently is
the case for matrix spaces. This is simply how Python dictionaries
work.

However, sage.structure.coerce_dict.TripleDict has the property that
(1) each key is a triple and (2) the three parts of the key are
compared by identity and not by equality. Hence, "D[A,A,A] is not
D[A,B,A]".

> but I'll just chime in as I
> think it could be related to something that I found.

The topic is certainly (weakly, at least :) related.

> sage: K. = NumberField(x^2-2, embedding=-1)
> sage: L. = NumberField(x^2-2, embedding=1)
> sage: xK = K['x'].gen()
> sage: xL = L['x'].gen()
> sage: M. = NumberField(xK^2-3)
> sage: N. = NumberField(xL^2-3)
> sage: O = M.absolute_field('e')
> sage: P = N.absolute_field('e')

Yep, non-uniqueness strikes again:
  sage: O==P
  True
  sage: O is P
  False

But I think in this case there should be other ways to ensure that the
conversion from O to P is really just used as conversion and not as
coercion.
Cheers,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Marco Streng

On 11/01/2012 11:46, Simon King wrote:

 2) A more general consideration: The coercion model prefers to have
 unique parents. But many people think that "A == B" should mean "A
 and B are canonically isomorphic", and not just "A is B". That could
 be solved by making the coercion model consequently use containers
 that compare by "is" and not by "==".


I'm not sure what you mean by ``making the coercion model use containers 
that compare by "is" and not by "=="'', but I'll just chime in as I 
think it could be related to something that I found.


Currently, if two parents A and B are equal according to "==" and no 
good coercion map is found, then A.coerce_map_from(B) returns 
A._generic_convert_map(B). In case of number fields, this means that if 
two number fields have same generator name and same defining polynomial, 
then the generators are identified by coercion. There is a NumberField 
example where this is incompatible with maps that I would consider 
natural. So in the NumberField case, I would prefer not to have a 
coercion in this case, but only a conversion.


Marco

PS. More specifically, the example is

sage: K. = NumberField(x^2-2, embedding=-1)
sage: L. = NumberField(x^2-2, embedding=1)
sage: xK = K['x'].gen()
sage: xL = L['x'].gen()
sage: M. = NumberField(xK^2-3)
sage: N. = NumberField(xL^2-3)
sage: O = M.absolute_field('e')
sage: P = N.absolute_field('e')
sage: b_in_a = K(0)+b
sage: map1 = O.structure()[1]
sage: map2 = P.structure()[1]
sage: b_in_a in map1.domain()
# True
sage: b in map2.domain()
# True
sage: map1(b_in_a) - map2(b)
# e^3 - 9*e, which is non-zero, so the maps don't commute!

The maps O <--> M <-- K <--> L --> N <--> P are natural (structure 
morphisms and coercions).
The fields O and P have same generator name and same defining 
polynomials, hence O==P is True. However, O.structure() and 
P.structure() are distinct, which makes O._generic_convert_map(P) 
incompatible with the natural maps O <--> M <-- K <--> L --> N <--> P


So I would prefer there not to be a coercion from O to P. I'm fine with 
conversion.






--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Simon King
Hi Nicolas, hi all,

On 11 Jan., 11:50, "Nicolas M. Thiery" 
wrote:
> > Question to you: Do you see an obvious reason why matrix spaces should
> > not be unique parents?
>
> If at all possible, I for myself would rather have them as unique
> parents.
>
> On the other hand, I remember it was argued against it for
> VectorSpaces: indeed users might want to create several copies of a
> given vector space, in particular to use different scalar products.
> I don't know if there are similar needs/use for matrix spaces.

Here, the only extra structure is "sparse versus dense". Namely,
currently, a matrix space is determined as unique object by
  base_ring, nrows, ncols, sparse
but equality is tested by
  base_ring, nrows, ncols
only.

Of course, "dense versus sparse" is not a mathematical property, but
only concerns implementation (so, it is different from a scalar
product, which carries mathematical information).

>From my perspective, it only matters whether one can do arithmetic
involving a sparse and a dense matrix -- that's to say, whether the
coercion model is easily able to handle it. And for the coercion
model, it is easier when the parents are unique.

Two remarks:
1) With my patch from #12290, the time for returning the hash of a
matrix space drops from 13.8 µs to 547 ns. But when using
UniqueRepresentation as a base class of matrix spaces, then one even
comes to 489 ns. So, if you mainly care for speed then using
UniqueRepresentation is the way to go.

2) A more general consideration:
The coercion model prefers to have unique parents. But many people
think that "A == B" should mean "A and B are canonically isomorphic",
and not just "A is B". That could be solved by making the coercion
model consequently use containers that compare by "is" and not by
"==". For example, consequently use
sage.structure.coerce_dict.TripleDict and not dict.

In that way, we could both strengthen the coercion model and make the
people happy. But it would probably involve some tedious work...

Best regards,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Re: VirtualBox

2012-01-11 Thread mmarco
I have tried the new VM from Volker (on a linux host), and the guest
browser works fine, but i can't connect from a host browser. Somebody
else noticed this?

As for the shared folders, i think it would be a good idea to include
a dialog in Emil's installer to configure them after the .ova image is
imported.


On 11 ene, 10:08, P Purkayastha  wrote:
> On Wednesday, January 11, 2012 11:26:43 AM UTC+8, Benjamin Jones wrote:
>
> > After a minute or two I couldn't figure out how to save a worksheet or
> > plots or other data files and access them in the host OS.
>
> > --
> > Benjamin Jones
>
> For this it would be best if shared folders are used, as Keshav mentioned
> earlier. One shared folder for .sagenb and another shared folder for "My
> Documents\sagenb" so that the user can right click on images and save it in
> the shared folder.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Nicolas M. Thiery
On Wed, Jan 11, 2012 at 01:25:47AM -0800, Simon King wrote:
> Matrix spaces of dense and sparse matrices are equal and are thus not
> unique parents:
>   sage: M1 = MatrixSpace(ZZ,2,sparse=True)
>   sage: M2 = MatrixSpace(ZZ,2,sparse=False)
>   sage: M1 is M2
>   False
>   sage: M1==M2
>   True
> 
> Fine. But what should be really bad: They violate the assumption that
> equal objects have equal hash.
>   sage: hash(M1)==hash(M2)
>   False
> 
> By consequence, the two equal matrix spaces will correspond to
> different items of dictionaries:
>   sage: D = {M1:1,M2:2}
>   sage: len(D)
>   2
> 
> I think that it is an apparent bug.

+1

> Therefore, at #12290, I am fixing the hash values (and moreover I
> speed-up the hash of matrix spaces considerably).

Cool.

> However, it seems that the coercion framework relies on the bug.
> Namely, when fixing it, one gets
>   sage: A = matrix(ZZ, 5, range(30), sparse=False)
>   sage: B = matrix(ZZ, 5, range(30), sparse=True)
>   sage: C = matrix(QQ, 5, range(30), sparse=True)
>   sage: A.elementwise_product(C).is_dense()
>   True
>   sage: B.elementwise_product(C).is_sparse()
>  
> ---
>   TypeError Traceback (most recent
> call last)
>   ...
>   TypeError: no common canonical parent for objects with parents:
> 'Full MatrixSpace of 5 by 6 sparse matrices over Integer Ring' and
> 'Full MatrixSpace of 5 by 6 sparse matrices over Rational Field'
> 
> The problem can be fixed by making matrix spaces unique parents (but I
> didn't check yet whether it creates other problems).
> 
> Question to you: Do you see an obvious reason why matrix spaces should
> not be unique parents?

If at all possible, I for myself would rather have them as unique
parents.

On the other hand, I remember it was argued against it for
VectorSpaces: indeed users might want to create several copies of a
given vector space, in particular to use different scalar products. 
I don't know if there are similar needs/use for matrix spaces.


In the case of VectorSpaces, I would be more in favor of having unique
parents, and making the scalar product a part of the data to construct
the vector space. That is:

VectorSpace(QQ,3, scalar_product=...)

would model QQ^3, *endowed* with the given scalar product, which is
different from QQ^3.

Also, we could still allow the user to create his/her private vector
space by specifying an extra key to the constructor (that's what
CombinatorialFreeModule does). But that might require some refactoring
and might break backward compatibility.

Cheers,
Nicolas
--
Nicolas M. Thiéry "Isil" 
http://Nicolas.Thiery.name/

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Sage pay electric for build slaves

2012-01-11 Thread Jeroen Demeyer
Just wondering: is bandwidth a problem for you, or would that
potentially become a problem if there were more buildbots at your place,
possibly also building and uploading binaries?

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] pexpect troubles

2012-01-11 Thread Jeroen Demeyer
On 2012-01-11 00:34, William Stein wrote:
> I would say that me and Mike Hansen both know it very well. From my
> perspective, it's not that complicated and I don't think it needs to be
> refactored.
Maybe the problem lies with pexpect upstream rather than Sage's use of
pexpect?  I don't know.  I would also be very happy with some advice on
how to debug pexpect interfaces.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


[sage-devel] Should matrix spaces keep violating the basic assumption on hash functions, or should they be unique parents?

2012-01-11 Thread Simon King
Hi!

Matrix spaces of dense and sparse matrices are equal and are thus not
unique parents:
  sage: M1 = MatrixSpace(ZZ,2,sparse=True)
  sage: M2 = MatrixSpace(ZZ,2,sparse=False)
  sage: M1 is M2
  False
  sage: M1==M2
  True

Fine. But what should be really bad: They violate the assumption that
equal objects have equal hash.
  sage: hash(M1)==hash(M2)
  False

By consequence, the two equal matrix spaces will correspond to
different items of dictionaries:
  sage: D = {M1:1,M2:2}
  sage: len(D)
  2

I think that it is an apparent bug. Therefore, at #12290, I am fixing
the hash values (and moreover I speed-up the hash of matrix spaces
considerably).

However, it seems that the coercion framework relies on the bug.
Namely, when fixing it, one gets
  sage: A = matrix(ZZ, 5, range(30), sparse=False)
  sage: B = matrix(ZZ, 5, range(30), sparse=True)
  sage: C = matrix(QQ, 5, range(30), sparse=True)
  sage: A.elementwise_product(C).is_dense()
  True
  sage: B.elementwise_product(C).is_sparse()
 
---
  TypeError Traceback (most recent
call last)
  ...
  TypeError: no common canonical parent for objects with parents:
'Full MatrixSpace of 5 by 6 sparse matrices over Integer Ring' and
'Full MatrixSpace of 5 by 6 sparse matrices over Rational Field'

The problem can be fixed by making matrix spaces unique parents (but I
didn't check yet whether it creates other problems).

Question to you: Do you see an obvious reason why matrix spaces should
not be unique parents?

Best regards,
Simon

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Re: VirtualBox

2012-01-11 Thread P Purkayastha


On Wednesday, January 11, 2012 11:26:43 AM UTC+8, Benjamin Jones wrote:
>
> After a minute or two I couldn't figure out how to save a worksheet or
> plots or other data files and access them in the host OS.
>
> --
> Benjamin Jones
>
For this it would be best if shared folders are used, as Keshav mentioned 
earlier. One shared folder for .sagenb and another shared folder for "My 
Documents\sagenb" so that the user can right click on images and save it in 
the shared folder.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org


Re: [sage-devel] Installing bzip2 only if needed

2012-01-11 Thread Jeroen Demeyer
On 2012-01-11 08:53, Julien Puydt wrote:
> Le 10/01/2012 23:26, Jeroen Demeyer a écrit :
>> On 2012-01-10 23:25, Julien Puydt wrote:
>>> Would sage maintainers accept a patch to bzip2's spkg adding the
>>> following to spkg-install : "if there's already a bzip2 on the system
>>> then don't compile&install a new one"?
>> I see absolutely no reason for doing this, apart from saving a little
>> bit of time and diskspace.  So the small disadvantage of being less
>> predictable and more prone to breakage (without the Sage bzip2)
>> outweighs the epsilon time/space advantage.
> 
> Ah, yes, bzip2 is small and compiles "fast".
> 
> Ah, yes, patch is small and compiles "fast".
> 
> Ah, yes...
> 
> 
> 
> \mathbb{R} is archimedean.
True, but we're talking a different order of magnitude here.  Speeding
up the atlas installation by just 5% would save more time than removing
both bzip2 and patch.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org