Sage: Ticket #1607: kernel -- A.right_kernel and A.left_kernel
https://trac.sagemath.org/ticket/1607
<pre class="wiki">
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
</pre>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/1607
Trac 1.1.6wasThu, 27 Dec 2007 04:10:03 GMTdescription changed
https://trac.sagemath.org/ticket/1607#comment:1
https://trac.sagemath.org/ticket/1607#comment:1
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/1607?action=diff&version=1">diff</a>)
</li>
</ul>
TicketwasThu, 27 Dec 2007 04:14:24 GMTdescription changed
https://trac.sagemath.org/ticket/1607#comment:2
https://trac.sagemath.org/ticket/1607#comment:2
<ul>
<li><strong>description</strong>
modified (<a href="/ticket/1607?action=diff&version=2">diff</a>)
</li>
</ul>
TicketwasThu, 27 Dec 2007 05:13:13 GMT
https://trac.sagemath.org/ticket/1607#comment:3
https://trac.sagemath.org/ticket/1607#comment:3
<p>
From David Joyner:
</p>
<p>
+1 and
</p>
<p>
"An option is to add column_echelon in addition to echelon (ie, row_echelon).
This is another left vs right thing."
</p>
TicketmhansenTue, 15 Apr 2008 01:49:51 GMTstatus, milestone changed; resolution set
https://trac.sagemath.org/ticket/1607#comment:4
https://trac.sagemath.org/ticket/1607#comment:4
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>duplicate</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-wishlist</em> to <em>sage-3.0</em>
</li>
</ul>
<p>
This was taken care of by <a class="closed ticket" href="https://trac.sagemath.org/ticket/2542" title="enhancement: [with patch, positive review] implement right_kernel() and ... (closed: fixed)">#2542</a>.
</p>
Ticket