base_ring, rank, degree, [sparse=None], [inner_product_matrix=False]) |
Create the free module of given rank over the given base_ring.
INPUT: base_ring -- a commutative ring rank -- a non-negative integer
ambient_module,
base_ring,
basis,
basis_matrix,
category,
coordinate_vector,
coordinates,
degree,
dimension,
discriminant,
free_module,
gen,
inner_product_is_dot_product,
inner_product_matrix,
is_dense,
is_full,
is_sparse,
matrix,
ngens,
nonembedded_free_module,
random_element,
rank,
set_inner_product_matrix,
zero_vector
Further documentation:
) |
Return the ambient module associated to this module.
) |
Return the base ring of this module.
) |
Return the basis of this module.
) |
Return the matrix whose rows are the basis for this free module.
) |
Return the category to which this free module belongs.
v) |
Return the a vector whose cofficients give v as a linear combination of the basis for self.
sage: M = FreeModule(IntegerRing(), 2); M0,M1=M.gens() sage: W = M.submodule([M0 + M1, M0 - 2*M1]) sage: W.coordinate_vector(2*M0 - M1) (-1, 1)
v) |
Write v in terms of the basis for self.
Returns a list c such that if B is the basis for self, then sum c[i] B[i] = v If v is not in self, raises an ArithmeticError exception.
sage: M = FreeModule(IntegerRing(), 2); M0,M1=M.gens() sage: W = M.submodule([M0 + M1, M0 - 2*M1]) sage: W.coordinates(2*M0-M1) [-1, 1]
) |
Return the degree of this free module. This is the dimension of the ambient vector space in which it is embedded.
sage: M = FreeModule(IntegerRing(), 10) sage: W = M.submodule([M.gen(0), 2*M.gen(3) - M.gen(0), M.gen(0) + M.gen(3)]) sage: W.degree() 10 sage: W.rank() 2
) |
Return the dimension of this free module.
sage: M = FreeModule(FiniteField(19), 100) sage: W = M.submodule([M.gen(50)]) sage: W.dimension() 1
) |
Return the discriminant of this free module.
) |
True if the rank equals the degree.
) |
Return the basis matrix of this module, which is the matrix whose rows are a basis for this module.
sage: M = FreeModule(IntegerRing(), 2) sage: M.matrix() [1 0] [0 1] sage: M.submodule([M.gen(0) + M.gen(1), M.gen(0) - 2*M.gen(1)]).matrix() [1 1] [3 0]
[bound=1.0], [prob=0]) |
Returns a random element of self.
) |
Return the rank of this free module.
A) |
Set the inner product matrix of self to A.
Instances of class FreeModule_generic also have the following special methods:
__call__,
__cmp__,
__contains__
Further documentation:
v) |
We create the module
, and the submodule generated by
one vector
, and check whether certain elements are
in the submodule.
sage: R = FreeModule(IntegerRing(), 3) sage: V = R.submodule([R.gen(0) + R.gen(1)]) sage: R.gen(0) + R.gen(1) in V True sage: R.gen(0) + 2*R.gen(1) in V False
sage: Q = RationalField() sage: w = Q('1/2')*(R.gen(0) + R.gen(1)) sage: w (1/2, 1/2, 0) sage: w.parent() Vector space of dimension 3 over Rational Field sage: w in V False sage: V.coordinates(w) [1/2]
See About this document... for information on suggesting changes.