I know how to construct ordinary vector spaces over fields. For example a vector space of dimension 4 over rationals:
sage: V=VectorSpace(QQ, 4)
Given a set of linearly independent elements, we can construct the subspace of V formed by that set. For example we can construct the subspace whose basis is {$(1,0,0,0), (0,1,0,0)$}:
sage: U=V.subspace_with_basis([(1,0,0,0), (0,1,0,0)])
Now we given $u\in U$, we can also find its coordinates with respect to the basis {$(1,0,0,0), (0,1,0,0)$}. For example, if we take the vector $(2,2,0,0)\in U$:
sage: U.coordinates((2,2,0,0))
sage: [2, 2]
I want to do something similar with Verma Modules. So given a linearly independent set and a vector, I want to get its coordinates w.r.t this basis.
So first let's construct a Verma Module over $\frak{sp}(4)$:
sage: L = lie_algebras.sp(QQ, 4)
sage: La = L.cartan_type().root_system().weight_lattice().fundamental_weights()
sage: M = L.verma_module(La[1] - 3*La[2])
Let $v$ be the highest weight vector.
sage: v=M.highest_weight_vector()
sage: pbw = M.pbw_basis()
sage: x1,x2,y1,y2,h1,h2 = [pbw(g) for g in L.gens()]
I want to construct the $\mathbb{Q}$-subspace of $M$ spanned by a given basis. For example I tried to construct a subspace with basis {$y_1^2\cdot v, y_2^3\cdot v$}. So quite naively I tired:
sage: M.subspace_with_basis([y1^2*v, y2^3*v])
which gave a big error message.
Is there a way to solve this problem?