ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Mon, 09 Mar 2015 11:50:35 -0500Scale to simple integershttps://ask.sagemath.org/question/26098/scale-to-simple-integers/There are many situations where multiplying an object by a scalar doesn't change its relevant properties. For example a polynomial, when all you care about are its roots. Or a matrix, when you onyl care about the kernel. Or a vector or matrix when you are dealing with homogeneous coordinates. Often it would be nice if we could choose a factor which leads to a particularly simple representation of all the objects involved. If all numbers involved are rational, we'd scale to make them integers. Then we could compute their gcd and divide by that, to obtain small integers. We might even fix the sign in some way, e.g. require the leading term of a polynomial to be positive.
Things become interesting if we nest things. If we have a matrix over the fraction field over some stack of nested polynomials, with rationals as the field underlying all of this, then we would have to traverse several layers of data structures to find all the numbers and turn them into integers. And along the way we'd multiply with the denominators from the polynomial fraction field as well.
**Is there any functionaliy in Sage to provide any of this? Perhaps not all the way to what I described, but at least part of it?**
I know there is a method `monic` both for vectors and for polynomials, to obtain a representation which is normalized in a certain sense. But that's not the sense I'm after since it usually leads to fractions. I also know that there are classes to represent [projective spaces](http://sagemath.org/doc/reference/schemes/sage/schemes/projective/projective_space.html) over arbitrary rings, and a [method to clear denominators](http://sagemath.org/doc/reference/schemes/sage/schemes/projective/projective_point.html#sage.schemes.projective.projective_point.SchemeMorphism_point_projective_field.clear_denominators) for points of such a space. But since I can't operate on such projective points using standard linear algebra matrices, and since converting between both worlds is tedious, I don't use these classes at all even though I use homogeneous coordinates all the time.
I'm tempted to write a trac ticket to request functionality along these lines (and perhaps write some of it myself later on), but I first wanted to know whether I had overlooked something like this.MvGMon, 09 Mar 2015 11:50:35 -0500https://ask.sagemath.org/question/26098/