|
39 | 39 | class Basis_abstract(UniqueRepresentation, AbstractFamily):
|
40 | 40 | """
|
41 | 41 | Abstract base class for (dual) bases of free modules.
|
| 42 | +
|
| 43 | + A basis is an :class:`~sage.sets.family.AbstractFamily`, hence like |
| 44 | + :class:`collections.abc.Mapping` subclasses such as :class:`dict`, it is |
| 45 | + an associative :class:`Container`, providing methods :meth:`keys`, |
| 46 | + :meth:`values`, and :meth:`items`. Thus, ``e[i]`` returns the element |
| 47 | + of the basis ``e`` indexed by the key ``i``. However, in contrast to |
| 48 | + :class:`Mapping` subclasses, not the :meth:`keys` but the |
| 49 | + :meth:`values` are considered the elements. |
| 50 | +
|
| 51 | + EXAMPLES: |
| 52 | +
|
| 53 | + sage: M = FiniteRankFreeModule(ZZ, 3, name='M', start_index=1) |
| 54 | + sage: e = M.basis('e'); e |
| 55 | + Basis (e_1,e_2,e_3) on the Rank-3 free module M over the Integer Ring |
| 56 | + sage: list(e) |
| 57 | + [Element e_1 of the Rank-3 free module M over the Integer Ring, |
| 58 | + Element e_2 of the Rank-3 free module M over the Integer Ring, |
| 59 | + Element e_3 of the Rank-3 free module M over the Integer Ring] |
| 60 | + sage: e.category() |
| 61 | + Category of facade finite enumerated sets |
| 62 | + sage: list(e.keys()) |
| 63 | + [1, 2, 3] |
| 64 | + sage: list(e.values()) |
| 65 | + [Element e_1 of the Rank-3 free module M over the Integer Ring, |
| 66 | + Element e_2 of the Rank-3 free module M over the Integer Ring, |
| 67 | + Element e_3 of the Rank-3 free module M over the Integer Ring] |
| 68 | + sage: list(e.items()) |
| 69 | + [(1, Element e_1 of the Rank-3 free module M over the Integer Ring), |
| 70 | + (2, Element e_2 of the Rank-3 free module M over the Integer Ring), |
| 71 | + (3, Element e_3 of the Rank-3 free module M over the Integer Ring)] |
42 | 72 | """
|
43 | 73 | def __init__(self, fmodule, symbol, latex_symbol, indices, latex_indices):
|
44 | 74 | """
|
|
0 commit comments