Sage will compute a null space for us. Which is rather remarkable, as it is an infinite set! Again, this is a powerful command, and there is lots of associated theory, so we will not understand everything about it right away, and it also has a radically different name in Sage. But we will find it useful immediately. Let us reprise Example NSEAI. The relevant command to build the null space of a matrix is .right_kernel(), where again, we will rely exclusively on the “right” version. Also, to match our work in the text, and make the results more recognizable, we will consistently us the keyword option basis='pivot', which we will be able to explain once we have more theory (Sage SSNS, Sage SUTH0). Note too, that this is a place where it is critical that matrices are defined to use the rationals as their number system (QQ).
As we said, nsp contains a lot of unfamiliar information. Ignore most of it for now. But as a set, we can test membership in nsp.
We did a bad thing above, as Sage likes to use I for the imaginary number $i=\sqrt{-1}$ and we just clobbered that. We will not do it again. See below how to fix this.
nsp is an infinite set. Since we know the null space is defined as solution to a system of equations, and the work above shows it has at least two elements, we are not surprised to discover that the set is infinite (Theorem PSSLS).
If we want an element of the null space to experiment with, we can get a “random” element easily. Evaluate the following compute cell repeatedly to get a feel for the variety of the different output. You will see a different result each time, and the result supplied in your downloaded worksheet is very unlikely to be a result you will ever see again. The bit of text, # random, is technically a “comment”, but we are using it as a signal to our automatic testing of the Sage examples that this example should be skipped. You do not need to use this device in your own work, though you may use the comment syntax if you wish.
Sometimes, just sometimes, the null space is finite, and we can list its elements. This is from Example CNS2.
Notice that we get back a list (which mathematically is really a set), and it has one element, the three-entry zero vector.
There is more to learn about exploring the null space with Sage's .right_kernel() so we will see more of this matrix method. In the meantime, if you are done experimenting with the matrix I we can restore the variable I back to being the imaginary number $i = \sqrt{-1}$ with the Sage restore() command.