#5928: [with patch, positive review] binary operations on factorisations should
coerce factors into a common universe
---------------------------+------------------------------------------------
 Reporter:  AlexGhitza     |       Owner:  AlexGhitza                           
     Type:  defect         |      Status:  assigned                             
 Priority:  major          |   Milestone:  sage-4.0                             
Component:  factorization  |    Keywords:  multiplication factorization coercion
---------------------------+------------------------------------------------

Comment(by cremona):

 This patch looks good, applies to 3.4.2.alpha0 and tests in sage/structure
 pass as well as those in sage/rings/*.py (I did not go into
 subdirectories).

 I was a little disappointed by this:
 {{{
 sage: R.<x> = ZZ[]
 sage: S.<y> = QQ[]
 sage: f = x^2-1
 sage: g = y^3-1
 sage: f.factor()
 (x - 1) * (x + 1)
 sage: g.factor()
 (y - 1) * (y^2 + y + 1)
 sage: f.factor() * g.factor()
 (1) * (y - 1) * (x - 1) * (x + 1) * (y^2 + y + 1)
 sage: (f.factor() * g.factor()).universe()
 Category of objects
 }}}
 and in fact coercion is not clever enough to allow x*y here.  but it does
 work if you do
 {{{
 sage: S.<x> = QQ[]
 sage: y=S.gen(0)
 sage: g = y^3-1
 sage: f.factor() * g.factor()
 (x + 1) * (x - 1)^2 * (x^2 + x + 1)
 }}}
 -- i.e. you have to define the two rings with the same name of the
 variable even if you use a different name for input.  Weird, but it is not
 going to stop this patch!

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5928#comment:2>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to