On Fri, Nov 09, 2012 at 08:44:15AM -0800, Nils Bruin wrote:
> Yes, this is odd. python's sum really does start with adding zero,
> even if no initial value is given.
This indeed looks like a natural spot for optimization. However it
would change the semantic:
sage: sum([1,2], 0.0)
3.0
Hi Nils!
On Fri, Nov 09, 2012 at 08:44:15AM -0800, Nils Bruin wrote:
> On Nov 9, 2:11 am, "Nicolas M. Thiery"
> wrote:
> > The main point is that writing V.sum(args) gives more information to
> > the system than sum(args, self.zero()): this is making a promise that
> > all elements in arg
On Sat, Nov 10, 2012 at 11:21:54AM +0100, Florent Hivert wrote:
> On Fri, Nov 09, 2012 at 09:53:49AM -0800, John H Palmieri wrote:
> >
> >
> > On Friday, November 9, 2012 4:42:42 AM UTC-8, Nicolas M. Thiéry wrote:
> > >
> > > More precisely: QQ^3 should be in the category of finite dimensional
On Fri, Nov 09, 2012 at 09:41:01AM -0800, Volker Braun wrote:
> Thanks, looks good.
>
> Maybe one could factor out the Enumerated (=canonical enumeration) part? Or
> is every parent with __iter__ supposed to be in EnumeratedSets and,
> therefore, have a rank() methods etc? The element order is o
On Fri, Nov 09, 2012 at 09:53:49AM -0800, John H Palmieri wrote:
>
>
> On Friday, November 9, 2012 4:42:42 AM UTC-8, Nicolas M. Thiéry wrote:
> >
> > More precisely: QQ^3 should be in the category of finite dimensional
> > modules with basis, and a finite dimensional module with basis over an
On Friday, November 9, 2012 4:42:42 AM UTC-8, Nicolas M. Thiéry wrote:
>
> More precisely: QQ^3 should be in the category of finite dimensional
> modules with basis, and a finite dimensional module with basis over an
> infinite field should be in the category of infinite enumerated sets.
>
>
Thanks, looks good.
Maybe one could factor out the Enumerated (=canonical enumeration) part? Or
is every parent with __iter__ supposed to be in EnumeratedSets and,
therefore, have a rank() methods etc? The element order is often just
arbitrary...
Also, I dislike .list() returning a Python list
On Nov 9, 2:11 am, "Nicolas M. Thiery"
wrote:
> The main point is that writing V.sum(args) gives more information to
> the system than sum(args, self.zero()): this is making a promise that
> all elements in args are elements of V.
In python's call dispatch system, it does not. It says something a
On Fri, Nov 09, 2012 at 05:58:48AM +, Simon King wrote:
> On 2012-11-09, Robert Bradshaw wrote:
> > __len__ must return a (machine-sized) int, not elements of ZZ let
> > alone infinity.
>
> Sorry, I didn't know that. Then one should probably go the other way,
> implement cardinality() for mor
Hi Volker,
On Thu, Nov 08, 2012 at 08:02:49AM -0800, Volker Braun wrote:
>This occurred to me before, its nice to have iterators/generators but
>there should be a mechanism to say that the iterator is over a finite or
>infinite set.
>Just to avoid doing exhaustive searches
On Thu, Nov 08, 2012 at 10:56:26PM +, Simon King wrote:
> why not make __len__ an alias for the cardinality?
It can't be a plain alias: __len__ is only allowed to return an `int`,
whereas cardinality should return an Integer or +infinity.
Cheers,
Nicolas
--
Nic
On Thu, Nov 08, 2012 at 10:16:36AM -0600, Jason Grout wrote:
> On 11/8/12 6:26 AM, Simon King wrote:
> >Hi David and John,
> >
> >On 2012-11-08, David Loeffler wrote:
> >>It is *really awful* that V.sum(W) attempts to sum all the elements of
> >>W! I don't know what general design decision underli
On Nov 8, 9:20 pm, Robert Bradshaw
wrote:
> However, I agree with the sentiment that V.sum(W) grossly violates the
> principle of least surprise as well as being of dubious merit over the
> builtin sum(...).
And note that python's builtin sum is in sage shadowed by
sum=sage.misc.functional.symb
Hi Robert,
On 2012-11-09, Robert Bradshaw wrote:
> __len__ must return a (machine-sized) int, not elements of ZZ let
> alone infinity.
Sorry, I didn't know that. Then one should probably go the other way,
implement cardinality() for more parents, and use it in "sum".
Cheers,
Simon
--
You rec
On Thu, Nov 8, 2012 at 2:56 PM, Simon King wrote:
> On 2012-11-08, Nils Bruin wrote:
>> On Nov 8, 1:17 pm, Simon King wrote:
>>> Hi Volker,
>>>
>>> On 2012-11-08, Volker Braun wrote:
>>>
>>> > But then you'd always have to write a lot of
>>> > boilerplate to return an iterator. Its much easier
On 2012-11-08, Nils Bruin wrote:
> On Nov 8, 1:17 pm, Simon King wrote:
>> Hi Volker,
>>
>> On 2012-11-08, Volker Braun wrote:
>>
>> > But then you'd always have to write a lot of
>> > boilerplate to return an iterator. Its much easier to use yield, but then
>> > you can't return any additional
On Nov 8, 1:17 pm, Simon King wrote:
> Hi Volker,
>
> On 2012-11-08, Volker Braun wrote:
>
> > But then you'd always have to write a lot of
> > boilerplate to return an iterator. Its much easier to use yield, but then
> > you can't return any additional information about finiteness.
>
> No? What'
Hi Volker,
On 2012-11-08, Volker Braun wrote:
> But then you'd always have to write a lot of
> boilerplate to return an iterator. Its much easier to use yield, but then
> you can't return any additional information about finiteness.
No? What's wrong with __len__?
Cheers,
Simon
--
You recei
On 11/09/2012 12:16 AM, Jason Grout wrote:
On 11/8/12 6:26 AM, Simon King wrote:
Hi David and John,
On 2012-11-08, David Loeffler wrote:
It is *really awful* that V.sum(W) attempts to sum all the elements of
W! I don't know what general design decision underlies this but I
don't like it.
Th
On 11/8/12 6:26 AM, Simon King wrote:
Hi David and John,
On 2012-11-08, David Loeffler wrote:
It is *really awful* that V.sum(W) attempts to sum all the elements of
W! I don't know what general design decision underlies this but I
don't like it.
That's easy to explain. All additive semigroup
This occurred to me before, its nice to have iterators/generators but there
should be a mechanism to say that the iterator is over a finite or infinite
set. Just to avoid doing exhaustive searches over infinite sets. Similar to
C++ iterator traits, I guess. Of course if you were to manually impl
I don't think anyone is objecting to being able to add a list of
vectors (or any other objects which can be added). But in my example,
V.sum(W) is taking the (infinite) list of elements of W and adding
them up, which has nothing at all to do with V. Just replace QQ by a
finite field in my examp
Hi David and John,
On 2012-11-08, David Loeffler wrote:
> It is *really awful* that V.sum(W) attempts to sum all the elements of
> W! I don't know what general design decision underlies this but I
> don't like it.
That's easy to explain. All additive semigroups should be able to sum up a
list of
Thanks to all. The machine is still up, as I was able to stop the
computation with Crtl-C.
Now I see it, of course that's what V.sum(W) says that it does, except
that it in fact makes no sense, since adding up the (infinitely many)
elements of W has nothing to do with V.
I don't quite know how I
I suspect that what John wants is the sum of V and W as subspaces of a
common ambient space (not the direct sum embedded in the direct sum of
two copies of the ambient space, as Francis suggests). This can be
obtained (very quickly) by doing
sage: time V + W
Vector space of degree 100 and dimensio
On 11/08/2012 05:36 PM, John Cremona wrote:
Either I am doing something wrong or a simple operation which should
be fast is in fact very slow, but I do not know why.
If V,W are vector spaces over QQ, subspaces of the same ambient
space, then V.sum(W) should return their sum, with an echelon bas
Op donderdag 8 november 2012 10:36:51 UTC+1 schreef John Cremona het
volgende:
>
> Either I am doing something wrong or a simple operation which should
> be fast is in fact very slow, but I do not know why.
>
> If V,W are vector spaces over QQ, subspaces of the same ambient
> space, then V.sum
I think you want
sage: V.direct_sum(W)
Vector space of degree 200 and dimension 2 over Rational Field
Basis matrix:
2 x 200 dense matrix over Rational Field
Francis
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To post to this group, send em
28 matches
Mail list logo