Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

Kernel not found?

asked 6 years ago

anonymous user

Anonymous

updated 0 years ago

FrédéricC gravatar image

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

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 6 years ago

rburing gravatar image

updated 6 years ago

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()
Preview: (hide)
link

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 ( 6 years ago )

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 ( 6 years ago )

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 ( 6 years ago )

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: 6 years ago

Seen: 1,075 times

Last updated: Jan 02 '19