You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered: