Loading [MathJax]/jax/output/HTML-CSS/jax.js
Ask Your Question
1

Basic question about annihilator

asked 8 years ago

Jsevillamol gravatar image

updated 8 years ago

kcrisman gravatar image

I want to compute the intersection of a plane r spanned by two vectors and another plane s defined by its implicit equation. I thought the following would work:

var('x0,x1,x2')
r0 = vector(QQ,[3,1,-2])
r1 = vector(QQ,[1,-5,3])
r = span([r0,r1])
s = 2*x0 - 3*x1 - 4*x2 == 0
r.annihilator([vector([2,-3,-4])])

But instead I am greeted with an error message saying that AttributeError: 'sage.rings.rational.Rational' object has no attribute '_vector_'.

What am I doing wrong?

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
1

answered 8 years ago

tmonteil gravatar image

updated 8 years ago

r is correctly defined. For s, i would just do:

sage: s = matrix(QQ,[2,-3,-4]).right_kernel()
sage: s
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[   1    0  1/2]
[   0    1 -3/4]

Then you can do:

sage: s.intersection(r)
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[    1    15 -43/4]

And check

sage: r.intersection(s)
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[    1    15 -43/4]

sage: b = r.intersection(s).basis()[0] ; b
(1, 15, -43/4)
sage: b in r
True
sage: b in s
True

As a general rule, unlike say complex analysis, Sage already offers precise objects to work with linear spaces, polynomials, combinatorics, so that you should avoid the use of fuzzy symbolic things.

Preview: (hide)
link
1

answered 8 years ago

kcrisman gravatar image

If you use the syntax in r.annihilator? then it makes it one step further:

sage: r.annihilator([2,-3,-4])
...
AttributeError: 'FreeModule_submodule_field_with_category' object has no attribute 'from_vector'

But I think you meant one vector, not three rationals, so that isn't helpful. I have opened Trac 21742 for this; I suspect this simply isn't a case where this was intended to be used.

Preview: (hide)
link

Comments

My intention was to filter the elements of r such that they satisfied s's equation. That is, the elements of r which map to 0 when you do the dot vector with [2,-3,-4]. What would be the canonical way of doing this?

Jsevillamol gravatar imageJsevillamol ( 8 years ago )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 8 years ago

Seen: 711 times

Last updated: Oct 23 '16