#21067: Symbolic factor_list() should do integer factorisation of
integers/rationals
-------------------------------------+-------------------------------------
Reporter: rws | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.3
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: Ralf Stephan | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/rws/symbolic_factor___should_do_integer_factorisation_of_integers_rationals|
ac3d7cb0574701f2f5d94fa1e3b34239237674cd
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by nbruin):
Two comments:
- I don't think SR needs to be imported at all. The very fact that we land
in this `factor_list` implementation should mean that `self.parent()`
should be SR. And if it isn't, that's probably the better parent to use
anyway.
- If we're going to do this anyway, I think it's better if we have
{{{
sage: (5/3*x/(x+1)).factor_list()
[(x + 1, -1), (x, 1), (5, 1), (3,-1)]
}}}
because it's closer to the idea that the factorisation of a product U*V
has a tendency to be the concatenation of the factorisations of U and V.
It should be clear that `factor_list` just returns *a* factorisation:
{{{
sage: ((sqrt(5)+1)^2*(x^2-5)).expand_rational().factor_list()
[(x^2 - 5, 1), (sqrt(5) + 3, 1), (2, 1)]
}}}
but keeping the convention that we factor rational numbers into their
prime factors should be fine and could be nice for newbies.
--
Ticket URL: <https://trac.sagemath.org/ticket/21067#comment:5>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.