Ask Your Question

Revision history [back]

Another possibility is

sage: V = FiniteRankFreeModule(QQ, 5); V
5-dimensional vector space over the Rational Field
sage: basis = V.basis(('a', 'b', 'c', 'd', 'e'), symbol_dual=('A', 'B', 'C', 'D', 'E'))
sage: ExampleList = [V((1,2,3,4,5)), V((2,3,4,1,8)), V((5,4,3,0,2))]
sage: EndList = [v.display() for v in ExampleList]; EndList
[a + 2 b + 3 c + 4 d + 5 e, 2 a + 3 b + 4 c + d + 8 e, 5 a + 4 b + 3 c + 2 e]

Being the first basis defined on V, basis is the default basis. Its individual elements are accessed via

sage: a, b, c, d, e = basis[:]

and their components w.r.t. basis are

sage: a[:]
[1, 0, 0, 0, 0]
sage: b[:]
[0, 1, 0, 0, 0]

etc.

Similarly

sage: [v[:] for v in ExampleList]
[[1, 2, 3, 4, 5], [2, 3, 4, 1, 8], [5, 4, 3, 0, 2]]