Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
More documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jul 28, 2020
1 parent 5910876 commit 78d0633
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions src/sage/modules/free_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def create_object(self, version, key):

def FreeModule(base_ring, rank_or_basis_keys=None, sparse=False, inner_product_matrix=None, *,
with_basis='standard', rank=None, basis_keys=None, **args):
"""
r"""
Create a free module over the given commutative ``base_ring``
``FreeModule`` can be called with the following positional arguments:
Expand Down Expand Up @@ -298,10 +298,50 @@ def FreeModule(base_ring, rank_or_basis_keys=None, sparse=False, inner_product_m
OUTPUT: a free module
.. note::
This factory function creates instances of various specialized classes
depending on the input. Not all combinations of options are
implemented.
- If the parameter ``basis_keys`` is provided, it must be a finite
or enumerated family of objects, and an instance of
:class:`CombinatorialFreeModule` is created.
EXAMPLE::
sage: CombinatorialFreeModule(QQ, ['a','b','c'])
Free module generated by {'a', 'b', 'c'} over Rational Field
It has a distinguished standard basis that is indexed by the provided
``basis_keys``. See the documentation of :class:`CombinatorialFreeModule`
for more examples and details, including its :class:`UniqueRepresentation`
semantics.
- If the parameter ``with_basis`` is set to ``None``, then a free module
of the given ``rank`` without distinguished basis is created. It is
represented by an instance of :class:`FiniteRankFreeModule`.
EXAMPLE::
sage: FiniteRankFreeModule(ZZ, 3, name='M')
Rank-3 free module M over the Integer Ring
See the documentation of :class:`FiniteRankFreeModule` for more
options, examples, and details.
- If ``rank`` is provided and the option ``with_basis`` is left at its
default value, ``"standard"``, then a free ambient module with
distinguished standard basis indexed by ``range(rank)`` is created.
There is only one dense and one sparse free ambient module of
given ``rank`` over ``base_ring``.
EXAMPLE::
sage: FreeModule(Integers(8), 10)
Ambient free module of rank 10 over Ring of integers modulo 8
The remainder of this documentation discusses this case of
free ambient modules.
In Sage it is the case that there is only one dense and one
sparse free ambient module of rank `n` over `R`.
EXAMPLES:
Expand All @@ -314,8 +354,6 @@ def FreeModule(base_ring, rank_or_basis_keys=None, sparse=False, inner_product_m
::
sage: FreeModule(Integers(8),10)
Ambient free module of rank 10 over Ring of integers modulo 8
sage: FreeModule(QQ,10)
Vector space of dimension 10 over Rational Field
sage: FreeModule(ZZ,10)
Expand Down

0 comments on commit 78d0633

Please sign in to comment.