Ask Your Question

Revision history [back]

You can give CombinatorialFreeModule a Family as a basis. For example:

sage: CombinatorialFreeModule(QQ, Family(NN))
Free module generated by Family (Non negative integer semiring) over Rational Field

sage: CombinatorialFreeModule(QQ, Family(NN, lambda d: Partitions(d)))
Free module generated by Lazy family (<lambda>(i))_{i in Non negative integer semiring} over Rational Field

Look at the implementation of the example of an algebra with basis in sage/categories/examples/algebras_with_basis.py (docs here) and trac #9280 for examples of this.

click to hide/show revision 2
No.2 Revision

You can give CombinatorialFreeModule a Family as a basis. For example:

sage: CombinatorialFreeModule(QQ, Family(NN))
Free module generated by Family (Non negative integer semiring) over Rational Field

sage: CombinatorialFreeModule(QQ, Family(NN, lambda d: Partitions(d)))
Free module generated by Lazy family (<lambda>(i))_{i in Non negative integer semiring} over Rational Field

Look at the implementation of the example of an algebra with basis in sage/categories/examples/algebras_with_basis.py (docs here) and trac #9280 for examples of this.

You can give CombinatorialFreeModule a Family as a basis. For example:

sage: CombinatorialFreeModule(QQ, Family(NN))
Free module generated by by
  Family (Non negative integer semiring) semiring)
  over Rational Field

sage: CombinatorialFreeModule(QQ, Family(NN, lambda d: Partitions(d)))
Free module generated by by
  Lazy family (<lambda>(i))_{i in Non negative integer semiring} semiring}
  over Rational Field

Look at the implementation of the example of an algebra with basis in sage/categories/examples/algebras_with_basis.py (docs here) and trac #9280 for examples of this.