| 1 | initial version |
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
| 2 | No.2 Revision |
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.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.