#4834: Return eigenvectors as members of a "normal" space instead of as members
of
an eigenspace
------------------------------+---------------------------------------------
Reporter: jason | Owner: jason
Type: defect | Status: needs_info
Priority: major | Milestone: sage-4.6.1
Component: linear algebra | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------------+---------------------------------------------
Comment(by rbeezer):
Following looks to me like the essence of the complaint. Eigenvectors are
assigned to their eigenspaces, which I think is useful and informative,
and not worth throwing away. Simple operations seem to work properly, in
that computations proceed and parents are assigned accordingly.
However, when a symbolic element is introduced, then addition fails with
incompatible parents. It would seem that the vector over the rationals
could get promoted to be over the symbolic ring? Similar behavior occurs
for an element of a number field.
{{{
sage: B=matrix([[1,2],[2,1]])
sage: spec=B.eigenvectors_right()
sage: v=spec[0][1][0]
sage: z=spec[1][1][0]
sage: v,z
((1, 1), (1, -1))
sage: v.parent()
Vector space of degree 2 and dimension 1 over Rational Field
User basis matrix:
[1 1]
sage: z.parent()
Vector space of degree 2 and dimension 1 over Rational Field
User basis matrix:
[ 1 -1]
sage: u=3*v
sage: u.parent()
Vector space of degree 2 and dimension 1 over Rational Field
User basis matrix:
[1 1]
sage: w = v + z
sage: w.parent()
Vector space of degree 2 and dimension 2 over Rational Field
User basis matrix:
[ 1 -1]
[ 1 1]
sage: var('t')
t
sage: v + t*z
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/sage/sage-4.6.1.rc1/devel/sage-main/<ipython console> in <module>()
/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.ModuleElement.__add__
(sage/structure/element.c:7627)()
/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6995)()
TypeError: unsupported operand parent(s) for '+': 'Vector space of degree
2 and dimension 1 over Rational Field
User basis matrix:
[1 1]' and 'Vector space of degree 2 and dimension 1 over Symbolic Ring
User basis matrix:
[ 1 -1]'
sage: R.<a>=QuadraticField(-5)
sage: v + a*z
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/home/sage/sage-4.6.1.rc1/devel/sage-main/<ipython console> in <module>()
/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.ModuleElement.__add__
(sage/structure/element.c:7627)()
/sage/sage-4.6.1.rc1/local/lib/python2.6/site-
packages/sage/structure/coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6995)()
TypeError: unsupported operand parent(s) for '+': 'Vector space of degree
2 and dimension 1 over Rational Field
User basis matrix:
[1 1]' and 'Vector space of degree 2 and dimension 1 over Number Field in
a with defining polynomial x^2 + 5
User basis matrix:
[ 1 -1]'
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4834#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.