Ask Your Question
0

Kernel not found?

asked 2019-01-02 04:24:02 -0500

anonymous user

Anonymous

updated 2019-01-02 04:26:53 -0500

Hi. Why is no kernel found for the 2x3 matrix A=[2,3,5];[-4,2,3] ?

sage: A = matrix([[2,3,5],[-4,2,3]])  
sage: A   
[ 2  3  5]  
[-4  2  3]  
sage: A.kernel()  
Free module of degree 2 and rank 0 over Integer Ring  
Echelon basis matrix:  
[]

However we know that the kernel should be given by: x=-z/16 and y=-13z/8

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2019-01-02 04:32:39 -0500

rburing gravatar image

updated 2019-01-02 04:35:47 -0500

Sage returns the left kernel. This is written in the documentation that you can access by

sage: A.kernel?

You want the right kernel:

sage: A.right_kernel()
edit flag offensive delete link more

Comments

While A.right_kernel() returns [ 1 26 -16], it's only one possible solution from the solution set. Instead, I expect it to return c * [ 1 26 -16 ]. Any idea how to not miss out all the solutions?

rijndaelxyz gravatar imagerijndaelxyz ( 2019-01-02 12:02:42 -0500 )edit

What A.right_kernel() returns is not a vector but a module with basis. (If you create a matrix over a field like A = matrix(QQ, [[2,3,5],[-4,2,3]]) it returns a vector space with basis.) You can obtain the basis (which is a sequence of vectors) by b = A.right_kernel().basis(). The set of solutions to $Ax = 0$ is spanned by this basis, i.e. all solutions are linear combinations of those basis vectors. If you insist, you can introduce the appropriate number of symbolic variables c = [var('c_%d' % i) for i in range(len(b))] and create such a linear combination: sum([c[i]*b[i] for i in range(len(b))]); this is a vector over the Symbolic Ring SR.

rburing gravatar imagerburing ( 2019-01-02 12:16:17 -0500 )edit

If you want to display the linear combination in the way you wrote, you can do it like this: FormalSum([(c[i], b[i]) for i in range(len(b))], parent=FormalSums(SR)), or even the fancy display show(FormalSum([(c[i], b[i].column()) for i in range(len(b))], parent=FormalSums(SR))).

rburing gravatar imagerburing ( 2019-01-02 12:22:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-01-02 04:24:02 -0500

Seen: 69 times

Last updated: Jan 02