Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kernel -- A.right_kernel and A.left_kernel #1607

Closed
williamstein opened this issue Dec 27, 2007 · 4 comments
Closed

kernel -- A.right_kernel and A.left_kernel #1607

williamstein opened this issue Dec 27, 2007 · 4 comments

Comments

@williamstein
Copy link
Contributor


It would be really useful to have

   sage: A.right_kernel()

to mean the set of vectors v such that A*v = 0, i.e., the vectors on the right.
That would have to be clearly documented -- the function itself would
be defined in matrix2.pyx and would just transpose A and call kernel
on the resulting transpose.  It would also cache the result.  

We have A.right_eigenvectors() in some cases (e.g., A an RDF matrix), and
the documentation makes the meaning very clear:

------------------------------

sage: A = random_matrix(RDF,3)
sage: A.right_eigenvectors()
([1.34856636676, -1.04338481358, -0.208244283695],
 [-0.250271326138  0.846883172518 0.0580964218791]
[ 0.884959315834  0.223023546117 -0.702413116863]
[ 0.392697431404   0.48275189278  0.709394543977])
sage: A.left_eigenvectors()
([1.34856636676, -1.04338481358, -0.208244283695],
 [ -0.51163197441  0.589230432257  0.625332088145]
[ 0.967591994779  0.214539369634  0.133186300037]
[-0.344957735432 -0.460493249193  0.817893714497])
sage: A.right_eigenvectors?
Type:           builtin_function_or_method
Base Class:     <type 'builtin_function_or_method'>
String Form:    <built-in method right_eigenvectors of sage.matrix.matrix_real_double_dense.Matrix_real_double_dense object at 0x2b077b08c3b0>
Namespace:      Interactive
Docstring:
    
            Computes the eigenvalues and *right* eigenvectors of this
            matrix m acting *from the left*.  I.e., vectors v such that
            m * v = lambda*v, where v is viewed as a column vector. 
------------------------------



It actually might be possible to define

   sage: A.left_kernel()

and

   sage: A.right_kernel()

and have
  
  sage: A.kernel()

default to A.right_kernel() without breaking sage into a million pieces.
One would first define only A.left_kernel and A.right_kernel.  Then
one would go through all of Sage and make sure every instance of
A.kernel where A is a matrix is changed to A.left_kernel -- since that
is what is currently assumed, then doctest everything, and finally
define a function kernel() in matrix2.pyx, which just calls self.right_kernel().

This would of course break code not in Sage that relies on the current
behavior, which is not desirable, but not a deal breaker either at this
stage in Sage development. 


Since x*A and A*x are both defined for x = vector(...), I think this
would be reasonable. 


Another possibility would be to *only* define A.left_kernel() and
A.right_kernel() and deprecate A.kernel().   That seems a little
 too anal to me. 

If we decide to do
the above, what are the other similar functions to worry about?
Certainly eigenspaces. 


 -- William 

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/1607

@williamstein

This comment has been minimized.

@williamstein

This comment has been minimized.

@williamstein
Copy link
Contributor Author

comment:3

From David Joyner:

+1 and

"An option is to add column_echelon in addition to echelon (ie, row_echelon).
This is another left vs right thing."

@mwhansen
Copy link
Contributor

comment:4

This was taken care of by #2542.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants