here is a matrix constructor i would like to see:
Matrix(M, N, f):
for i in range(1,M+1):
for j in range(1,N+1):
self[i][j] = f(i,j) # or whatever the syntax is
i might use it like this:
A = Matrix(3, 3, lambda i,j: i+j)
i'd do it myself, but i don't have a development envir
how hard would it be to make this work?
W. = ZZ['w1','w2']
factor(w1*w2)
i'm using sage 2.3. if somebody could send me a code snippet,
it would be hugely appreciated.
kyle
--~--~-~--~~~---~--~~
To post to this group, send email to sage-devel@googlegroups.com
>
> Work over QQ instead:
>
> sage: W. = QQ['w1','w2']
> sage: factor(w1*w2)
> w2 * w1
>
> One can reduce factoring over ZZ to over QQ, with some work.
> Volunteers...?
>
> William
oh good, an easy workaround. the same trick doesn't seem to work if the
base ring is a polynomial ring, that is,
there is trouble with the determinant method on a matrix over a funky ring
(yes, the same funky ring causing all my other problems). in its simplest
form:
In [43]: W.=QQ['w']
In [44]: WZ.=W['z']
In [45]: matrix(WZ,2,2,[1,z,z,z^2]).det()
Out[45]:
the analog over a "shallower" polynomial ring
> On 3/20/07, Kyle Schalm <[EMAIL PROTECTED]> wrote:
>> there is trouble with the determinant method on a matrix over a funky ring
>> (yes, the same funky ring causing all my other problems). in its simplest
>> form:
>>
>> In [43]: W.=QQ['w']
&g
here is some behaviour i find rather weird.
In [76]: w1,w2=QQ['w1,w2'].gens()
now as i see it, w1 is a polynomial in one variable. indeed:
In [77]: w1.variables()
Out[77]: [w1]
however,
In [78]: w1(1)
: x must be of correct length
whereas
In [79]: w1(1,1)
Out[79]: 1
succeeds. i see why i
>
> The definition of variables is that it returns the "list of variables
> ocuring in the poly". If that determined whether the poly
> were in 1 or 2 variables, then it would, e.g. be impossible to
> even define a constant polynomial -- since it wouldn't be
> a polynomial.
i see. makes more
pardon my ignorance, as i'm sure it's been explainedbefore, but if
i've made local changes to the sage code, what's the proper way to
upgrade? if i type "sage -upgrade", will it clobber my changes? how do i
"merge in" the new features in going from, say, 2.3 to 2.4.1?
thanks.
kyle
--~--~
this is one of the strangest bugs i've seen. using sage 2.3, sometimes
constructing quotients in the rational function field CC(z) freezes, and
sometimes not. when i say freezes, i mean it justs sits there until i
press ctrl-C. no error, no stack overflow... just sits and runs forever.
once i
perhaps there's been a discussion about this that i didn't pay attention
to, but i just realized that equality (==) is not always transitive:
In [109]: mod(2,5)==mod(2,10)
Out[109]: True
In [110]: mod(2,5)==mod(7,10)
Out[110]: True
In [111]: mod(2,10)==mod(7,10)
Out[111]: False
what is the r
oops, instead of
> FractionFieldElement(z.parent(),(I-z),(z+1.8),reduce=false)
i should have written
>
> FractionFieldElement(z.parent().fraction_field(),(I-z),(z+1.8),reduce=false)
because that works.
-kyle
--~--~-~--~~~---~--~~
To post to this gro
>
> I'm not sure what to say except:
> (1) the definition of equality in SAGE is "equal images under a
> canonical map",
hmmm. ok. if i wanted to find out the semantics of some SAGE operator,
where would i look? perusing the reference manual, i didn't see any
discussion of this. perhaps ther
On Wed, 4 Apr 2007, William Stein wrote:
> What do you think of the attached? The problem was that
> gcd of numerical polynomials, via the algorithm we use, doesn't
> always converge, so polynomials couldn't be reduced to lowest
> terms. The patch changes the behavior of SAGE so fraction fields
since the default hash value
comes from the string representation.
---
below is the patch.
# HG changeset patch
# User Kyle Schalm <[EMAIL PROTECTED]>>
# Date 1176451637 18000
# Node ID bca0cc86fd5e88dc21887c5d222c1fcfa71ae490
# Parent 76e21a785e866569cc43a15b01ee81d9dd131b43
fix bu
f not, just use the first part of this patch.
# HG changeset patch
# User Kyle Schalm <[EMAIL PROTECTED]>>
# Date 1176453082 18000
# Node ID ce41e74d58b655aa854acba1e08a69fec9534cc6
# Parent bca0cc86fd5e88dc21887c5d222c1fcfa71ae490
guard Set_object_enumerated against accidental change
>> while i'm on the topic of sets, is the Set class intended to be immutable?
>
> No. The builtin Python set type isn't immutable, so it doesn't
> seem sensible to make the SAGE one immutable. E.g., the
> builtin set type has an add method:
ok, but there is no add method in the SAGE Set, nor
i thought all these sorts of things were ironed out by now:
In [24]: z*d1
---
Traceback (most recent call
last)
/home/kyle/ in ()
/home/kyle/element.pyx in element.RingElement.__mul__()
/home/kyle/element.pyx
yesterday i tried to install sage 2.6 on a friend's machine running debian
4.0R0 for powerpc.
there does not appear to be a binary, so i grabbed the source and started
building. i figured it would take a few hours.
i don't know if sage 2.6 is building correctly and just looks like it's
not, or
>>> make[4]: Warning: File `configure' has modification time 2.2e+06 s
>>> in the
>>> future
>
> This timestamp problem seems to be the root of your problem. Where is the
> build directory coming from, i.e. mounted per NFS or somehow else via
> network? What is the local time? Is it off by roughly
On Tue, 14 Aug 2007, William Stein wrote:
>
> On 8/14/07, John Cremona <[EMAIL PROTECTED]> wrote:
>>
>> Whatever the fact of the case, I find the tone of this email
>> offensive. I'm sure I am not the only one. I think an apology is
>> called for.
>
> I'm very sorry for not carefully reading t
as long as the polynomial x^0 continues to evaluate to 1 at x=0, i'm happy
with defining 0^0 to be whatever.
On Tue, 28 Aug 2007, William Stein wrote:
>
> Hi,
>
> In SAGE until now 0^0 gave 1 as answer. We are almost certainly going to
> change
> this to raise an ArithmeticError. Does anybo
21 matches
Mail list logo