base_ring, rank, degree, [sparse=None], [inner_product_matrix=False]) |
base_field,
basis_matrix,
intersection,
is_submodule,
is_vector,
submodule,
submodule_with_basis,
subspace,
subspace_with_basis,
zero_submodule
Further documentation:
) |
Return the matrix whose rows are the basis for this free module.
other) |
True if this module is a submodule of other.
gens, [check=True]) |
Create the R-submodule of the ambient vector space with given generators, where R is the base ring of self.
INPUT: gens -- a list of vector in self check -- whether or not to verify that each gen is in the ambient vector space OUTPUT: FreeModule -- the submodule spanned by the vectors in the list gens. The basis for the subspace is always put in reduced row echelon form.
We create a submodule of
:
sage: M = FreeModule(IntegerRing(), 3) sage: B = M.basis() sage: W = M.submodule([B[0]+B[1], 2*B[1]-B[2]]) sage: W Free module of degree 3 and rank 2 over Integer Ring Echelon basis matrix: [ 1 1 0] [ 0 2 -1]
basis, [check=True]) |
Create the R-submodule of the ambient vector space with given basis, where R is the base ring of self.
INPUT: basis -- a list of linearly independent vectors check -- whether or not to verify that each gen is in the ambient vector space OUTPUT: FreeModule -- the R-submodule with given basis
First we create a submodule of
:
sage: M = FreeModule(IntegerRing(), 3) sage: B = M.basis() sage: W = M.submodule_with_basis([B[0]+B[1], 2*B[1]-B[2]]) sage: W Free module of degree 3 and rank 2 over Integer Ring User basis matrix: [ 1 1 0] [ 0 2 -1]
gens, [check=True]) |
Create the vector subspace of the ambient vector space with given generators.
INPUT: gens -- a list of vector in self check -- whether or not to verify that each gen is in the ambient vector space OUTPUT: a vector subspace
sage: V = VectorSpace(RationalField(), 3) sage: B = V.basis() sage: W = V.subspace([B[0]+B[1], 2*B[1]-B[2]]) sage: W Vector space of degree 3 and dimension 2 over Rational Field Basis matrix: [ 1 0 1/2] [ 0 1 -1/2]
sage: x = PolynomialRing(RationalField()).gen() sage: K = NumberField(x**2 + 1, 'a'); a = K.gen() sage: V = VectorSpace(K, 3) sage: V.subspace([2*V.gen(0) + 3*V.gen(2)]) Vector space of degree 3 and dimension 1 over Number Field in a with defining polynomial x^2 + 1 Basis matrix: [ 1 0 3/2]
basis, [check=True]) |
Create the vector subspace of the ambient vector space with given basis.
INPUT: basis -- a list of linearly independent vectors check -- whether or not to verify that each gen is in the ambient vector space OUTPUT: a vector subspace with user-specified basis
sage: V = VectorSpace(RationalField(), 3) sage: B = V.basis() sage: W = V.subspace_with_basis([B[0]+B[1], 2*B[1]-B[2]]) sage: W Vector space of degree 3 and dimension 2 over Rational Field User basis matrix: [ 1 1 0] [ 0 2 -1]
Instances of class FreeModule_generic_pid also have the following special methods:
__add__,
__mul__,
__rmul__
Further documentation:
other) |
Return the sum of self and other, where both self and other must be submodules of the ambient vector space.
We add two vector spaces:
sage: V = VectorSpace(RationalField(), 3) sage: W = V.subspace([V([1,1,0])]) sage: W2 = V.subspace([V([1,-1,0])]) sage: W + W2 Vector space of degree 3 and dimension 2 over Rational Field Basis matrix: [1 0 0] [0 1 0]
We add two free
-modules.
sage: M = FreeModule(IntegerRing(), 3) sage: W = M.submodule([M([1,0,2])]) sage: W2 = M.submodule([M([2,0,-4])]) sage: W + W2 Free module of degree 3 and rank 2 over Integer Ring Echelon basis matrix: [1 0 2] [0 0 8]
We can also add free
-modules embedded non-integrally
into an ambient space.
sage: V = VectorSpace(RationalField(), 3) sage: W = M.submodule([Q('1/2')*V.gen(0) - Q('1/3')*V.gen(1)]) sage: W2 = M.submodule([Q('1/3')*V.gen(0) + V.gen(1)]) sage: W + W2 Free module of degree 3 and rank 2 over Integer Ring Echelon basis matrix: [ 1/6 7/3 0] [ 0 11/3 0]
other) |
Return the product of this module by the number other, which is the module spanned by other times each basis vector.
sage: M = FreeModule(IntegerRing(), 3) sage: 2*M Free module of degree 3 and rank 3 over Integer Ring Echelon basis matrix: [2 0 0] [0 2 0] [0 0 2]
sage: a = RationalField()('1/3') sage: a*M Free module of degree 3 and rank 3 over Integer Ring Echelon basis matrix: [1/3 0 0] [ 0 1/3 0] [ 0 0 1/3]
See About this document... for information on suggesting changes.