First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

updated 3 years ago

kcrisman gravatar image

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 3
No.3 Revision

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.