On Tuesday, June 25, 2019 at 3:10:29 AM UTC-7, Peter Luschny wrote:
>
> Am Di., 25. Juni 2019 um 10:49 Uhr 'luisfe' :
>
> | When n =0, k ranges from 0 to -1 so there is no k and the list
> constructed in ib(n,m)
> | is just the empty list. Not an empty list of polynomials, just an empty
>
Am Di., 25. Juni 2019 um 11:29 Uhr schrieb slelievre <
samuel.lelie...@gmail.com>:
> So, replace
>
> sum(binomial(m*n-1, m*k)*OmegaPolynomial(m,k) for k in (0..n-1))
>
> by
>
> sum((binomial(m*n-1, m*k)*OmegaPolynomial(m, k) for k in (0 .. n-1)),
> RR['x'].zero())
>
Now, this is clever!
Am Di., 25. Juni 2019 um 10:49 Uhr 'luisfe' :
| When n =0, k ranges from 0 to -1 so there is no k and the list
constructed in ib(n,m)
| is just the empty list. Not an empty list of polynomials, just an empty
list.
Well, then the way 'sum' is implemented is possibly improvable?
The type
Tue 2019-06-25 10:49:44 UTC+2, luisfe:
>
>
> On Tuesday, June 25, 2019 at 10:03:03 AM UTC+2, Peter Luschny wrote:
>>
>> How that? Look at the output above. Sage *knows* that the terms of the
>> sum
>> are polynomials. So it should return the zero of that ring, which is the
>> null polynomial.
On Tuesday, June 25, 2019 at 10:03:03 AM UTC+2, Peter Luschny wrote:
>
> How that? Look at the output above. Sage *knows* that the terms of the sum
> are polynomials. So it should return the zero of that ring, which is the
> null polynomial.
>
>
Not in the first case, look at what are you
Would you share the definition of OmegaPolynomial?
This would help figure out / explain what the issue is.
--
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
Am Montag, 17. Juni 2019 14:27:40 UTC+2 schrieb luisfe:
>
> On Mon, Jun 17, 2019 at 5:18 AM Peter Luschny wrote:
>>
>>> def ib(m, n): return sum(binomial(m*n-1, m*k)*OmegaPolynomial(m,k) for k
>>> in (0..n-1))
>>>
>>> The terms "binomial(m*n-1, m*k)*OmegaPolynomial(m,k)" are of type
>>> >>
The SageMath function sum accepts an optional "zero" argument precisely
for this purpose
sage: sum([], 0)
0
sage: sum([], 11)
11
sage: sum([], [])
[]
Le 17/06/2019 à 11:18, Peter Luschny a écrit :
Hi,
I think we should be confident that the sum of integers is
again an integer, the sum of
On Monday, June 17, 2019 at 2:12:58 PM UTC+2, Peter Luschny wrote:
As I see it the problem is that the sum runs over (0..n-1).
> Thus for n = 0 it returns by convention the integer 0 for the
> empty sum (is this correct?) which of course has no list.
>
> But shouldn't it return the null
On Monday, June 17, 2019 at 2:12:58 PM UTC+2, Peter Luschny wrote:
As I see it the problem is that the sum runs over (0..n-1).
> Thus for n = 0 it returns by convention the integer 0 for the
> empty sum (is this correct?) which of course has no list.
>
> But shouldn't it return the null
> Are you saying, the error message it spits out,
>>
> AttributeError: 'int' object has no attribute 'list',
> is misleading?
>
As I see it the problem is that the sum runs over (0..n-1).
Thus for n = 0 it returns by convention the integer 0 for the
empty sum (is this correct?) which of
On Mon, Jun 17, 2019 at 5:38 AM Peter Luschny
wrote:
> I don't know what OmegaPolynomial is. However, if you replace it by
>> cyclotomic_polynomial,
>> it seems to work as expected, doesn't it?
>>
>
> No, it does not. You missed the question.
>
>
>>
>> sage: *def* *ib*(m, n): *return*
>
> I don't know what OmegaPolynomial is. However, if you replace it by
> cyclotomic_polynomial,
> it seems to work as expected, doesn't it?
>
No, it does not. You missed the question.
>
> sage: *def* *ib*(m, n): *return* sum(binomial(m*n-*1*,
> m*k)*cyclotomic_polynomial(m*(k+*1*)) *for*
On Mon, Jun 17, 2019 at 5:18 AM Peter Luschny
wrote:
> Hi,
>
> I think we should be confident that the sum of integers is
> again an integer, the sum of rational numbers a rational number
> and that the sum of polynomials is a polynomial.
>
> With Sage this is not the case.
>
> def ib(m, n):
Hi,
I think we should be confident that the sum of integers is
again an integer, the sum of rational numbers a rational number
and that the sum of polynomials is a polynomial.
With Sage this is not the case.
def ib(m, n): return sum(binomial(m*n-1, m*k)*OmegaPolynomial(m,k) for k in
15 matches
Mail list logo