Skip to main content
It's now named "Sagemath"
Source Link
Federico Poloni
  • 20.5k
  • 2
  • 83
  • 125

How do Computercomputer algebra packages like SageSagemath implement rank of a matrix

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 SageSagemath 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)matrix(ZZ, R, C), or as matrix(QQ, R, C)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)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 SageSagemath a couple of times, but I was quickly lost, so I hope someone can point me to the precise documentation/source code)

How do Computer algebra packages like Sage implement rank of a matrix

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 Sage 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 Sage a couple of times, but I was quickly lost, so I hope someone can point me to the precise documentation/source code)

How do computer algebra packages like Sagemath implement rank of a matrix

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)

added (computer-algebra) tag
Link
Martin Sleziak
  • 4.8k
  • 4
  • 38
  • 42
Source Link
Nikhil
  • 273
  • 1
  • 9

How do Computer algebra packages like Sage implement rank of a matrix

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 Sage 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 Sage a couple of times, but I was quickly lost, so I hope someone can point me to the precise documentation/source code)