[sage-support] Coercion question

2024-07-29 Thread 'Andrew' via sage-support
[Not sure if this belongs here or in sage-dev...] I am trying to implement coercions between algebras that are related by base change. For example,consider A=CombinatorialFreeModule(ZZ['x'], ['1','2']) B=CombinatorialFreeModule(ZZ, ['1','2']) A.module_morphism( lambda a: B._from_dict({b: c.s

[sage-support] Coercion bug message when working with group algebras

2022-08-05 Thread keirh...@gmail.com
When I do this: *H = PermutationGroup([ [(1,2), (3,4)], [(5,6,7),(12,14,18)] ])kH = H.algebra(GF(2))[a, b] = H.gens()x = kH(a) + kH(b) + kH.one(); print(x)x*x* I get an error caused by the last computation: "RuntimeError: There is a bug in the coercion code in Sage." (I was working in Cocal

[sage-support] coercion failure?

2016-04-30 Thread kcrisman
RDF('0.0') is fine QQ(RDF('0.0')) is fine QQ('0') is fine QQ(0.0) is fine QQ('0.0') # boom Any ideas, or should I not expect this to work in the first place? -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop

Re: [sage-support] Coercion problem

2015-01-15 Thread Robert Bradshaw
I assume you meant sage: v = P(5) sage: v(oo) A positive finite number This is because the elements of QQ coerce to the parent of oo, which is the "signed infinity ring." This is so we have sage: P. = PolynomialRing(QQ) sage: w = x + 5 sage: v = w - x w(1.0) 6.00 sage: v(1.0) 5.0

[sage-support] Coercion problem

2015-01-15 Thread michalg0x5a
I recently sumbled at following behaviour: sage: P. = PolynomialRing(QQ) sage: w = x + 1 sage: w(oo) + Infinity sage: v = 5 sage: v(oo) A positive finite number This behaviour is strange (altough works as desined). For nonconstant polynomial it has the same effect as calculating limit, for consta

[sage-support] Coercion between polynomial rings gives parent sympy.core.add.Add

2014-03-16 Thread Tristan
Hi all, I'm using Sage-5.13 on Virtual Box 4.3.8 and I want to use the inbuilt polynomial methods for testing irreducibility, factorizing and homogenizing polynomials. I know that I need to coerce between univariate and multivariate polynomial rings to do this, but whenever I try this the image

[sage-support] coercion does work in 4.5.2, does not work in 4.6(.2)

2011-05-03 Thread eggartmumie
Hi, as a newbie I am rather irritated about coercion working in 4.5.2 and not working in 4.6. In 4.5.2 the following works nicely and up to expectation F.=GF(2^4); for i in range(15): a = x^i; print a,'with integer representation', int(a); in 4.6 (on www.sagenb.org) or 4.6.2 I get 1 with in

[sage-support] Coercion problem in free module

2010-11-11 Thread Enrico
Hi All, Can anyone think why my binary install (Sage4.5.2 on Ubuntu10.04) should start intermittently having a coercion problem "rank = int(rank) in free_module.py" when I haven't tried to install anything else in Sage's python or modify Sage itself. eg. I had: V = VectorSpace(RR, 2) v = V([3.0,

Re: [sage-support] coercion bug + help please

2009-12-08 Thread William Stein
On Tue, Dec 8, 2009 at 8:47 AM, Pierre wrote: > this is definitely a bug, right ? > > sage: k= CyclotomicField(4, "i") > sage: poly= PolynomialRing(k, "x") > sage: x= poly.gen() > sage: p= 3; K= NumberField(x^2 - p, "r") > sage: i= K( k.gen() ) > sage: CDF(i) > 2.31897834269e-14 - 1.0*I > > So i i

[sage-support] coercion bug + help please

2009-12-08 Thread Pierre
this is definitely a bug, right ? sage: k= CyclotomicField(4, "i") sage: poly= PolynomialRing(k, "x") sage: x= poly.gen() sage: p= 3; K= NumberField(x^2 - p, "r") sage: i= K( k.gen() ) sage: CDF(i) 2.31897834269e-14 - 1.0*I So i is converted to roughly -i... which can makes sense as it's just a c

[sage-support] Coercion into power series ring

2009-06-08 Thread Kwankyu
Hi, See this: sage: R.=PowerSeriesRing(QQ) sage: P.=PolynomialRing(R) sage: f=(x*t+t^2)/t sage: f x + t sage: P(f) --- TypeError Traceback (most recent call last) ... TypeError: Unable to coer

[sage-support] Coercion problem

2009-03-21 Thread Jason Bandlow
Hi all, Is the following missing coercion known? I couldn't find anything on trac, but there's a lot there related to coercion, so I may have missed it. sage: a = float(1.0) sage: QQ(a) TypeError: Unable to coerce 1.0 () to Rational Note that the following works:

[sage-support] coercion bug?

2009-03-10 Thread Alex Raichev
Does anyone know what's up with this weird error? Sage can multiply a symbolic variable and a constant of a polynomial ring R but not a symbolic variable and an element of R.base_ring(). Alex sage: var('t') t sage: K.= NumberField(t^2+2,'a') sage: R.= PolynomialRing(K) sage: t*R(a) a*t sage: t*

[sage-support] coercion question

2008-07-04 Thread John H Palmieri
I'm running into a coercion problem. I'm trying to define a class SteenrodAlgebra (based on the Algebra class); there should be one Steenrod algebra for each prime number p, and it is an algebra over GF(p). For example, you can do sage: A5 = SteenrodAlgebra(5) sage: A7 = SteenrodAlgebra(7) I h

[sage-support] coercion problem?

2008-06-02 Thread David Joyner
Hi: Possibly this is a problem with coercion but I don't know. Does anyone know why the following takes so long? sage: p = 5 sage: F = GF(p) sage: E. = GF(p^2,"a") sage: G = GL(2,p) sage: M = MatrixSpace(E,2,2) sage: V = VectorSpace(E,2) sage: g = G.random_element() sage: v = V([1,a]); v; g; M(

[sage-support] Coercion

2007-08-27 Thread Justin Walker
Hi, all, I do this, and get integers, but the types are rational: sage: b1=0 sage: b2=2 sage: s=(b1+b2)/2 sage: n=(b1-b2)/2 sage: s 1 sage: n -1 Then I do this: sage: xgcd(s,n) --- Traceback (most recent call last)

[sage-support] Coercion bug?

2007-01-30 Thread Iftikhar Burhanuddin
"long int too large to convert to int". Seems like a coercion bug? Regards, Ifti === sage: X = SupersingularModule(17) sage: M = X.T(13).matrix() --- Traceback (most recent call last) /home/burhanud/ssmod_new/ in