Function to calculate the nullspace

12272019, 12:07 AM
(This post was last modified: 12272019 12:53 AM by hamorabi.)
Post: #1




Function to calculate the nullspace
The Prime has builtin functions to calculate the column and row spaces. For some reason, there's no function for the nullspace.
I'd like to share this piece of code (written in Python syntax) that calculates the nullspace of a matrix. The left nullspace can be calculate by taking the transpose of the matrix first. Here's a 7x10 random matrix that you can try. PHP Code: [[13,31,27,33,77,47,77,2,95,42][95,60,98,44,84,58,64,89,37,63][9,33,18,13,68,72,34,27,3,95][7,61,12,88,55,24,62,7,37,72][53,2,20,67,33,3,82,73,40,32][71,90,46,45,14,64,95,35,67,7][69,67,9,40,93,34,64,88,25,81]] PHP Code: #cas 

12272019, 06:54 AM
Post: #2




RE: Function to calculate the nullspace
(12272019 12:07 AM)hamorabi Wrote: The Prime has builtin functions to calculate the column and row spaces. For some reason, there's no function for the nullspace. Wikipedia says that "The kernel of a matrix, also called the null space, is the kernel of the linear map defined by the matrix." So maybe Prime's "ker" function (or its "jacobi_symbol" function) is related to the "nullspace" you refer to, since Prime's doc says that they are related to the "kernel" of a matrix (whatever that means). <0ΙΈ0> Joe 

12272019, 08:36 AM
(This post was last modified: 12272019 08:47 AM by Stevetuc.)
Post: #3




RE: Function to calculate the nullspace
(12272019 06:54 AM)Joe Horn Wrote:(12272019 12:07 AM)hamorabi Wrote: The Prime has builtin functions to calculate the column and row spaces. For some reason, there's no function for the nullspace. It seems that above nullspace(mat) code is equivalent to transpose(ker(mat)) 

12272019, 10:51 AM
Post: #4




RE: Function to calculate the nullspace
(12272019 08:36 AM)Stevetuc Wrote:(12272019 06:54 AM)Joe Horn Wrote: Wikipedia says that "The kernel of a matrix, also called the null space, is the kernel of the linear map defined by the matrix." So maybe Prime's "ker" function (or its "jacobi_symbol" function) is related to the "nullspace" you refer to, since Prime's doc says that they are related to the "kernel" of a matrix (whatever that means). You're right. It seems that I just wasted my time. The prime has a function called colspace, rowspace, but no nullspace. However, nullspace is available on xcas, which suggested to me that nullspace was one of those functions that didn't make it to the Prime. I'm thinking of writing a couple of functions that can do vector calculus functions in different coordinates. At the moment, you can do the curl on the Prime but only using rectangular coordinates, unless I'm mistaken. Is it possible to do the curl in spherical coordinates on the Prime? I don't want to waste time on something that is already available. 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)