ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 09 Aug 2016 20:57:35 -0500Does right_kernel_matrix support assumptions over the symbolic ring?http://ask.sagemath.org/question/34385/does-right_kernel_matrix-support-assumptions-over-the-symbolic-ring/I'm trying to a basis for the kernel of a symbolic matrix. However, exactly quite what the kernel is depends on the assumptions that have been made. It seems that although other matrix functions (e.g. calculating the inverse) respect assumptions the kernel function doesn't. Here is an example:
var('x,y')
M = Matrix(SR, [[x, 0],[0,y]])
print(~M) # Gives expected inverse [[1/x, 0], [0,1/y]]
print(M.right_kernel_matrix()) # Gives [] as expected (if x, y != 0 then M is invertible so has trivial kernel)
assume(x == 0)
# print(~M) # Throws an error (ZeroDivisionError)
print(M.right_kernel_matrix()) # Still gives [], whereas the kernel now has basis [(1, 0)]
Am I missing something here? Is it possible to use this function with assumptions?Tue, 09 Aug 2016 09:51:57 -0500http://ask.sagemath.org/question/34385/does-right_kernel_matrix-support-assumptions-over-the-symbolic-ring/Comment by kcrisman for <p>I'm trying to a basis for the kernel of a symbolic matrix. However, exactly quite what the kernel is depends on the assumptions that have been made. It seems that although other matrix functions (e.g. calculating the inverse) respect assumptions the kernel function doesn't. Here is an example:</p>
<pre><code>var('x,y')
M = Matrix(SR, [[x, 0],[0,y]])
print(~M) # Gives expected inverse [[1/x, 0], [0,1/y]]
print(M.right_kernel_matrix()) # Gives [] as expected (if x, y != 0 then M is invertible so has trivial kernel)
assume(x == 0)
# print(~M) # Throws an error (ZeroDivisionError)
print(M.right_kernel_matrix()) # Still gives [], whereas the kernel now has basis [(1, 0)]
</code></pre>
<p>Am I missing something here? Is it possible to use this function with assumptions?</p>
http://ask.sagemath.org/question/34385/does-right_kernel_matrix-support-assumptions-over-the-symbolic-ring/?comment=34395#post-id-34395Most likely computing the inverse of a symbolic matrix is done using Maxima, which knows about the assumptions, while the other methods don't, so it doesn't. (More or less only methods which use Maxima will know about them; usually one doesn't have it used for matrix stuff so this is an outlier. Yes, Sage's assumption framework could use improvement.)Tue, 09 Aug 2016 20:57:35 -0500http://ask.sagemath.org/question/34385/does-right_kernel_matrix-support-assumptions-over-the-symbolic-ring/?comment=34395#post-id-34395