I am not sure if this is the right place to ask this question, but I believe there will be people here who do computations on computer algebra packages like Sage in their work. I have been using Sagemath to perform some matrix rank computations. It turns up a few bizarre results occasionally.
For example, I had to find the rank of a matrix ($100 \times 150$) with large integer entries (entries of magnitude in the range of $1$ to $10^{15}$). When I wrote the code with the matrix M declared as matrix(ZZ, R, C)
, or as matrix(QQ, R, C)
, it returns a rank of around 90 (which I believe is correct), whereas if I declare the matrix over the reals as matrix(RR, R, C)
, it returns a rank of around 50, which I believe is too low based on some conjectures I have.
So, overall I am curious, what are the standard way(s) to implement rank computation (and does it differ based on reals, or rationals) and where can I read more about these? If these issues arise due to precision errors, how can I get around them? And more importantly, how do I know beforehand that my computation is susceptible to precision errors? (I tried looking up the source code of Sagemath a couple of times, but I was quickly lost, so I hope someone can point me to the precise documentation/source code)